]> git.sur5r.net Git - openldap/blob - configure
minimal copyright year update
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.408.2.25 2003/01/03 17:59:16 kurt Exp  
4
5 # Copyright 1998-2003 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2003 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "  Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-ipv6           enable IPv6 support [auto]"
42 ac_help="$ac_help
43   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
44 ac_help="$ac_help
45   --enable-x-compile      enable cross compiling [no]"
46 ac_help="$ac_help
47   --with-cyrus-sasl       with Cyrus SASL support [auto]"
48 ac_help="$ac_help
49   --with-fetch            with freeBSD fetch URL support [auto]"
50 ac_help="$ac_help
51   --with-kerberos         with Kerberos support [auto]"
52 ac_help="$ac_help
53   --with-readline         with readline support [auto]"
54 ac_help="$ac_help
55   --with-threads          with threads [auto]"
56 ac_help="$ac_help
57   --with-tls              with TLS/SSL support [auto]"
58 ac_help="$ac_help
59   --with-yielding-select  with implicitly yielding select [auto]"
60 ac_help="$ac_help
61
62 SLAPD (Standalone LDAP Daemon) Options:"
63 ac_help="$ac_help
64   --enable-slapd          enable building slapd [yes]"
65 ac_help="$ac_help
66     --enable-aci          enable per-object ACIs (experimental) [no]"
67 ac_help="$ac_help
68     --enable-cleartext    enable cleartext passwords [yes]"
69 ac_help="$ac_help
70     --enable-crypt        enable crypt(3) passwords [no]"
71 ac_help="$ac_help
72     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
73 ac_help="$ac_help
74     --enable-kpasswd      enable Kerberos password verification [no]"
75 ac_help="$ac_help
76     --enable-lmpasswd     enable LAN Manager passwords [no]"
77 ac_help="$ac_help
78     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
79 ac_help="$ac_help
80     --enable-modules      enable dynamic module support [no]"
81 ac_help="$ac_help
82     --enable-phonetic     enable phonetic/soundex [no]"
83 ac_help="$ac_help
84     --enable-rewrite      enable DN rewriting in back-ldap and back-meta [no]"
85 ac_help="$ac_help
86     --enable-rlookups     enable reverse lookups of client hostnames [no]"
87 ac_help="$ac_help
88     --enable-slp          enable SLPv2 support [no]"
89 ac_help="$ac_help
90     --enable-wrappers     enable tcp wrapper support [no]"
91 ac_help="$ac_help
92     --enable-bdb          enable Berkeley DB backend [yes]"
93 ac_help="$ac_help
94     --with-bdb-module     module type static|dynamic [static]"
95 ac_help="$ac_help
96     --enable-dnssrv       enable dnssrv backend [no]"
97 ac_help="$ac_help
98     --with-dnssrv-module  module type static|dynamic [static]"
99 ac_help="$ac_help
100     --enable-ldap         enable ldap backend [no]"
101 ac_help="$ac_help
102     --with-ldap-module    module type static|dynamic [static]"
103 ac_help="$ac_help
104     --enable-ldbm         enable ldbm backend [no]"
105 ac_help="$ac_help
106     --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm [auto]"
107 ac_help="$ac_help
108     --with-ldbm-module    module type static|dynamic [static]"
109 ac_help="$ac_help
110     --with-ldbm-type      use LDBM type auto|btree|hash [auto]"
111 ac_help="$ac_help
112     --enable-meta         enable metadirectory backend [no]"
113 ac_help="$ac_help
114     --with-meta-module    module type static|dynamic [static]"
115 ac_help="$ac_help
116     --enable-monitor      enable monitor backend [no]"
117 ac_help="$ac_help
118     --with-monitor-module module type static|dynamic [static]"
119 ac_help="$ac_help
120     --enable-null         enable null backend [no]"
121 ac_help="$ac_help
122     --with-null-module    module type static|dynamic [static]"
123 ac_help="$ac_help
124     --enable-passwd       enable passwd backend [no]"
125 ac_help="$ac_help
126     --with-passwd-module  module type static|dynamic [static]"
127 ac_help="$ac_help
128     --enable-perl         enable perl backend [no]"
129 ac_help="$ac_help
130     --with-perl-module    module type static|dynamic [static]"
131 ac_help="$ac_help
132     --enable-shell        enable shell backend [no]"
133 ac_help="$ac_help
134     --with-shell-module   module type static|dynamic [static]"
135 ac_help="$ac_help
136     --enable-sql          enable sql backend [no]"
137 ac_help="$ac_help
138     --with-sql-module     module type static|dynamic [static]"
139 ac_help="$ac_help
140
141 SLURPD (Replication Daemon) Options:"
142 ac_help="$ac_help
143   --enable-slurpd         enable building slurpd [auto]"
144 ac_help="$ac_help
145
146 Library Generation & Linking Options"
147 ac_help="$ac_help
148   --enable-static[=PKGS]  build static libraries [default=yes]"
149 ac_help="$ac_help
150   --enable-shared[=PKGS]  build shared libraries [default=yes]"
151 ac_help="$ac_help
152   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
153 ac_help="$ac_help
154   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
155
156 # Find the correct PATH separator.  Usually this is `:', but
157 # DJGPP uses `;' like DOS.
158 if test "X${PATH_SEPARATOR+set}" != Xset; then
159   UNAME=${UNAME-`uname 2>/dev/null`}
160   case X$UNAME in
161     *-DOS) lt_cv_sys_path_separator=';' ;;
162     *)     lt_cv_sys_path_separator=':' ;;
163   esac
164   PATH_SEPARATOR=$lt_cv_sys_path_separator
165 fi
166
167
168 # Check that we are running under the correct shell.
169 SHELL=${CONFIG_SHELL-/bin/sh}
170
171 case X$ECHO in
172 X*--fallback-echo)
173   # Remove one level of quotation (which was required for Make).
174   ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
175   ;;
176 esac
177
178 echo=${ECHO-echo}
179 if test "X$1" = X--no-reexec; then
180   # Discard the --no-reexec flag, and continue.
181   shift
182 elif test "X$1" = X--fallback-echo; then
183   # Avoid inline document here, it may be left over
184   :
185 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
186   # Yippee, $echo works!
187   :
188 else
189   # Restart under the correct shell.
190   exec $SHELL "$0" --no-reexec ${1+"$@"}
191 fi
192
193 if test "X$1" = X--fallback-echo; then
194   # used as fallback echo
195   shift
196   cat <<EOF
197
198 EOF
199   exit 0
200 fi
201
202 # The HP-UX ksh and POSIX shell print the target directory to stdout
203 # if CDPATH is set.
204 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
205
206 if test -z "$ECHO"; then
207 if test "X${echo_test_string+set}" != Xset; then
208 # find a string as large as possible, as long as the shell can cope with it
209   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
210     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
211     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
212        echo_test_string="`eval $cmd`" &&
213        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
214     then
215       break
216     fi
217   done
218 fi
219
220 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
221    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
222    test "X$echo_testing_string" = "X$echo_test_string"; then
223   :
224 else
225   # The Solaris, AIX, and Digital Unix default echo programs unquote
226   # backslashes.  This makes it impossible to quote backslashes using
227   #   echo "$something" | sed 's/\\/\\\\/g'
228   #
229   # So, first we look for a working echo in the user's PATH.
230
231   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
232   for dir in $PATH /usr/ucb; do
233     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
234        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
235        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
236        test "X$echo_testing_string" = "X$echo_test_string"; then
237       echo="$dir/echo"
238       break
239     fi
240   done
241   IFS="$save_ifs"
242
243   if test "X$echo" = Xecho; then
244     # We didn't find a better echo, so look for alternatives.
245     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
246        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
247        test "X$echo_testing_string" = "X$echo_test_string"; then
248       # This shell has a builtin print -r that does the trick.
249       echo='print -r'
250     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
251          test "X$CONFIG_SHELL" != X/bin/ksh; then
252       # If we have ksh, try running configure again with it.
253       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
254       export ORIGINAL_CONFIG_SHELL
255       CONFIG_SHELL=/bin/ksh
256       export CONFIG_SHELL
257       exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
258     else
259       # Try using printf.
260       echo='printf %s\n'
261       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
262          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
263          test "X$echo_testing_string" = "X$echo_test_string"; then
264         # Cool, printf works
265         :
266       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
267            test "X$echo_testing_string" = 'X\t' &&
268            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
269            test "X$echo_testing_string" = "X$echo_test_string"; then
270         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
271         export CONFIG_SHELL
272         SHELL="$CONFIG_SHELL"
273         export SHELL
274         echo="$CONFIG_SHELL $0 --fallback-echo"
275       elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
276            test "X$echo_testing_string" = 'X\t' &&
277            echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
278            test "X$echo_testing_string" = "X$echo_test_string"; then
279         echo="$CONFIG_SHELL $0 --fallback-echo"
280       else
281         # maybe with a smaller string...
282         prev=:
283
284         for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
285           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
286           then
287             break
288           fi
289           prev="$cmd"
290         done
291
292         if test "$prev" != 'sed 50q "$0"'; then
293           echo_test_string=`eval $prev`
294           export echo_test_string
295           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
296         else
297           # Oops.  We lost completely, so just stick with echo.
298           echo=echo
299         fi
300       fi
301     fi
302   fi
303 fi
304 fi
305
306 # Copy echo and quote the copy suitably for passing to libtool from
307 # the Makefile, instead of quoting the original, which is used later.
308 ECHO=$echo
309 if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
310    ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
311 fi
312
313
314 ac_help="$ac_help
315   --disable-libtool-lock  avoid locking (might break parallel builds)"
316 ac_help="$ac_help
317   --with-pic              try to use only PIC/non-PIC objects [default=use both]"
318 ac_help="$ac_help
319
320 See INSTALL file for further details."
321
322 # Initialize some variables set by options.
323 # The variables have the same names as the options, with
324 # dashes changed to underlines.
325 build=NONE
326 cache_file=./config.cache
327 exec_prefix=NONE
328 host=NONE
329 no_create=
330 nonopt=NONE
331 no_recursion=
332 prefix=NONE
333 program_prefix=NONE
334 program_suffix=NONE
335 program_transform_name=s,x,x,
336 silent=
337 site=
338 srcdir=
339 target=NONE
340 verbose=
341 x_includes=NONE
342 x_libraries=NONE
343 bindir='${exec_prefix}/bin'
344 sbindir='${exec_prefix}/sbin'
345 libexecdir='${exec_prefix}/libexec'
346 datadir='${prefix}/share'
347 sysconfdir='${prefix}/etc'
348 sharedstatedir='${prefix}/com'
349 localstatedir='${prefix}/var'
350 libdir='${exec_prefix}/lib'
351 includedir='${prefix}/include'
352 oldincludedir='/usr/include'
353 infodir='${prefix}/info'
354 mandir='${prefix}/man'
355
356 # Initialize some other variables.
357 subdirs=
358 MFLAGS= MAKEFLAGS=
359 SHELL=${CONFIG_SHELL-/bin/sh}
360 # Maximum number of lines to put in a shell here document.
361 ac_max_here_lines=12
362
363 ac_prev=
364 for ac_option
365 do
366
367   # If the previous option needs an argument, assign it.
368   if test -n "$ac_prev"; then
369     eval "$ac_prev=\$ac_option"
370     ac_prev=
371     continue
372   fi
373
374   case "$ac_option" in
375   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
376   *) ac_optarg= ;;
377   esac
378
379   # Accept the important Cygnus configure options, so we can diagnose typos.
380
381   case "$ac_option" in
382
383   -bindir | --bindir | --bindi | --bind | --bin | --bi)
384     ac_prev=bindir ;;
385   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
386     bindir="$ac_optarg" ;;
387
388   -build | --build | --buil | --bui | --bu)
389     ac_prev=build ;;
390   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
391     build="$ac_optarg" ;;
392
393   -cache-file | --cache-file | --cache-fil | --cache-fi \
394   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
395     ac_prev=cache_file ;;
396   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
397   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
398     cache_file="$ac_optarg" ;;
399
400   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
401     ac_prev=datadir ;;
402   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
403   | --da=*)
404     datadir="$ac_optarg" ;;
405
406   -disable-* | --disable-*)
407     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
408     # Reject names that are not valid shell variable names.
409     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
410       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
411     fi
412     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
413     eval "enable_${ac_feature}=no" ;;
414
415   -enable-* | --enable-*)
416     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
417     # Reject names that are not valid shell variable names.
418     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
419       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
420     fi
421     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
422     case "$ac_option" in
423       *=*) ;;
424       *) ac_optarg=yes ;;
425     esac
426     eval "enable_${ac_feature}='$ac_optarg'" ;;
427
428   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
429   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
430   | --exec | --exe | --ex)
431     ac_prev=exec_prefix ;;
432   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
433   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
434   | --exec=* | --exe=* | --ex=*)
435     exec_prefix="$ac_optarg" ;;
436
437   -gas | --gas | --ga | --g)
438     # Obsolete; use --with-gas.
439     with_gas=yes ;;
440
441   -help | --help | --hel | --he)
442     # Omit some internal or obsolete options to make the list less imposing.
443     # This message is too long to be a string in the A/UX 3.1 sh.
444     cat << EOF
445 Usage: configure [options] [host]
446 Options: [defaults in brackets after descriptions]
447 Configuration:
448   --cache-file=FILE       cache test results in FILE
449   --help                  print this message
450   --no-create             do not create output files
451   --quiet, --silent       do not print \`checking...' messages
452   --version               print the version of autoconf that created configure
453 Directory and file names:
454   --prefix=PREFIX         install architecture-independent files in PREFIX
455                           [$ac_default_prefix]
456   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
457                           [same as prefix]
458   --bindir=DIR            user executables in DIR [EPREFIX/bin]
459   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
460   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
461   --datadir=DIR           read-only architecture-independent data in DIR
462                           [PREFIX/share]
463   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
464   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
465                           [PREFIX/com]
466   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
467   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
468   --includedir=DIR        C header files in DIR [PREFIX/include]
469   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
470   --infodir=DIR           info documentation in DIR [PREFIX/info]
471   --mandir=DIR            man documentation in DIR [PREFIX/man]
472   --srcdir=DIR            find the sources in DIR [configure dir or ..]
473   --program-prefix=PREFIX prepend PREFIX to installed program names
474   --program-suffix=SUFFIX append SUFFIX to installed program names
475   --program-transform-name=PROGRAM
476                           run sed PROGRAM on installed program names
477 EOF
478     cat << EOF
479 Host type:
480   --build=BUILD           configure for building on BUILD [BUILD=HOST]
481   --host=HOST             configure for HOST [guessed]
482   --target=TARGET         configure for TARGET [TARGET=HOST]
483 Features and packages:
484   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
485   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
486   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
487   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
488   --x-includes=DIR        X include files are in DIR
489   --x-libraries=DIR       X library files are in DIR
490 EOF
491     if test -n "$ac_help"; then
492       echo "--enable and --with options recognized:$ac_help"
493     fi
494     exit 0 ;;
495
496   -host | --host | --hos | --ho)
497     ac_prev=host ;;
498   -host=* | --host=* | --hos=* | --ho=*)
499     host="$ac_optarg" ;;
500
501   -includedir | --includedir | --includedi | --included | --include \
502   | --includ | --inclu | --incl | --inc)
503     ac_prev=includedir ;;
504   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
505   | --includ=* | --inclu=* | --incl=* | --inc=*)
506     includedir="$ac_optarg" ;;
507
508   -infodir | --infodir | --infodi | --infod | --info | --inf)
509     ac_prev=infodir ;;
510   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
511     infodir="$ac_optarg" ;;
512
513   -libdir | --libdir | --libdi | --libd)
514     ac_prev=libdir ;;
515   -libdir=* | --libdir=* | --libdi=* | --libd=*)
516     libdir="$ac_optarg" ;;
517
518   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
519   | --libexe | --libex | --libe)
520     ac_prev=libexecdir ;;
521   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
522   | --libexe=* | --libex=* | --libe=*)
523     libexecdir="$ac_optarg" ;;
524
525   -localstatedir | --localstatedir | --localstatedi | --localstated \
526   | --localstate | --localstat | --localsta | --localst \
527   | --locals | --local | --loca | --loc | --lo)
528     ac_prev=localstatedir ;;
529   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
530   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
531   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
532     localstatedir="$ac_optarg" ;;
533
534   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
535     ac_prev=mandir ;;
536   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
537     mandir="$ac_optarg" ;;
538
539   -nfp | --nfp | --nf)
540     # Obsolete; use --without-fp.
541     with_fp=no ;;
542
543   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
544   | --no-cr | --no-c)
545     no_create=yes ;;
546
547   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
548   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
549     no_recursion=yes ;;
550
551   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
552   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
553   | --oldin | --oldi | --old | --ol | --o)
554     ac_prev=oldincludedir ;;
555   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
556   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
557   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
558     oldincludedir="$ac_optarg" ;;
559
560   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
561     ac_prev=prefix ;;
562   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
563     prefix="$ac_optarg" ;;
564
565   -program-prefix | --program-prefix | --program-prefi | --program-pref \
566   | --program-pre | --program-pr | --program-p)
567     ac_prev=program_prefix ;;
568   -program-prefix=* | --program-prefix=* | --program-prefi=* \
569   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
570     program_prefix="$ac_optarg" ;;
571
572   -program-suffix | --program-suffix | --program-suffi | --program-suff \
573   | --program-suf | --program-su | --program-s)
574     ac_prev=program_suffix ;;
575   -program-suffix=* | --program-suffix=* | --program-suffi=* \
576   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
577     program_suffix="$ac_optarg" ;;
578
579   -program-transform-name | --program-transform-name \
580   | --program-transform-nam | --program-transform-na \
581   | --program-transform-n | --program-transform- \
582   | --program-transform | --program-transfor \
583   | --program-transfo | --program-transf \
584   | --program-trans | --program-tran \
585   | --progr-tra | --program-tr | --program-t)
586     ac_prev=program_transform_name ;;
587   -program-transform-name=* | --program-transform-name=* \
588   | --program-transform-nam=* | --program-transform-na=* \
589   | --program-transform-n=* | --program-transform-=* \
590   | --program-transform=* | --program-transfor=* \
591   | --program-transfo=* | --program-transf=* \
592   | --program-trans=* | --program-tran=* \
593   | --progr-tra=* | --program-tr=* | --program-t=*)
594     program_transform_name="$ac_optarg" ;;
595
596   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
597   | -silent | --silent | --silen | --sile | --sil)
598     silent=yes ;;
599
600   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
601     ac_prev=sbindir ;;
602   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
603   | --sbi=* | --sb=*)
604     sbindir="$ac_optarg" ;;
605
606   -sharedstatedir | --sharedstatedir | --sharedstatedi \
607   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
608   | --sharedst | --shareds | --shared | --share | --shar \
609   | --sha | --sh)
610     ac_prev=sharedstatedir ;;
611   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
612   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
613   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
614   | --sha=* | --sh=*)
615     sharedstatedir="$ac_optarg" ;;
616
617   -site | --site | --sit)
618     ac_prev=site ;;
619   -site=* | --site=* | --sit=*)
620     site="$ac_optarg" ;;
621
622   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
623     ac_prev=srcdir ;;
624   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
625     srcdir="$ac_optarg" ;;
626
627   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
628   | --syscon | --sysco | --sysc | --sys | --sy)
629     ac_prev=sysconfdir ;;
630   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
631   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
632     sysconfdir="$ac_optarg" ;;
633
634   -target | --target | --targe | --targ | --tar | --ta | --t)
635     ac_prev=target ;;
636   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
637     target="$ac_optarg" ;;
638
639   -v | -verbose | --verbose | --verbos | --verbo | --verb)
640     verbose=yes ;;
641
642   -version | --version | --versio | --versi | --vers)
643     echo "configure generated by autoconf version 2.13.1"
644     exit 0 ;;
645
646   -with-* | --with-*)
647     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
648     # Reject names that are not valid shell variable names.
649     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
650       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
651     fi
652     ac_package=`echo $ac_package| sed 's/-/_/g'`
653     case "$ac_option" in
654       *=*) ;;
655       *) ac_optarg=yes ;;
656     esac
657     eval "with_${ac_package}='$ac_optarg'" ;;
658
659   -without-* | --without-*)
660     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
661     # Reject names that are not valid shell variable names.
662     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
663       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
664     fi
665     ac_package=`echo $ac_package| sed 's/-/_/g'`
666     eval "with_${ac_package}=no" ;;
667
668   --x)
669     # Obsolete; use --with-x.
670     with_x=yes ;;
671
672   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
673   | --x-incl | --x-inc | --x-in | --x-i)
674     ac_prev=x_includes ;;
675   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
676   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
677     x_includes="$ac_optarg" ;;
678
679   -x-libraries | --x-libraries | --x-librarie | --x-librari \
680   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
681     ac_prev=x_libraries ;;
682   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
683   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
684     x_libraries="$ac_optarg" ;;
685
686   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
687     ;;
688
689   *)
690     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
691       echo "configure: warning: $ac_option: invalid host type" 1>&2
692     fi
693     if test "x$nonopt" != xNONE; then
694       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
695     fi
696     nonopt="$ac_option"
697     ;;
698
699   esac
700 done
701
702 if test -n "$ac_prev"; then
703   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
704 fi
705
706 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
707
708 # File descriptor usage:
709 # 0 standard input
710 # 1 file creation
711 # 2 errors and warnings
712 # 3 some systems may open it to /dev/tty
713 # 4 used on the Kubota Titan
714 # 6 checking for... messages and results
715 # 5 compiler messages saved in config.log
716 if test "$silent" = yes; then
717   exec 6>/dev/null
718 else
719   exec 6>&1
720 fi
721 exec 5>./config.log
722
723 echo "\
724 This file contains any messages produced by compilers while
725 running configure, to aid debugging if configure makes a mistake.
726 " 1>&5
727
728 # Strip out --no-create and --no-recursion so they do not pile up.
729 # Also quote any args containing shell metacharacters.
730 ac_configure_args=
731 for ac_arg
732 do
733   case "$ac_arg" in
734   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
735   | --no-cr | --no-c) ;;
736   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
737   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
738   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
739   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
740   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
741   esac
742 done
743
744 # NLS nuisances.
745 # Only set these to C if already set.  These must not be set unconditionally
746 # because not all systems understand e.g. LANG=C (notably SCO).
747 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
748 # Non-C LC_CTYPE values break the ctype check.
749 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
750 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
751 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
752 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
753
754 # confdefs.h avoids OS command line length limits that DEFS can exceed.
755 rm -rf conftest* confdefs.h
756 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
757 echo > confdefs.h
758
759 # A filename unique to this package, relative to the directory that
760 # configure is in, which we can look for to find out if srcdir is correct.
761 ac_unique_file=build/version.sh
762
763 # Find the source files, if location was not specified.
764 if test -z "$srcdir"; then
765   ac_srcdir_defaulted=yes
766   # Try the directory containing this script, then its parent.
767   ac_prog=$0
768   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
769   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
770   srcdir=$ac_confdir
771   if test ! -r $srcdir/$ac_unique_file; then
772     srcdir=..
773   fi
774 else
775   ac_srcdir_defaulted=no
776 fi
777 if test ! -r $srcdir/$ac_unique_file; then
778   if test "$ac_srcdir_defaulted" = yes; then
779     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
780   else
781     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
782   fi
783 fi
784 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
785
786 # Prefer explicitly selected file to automatically selected ones.
787 if test -z "$CONFIG_SITE"; then
788   if test "x$prefix" != xNONE; then
789     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
790   else
791     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
792   fi
793 fi
794 for ac_site_file in $CONFIG_SITE; do
795   if test -r "$ac_site_file"; then
796     echo "loading site script $ac_site_file"
797     . "$ac_site_file"
798   fi
799 done
800
801
802 ac_ext=c
803 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
804 ac_cpp='$CPP $CPPFLAGS'
805 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
806 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
807 cross_compiling=$ac_cv_prog_cc_cross
808
809 ac_exeext=
810 ac_objext=o
811 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
812   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
813   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
814     ac_n= ac_c='
815 ' ac_t='        '
816   else
817     ac_n=-n ac_c= ac_t=
818   fi
819 else
820   ac_n= ac_c='\c' ac_t=
821 fi
822
823
824 # set unset (borrowed from autoconf 2.49c)
825 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
826   ol_unset=unset
827 else
828   ol_unset=false
829 fi
830 # unset CDPATH
831 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
832
833 ac_aux_dir=
834 for ac_dir in build $srcdir/build; do
835   if test -f $ac_dir/install-sh; then
836     ac_aux_dir=$ac_dir
837     ac_install_sh="$ac_aux_dir/install-sh -c"
838     break
839   elif test -f $ac_dir/install.sh; then
840     ac_aux_dir=$ac_dir
841     ac_install_sh="$ac_aux_dir/install.sh -c"
842     break
843   elif test -f $ac_dir/shtool; then
844     ac_aux_dir=$ac_dir
845     ac_install_sh="$ac_aux_dir/shtool install -c"
846     break
847   fi
848 done
849 if test -z "$ac_aux_dir"; then
850   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
851 fi
852 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
853 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
854 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
855
856 eval `$ac_aux_dir/version.sh`
857 if test -z "$OL_STRING"; then
858         { echo "configure: error: could not determine version" 1>&2; exit 1; }
859 fi
860
861 if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
862         ac_cv_shtool="$ac_aux_dir/shtool"
863 else
864         { echo "configure: error: no shtool found in $ac_aux_dir" 1>&2; exit 1; }
865 fi
866
867 SHTOOL="$ac_cv_shtool"
868
869 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
870 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
871
872 echo "Configuring ${TB}${OL_STRING}${TN} ..."
873
874
875 echo $ac_n "checking host system type""... $ac_c" 1>&6
876 echo "configure:877: checking host system type" >&5
877 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
878
879 # Make sure we can run config.sub.
880   if $ac_config_sub sun4 >/dev/null 2>&1; then :
881     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
882   fi
883
884   ac_cv_host_alias=$host
885   case "$ac_cv_host_alias" in
886   NONE)
887     case $nonopt in
888     NONE)
889       if ac_cv_host_alias=`$ac_config_guess`; then :
890       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
891       fi ;;
892     *) ac_cv_host_alias=$nonopt ;;
893     esac ;;
894   esac
895
896   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
897   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
898   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
899   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
900 else
901   echo $ac_n "(cached) $ac_c" 1>&6
902 fi
903
904 echo "$ac_t""$ac_cv_host" 1>&6
905
906 host=$ac_cv_host
907 host_alias=$ac_cv_host_alias
908 host_cpu=$ac_cv_host_cpu
909 host_vendor=$ac_cv_host_vendor
910 host_os=$ac_cv_host_os
911
912
913
914
915
916 echo $ac_n "checking target system type""... $ac_c" 1>&6
917 echo "configure:918: checking target system type" >&5
918 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
919
920 # Make sure we can run config.sub.
921   if $ac_config_sub sun4 >/dev/null 2>&1; then :
922     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
923   fi
924
925   ac_cv_target_alias=$target
926   case "$ac_cv_target_alias" in
927   NONE)
928     case $nonopt in
929     NONE)
930       ac_cv_target_alias=$host_alias ;;
931
932     *) ac_cv_target_alias=$nonopt ;;
933     esac ;;
934   esac
935
936   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
937   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
938   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
939   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
940 else
941   echo $ac_n "(cached) $ac_c" 1>&6
942 fi
943
944 echo "$ac_t""$ac_cv_target" 1>&6
945
946 target=$ac_cv_target
947 target_alias=$ac_cv_target_alias
948 target_cpu=$ac_cv_target_cpu
949 target_vendor=$ac_cv_target_vendor
950 target_os=$ac_cv_target_os
951
952
953
954
955
956 echo $ac_n "checking build system type""... $ac_c" 1>&6
957 echo "configure:958: checking build system type" >&5
958 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
959
960 # Make sure we can run config.sub.
961   if $ac_config_sub sun4 >/dev/null 2>&1; then :
962     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
963   fi
964
965   ac_cv_build_alias=$build
966   case "$ac_cv_build_alias" in
967   NONE)
968     case $nonopt in
969     NONE)
970       ac_cv_build_alias=$host_alias ;;
971
972     *) ac_cv_build_alias=$nonopt ;;
973     esac ;;
974   esac
975
976   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
977   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
978   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
979   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
980 else
981   echo $ac_n "(cached) $ac_c" 1>&6
982 fi
983
984 echo "$ac_t""$ac_cv_build" 1>&6
985
986 build=$ac_cv_build
987 build_alias=$ac_cv_build_alias
988 build_cpu=$ac_cv_build_cpu
989 build_vendor=$ac_cv_build_vendor
990 build_os=$ac_cv_build_os
991
992
993
994
995
996 # Do some error checking and defaulting for the host and target type.
997 # The inputs are:
998 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
999 #
1000 # The rules are:
1001 # 1. You are not allowed to specify --host, --target, and nonopt at the
1002 #    same time.
1003 # 2. Host defaults to nonopt.
1004 # 3. If nonopt is not specified, then host defaults to the current host,
1005 #    as determined by config.guess.
1006 # 4. Target and build default to nonopt.
1007 # 5. If nonopt is not specified, then target and build default to host.
1008
1009 # The aliases save the names the user supplied, while $host etc.
1010 # will get canonicalized.
1011 case $host---$target---$nonopt in
1012 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1013 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1014 esac
1015
1016 test "$host_alias" != "$target_alias" &&
1017   test "$program_prefix$program_suffix$program_transform_name" = \
1018     NONENONEs,x,x, &&
1019   program_prefix=${target_alias}-
1020
1021
1022 # Find a good install program.  We prefer a C program (faster),
1023 # so one script is as good as another.  But avoid the broken or
1024 # incompatible versions:
1025 # SysV /etc/install, /usr/sbin/install
1026 # SunOS /usr/etc/install
1027 # IRIX /sbin/install
1028 # AIX /bin/install
1029 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1030 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1031 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1032 # ./install, which can be erroneously created by make from ./install.sh.
1033 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1034 echo "configure:1035: checking for a BSD compatible install" >&5
1035 if test -z "$INSTALL"; then
1036 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
1037   echo $ac_n "(cached) $ac_c" 1>&6
1038 else
1039     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1040   for ac_dir in $PATH; do
1041     # Account for people who put trailing slashes in PATH elements.
1042     case "$ac_dir/" in
1043     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1044     *)
1045       # OSF1 and SCO ODT 3.0 have their own names for install.
1046       # Don't use installbsd from OSF since it installs stuff as root
1047       # by default.
1048       for ac_prog in ginstall scoinst install; do
1049         if test -f $ac_dir/$ac_prog; then
1050           if test $ac_prog = install &&
1051             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1052             # AIX install.  It has an incompatible calling convention.
1053             :
1054           elif test $ac_prog = install &&
1055             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
1056             # program-specific install script used by HP pwplus--don't use.
1057             :
1058           else
1059             ac_cv_path_install="$ac_dir/$ac_prog -c"
1060             break 2
1061           fi
1062         fi
1063       done
1064       ;;
1065     esac
1066   done
1067   IFS="$ac_save_IFS"
1068
1069 fi
1070   if test "${ac_cv_path_install+set}" = set; then
1071     INSTALL="$ac_cv_path_install"
1072   else
1073     # As a last resort, use the slow shell script.  We don't cache a
1074     # path for INSTALL within a source directory, because that will
1075     # break other packages using the cache if that directory is
1076     # removed, or if the path is relative.
1077     INSTALL="$ac_install_sh"
1078   fi
1079 fi
1080 echo "$ac_t""$INSTALL" 1>&6
1081
1082 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1083 # It thinks the first close brace ends the variable substitution.
1084 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1085
1086 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
1087
1088 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1089
1090 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
1091 echo "configure:1092: checking whether build environment is sane" >&5
1092 # Just in case
1093 sleep 1
1094 echo timestamp > conftestfile
1095 # Do `set' in a subshell so we don't clobber the current shell's
1096 # arguments.  Must try -L first in case configure is actually a
1097 # symlink; some systems play weird games with the mod time of symlinks
1098 # (eg FreeBSD returns the mod time of the symlink's containing
1099 # directory).
1100 if (
1101    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1102    if test "$*" = "X"; then
1103       # -L didn't work.
1104       set X `ls -t $srcdir/configure conftestfile`
1105    fi
1106    if test "$*" != "X $srcdir/configure conftestfile" \
1107       && test "$*" != "X conftestfile $srcdir/configure"; then
1108
1109       # If neither matched, then we have a broken ls.  This can happen
1110       # if, for instance, CONFIG_SHELL is bash and it inherits a
1111       # broken ls alias from the environment.  This has actually
1112       # happened.  Such a system could not be considered "sane".
1113       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
1114 alias in your environment" 1>&2; exit 1; }
1115    fi
1116
1117    test "$2" = conftestfile
1118    )
1119 then
1120    # Ok.
1121    :
1122 else
1123    { echo "configure: error: newly created file is older than distributed files!
1124 Check your system clock" 1>&2; exit 1; }
1125 fi
1126 rm -f conftest*
1127 echo "$ac_t""yes" 1>&6
1128 if test "$program_transform_name" = s,x,x,; then
1129   program_transform_name=
1130 else
1131   # Double any \ or $.  echo might interpret backslashes.
1132   cat <<\EOF_SED > conftestsed
1133 s,\\,\\\\,g; s,\$,$$,g
1134 EOF_SED
1135   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1136   rm -f conftestsed
1137 fi
1138 test "$program_prefix" != NONE &&
1139   program_transform_name="s,^,${program_prefix},;$program_transform_name"
1140 # Use a double $ so make ignores it.
1141 test "$program_suffix" != NONE &&
1142   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
1143
1144 # sed with no file args requires a program.
1145 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1146
1147 for ac_prog in mawk gawk nawk awk
1148 do
1149 # Extract the first word of "$ac_prog", so it can be a program name with args.
1150 set dummy $ac_prog; ac_word=$2
1151 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1152 echo "configure:1153: checking for $ac_word" >&5
1153 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
1154   echo $ac_n "(cached) $ac_c" 1>&6
1155 else
1156   if test -n "$AWK"; then
1157   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1158 else
1159   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1160   ac_dummy="$PATH"
1161   for ac_dir in $ac_dummy; do
1162     test -z "$ac_dir" && ac_dir=.
1163     if test -f $ac_dir/$ac_word; then
1164       ac_cv_prog_AWK="$ac_prog"
1165       break
1166     fi
1167   done
1168   IFS="$ac_save_ifs"
1169 fi
1170 fi
1171 AWK="$ac_cv_prog_AWK"
1172 if test -n "$AWK"; then
1173   echo "$ac_t""$AWK" 1>&6
1174 else
1175   echo "$ac_t""no" 1>&6
1176 fi
1177
1178 test -n "$AWK" && break
1179 done
1180
1181 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1182 echo "configure:1183: checking whether ${MAKE-make} sets \${MAKE}" >&5
1183 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1184 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1185   echo $ac_n "(cached) $ac_c" 1>&6
1186 else
1187   cat > conftestmake <<\EOF
1188 all:
1189         @echo 'ac_maketemp="${MAKE}"'
1190 EOF
1191 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1192 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1193 if test -n "$ac_maketemp"; then
1194   eval ac_cv_prog_make_${ac_make}_set=yes
1195 else
1196   eval ac_cv_prog_make_${ac_make}_set=no
1197 fi
1198 rm -f conftestmake
1199 fi
1200 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1201   echo "$ac_t""yes" 1>&6
1202   SET_MAKE=
1203 else
1204   echo "$ac_t""no" 1>&6
1205   SET_MAKE="MAKE=${MAKE-make}"
1206 fi
1207
1208
1209
1210 PACKAGE=$OL_PACKAGE
1211
1212 VERSION=$OL_VERSION
1213
1214 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1215   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1216 fi
1217
1218
1219
1220 missing_dir=`cd $ac_aux_dir && pwd`
1221 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1222 echo "configure:1223: checking for working aclocal" >&5
1223 # Run test in a subshell; some versions of sh will print an error if
1224 # an executable is not found, even if stderr is redirected.
1225 # Redirect stdin to placate older versions of autoconf.  Sigh.
1226 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1227    ACLOCAL=aclocal
1228    echo "$ac_t""found" 1>&6
1229 else
1230    ACLOCAL="$missing_dir/missing aclocal"
1231    echo "$ac_t""missing" 1>&6
1232 fi
1233
1234 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1235 echo "configure:1236: checking for working autoconf" >&5
1236 # Run test in a subshell; some versions of sh will print an error if
1237 # an executable is not found, even if stderr is redirected.
1238 # Redirect stdin to placate older versions of autoconf.  Sigh.
1239 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1240    AUTOCONF=autoconf
1241    echo "$ac_t""found" 1>&6
1242 else
1243    AUTOCONF="$missing_dir/missing autoconf"
1244    echo "$ac_t""missing" 1>&6
1245 fi
1246
1247 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1248 echo "configure:1249: checking for working automake" >&5
1249 # Run test in a subshell; some versions of sh will print an error if
1250 # an executable is not found, even if stderr is redirected.
1251 # Redirect stdin to placate older versions of autoconf.  Sigh.
1252 if (automake --version) < /dev/null > /dev/null 2>&1; then
1253    AUTOMAKE=automake
1254    echo "$ac_t""found" 1>&6
1255 else
1256    AUTOMAKE="$missing_dir/missing automake"
1257    echo "$ac_t""missing" 1>&6
1258 fi
1259
1260 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1261 echo "configure:1262: checking for working autoheader" >&5
1262 # Run test in a subshell; some versions of sh will print an error if
1263 # an executable is not found, even if stderr is redirected.
1264 # Redirect stdin to placate older versions of autoconf.  Sigh.
1265 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1266    AUTOHEADER=autoheader
1267    echo "$ac_t""found" 1>&6
1268 else
1269    AUTOHEADER="$missing_dir/missing autoheader"
1270    echo "$ac_t""missing" 1>&6
1271 fi
1272
1273 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1274 echo "configure:1275: checking for working makeinfo" >&5
1275 # Run test in a subshell; some versions of sh will print an error if
1276 # an executable is not found, even if stderr is redirected.
1277 # Redirect stdin to placate older versions of autoconf.  Sigh.
1278 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1279    MAKEINFO=makeinfo
1280    echo "$ac_t""found" 1>&6
1281 else
1282    MAKEINFO="$missing_dir/missing makeinfo"
1283    echo "$ac_t""missing" 1>&6
1284 fi
1285
1286 install_sh="$missing_dir/install-sh"
1287 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1288
1289 for ac_prog in gnutar gtar tar
1290 do
1291 # Extract the first word of "$ac_prog", so it can be a program name with args.
1292 set dummy $ac_prog; ac_word=$2
1293 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1294 echo "configure:1295: checking for $ac_word" >&5
1295 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1296   echo $ac_n "(cached) $ac_c" 1>&6
1297 else
1298   if test -n "$AMTAR"; then
1299   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1300 else
1301   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1302   ac_dummy="$PATH"
1303   for ac_dir in $ac_dummy; do
1304     test -z "$ac_dir" && ac_dir=.
1305     if test -f $ac_dir/$ac_word; then
1306       ac_cv_prog_AMTAR="$ac_prog"
1307       break
1308     fi
1309   done
1310   IFS="$ac_save_ifs"
1311 fi
1312 fi
1313 AMTAR="$ac_cv_prog_AMTAR"
1314 if test -n "$AMTAR"; then
1315   echo "$ac_t""$AMTAR" 1>&6
1316 else
1317   echo "$ac_t""no" 1>&6
1318 fi
1319
1320 test -n "$AMTAR" && break
1321 done
1322
1323
1324 AMTARFLAGS=
1325 if test -n "$AMTAR"; then
1326   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1327         AMTARFLAGS=o
1328   fi
1329 fi
1330
1331 cat >> confdefs.h <<EOF
1332 #define OPENLDAP_PACKAGE "$PACKAGE"
1333 EOF
1334
1335 cat >> confdefs.h <<EOF
1336 #define OPENLDAP_VERSION "$VERSION"
1337 EOF
1338
1339
1340 cat >> confdefs.h <<EOF
1341 #define LDAP_VENDOR_VERSION $OL_API_INC
1342 EOF
1343
1344 cat >> confdefs.h <<EOF
1345 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1346 EOF
1347
1348 cat >> confdefs.h <<EOF
1349 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1350 EOF
1351
1352 cat >> confdefs.h <<EOF
1353 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1354 EOF
1355
1356
1357 OPENLDAP_LIBVERSION=$OL_API_LIB
1358
1359 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
1360
1361
1362
1363 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1364 echo "configure:1365: checking configure arguments" >&5
1365
1366
1367 top_builddir=`pwd`
1368
1369 ldap_subdir="/openldap"
1370
1371 # Check whether --with-subdir or --without-subdir was given.
1372 if test "${with_subdir+set}" = set; then
1373   withval="$with_subdir"
1374   case "$withval" in
1375         no) ldap_subdir=""
1376                 ;;
1377         yes)
1378                 ;;
1379         /*|\\*)
1380                 ldap_subdir="$withval"
1381                 ;;
1382         *)
1383                 ldap_subdir="/$withval"
1384                 ;;
1385 esac
1386
1387 fi
1388
1389
1390 # OpenLDAP --enable-debug
1391         # Check whether --enable-debug or --disable-debug was given.
1392 if test "${enable_debug+set}" = set; then
1393   enableval="$enable_debug"
1394   
1395         ol_arg=invalid
1396         for ol_val in auto yes no ; do
1397                 if test "$enableval" = "$ol_val" ; then
1398                         ol_arg="$ol_val"
1399                 fi
1400         done
1401         if test "$ol_arg" = "invalid" ; then
1402                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1403         fi
1404         ol_enable_debug="$ol_arg"
1405
1406 else
1407         ol_enable_debug="yes"
1408 fi
1409 # end --enable-debug
1410 # OpenLDAP --enable-syslog
1411         # Check whether --enable-syslog or --disable-syslog was given.
1412 if test "${enable_syslog+set}" = set; then
1413   enableval="$enable_syslog"
1414   
1415         ol_arg=invalid
1416         for ol_val in auto yes no ; do
1417                 if test "$enableval" = "$ol_val" ; then
1418                         ol_arg="$ol_val"
1419                 fi
1420         done
1421         if test "$ol_arg" = "invalid" ; then
1422                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1423         fi
1424         ol_enable_syslog="$ol_arg"
1425
1426 else
1427         ol_enable_syslog="auto"
1428 fi
1429 # end --enable-syslog
1430 # OpenLDAP --enable-proctitle
1431         # Check whether --enable-proctitle or --disable-proctitle was given.
1432 if test "${enable_proctitle+set}" = set; then
1433   enableval="$enable_proctitle"
1434   
1435         ol_arg=invalid
1436         for ol_val in auto yes no ; do
1437                 if test "$enableval" = "$ol_val" ; then
1438                         ol_arg="$ol_val"
1439                 fi
1440         done
1441         if test "$ol_arg" = "invalid" ; then
1442                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1443         fi
1444         ol_enable_proctitle="$ol_arg"
1445
1446 else
1447         ol_enable_proctitle="yes"
1448 fi
1449 # end --enable-proctitle
1450 # OpenLDAP --enable-cache
1451         # Check whether --enable-cache or --disable-cache was given.
1452 if test "${enable_cache+set}" = set; then
1453   enableval="$enable_cache"
1454   
1455         ol_arg=invalid
1456         for ol_val in auto yes no ; do
1457                 if test "$enableval" = "$ol_val" ; then
1458                         ol_arg="$ol_val"
1459                 fi
1460         done
1461         if test "$ol_arg" = "invalid" ; then
1462                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1463         fi
1464         ol_enable_cache="$ol_arg"
1465
1466 else
1467         ol_enable_cache="no"
1468 fi
1469 # end --enable-cache
1470 # OpenLDAP --enable-referrals
1471         # Check whether --enable-referrals or --disable-referrals was given.
1472 if test "${enable_referrals+set}" = set; then
1473   enableval="$enable_referrals"
1474   
1475         ol_arg=invalid
1476         for ol_val in auto yes no ; do
1477                 if test "$enableval" = "$ol_val" ; then
1478                         ol_arg="$ol_val"
1479                 fi
1480         done
1481         if test "$ol_arg" = "invalid" ; then
1482                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1483         fi
1484         ol_enable_referrals="$ol_arg"
1485
1486 else
1487         ol_enable_referrals="no"
1488 fi
1489 # end --enable-referrals
1490 ol_enable_kbind=${ol_enable_kbind-no}
1491 # OpenLDAP --enable-ipv6
1492         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1493 if test "${enable_ipv6+set}" = set; then
1494   enableval="$enable_ipv6"
1495   
1496         ol_arg=invalid
1497         for ol_val in auto yes no ; do
1498                 if test "$enableval" = "$ol_val" ; then
1499                         ol_arg="$ol_val"
1500                 fi
1501         done
1502         if test "$ol_arg" = "invalid" ; then
1503                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1504         fi
1505         ol_enable_ipv6="$ol_arg"
1506
1507 else
1508         ol_enable_ipv6="auto"
1509 fi
1510 # end --enable-ipv6
1511 # OpenLDAP --enable-local
1512         # Check whether --enable-local or --disable-local was given.
1513 if test "${enable_local+set}" = set; then
1514   enableval="$enable_local"
1515   
1516         ol_arg=invalid
1517         for ol_val in auto yes no ; do
1518                 if test "$enableval" = "$ol_val" ; then
1519                         ol_arg="$ol_val"
1520                 fi
1521         done
1522         if test "$ol_arg" = "invalid" ; then
1523                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1524         fi
1525         ol_enable_local="$ol_arg"
1526
1527 else
1528         ol_enable_local="auto"
1529 fi
1530 # end --enable-local
1531 # OpenLDAP --enable-x_compile
1532         # Check whether --enable-x_compile or --disable-x_compile was given.
1533 if test "${enable_x_compile+set}" = set; then
1534   enableval="$enable_x_compile"
1535   
1536         ol_arg=invalid
1537         for ol_val in yes no ; do
1538                 if test "$enableval" = "$ol_val" ; then
1539                         ol_arg="$ol_val"
1540                 fi
1541         done
1542         if test "$ol_arg" = "invalid" ; then
1543                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1544         fi
1545         ol_enable_x_compile="$ol_arg"
1546
1547 else
1548         ol_enable_x_compile="no"
1549 fi
1550 # end --enable-x_compile
1551
1552
1553 # OpenLDAP --with-cyrus_sasl
1554         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1555 if test "${with_cyrus_sasl+set}" = set; then
1556   withval="$with_cyrus_sasl"
1557   
1558         ol_arg=invalid
1559         for ol_val in auto yes no  ; do
1560                 if test "$withval" = "$ol_val" ; then
1561                         ol_arg="$ol_val"
1562                 fi
1563         done
1564         if test "$ol_arg" = "invalid" ; then
1565                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1566         fi
1567         ol_with_cyrus_sasl="$ol_arg"
1568
1569 else
1570         ol_with_cyrus_sasl="auto"
1571 fi
1572 # end --with-cyrus_sasl
1573
1574 # OpenLDAP --with-fetch
1575         # Check whether --with-fetch or --without-fetch was given.
1576 if test "${with_fetch+set}" = set; then
1577   withval="$with_fetch"
1578   
1579         ol_arg=invalid
1580         for ol_val in auto yes no  ; do
1581                 if test "$withval" = "$ol_val" ; then
1582                         ol_arg="$ol_val"
1583                 fi
1584         done
1585         if test "$ol_arg" = "invalid" ; then
1586                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1587         fi
1588         ol_with_fetch="$ol_arg"
1589
1590 else
1591         ol_with_fetch="auto"
1592 fi
1593 # end --with-fetch
1594
1595 # OpenLDAP --with-kerberos
1596         # Check whether --with-kerberos or --without-kerberos was given.
1597 if test "${with_kerberos+set}" = set; then
1598   withval="$with_kerberos"
1599   
1600         ol_arg=invalid
1601         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1602                 if test "$withval" = "$ol_val" ; then
1603                         ol_arg="$ol_val"
1604                 fi
1605         done
1606         if test "$ol_arg" = "invalid" ; then
1607                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1608         fi
1609         ol_with_kerberos="$ol_arg"
1610
1611 else
1612         ol_with_kerberos="auto"
1613 fi
1614 # end --with-kerberos
1615
1616 # OpenLDAP --with-readline
1617         # Check whether --with-readline or --without-readline was given.
1618 if test "${with_readline+set}" = set; then
1619   withval="$with_readline"
1620   
1621         ol_arg=invalid
1622         for ol_val in auto yes no  ; do
1623                 if test "$withval" = "$ol_val" ; then
1624                         ol_arg="$ol_val"
1625                 fi
1626         done
1627         if test "$ol_arg" = "invalid" ; then
1628                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1629         fi
1630         ol_with_readline="$ol_arg"
1631
1632 else
1633         ol_with_readline="auto"
1634 fi
1635 # end --with-readline
1636
1637 # OpenLDAP --with-threads
1638         # Check whether --with-threads or --without-threads was given.
1639 if test "${with_threads+set}" = set; then
1640   withval="$with_threads"
1641   
1642         ol_arg=invalid
1643         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1644                 if test "$withval" = "$ol_val" ; then
1645                         ol_arg="$ol_val"
1646                 fi
1647         done
1648         if test "$ol_arg" = "invalid" ; then
1649                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1650         fi
1651         ol_with_threads="$ol_arg"
1652
1653 else
1654         ol_with_threads="auto"
1655 fi
1656 # end --with-threads
1657
1658 # OpenLDAP --with-tls
1659         # Check whether --with-tls or --without-tls was given.
1660 if test "${with_tls+set}" = set; then
1661   withval="$with_tls"
1662   
1663         ol_arg=invalid
1664         for ol_val in auto ssleay openssl yes no  ; do
1665                 if test "$withval" = "$ol_val" ; then
1666                         ol_arg="$ol_val"
1667                 fi
1668         done
1669         if test "$ol_arg" = "invalid" ; then
1670                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1671         fi
1672         ol_with_tls="$ol_arg"
1673
1674 else
1675         ol_with_tls="auto"
1676 fi
1677 # end --with-tls
1678
1679 # OpenLDAP --with-yielding_select
1680         # Check whether --with-yielding_select or --without-yielding_select was given.
1681 if test "${with_yielding_select+set}" = set; then
1682   withval="$with_yielding_select"
1683   
1684         ol_arg=invalid
1685         for ol_val in auto yes no manual  ; do
1686                 if test "$withval" = "$ol_val" ; then
1687                         ol_arg="$ol_val"
1688                 fi
1689         done
1690         if test "$ol_arg" = "invalid" ; then
1691                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1692         fi
1693         ol_with_yielding_select="$ol_arg"
1694
1695 else
1696         ol_with_yielding_select="auto"
1697 fi
1698 # end --with-yielding_select
1699
1700
1701
1702 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1703 if test "${with_xxslapdoptions+set}" = set; then
1704   withval="$with_xxslapdoptions"
1705   :
1706 fi
1707
1708 # OpenLDAP --enable-slapd
1709         # Check whether --enable-slapd or --disable-slapd was given.
1710 if test "${enable_slapd+set}" = set; then
1711   enableval="$enable_slapd"
1712   
1713         ol_arg=invalid
1714         for ol_val in auto yes no ; do
1715                 if test "$enableval" = "$ol_val" ; then
1716                         ol_arg="$ol_val"
1717                 fi
1718         done
1719         if test "$ol_arg" = "invalid" ; then
1720                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1721         fi
1722         ol_enable_slapd="$ol_arg"
1723
1724 else
1725         ol_enable_slapd="yes"
1726 fi
1727 # end --enable-slapd
1728 # OpenLDAP --enable-aci
1729         # Check whether --enable-aci or --disable-aci was given.
1730 if test "${enable_aci+set}" = set; then
1731   enableval="$enable_aci"
1732   
1733         ol_arg=invalid
1734         for ol_val in auto yes no ; do
1735                 if test "$enableval" = "$ol_val" ; then
1736                         ol_arg="$ol_val"
1737                 fi
1738         done
1739         if test "$ol_arg" = "invalid" ; then
1740                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1741         fi
1742         ol_enable_aci="$ol_arg"
1743
1744 else
1745         ol_enable_aci="no"
1746 fi
1747 # end --enable-aci
1748 # OpenLDAP --enable-cleartext
1749         # Check whether --enable-cleartext or --disable-cleartext was given.
1750 if test "${enable_cleartext+set}" = set; then
1751   enableval="$enable_cleartext"
1752   
1753         ol_arg=invalid
1754         for ol_val in auto yes no ; do
1755                 if test "$enableval" = "$ol_val" ; then
1756                         ol_arg="$ol_val"
1757                 fi
1758         done
1759         if test "$ol_arg" = "invalid" ; then
1760                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1761         fi
1762         ol_enable_cleartext="$ol_arg"
1763
1764 else
1765         ol_enable_cleartext="yes"
1766 fi
1767 # end --enable-cleartext
1768 # OpenLDAP --enable-crypt
1769         # Check whether --enable-crypt or --disable-crypt was given.
1770 if test "${enable_crypt+set}" = set; then
1771   enableval="$enable_crypt"
1772   
1773         ol_arg=invalid
1774         for ol_val in auto yes no ; do
1775                 if test "$enableval" = "$ol_val" ; then
1776                         ol_arg="$ol_val"
1777                 fi
1778         done
1779         if test "$ol_arg" = "invalid" ; then
1780                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1781         fi
1782         ol_enable_crypt="$ol_arg"
1783
1784 else
1785         ol_enable_crypt="no"
1786 fi
1787 # end --enable-crypt
1788 # OpenLDAP --enable-dynamic
1789         # Check whether --enable-dynamic or --disable-dynamic was given.
1790 if test "${enable_dynamic+set}" = set; then
1791   enableval="$enable_dynamic"
1792   
1793         ol_arg=invalid
1794         for ol_val in auto yes no ; do
1795                 if test "$enableval" = "$ol_val" ; then
1796                         ol_arg="$ol_val"
1797                 fi
1798         done
1799         if test "$ol_arg" = "invalid" ; then
1800                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1801         fi
1802         ol_enable_dynamic="$ol_arg"
1803
1804 else
1805         ol_enable_dynamic="no"
1806 fi
1807 # end --enable-dynamic
1808 # OpenLDAP --enable-kpasswd
1809         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1810 if test "${enable_kpasswd+set}" = set; then
1811   enableval="$enable_kpasswd"
1812   
1813         ol_arg=invalid
1814         for ol_val in auto yes no ; do
1815                 if test "$enableval" = "$ol_val" ; then
1816                         ol_arg="$ol_val"
1817                 fi
1818         done
1819         if test "$ol_arg" = "invalid" ; then
1820                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1821         fi
1822         ol_enable_kpasswd="$ol_arg"
1823
1824 else
1825         ol_enable_kpasswd="no"
1826 fi
1827 # end --enable-kpasswd
1828 # OpenLDAP --enable-lmpasswd
1829         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1830 if test "${enable_lmpasswd+set}" = set; then
1831   enableval="$enable_lmpasswd"
1832   
1833         ol_arg=invalid
1834         for ol_val in auto yes no ; do
1835                 if test "$enableval" = "$ol_val" ; then
1836                         ol_arg="$ol_val"
1837                 fi
1838         done
1839         if test "$ol_arg" = "invalid" ; then
1840                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1841         fi
1842         ol_enable_lmpasswd="$ol_arg"
1843
1844 else
1845         ol_enable_lmpasswd="no"
1846 fi
1847 # end --enable-lmpasswd
1848 # OpenLDAP --enable-spasswd
1849         # Check whether --enable-spasswd or --disable-spasswd was given.
1850 if test "${enable_spasswd+set}" = set; then
1851   enableval="$enable_spasswd"
1852   
1853         ol_arg=invalid
1854         for ol_val in auto yes no ; do
1855                 if test "$enableval" = "$ol_val" ; then
1856                         ol_arg="$ol_val"
1857                 fi
1858         done
1859         if test "$ol_arg" = "invalid" ; then
1860                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1861         fi
1862         ol_enable_spasswd="$ol_arg"
1863
1864 else
1865         ol_enable_spasswd="no"
1866 fi
1867 # end --enable-spasswd
1868 # OpenLDAP --enable-modules
1869         # Check whether --enable-modules or --disable-modules was given.
1870 if test "${enable_modules+set}" = set; then
1871   enableval="$enable_modules"
1872   
1873         ol_arg=invalid
1874         for ol_val in auto yes no ; do
1875                 if test "$enableval" = "$ol_val" ; then
1876                         ol_arg="$ol_val"
1877                 fi
1878         done
1879         if test "$ol_arg" = "invalid" ; then
1880                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1881         fi
1882         ol_enable_modules="$ol_arg"
1883
1884 else
1885         ol_enable_modules="no"
1886 fi
1887 # end --enable-modules
1888 ol_enable_multimaster=${ol_enable_multimaster-no}
1889 # OpenLDAP --enable-phonetic
1890         # Check whether --enable-phonetic or --disable-phonetic was given.
1891 if test "${enable_phonetic+set}" = set; then
1892   enableval="$enable_phonetic"
1893   
1894         ol_arg=invalid
1895         for ol_val in auto yes no ; do
1896                 if test "$enableval" = "$ol_val" ; then
1897                         ol_arg="$ol_val"
1898                 fi
1899         done
1900         if test "$ol_arg" = "invalid" ; then
1901                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1902         fi
1903         ol_enable_phonetic="$ol_arg"
1904
1905 else
1906         ol_enable_phonetic="no"
1907 fi
1908 # end --enable-phonetic
1909 # OpenLDAP --enable-rewrite
1910         # Check whether --enable-rewrite or --disable-rewrite was given.
1911 if test "${enable_rewrite+set}" = set; then
1912   enableval="$enable_rewrite"
1913   
1914         ol_arg=invalid
1915         for ol_val in auto yes no ; do
1916                 if test "$enableval" = "$ol_val" ; then
1917                         ol_arg="$ol_val"
1918                 fi
1919         done
1920         if test "$ol_arg" = "invalid" ; then
1921                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1922         fi
1923         ol_enable_rewrite="$ol_arg"
1924
1925 else
1926         ol_enable_rewrite="no"
1927 fi
1928 # end --enable-rewrite
1929 # OpenLDAP --enable-rlookups
1930         # Check whether --enable-rlookups or --disable-rlookups was given.
1931 if test "${enable_rlookups+set}" = set; then
1932   enableval="$enable_rlookups"
1933   
1934         ol_arg=invalid
1935         for ol_val in auto yes no ; do
1936                 if test "$enableval" = "$ol_val" ; then
1937                         ol_arg="$ol_val"
1938                 fi
1939         done
1940         if test "$ol_arg" = "invalid" ; then
1941                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1942         fi
1943         ol_enable_rlookups="$ol_arg"
1944
1945 else
1946         ol_enable_rlookups="no"
1947 fi
1948 # end --enable-rlookups
1949 # OpenLDAP --enable-slp
1950         # Check whether --enable-slp or --disable-slp was given.
1951 if test "${enable_slp+set}" = set; then
1952   enableval="$enable_slp"
1953   
1954         ol_arg=invalid
1955         for ol_val in auto yes no ; do
1956                 if test "$enableval" = "$ol_val" ; then
1957                         ol_arg="$ol_val"
1958                 fi
1959         done
1960         if test "$ol_arg" = "invalid" ; then
1961                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1962         fi
1963         ol_enable_slp="$ol_arg"
1964
1965 else
1966         ol_enable_slp="no"
1967 fi
1968 # end --enable-slp
1969 # OpenLDAP --enable-wrappers
1970         # Check whether --enable-wrappers or --disable-wrappers was given.
1971 if test "${enable_wrappers+set}" = set; then
1972   enableval="$enable_wrappers"
1973   
1974         ol_arg=invalid
1975         for ol_val in auto yes no ; do
1976                 if test "$enableval" = "$ol_val" ; then
1977                         ol_arg="$ol_val"
1978                 fi
1979         done
1980         if test "$ol_arg" = "invalid" ; then
1981                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1982         fi
1983         ol_enable_wrappers="$ol_arg"
1984
1985 else
1986         ol_enable_wrappers="no"
1987 fi
1988 # end --enable-wrappers
1989
1990 # OpenLDAP --enable-bdb
1991         # Check whether --enable-bdb or --disable-bdb was given.
1992 if test "${enable_bdb+set}" = set; then
1993   enableval="$enable_bdb"
1994   
1995         ol_arg=invalid
1996         for ol_val in auto yes no ; do
1997                 if test "$enableval" = "$ol_val" ; then
1998                         ol_arg="$ol_val"
1999                 fi
2000         done
2001         if test "$ol_arg" = "invalid" ; then
2002                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
2003         fi
2004         ol_enable_bdb="$ol_arg"
2005
2006 else
2007         ol_enable_bdb="yes"
2008 fi
2009 # end --enable-bdb
2010 # OpenLDAP --with-bdb_module
2011         # Check whether --with-bdb_module or --without-bdb_module was given.
2012 if test "${with_bdb_module+set}" = set; then
2013   withval="$with_bdb_module"
2014   
2015         ol_arg=invalid
2016         for ol_val in static dynamic ; do
2017                 if test "$withval" = "$ol_val" ; then
2018                         ol_arg="$ol_val"
2019                 fi
2020         done
2021         if test "$ol_arg" = "invalid" ; then
2022                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
2023         fi
2024         ol_with_bdb_module="$ol_arg"
2025
2026 else
2027         ol_with_bdb_module="static"
2028 fi
2029 # end --with-bdb_module
2030
2031 # OpenLDAP --enable-dnssrv
2032         # Check whether --enable-dnssrv or --disable-dnssrv was given.
2033 if test "${enable_dnssrv+set}" = set; then
2034   enableval="$enable_dnssrv"
2035   
2036         ol_arg=invalid
2037         for ol_val in auto yes no ; do
2038                 if test "$enableval" = "$ol_val" ; then
2039                         ol_arg="$ol_val"
2040                 fi
2041         done
2042         if test "$ol_arg" = "invalid" ; then
2043                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
2044         fi
2045         ol_enable_dnssrv="$ol_arg"
2046
2047 else
2048         ol_enable_dnssrv="no"
2049 fi
2050 # end --enable-dnssrv
2051 # OpenLDAP --with-dnssrv_module
2052         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
2053 if test "${with_dnssrv_module+set}" = set; then
2054   withval="$with_dnssrv_module"
2055   
2056         ol_arg=invalid
2057         for ol_val in static dynamic ; do
2058                 if test "$withval" = "$ol_val" ; then
2059                         ol_arg="$ol_val"
2060                 fi
2061         done
2062         if test "$ol_arg" = "invalid" ; then
2063                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
2064         fi
2065         ol_with_dnssrv_module="$ol_arg"
2066
2067 else
2068         ol_with_dnssrv_module="static"
2069 fi
2070 # end --with-dnssrv_module
2071
2072 # OpenLDAP --enable-ldap
2073         # Check whether --enable-ldap or --disable-ldap was given.
2074 if test "${enable_ldap+set}" = set; then
2075   enableval="$enable_ldap"
2076   
2077         ol_arg=invalid
2078         for ol_val in auto yes no ; do
2079                 if test "$enableval" = "$ol_val" ; then
2080                         ol_arg="$ol_val"
2081                 fi
2082         done
2083         if test "$ol_arg" = "invalid" ; then
2084                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
2085         fi
2086         ol_enable_ldap="$ol_arg"
2087
2088 else
2089         ol_enable_ldap="no"
2090 fi
2091 # end --enable-ldap
2092 # OpenLDAP --with-ldap_module
2093         # Check whether --with-ldap_module or --without-ldap_module was given.
2094 if test "${with_ldap_module+set}" = set; then
2095   withval="$with_ldap_module"
2096   
2097         ol_arg=invalid
2098         for ol_val in static dynamic ; do
2099                 if test "$withval" = "$ol_val" ; then
2100                         ol_arg="$ol_val"
2101                 fi
2102         done
2103         if test "$ol_arg" = "invalid" ; then
2104                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
2105         fi
2106         ol_with_ldap_module="$ol_arg"
2107
2108 else
2109         ol_with_ldap_module="static"
2110 fi
2111 # end --with-ldap_module
2112
2113 # OpenLDAP --enable-ldbm
2114         # Check whether --enable-ldbm or --disable-ldbm was given.
2115 if test "${enable_ldbm+set}" = set; then
2116   enableval="$enable_ldbm"
2117   
2118         ol_arg=invalid
2119         for ol_val in auto yes no ; do
2120                 if test "$enableval" = "$ol_val" ; then
2121                         ol_arg="$ol_val"
2122                 fi
2123         done
2124         if test "$ol_arg" = "invalid" ; then
2125                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
2126         fi
2127         ol_enable_ldbm="$ol_arg"
2128
2129 else
2130         ol_enable_ldbm="no"
2131 fi
2132 # end --enable-ldbm
2133 # OpenLDAP --with-ldbm_api
2134         # Check whether --with-ldbm_api or --without-ldbm_api was given.
2135 if test "${with_ldbm_api+set}" = set; then
2136   withval="$with_ldbm_api"
2137   
2138         ol_arg=invalid
2139         for ol_val in auto berkeley bcompat mdbm gdbm ; do
2140                 if test "$withval" = "$ol_val" ; then
2141                         ol_arg="$ol_val"
2142                 fi
2143         done
2144         if test "$ol_arg" = "invalid" ; then
2145                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
2146         fi
2147         ol_with_ldbm_api="$ol_arg"
2148
2149 else
2150         ol_with_ldbm_api="auto"
2151 fi
2152 # end --with-ldbm_api
2153
2154 # OpenLDAP --with-ldbm_module
2155         # Check whether --with-ldbm_module or --without-ldbm_module was given.
2156 if test "${with_ldbm_module+set}" = set; then
2157   withval="$with_ldbm_module"
2158   
2159         ol_arg=invalid
2160         for ol_val in static dynamic ; do
2161                 if test "$withval" = "$ol_val" ; then
2162                         ol_arg="$ol_val"
2163                 fi
2164         done
2165         if test "$ol_arg" = "invalid" ; then
2166                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2167         fi
2168         ol_with_ldbm_module="$ol_arg"
2169
2170 else
2171         ol_with_ldbm_module="static"
2172 fi
2173 # end --with-ldbm_module
2174
2175 # OpenLDAP --with-ldbm_type
2176         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2177 if test "${with_ldbm_type+set}" = set; then
2178   withval="$with_ldbm_type"
2179   
2180         ol_arg=invalid
2181         for ol_val in auto btree hash ; do
2182                 if test "$withval" = "$ol_val" ; then
2183                         ol_arg="$ol_val"
2184                 fi
2185         done
2186         if test "$ol_arg" = "invalid" ; then
2187                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2188         fi
2189         ol_with_ldbm_type="$ol_arg"
2190
2191 else
2192         ol_with_ldbm_type="auto"
2193 fi
2194 # end --with-ldbm_type
2195
2196 # OpenLDAP --enable-meta
2197         # Check whether --enable-meta or --disable-meta was given.
2198 if test "${enable_meta+set}" = set; then
2199   enableval="$enable_meta"
2200   
2201         ol_arg=invalid
2202         for ol_val in auto yes no ; do
2203                 if test "$enableval" = "$ol_val" ; then
2204                         ol_arg="$ol_val"
2205                 fi
2206         done
2207         if test "$ol_arg" = "invalid" ; then
2208                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2209         fi
2210         ol_enable_meta="$ol_arg"
2211
2212 else
2213         ol_enable_meta="no"
2214 fi
2215 # end --enable-meta
2216 # OpenLDAP --with-meta_module
2217         # Check whether --with-meta_module or --without-meta_module was given.
2218 if test "${with_meta_module+set}" = set; then
2219   withval="$with_meta_module"
2220   
2221         ol_arg=invalid
2222         for ol_val in static dynamic ; do
2223                 if test "$withval" = "$ol_val" ; then
2224                         ol_arg="$ol_val"
2225                 fi
2226         done
2227         if test "$ol_arg" = "invalid" ; then
2228                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2229         fi
2230         ol_with_meta_module="$ol_arg"
2231
2232 else
2233         ol_with_meta_module="static"
2234 fi
2235 # end --with-meta_module
2236
2237 # OpenLDAP --enable-monitor
2238         # Check whether --enable-monitor or --disable-monitor was given.
2239 if test "${enable_monitor+set}" = set; then
2240   enableval="$enable_monitor"
2241   
2242         ol_arg=invalid
2243         for ol_val in auto yes no ; do
2244                 if test "$enableval" = "$ol_val" ; then
2245                         ol_arg="$ol_val"
2246                 fi
2247         done
2248         if test "$ol_arg" = "invalid" ; then
2249                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2250         fi
2251         ol_enable_monitor="$ol_arg"
2252
2253 else
2254         ol_enable_monitor="no"
2255 fi
2256 # end --enable-monitor
2257 # OpenLDAP --with-monitor_module
2258         # Check whether --with-monitor_module or --without-monitor_module was given.
2259 if test "${with_monitor_module+set}" = set; then
2260   withval="$with_monitor_module"
2261   
2262         ol_arg=invalid
2263         for ol_val in static dynamic ; do
2264                 if test "$withval" = "$ol_val" ; then
2265                         ol_arg="$ol_val"
2266                 fi
2267         done
2268         if test "$ol_arg" = "invalid" ; then
2269                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2270         fi
2271         ol_with_monitor_module="$ol_arg"
2272
2273 else
2274         ol_with_monitor_module="static"
2275 fi
2276 # end --with-monitor_module
2277
2278 # OpenLDAP --enable-null
2279         # Check whether --enable-null or --disable-null was given.
2280 if test "${enable_null+set}" = set; then
2281   enableval="$enable_null"
2282   
2283         ol_arg=invalid
2284         for ol_val in auto yes no ; do
2285                 if test "$enableval" = "$ol_val" ; then
2286                         ol_arg="$ol_val"
2287                 fi
2288         done
2289         if test "$ol_arg" = "invalid" ; then
2290                 { echo "configure: error: bad value $enableval for --enable-null" 1>&2; exit 1; }
2291         fi
2292         ol_enable_null="$ol_arg"
2293
2294 else
2295         ol_enable_null="no"
2296 fi
2297 # end --enable-null
2298 # OpenLDAP --with-null_module
2299         # Check whether --with-null_module or --without-null_module was given.
2300 if test "${with_null_module+set}" = set; then
2301   withval="$with_null_module"
2302   
2303         ol_arg=invalid
2304         for ol_val in static dynamic ; do
2305                 if test "$withval" = "$ol_val" ; then
2306                         ol_arg="$ol_val"
2307                 fi
2308         done
2309         if test "$ol_arg" = "invalid" ; then
2310                 { echo "configure: error: bad value $withval for --with-null_module" 1>&2; exit 1; }
2311         fi
2312         ol_with_null_module="$ol_arg"
2313
2314 else
2315         ol_with_null_module="static"
2316 fi
2317 # end --with-null_module
2318
2319 # OpenLDAP --enable-passwd
2320         # Check whether --enable-passwd or --disable-passwd was given.
2321 if test "${enable_passwd+set}" = set; then
2322   enableval="$enable_passwd"
2323   
2324         ol_arg=invalid
2325         for ol_val in auto yes no ; do
2326                 if test "$enableval" = "$ol_val" ; then
2327                         ol_arg="$ol_val"
2328                 fi
2329         done
2330         if test "$ol_arg" = "invalid" ; then
2331                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2332         fi
2333         ol_enable_passwd="$ol_arg"
2334
2335 else
2336         ol_enable_passwd="no"
2337 fi
2338 # end --enable-passwd
2339 # OpenLDAP --with-passwd_module
2340         # Check whether --with-passwd_module or --without-passwd_module was given.
2341 if test "${with_passwd_module+set}" = set; then
2342   withval="$with_passwd_module"
2343   
2344         ol_arg=invalid
2345         for ol_val in static dynamic ; do
2346                 if test "$withval" = "$ol_val" ; then
2347                         ol_arg="$ol_val"
2348                 fi
2349         done
2350         if test "$ol_arg" = "invalid" ; then
2351                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2352         fi
2353         ol_with_passwd_module="$ol_arg"
2354
2355 else
2356         ol_with_passwd_module="static"
2357 fi
2358 # end --with-passwd_module
2359
2360 # OpenLDAP --enable-perl
2361         # Check whether --enable-perl or --disable-perl was given.
2362 if test "${enable_perl+set}" = set; then
2363   enableval="$enable_perl"
2364   
2365         ol_arg=invalid
2366         for ol_val in auto yes no ; do
2367                 if test "$enableval" = "$ol_val" ; then
2368                         ol_arg="$ol_val"
2369                 fi
2370         done
2371         if test "$ol_arg" = "invalid" ; then
2372                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2373         fi
2374         ol_enable_perl="$ol_arg"
2375
2376 else
2377         ol_enable_perl="no"
2378 fi
2379 # end --enable-perl
2380 # OpenLDAP --with-perl_module
2381         # Check whether --with-perl_module or --without-perl_module was given.
2382 if test "${with_perl_module+set}" = set; then
2383   withval="$with_perl_module"
2384   
2385         ol_arg=invalid
2386         for ol_val in static dynamic ; do
2387                 if test "$withval" = "$ol_val" ; then
2388                         ol_arg="$ol_val"
2389                 fi
2390         done
2391         if test "$ol_arg" = "invalid" ; then
2392                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2393         fi
2394         ol_with_perl_module="$ol_arg"
2395
2396 else
2397         ol_with_perl_module="static"
2398 fi
2399 # end --with-perl_module
2400
2401 # OpenLDAP --enable-shell
2402         # Check whether --enable-shell or --disable-shell was given.
2403 if test "${enable_shell+set}" = set; then
2404   enableval="$enable_shell"
2405   
2406         ol_arg=invalid
2407         for ol_val in auto yes no ; do
2408                 if test "$enableval" = "$ol_val" ; then
2409                         ol_arg="$ol_val"
2410                 fi
2411         done
2412         if test "$ol_arg" = "invalid" ; then
2413                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2414         fi
2415         ol_enable_shell="$ol_arg"
2416
2417 else
2418         ol_enable_shell="no"
2419 fi
2420 # end --enable-shell
2421 # OpenLDAP --with-shell_module
2422         # Check whether --with-shell_module or --without-shell_module was given.
2423 if test "${with_shell_module+set}" = set; then
2424   withval="$with_shell_module"
2425   
2426         ol_arg=invalid
2427         for ol_val in static dynamic ; do
2428                 if test "$withval" = "$ol_val" ; then
2429                         ol_arg="$ol_val"
2430                 fi
2431         done
2432         if test "$ol_arg" = "invalid" ; then
2433                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2434         fi
2435         ol_with_shell_module="$ol_arg"
2436
2437 else
2438         ol_with_shell_module="static"
2439 fi
2440 # end --with-shell_module
2441
2442 # OpenLDAP --enable-sql
2443         # Check whether --enable-sql or --disable-sql was given.
2444 if test "${enable_sql+set}" = set; then
2445   enableval="$enable_sql"
2446   
2447         ol_arg=invalid
2448         for ol_val in auto yes no ; do
2449                 if test "$enableval" = "$ol_val" ; then
2450                         ol_arg="$ol_val"
2451                 fi
2452         done
2453         if test "$ol_arg" = "invalid" ; then
2454                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2455         fi
2456         ol_enable_sql="$ol_arg"
2457
2458 else
2459         ol_enable_sql="no"
2460 fi
2461 # end --enable-sql
2462 # OpenLDAP --with-sql_module
2463         # Check whether --with-sql_module or --without-sql_module was given.
2464 if test "${with_sql_module+set}" = set; then
2465   withval="$with_sql_module"
2466   
2467         ol_arg=invalid
2468         for ol_val in static dynamic ; do
2469                 if test "$withval" = "$ol_val" ; then
2470                         ol_arg="$ol_val"
2471                 fi
2472         done
2473         if test "$ol_arg" = "invalid" ; then
2474                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2475         fi
2476         ol_with_sql_module="$ol_arg"
2477
2478 else
2479         ol_with_sql_module="static"
2480 fi
2481 # end --with-sql_module
2482
2483
2484 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2485 if test "${with_xxslurpdoptions+set}" = set; then
2486   withval="$with_xxslurpdoptions"
2487   :
2488 fi
2489
2490 # OpenLDAP --enable-slurpd
2491         # Check whether --enable-slurpd or --disable-slurpd was given.
2492 if test "${enable_slurpd+set}" = set; then
2493   enableval="$enable_slurpd"
2494   
2495         ol_arg=invalid
2496         for ol_val in auto yes no ; do
2497                 if test "$enableval" = "$ol_val" ; then
2498                         ol_arg="$ol_val"
2499                 fi
2500         done
2501         if test "$ol_arg" = "invalid" ; then
2502                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2503         fi
2504         ol_enable_slurpd="$ol_arg"
2505
2506 else
2507         ol_enable_slurpd="auto"
2508 fi
2509 # end --enable-slurpd
2510
2511 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2512 if test "${with_xxliboptions+set}" = set; then
2513   withval="$with_xxliboptions"
2514   :
2515 fi
2516
2517 # Check whether --enable-static or --disable-static was given.
2518 if test "${enable_static+set}" = set; then
2519   enableval="$enable_static"
2520   p=${PACKAGE-default}
2521 case $enableval in
2522 yes) enable_static=yes ;;
2523 no) enable_static=no ;;
2524 *)
2525   enable_static=no
2526   # Look at the argument we got.  We use all the common list separators.
2527   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2528   for pkg in $enableval; do
2529     if test "X$pkg" = "X$p"; then
2530       enable_static=yes
2531     fi
2532   done
2533   IFS="$ac_save_ifs"
2534   ;;
2535 esac
2536 else
2537   enable_static=yes
2538 fi
2539
2540 # Check whether --enable-shared or --disable-shared was given.
2541 if test "${enable_shared+set}" = set; then
2542   enableval="$enable_shared"
2543   p=${PACKAGE-default}
2544 case $enableval in
2545 yes) enable_shared=yes ;;
2546 no) enable_shared=no ;;
2547 *)
2548   enable_shared=no
2549   # Look at the argument we got.  We use all the common list separators.
2550   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2551   for pkg in $enableval; do
2552     if test "X$pkg" = "X$p"; then
2553       enable_shared=yes
2554     fi
2555   done
2556   IFS="$ac_save_ifs"
2557   ;;
2558 esac
2559 else
2560   enable_shared=yes
2561 fi
2562
2563
2564
2565 # validate options
2566 if test $ol_enable_slapd = no ; then
2567                 if test $ol_enable_bdb = yes ; then
2568                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2569         fi
2570         if test $ol_enable_dnssrv = yes ; then
2571                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2572         fi
2573         if test $ol_enable_ldap = yes ; then
2574                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2575         fi
2576         if test $ol_enable_ldbm = yes ; then
2577                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2578         fi
2579         if test $ol_enable_meta = yes ; then
2580                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2581         fi
2582         if test $ol_enable_monitor = yes ; then
2583                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2584         fi
2585         if test $ol_enable_null = yes ; then
2586                 echo "configure: warning: slapd disabled, ignoring --enable-null argument" 1>&2
2587         fi
2588         if test $ol_enable_passwd = yes ; then
2589                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2590         fi
2591         if test $ol_enable_perl = yes ; then
2592                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2593         fi
2594         if test $ol_enable_shell = yes ; then
2595                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2596         fi
2597         if test $ol_enable_sql = yes ; then
2598                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2599         fi
2600         if test $ol_enable_modules = yes ; then
2601                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2602         fi
2603         if test $ol_enable_multimaster = yes ; then
2604                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2605         fi
2606         if test $ol_enable_wrappers = yes ; then
2607                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2608         fi
2609         if test $ol_enable_phonetic = yes ; then
2610                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2611         fi
2612         if test $ol_enable_rlookups = yes ; then
2613                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2614         fi
2615         if test $ol_enable_aci = yes ; then
2616                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2617         fi
2618         if test $ol_with_ldbm_api != auto ; then
2619                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2620         fi
2621         if test $ol_with_ldbm_type != auto ; then
2622                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2623         fi
2624         if test $ol_with_bdb_module != static ; then
2625                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2626         fi
2627         if test $ol_with_dnssrv_module != static ; then
2628                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2629         fi
2630         if test $ol_with_ldap_module != static ; then
2631                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2632         fi
2633         if test $ol_with_ldbm_module != static ; then
2634                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2635         fi
2636         if test $ol_with_meta_module != static ; then
2637                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2638         fi
2639         if test $ol_with_monitor_module != static ; then
2640                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2641         fi
2642         if test $ol_with_null_module != static ; then
2643                 echo "configure: warning: slapd disabled, ignoring --with-null-module argument" 1>&2
2644         fi
2645         if test $ol_with_passwd_module != static ; then
2646                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2647         fi
2648         if test $ol_with_perl_module != static ; then
2649                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2650         fi
2651         if test $ol_with_shell_module != static ; then
2652                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2653         fi
2654         if test $ol_with_sql_module != static ; then
2655                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2656         fi
2657         if test $ol_enable_slurpd = yes ; then
2658                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2659         fi
2660         if test $ol_enable_rewrite = yes ; then
2661                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2662         fi
2663
2664         # force settings to no
2665         ol_enable_bdb=no
2666         ol_enable_dnssrv=no
2667         ol_enable_ldap=no
2668         ol_enable_ldbm=no
2669         ol_enable_meta=no
2670         ol_enable_monitor=no
2671         ol_enable_null=no
2672         ol_enable_passwd=no
2673         ol_enable_perl=no
2674         ol_enable_shell=no
2675         ol_enable_sql=no
2676
2677         ol_enable_modules=no
2678         ol_enable_multimaster=no
2679         ol_enable_phonetic=no
2680         ol_enable_rlookups=no
2681         ol_enable_aci=no
2682         ol_enable_wrappers=no
2683         ol_enable_dynamic=no
2684
2685         ol_with_ldbm_api=no
2686         ol_with_ldbm_type=no
2687
2688         ol_with_bdb_module=static
2689         ol_with_dnssrv_module=static
2690         ol_with_ldap_module=static
2691         ol_with_ldbm_module=static
2692         ol_with_meta_module=static
2693         ol_with_monitor_module=static
2694         ol_with_null_module=static
2695         ol_with_passwd_module=static
2696         ol_with_perl_module=static
2697         ol_with_shell_module=static
2698         ol_with_sql_module=static
2699
2700         ol_enable_slurpd=no
2701
2702         ol_enable_rewrite=no
2703
2704 elif test $ol_enable_ldbm = no ; then
2705         
2706         if test $ol_with_ldbm_api != auto ; then
2707                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2708         fi
2709
2710         if test $ol_with_ldbm_type != auto ; then
2711                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2712         fi
2713
2714         if test $ol_with_ldbm_module != static ; then
2715                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2716         fi
2717
2718         if test $ol_enable_modules != yes -a \
2719                 $ol_enable_bdb = no -a \
2720                 $ol_enable_dnssrv = no -a \
2721                 $ol_enable_ldap = no -a \
2722                 $ol_enable_meta = no -a \
2723                 $ol_enable_monitor = no -a \
2724                 $ol_enable_null = no -a \
2725                 $ol_enable_passwd = no -a \
2726                 $ol_enable_perl = no -a \
2727                 $ol_enable_shell = no -a \
2728                 $ol_enable_sql = no ; then
2729
2730                 if test $ol_enable_slapd = yes ; then
2731                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2732                 else
2733                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2734                         ol_enable_slapd=no
2735                 fi
2736         fi
2737
2738         ol_with_ldbm_api=no
2739         ol_with_ldbm_type=no
2740         ol_with_ldbm_module=static
2741
2742         if test $ol_enable_bdb != no ; then
2743                 ol_with_ldbm_api=berkeley
2744         fi
2745
2746 else
2747                 if test $ol_with_ldbm_api = gdbm -a \
2748                 $ol_with_ldbm_type = btree ; then
2749                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2750         fi
2751         if test $ol_with_ldbm_api = mdbm -a \
2752                 $ol_with_ldbm_type = btree ; then
2753                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2754         fi
2755         if test $ol_with_ldbm_api = ndbm -a \
2756                 $ol_with_ldbm_type = btree ; then
2757                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2758         fi
2759
2760         if test $ol_enable_bdb = yes ; then
2761                 if test $ol_with_ldbm_api = auto ; then
2762                         ol_with_ldbm_api=berkeley
2763                 elif test $ol_with_ldbm_api != berkeley ; then
2764                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2765                 fi
2766
2767         elif test $ol_enable_bdb = auto ; then
2768                 if test $ol_with_ldbm_api != berkeley \
2769                         -o $ol_with_ldbm_api != auto ; then
2770                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2771                         ol_enable_bdb=no
2772                 fi
2773         fi
2774 fi
2775
2776 if test $ol_enable_slurpd = yes ; then
2777                 if test $ol_with_threads = no ; then
2778                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2779         fi
2780 fi
2781
2782 if test $ol_enable_lmpasswd = yes ; then
2783         if test $ol_with_tls = no ; then
2784                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2785         fi
2786 fi
2787
2788 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2789         if test $ol_with_kerberos = no ; then
2790                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2791         elif test $ol_with_kerberos = auto ; then
2792                 ol_with_kerberos=yes
2793         fi
2794
2795 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2796         if test $ol_with_kerberos = auto ; then
2797                 ol_with_kerberos=no
2798         elif test $ol_with_kerberos != no ; then
2799                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2800                 ol_with_kerberos=no
2801         fi
2802 fi
2803
2804 if test $ol_enable_spasswd = yes ; then
2805         if test $ol_with_cyrus_sasl = no ; then
2806                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2807         fi
2808         ol_with_cyrus_sasl=yes
2809 fi
2810
2811 echo "$ac_t""done" 1>&6
2812
2813 LDAP_LIBS=
2814 LDIF_LIBS=
2815 LDBM_LIBS=
2816 LTHREAD_LIBS=
2817 LUTIL_LIBS=
2818
2819 SLAPD_LIBS=
2820 SLURPD_LIBS=
2821
2822 BUILD_SLAPD=no
2823 BUILD_SLURPD=no
2824
2825 BUILD_THREAD=no
2826
2827 BUILD_BDB=no
2828 BUILD_DNSSRV=no
2829 BUILD_LDAP=no
2830 BUILD_LDBM=no
2831 BUILD_META=no
2832 BUILD_MONITOR=no
2833 BUILD_NULL=no
2834 BUILD_PASSWD=no
2835 BUILD_PERL=no
2836 BUILD_SHELL=no
2837 BUILD_SQL=no
2838
2839 BUILD_BDB_DYNAMIC=static
2840 BUILD_DNSSRV_DYNAMIC=static
2841 BUILD_LDAP_DYNAMIC=static
2842 BUILD_LDBM_DYNAMIC=static
2843 BUILD_META_DYNAMIC=static
2844 BUILD_MONITOR_DYNAMIC=static
2845 BUILD_NULL_DYNAMIC=static
2846 BUILD_PASSWD_DYNAMIC=static
2847 BUILD_PERL_DYNAMIC=static
2848 BUILD_SHELL_DYNAMIC=static
2849 BUILD_SQL_DYNAMIC=static
2850
2851 SLAPD_MODULES_LDFLAGS=
2852 SLAPD_MODULES_CPPFLAGS=
2853
2854 SLAPD_STATIC_BACKENDS=
2855 SLAPD_DYNAMIC_BACKENDS=
2856
2857 SLAPD_PERL_LDFLAGS=
2858 MOD_PERL_LDFLAGS=
2859 PERL_CPPFLAGS=
2860
2861 SLAPD_SQL_LDFLAGS=
2862 SLAPD_SQL_LIBS=
2863 SLAPD_SQL_INCLUDES=
2864
2865 KRB4_LIBS=
2866 KRB5_LIBS=
2867 READLINE_LIBS=
2868 SASL_LIBS=
2869 TERMCAP_LIBS=
2870 TLS_LIBS=
2871 MODULES_LIBS=
2872 AUTH_LIBS=
2873
2874 SLAPD_SLP_LIBS=
2875
2876
2877 # Find a good install program.  We prefer a C program (faster),
2878 # so one script is as good as another.  But avoid the broken or
2879 # incompatible versions:
2880 # SysV /etc/install, /usr/sbin/install
2881 # SunOS /usr/etc/install
2882 # IRIX /sbin/install
2883 # AIX /bin/install
2884 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2885 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2886 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2887 # ./install, which can be erroneously created by make from ./install.sh.
2888 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2889 echo "configure:2890: checking for a BSD compatible install" >&5
2890 if test -z "$INSTALL"; then
2891 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
2892   echo $ac_n "(cached) $ac_c" 1>&6
2893 else
2894     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2895   for ac_dir in $PATH; do
2896     # Account for people who put trailing slashes in PATH elements.
2897     case "$ac_dir/" in
2898     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2899     *)
2900       # OSF1 and SCO ODT 3.0 have their own names for install.
2901       # Don't use installbsd from OSF since it installs stuff as root
2902       # by default.
2903       for ac_prog in ginstall scoinst install; do
2904         if test -f $ac_dir/$ac_prog; then
2905           if test $ac_prog = install &&
2906             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2907             # AIX install.  It has an incompatible calling convention.
2908             :
2909           elif test $ac_prog = install &&
2910             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2911             # program-specific install script used by HP pwplus--don't use.
2912             :
2913           else
2914             ac_cv_path_install="$ac_dir/$ac_prog -c"
2915             break 2
2916           fi
2917         fi
2918       done
2919       ;;
2920     esac
2921   done
2922   IFS="$ac_save_IFS"
2923
2924 fi
2925   if test "${ac_cv_path_install+set}" = set; then
2926     INSTALL="$ac_cv_path_install"
2927   else
2928     # As a last resort, use the slow shell script.  We don't cache a
2929     # path for INSTALL within a source directory, because that will
2930     # break other packages using the cache if that directory is
2931     # removed, or if the path is relative.
2932     INSTALL="$ac_install_sh"
2933   fi
2934 fi
2935 echo "$ac_t""$INSTALL" 1>&6
2936
2937 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2938 # It thinks the first close brace ends the variable substitution.
2939 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2940
2941 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2942
2943 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2944
2945
2946 cat >> confdefs.h <<\EOF
2947 #define HAVE_MKVERSION 1
2948 EOF
2949
2950
2951
2952
2953 ol_aix_threads=no
2954 case "$target" in
2955 *-*-aix*)       if test -z "$CC" ; then
2956                 case "$ol_with_threads" in
2957                 auto | yes |  posix) ol_aix_threads=yes ;;
2958                 esac
2959         fi
2960 ;;
2961 esac
2962
2963 if test $ol_aix_threads = yes ; then
2964         if test -z "${CC}" ; then
2965                 for ac_prog in cc_r xlc_r cc
2966 do
2967 # Extract the first word of "$ac_prog", so it can be a program name with args.
2968 set dummy $ac_prog; ac_word=$2
2969 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2970 echo "configure:2971: checking for $ac_word" >&5
2971 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2972   echo $ac_n "(cached) $ac_c" 1>&6
2973 else
2974   if test -n "$CC"; then
2975   ac_cv_prog_CC="$CC" # Let the user override the test.
2976 else
2977   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2978   ac_dummy="$PATH"
2979   for ac_dir in $ac_dummy; do
2980     test -z "$ac_dir" && ac_dir=.
2981     if test -f $ac_dir/$ac_word; then
2982       ac_cv_prog_CC="$ac_prog"
2983       break
2984     fi
2985   done
2986   IFS="$ac_save_ifs"
2987 fi
2988 fi
2989 CC="$ac_cv_prog_CC"
2990 if test -n "$CC"; then
2991   echo "$ac_t""$CC" 1>&6
2992 else
2993   echo "$ac_t""no" 1>&6
2994 fi
2995
2996 test -n "$CC" && break
2997 done
2998
2999
3000                 if test "$CC" = cc ; then
3001                                                 if test $ol_with_threads != auto ; then
3002                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
3003                         else
3004                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
3005                         fi
3006                         ol_with_threads=no
3007                 fi
3008         fi
3009
3010         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
3011                 ol_with_threads=posix
3012                 ol_cv_pthread_create=yes
3013         fi
3014 fi
3015
3016 if test -z "${CC}"; then
3017         for ac_prog in cc gcc
3018 do
3019 # Extract the first word of "$ac_prog", so it can be a program name with args.
3020 set dummy $ac_prog; ac_word=$2
3021 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3022 echo "configure:3023: checking for $ac_word" >&5
3023 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3024   echo $ac_n "(cached) $ac_c" 1>&6
3025 else
3026   if test -n "$CC"; then
3027   ac_cv_prog_CC="$CC" # Let the user override the test.
3028 else
3029   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3030   ac_dummy="$PATH"
3031   for ac_dir in $ac_dummy; do
3032     test -z "$ac_dir" && ac_dir=.
3033     if test -f $ac_dir/$ac_word; then
3034       ac_cv_prog_CC="$ac_prog"
3035       break
3036     fi
3037   done
3038   IFS="$ac_save_ifs"
3039 fi
3040 fi
3041 CC="$ac_cv_prog_CC"
3042 if test -n "$CC"; then
3043   echo "$ac_t""$CC" 1>&6
3044 else
3045   echo "$ac_t""no" 1>&6
3046 fi
3047
3048 test -n "$CC" && break
3049 done
3050 test -n "$CC" || CC="missing"
3051
3052
3053         if test "${CC}" = "missing" ; then
3054                 { echo "configure: error: Unable to locate cc(1) or suitable replacement.  Check PATH or set CC." 1>&2; exit 1; }
3055         fi
3056 fi
3057
3058 if test -z "${AR}"; then
3059         for ac_prog in ar gar
3060 do
3061 # Extract the first word of "$ac_prog", so it can be a program name with args.
3062 set dummy $ac_prog; ac_word=$2
3063 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3064 echo "configure:3065: checking for $ac_word" >&5
3065 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
3066   echo $ac_n "(cached) $ac_c" 1>&6
3067 else
3068   if test -n "$AR"; then
3069   ac_cv_prog_AR="$AR" # Let the user override the test.
3070 else
3071   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3072   ac_dummy="$PATH"
3073   for ac_dir in $ac_dummy; do
3074     test -z "$ac_dir" && ac_dir=.
3075     if test -f $ac_dir/$ac_word; then
3076       ac_cv_prog_AR="$ac_prog"
3077       break
3078     fi
3079   done
3080   IFS="$ac_save_ifs"
3081 fi
3082 fi
3083 AR="$ac_cv_prog_AR"
3084 if test -n "$AR"; then
3085   echo "$ac_t""$AR" 1>&6
3086 else
3087   echo "$ac_t""no" 1>&6
3088 fi
3089
3090 test -n "$AR" && break
3091 done
3092 test -n "$AR" || AR="missing"
3093
3094
3095         if test "${AR}" = "missing" ; then
3096                 { echo "configure: error: Unable to locate ar(1) or suitable replacement.  Check PATH or set AR." 1>&2; exit 1; }
3097         fi
3098 fi
3099
3100
3101
3102 # Find the correct PATH separator.  Usually this is `:', but
3103 # DJGPP uses `;' like DOS.
3104 if test "X${PATH_SEPARATOR+set}" != Xset; then
3105   UNAME=${UNAME-`uname 2>/dev/null`}
3106   case X$UNAME in
3107     *-DOS) lt_cv_sys_path_separator=';' ;;
3108     *)     lt_cv_sys_path_separator=':' ;;
3109   esac
3110   PATH_SEPARATOR=$lt_cv_sys_path_separator
3111 fi
3112
3113 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3114 echo "configure:3115: checking for Cygwin environment" >&5
3115 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3116   echo $ac_n "(cached) $ac_c" 1>&6
3117 else
3118   cat > conftest.$ac_ext <<EOF
3119 #line 3120 "configure"
3120 #include "confdefs.h"
3121
3122 int main() {
3123
3124 #ifndef __CYGWIN__
3125 #define __CYGWIN__ __CYGWIN32__
3126 #endif
3127 return __CYGWIN__;
3128 ; return 0; }
3129 EOF
3130 if { (eval echo configure:3131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3131   rm -rf conftest*
3132   ac_cv_cygwin=yes
3133 else
3134   echo "configure: failed program was:" >&5
3135   cat conftest.$ac_ext >&5
3136   rm -rf conftest*
3137   ac_cv_cygwin=no
3138 fi
3139 rm -f conftest*
3140 fi
3141
3142 echo "$ac_t""$ac_cv_cygwin" 1>&6
3143 CYGWIN=
3144 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3145 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3146 echo "configure:3147: checking for mingw32 environment" >&5
3147 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3148   echo $ac_n "(cached) $ac_c" 1>&6
3149 else
3150   cat > conftest.$ac_ext <<EOF
3151 #line 3152 "configure"
3152 #include "confdefs.h"
3153
3154 int main() {
3155 return __MINGW32__;
3156 ; return 0; }
3157 EOF
3158 if { (eval echo configure:3159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3159   rm -rf conftest*
3160   ac_cv_mingw32=yes
3161 else
3162   echo "configure: failed program was:" >&5
3163   cat conftest.$ac_ext >&5
3164   rm -rf conftest*
3165   ac_cv_mingw32=no
3166 fi
3167 rm -f conftest*
3168 fi
3169
3170 echo "$ac_t""$ac_cv_mingw32" 1>&6
3171 MINGW32=
3172 test "$ac_cv_mingw32" = yes && MINGW32=yes
3173 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3174 echo "configure:3175: checking for EMX OS/2 environment" >&5
3175 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3176   echo $ac_n "(cached) $ac_c" 1>&6
3177 else
3178   cat > conftest.$ac_ext <<EOF
3179 #line 3180 "configure"
3180 #include "confdefs.h"
3181
3182 int main() {
3183 return __EMX__;
3184 ; return 0; }
3185 EOF
3186 if { (eval echo configure:3187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3187   rm -rf conftest*
3188   ac_cv_emxos2=yes
3189 else
3190   echo "configure: failed program was:" >&5
3191   cat conftest.$ac_ext >&5
3192   rm -rf conftest*
3193   ac_cv_emxos2=no
3194 fi
3195 rm -f conftest*
3196 fi
3197
3198 echo "$ac_t""$ac_cv_emxos2" 1>&6
3199 EMXOS2=
3200 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3201 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3202 echo "configure:3203: checking how to run the C preprocessor" >&5
3203 # On Suns, sometimes $CPP names a directory.
3204 if test -n "$CPP" && test -d "$CPP"; then
3205   CPP=
3206 fi
3207 if test -z "$CPP"; then
3208 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3209   echo $ac_n "(cached) $ac_c" 1>&6
3210 else
3211     # This must be in double quotes, not single quotes, because CPP may get
3212   # substituted into the Makefile and "${CC-cc}" will confuse make.
3213   CPP="${CC-cc} -E"
3214   # On the NeXT, cc -E runs the code through the compiler's parser,
3215   # not just through cpp.
3216   cat > conftest.$ac_ext <<EOF
3217 #line 3218 "configure"
3218 #include "confdefs.h"
3219 #include <assert.h>
3220 Syntax Error
3221 EOF
3222 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3223 { (eval echo configure:3224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3224 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3225 if test -z "$ac_err"; then
3226   :
3227 else
3228   echo "$ac_err" >&5
3229   echo "configure: failed program was:" >&5
3230   cat conftest.$ac_ext >&5
3231   rm -rf conftest*
3232   CPP="${CC-cc} -E -traditional-cpp"
3233   cat > conftest.$ac_ext <<EOF
3234 #line 3235 "configure"
3235 #include "confdefs.h"
3236 #include <assert.h>
3237 Syntax Error
3238 EOF
3239 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3240 { (eval echo configure:3241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3241 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3242 if test -z "$ac_err"; then
3243   :
3244 else
3245   echo "$ac_err" >&5
3246   echo "configure: failed program was:" >&5
3247   cat conftest.$ac_ext >&5
3248   rm -rf conftest*
3249   CPP="${CC-cc} -nologo -E"
3250   cat > conftest.$ac_ext <<EOF
3251 #line 3252 "configure"
3252 #include "confdefs.h"
3253 #include <assert.h>
3254 Syntax Error
3255 EOF
3256 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3257 { (eval echo configure:3258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3258 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3259 if test -z "$ac_err"; then
3260   :
3261 else
3262   echo "$ac_err" >&5
3263   echo "configure: failed program was:" >&5
3264   cat conftest.$ac_ext >&5
3265   rm -rf conftest*
3266   CPP=/lib/cpp
3267 fi
3268 rm -f conftest*
3269 fi
3270 rm -f conftest*
3271 fi
3272 rm -f conftest*
3273   ac_cv_prog_CPP="$CPP"
3274 fi
3275   CPP="$ac_cv_prog_CPP"
3276 else
3277   ac_cv_prog_CPP="$CPP"
3278 fi
3279 echo "$ac_t""$CPP" 1>&6
3280
3281 # Check whether --enable-fast-install or --disable-fast-install was given.
3282 if test "${enable_fast_install+set}" = set; then
3283   enableval="$enable_fast_install"
3284   p=${PACKAGE-default}
3285 case $enableval in
3286 yes) enable_fast_install=yes ;;
3287 no) enable_fast_install=no ;;
3288 *)
3289   enable_fast_install=no
3290   # Look at the argument we got.  We use all the common list separators.
3291   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3292   for pkg in $enableval; do
3293     if test "X$pkg" = "X$p"; then
3294       enable_fast_install=yes
3295     fi
3296   done
3297   IFS="$ac_save_ifs"
3298   ;;
3299 esac
3300 else
3301   enable_fast_install=yes
3302 fi
3303
3304 # Extract the first word of "gcc", so it can be a program name with args.
3305 set dummy gcc; ac_word=$2
3306 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3307 echo "configure:3308: checking for $ac_word" >&5
3308 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3309   echo $ac_n "(cached) $ac_c" 1>&6
3310 else
3311   if test -n "$CC"; then
3312   ac_cv_prog_CC="$CC" # Let the user override the test.
3313 else
3314   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3315   ac_dummy="$PATH"
3316   for ac_dir in $ac_dummy; do
3317     test -z "$ac_dir" && ac_dir=.
3318     if test -f $ac_dir/$ac_word; then
3319       ac_cv_prog_CC="gcc"
3320       break
3321     fi
3322   done
3323   IFS="$ac_save_ifs"
3324 fi
3325 fi
3326 CC="$ac_cv_prog_CC"
3327 if test -n "$CC"; then
3328   echo "$ac_t""$CC" 1>&6
3329 else
3330   echo "$ac_t""no" 1>&6
3331 fi
3332
3333 if test -z "$CC"; then
3334   # Extract the first word of "cc", so it can be a program name with args.
3335 set dummy cc; ac_word=$2
3336 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3337 echo "configure:3338: checking for $ac_word" >&5
3338 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3339   echo $ac_n "(cached) $ac_c" 1>&6
3340 else
3341   if test -n "$CC"; then
3342   ac_cv_prog_CC="$CC" # Let the user override the test.
3343 else
3344   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3345   ac_prog_rejected=no
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       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
3351         ac_prog_rejected=yes
3352         continue
3353       fi
3354       ac_cv_prog_CC="cc"
3355       break
3356     fi
3357   done
3358   IFS="$ac_save_ifs"
3359 if test $ac_prog_rejected = yes; then
3360   # We found a bogon in the path, so make sure we never use it.
3361   set dummy $ac_cv_prog_CC
3362   shift
3363   if test $# -gt 0; then
3364     # We chose a different compiler from the bogus one.
3365     # However, it has the same basename, so the bogon will be chosen
3366     # first if we set CC to just the basename; use the full file name.
3367     shift
3368     set dummy "$ac_dir/$ac_word" "$@"
3369     shift
3370     ac_cv_prog_CC="$@"
3371   fi
3372 fi
3373 fi
3374 fi
3375 CC="$ac_cv_prog_CC"
3376 if test -n "$CC"; then
3377   echo "$ac_t""$CC" 1>&6
3378 else
3379   echo "$ac_t""no" 1>&6
3380 fi
3381
3382   if test -z "$CC"; then
3383     case "`uname -s`" in
3384     *win32* | *WIN32* | *CYGWIN*)
3385       # Extract the first word of "cl", so it can be a program name with args.
3386 set dummy cl; ac_word=$2
3387 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3388 echo "configure:3389: checking for $ac_word" >&5
3389 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3390   echo $ac_n "(cached) $ac_c" 1>&6
3391 else
3392   if test -n "$CC"; then
3393   ac_cv_prog_CC="$CC" # Let the user override the test.
3394 else
3395   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3396   ac_dummy="$PATH"
3397   for ac_dir in $ac_dummy; do
3398     test -z "$ac_dir" && ac_dir=.
3399     if test -f $ac_dir/$ac_word; then
3400       ac_cv_prog_CC="cl"
3401       break
3402     fi
3403   done
3404   IFS="$ac_save_ifs"
3405 fi
3406 fi
3407 CC="$ac_cv_prog_CC"
3408 if test -n "$CC"; then
3409   echo "$ac_t""$CC" 1>&6
3410 else
3411   echo "$ac_t""no" 1>&6
3412 fi
3413  ;;
3414     esac
3415   fi
3416   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3417 fi
3418
3419 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3420 echo "configure:3421: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3421
3422 ac_ext=c
3423 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3424 ac_cpp='$CPP $CPPFLAGS'
3425 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3426 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3427 cross_compiling=$ac_cv_prog_cc_cross
3428
3429 cat > conftest.$ac_ext << EOF
3430
3431 #line 3432 "configure"
3432 #include "confdefs.h"
3433
3434 main(){return(0);}
3435 EOF
3436 if { (eval echo configure:3437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3437   ac_cv_prog_cc_works=yes
3438   # If we can't run a trivial program, we are probably using a cross compiler.
3439   if (./conftest; exit) 2>/dev/null; then
3440     ac_cv_prog_cc_cross=no
3441   else
3442     ac_cv_prog_cc_cross=yes
3443   fi
3444 else
3445   echo "configure: failed program was:" >&5
3446   cat conftest.$ac_ext >&5
3447   ac_cv_prog_cc_works=no
3448 fi
3449 rm -fr conftest*
3450 ac_ext=c
3451 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3452 ac_cpp='$CPP $CPPFLAGS'
3453 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3454 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3455 cross_compiling=$ac_cv_prog_cc_cross
3456
3457 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3458 if test $ac_cv_prog_cc_works = no; then
3459   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3460 fi
3461 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3462 echo "configure:3463: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3463 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3464 cross_compiling=$ac_cv_prog_cc_cross
3465
3466 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3467 echo "configure:3468: checking whether we are using GNU C" >&5
3468 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3469   echo $ac_n "(cached) $ac_c" 1>&6
3470 else
3471   cat > conftest.c <<EOF
3472 #ifdef __GNUC__
3473   yes;
3474 #endif
3475 EOF
3476 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3477   ac_cv_prog_gcc=yes
3478 else
3479   ac_cv_prog_gcc=no
3480 fi
3481 fi
3482
3483 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3484
3485 if test $ac_cv_prog_gcc = yes; then
3486   GCC=yes
3487 else
3488   GCC=
3489 fi
3490
3491 ac_test_CFLAGS="${CFLAGS+set}"
3492 ac_save_CFLAGS="$CFLAGS"
3493 CFLAGS=
3494 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3495 echo "configure:3496: checking whether ${CC-cc} accepts -g" >&5
3496 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3497   echo $ac_n "(cached) $ac_c" 1>&6
3498 else
3499   echo 'void f(){}' > conftest.c
3500 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3501   ac_cv_prog_cc_g=yes
3502 else
3503   ac_cv_prog_cc_g=no
3504 fi
3505 rm -f conftest*
3506
3507 fi
3508
3509 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3510 if test "$ac_test_CFLAGS" = set; then
3511   CFLAGS="$ac_save_CFLAGS"
3512 elif test $ac_cv_prog_cc_g = yes; then
3513   if test "$GCC" = yes; then
3514     CFLAGS="-g -O2"
3515   else
3516     CFLAGS="-g"
3517   fi
3518 else
3519   if test "$GCC" = yes; then
3520     CFLAGS="-O2"
3521   else
3522     CFLAGS=
3523   fi
3524 fi
3525
3526 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3527 if test "${with_gnu_ld+set}" = set; then
3528   withval="$with_gnu_ld"
3529   test "$withval" = no || with_gnu_ld=yes
3530 else
3531   with_gnu_ld=no
3532 fi
3533
3534 ac_prog=ld
3535 if test "$GCC" = yes; then
3536   # Check if gcc -print-prog-name=ld gives a path.
3537   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3538 echo "configure:3539: checking for ld used by GCC" >&5
3539   case $host in
3540   *-*-mingw*)
3541     # gcc leaves a trailing carriage return which upsets mingw
3542     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3543   *)
3544     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3545   esac
3546   case $ac_prog in
3547     # Accept absolute paths.
3548     [\\/]* | [A-Za-z]:[\\/]*)
3549       re_direlt='/[^/][^/]*/\.\./'
3550       # Canonicalize the path of ld
3551       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3552       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3553         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3554       done
3555       test -z "$LD" && LD="$ac_prog"
3556       ;;
3557   "")
3558     # If it fails, then pretend we aren't using GCC.
3559     ac_prog=ld
3560     ;;
3561   *)
3562     # If it is relative, then search for the first ld in PATH.
3563     with_gnu_ld=unknown
3564     ;;
3565   esac
3566 elif test "$with_gnu_ld" = yes; then
3567   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3568 echo "configure:3569: checking for GNU ld" >&5
3569 else
3570   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3571 echo "configure:3572: checking for non-GNU ld" >&5
3572 fi
3573 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
3574   echo $ac_n "(cached) $ac_c" 1>&6
3575 else
3576   if test -z "$LD"; then
3577   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3578   for ac_dir in $PATH; do
3579     test -z "$ac_dir" && ac_dir=.
3580     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3581       lt_cv_path_LD="$ac_dir/$ac_prog"
3582       # Check to see if the program is GNU ld.  I'd rather use --version,
3583       # but apparently some GNU ld's only accept -v.
3584       # Break only if it was the GNU/non-GNU ld that we prefer.
3585       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3586         test "$with_gnu_ld" != no && break
3587       else
3588         test "$with_gnu_ld" != yes && break
3589       fi
3590     fi
3591   done
3592   IFS="$ac_save_ifs"
3593 else
3594   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3595 fi
3596 fi
3597
3598 LD="$lt_cv_path_LD"
3599 if test -n "$LD"; then
3600   echo "$ac_t""$LD" 1>&6
3601 else
3602   echo "$ac_t""no" 1>&6
3603 fi
3604 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3605 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3606 echo "configure:3607: checking if the linker ($LD) is GNU ld" >&5
3607 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
3608   echo $ac_n "(cached) $ac_c" 1>&6
3609 else
3610   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3611 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3612   lt_cv_prog_gnu_ld=yes
3613 else
3614   lt_cv_prog_gnu_ld=no
3615 fi
3616 fi
3617
3618 echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
3619 with_gnu_ld=$lt_cv_prog_gnu_ld
3620
3621
3622 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
3623 echo "configure:3624: checking for $LD option to reload object files" >&5
3624 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
3625   echo $ac_n "(cached) $ac_c" 1>&6
3626 else
3627   lt_cv_ld_reload_flag='-r'
3628 fi
3629
3630 echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
3631 reload_flag=$lt_cv_ld_reload_flag
3632 test -n "$reload_flag" && reload_flag=" $reload_flag"
3633
3634 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3635 echo "configure:3636: checking for BSD-compatible nm" >&5
3636 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
3637   echo $ac_n "(cached) $ac_c" 1>&6
3638 else
3639   if test -n "$NM"; then
3640   # Let the user override the test.
3641   lt_cv_path_NM="$NM"
3642 else
3643   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3644   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3645     test -z "$ac_dir" && ac_dir=.
3646     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3647     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3648       # Check to see if the nm accepts a BSD-compat flag.
3649       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3650       #   nm: unknown option "B" ignored
3651       # Tru64's nm complains that /dev/null is an invalid object file
3652       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3653         lt_cv_path_NM="$tmp_nm -B"
3654         break
3655       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3656         lt_cv_path_NM="$tmp_nm -p"
3657         break
3658       else
3659         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3660         continue # so that we can try to find one that supports BSD flags
3661       fi
3662     fi
3663   done
3664   IFS="$ac_save_ifs"
3665   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3666 fi
3667 fi
3668
3669 NM="$lt_cv_path_NM"
3670 echo "$ac_t""$NM" 1>&6
3671
3672 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
3673 echo "configure:3674: checking for a sed that does not truncate output" >&5
3674 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
3675   echo $ac_n "(cached) $ac_c" 1>&6
3676 else
3677   # Loop through the user's path and test for sed and gsed.
3678 # Then use that list of sed's as ones to test for truncation.
3679 as_executable_p="test -f"
3680 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3681 for as_dir in $PATH
3682 do
3683   IFS=$as_save_IFS
3684   test -z "$as_dir" && as_dir=.
3685   for ac_prog in sed gsed; do
3686     for ac_exec_ext in '' $ac_executable_extensions; do
3687       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
3688         _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
3689       fi
3690     done
3691   done
3692 done
3693
3694   # Create a temporary directory, and hook for its removal unless debugging.
3695 $debug ||
3696 {
3697   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
3698   trap '{ (exit 1); exit 1; }' 1 2 13 15
3699 }
3700
3701 # Create a (secure) tmp directory for tmp files.
3702 : ${TMPDIR=/tmp}
3703 {
3704   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
3705   test -n "$tmp" && test -d "$tmp"
3706 }  ||
3707 {
3708   tmp=$TMPDIR/sed$$-$RANDOM
3709   (umask 077 && mkdir $tmp)
3710 } ||
3711 {
3712    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
3713    { (exit 1); exit 1; }
3714 }
3715   _max=0
3716   _count=0
3717   # Add /usr/xpg4/bin/sed as it is typically found on Solaris
3718   # along with /bin/sed that truncates output.
3719   for _sed in $_sed_list /usr/xpg4/bin/sed; do
3720     test ! -f ${_sed} && break
3721     cat /dev/null > "$tmp/sed.in"
3722     _count=0
3723     echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
3724     # Check for GNU sed and select it if it is found.
3725     if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
3726       lt_cv_path_SED=${_sed}
3727       break
3728     fi
3729     while true; do
3730       cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
3731       mv "$tmp/sed.tmp" "$tmp/sed.in"
3732       cp "$tmp/sed.in" "$tmp/sed.nl"
3733       echo >>"$tmp/sed.nl"
3734       ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
3735       cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
3736       # 40000 chars as input seems more than enough
3737       test $_count -gt 10 && break
3738       _count=`expr $_count + 1`
3739       if test $_count -gt $_max; then
3740         _max=$_count
3741         lt_cv_path_SED=$_sed
3742       fi
3743     done
3744   done
3745   rm -rf "$tmp"
3746
3747 fi
3748
3749 if test "X$SED" != "X"; then
3750   lt_cv_path_SED=$SED
3751 else
3752   SED=$lt_cv_path_SED
3753 fi
3754 echo "$ac_t""$SED" 1>&6
3755
3756 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3757 echo "configure:3758: checking whether ln -s works" >&5
3758 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3759   echo $ac_n "(cached) $ac_c" 1>&6
3760 else
3761   rm -f conftestdata
3762 if ln -s X conftestdata 2>/dev/null
3763 then
3764   rm -f conftestdata
3765   ac_cv_prog_LN_S="ln -s"
3766 else
3767   ac_cv_prog_LN_S=ln
3768 fi
3769 fi
3770 LN_S="$ac_cv_prog_LN_S"
3771 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3772   echo "$ac_t""yes" 1>&6
3773 else
3774   echo "$ac_t""no" 1>&6
3775 fi
3776
3777 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
3778 echo "configure:3779: checking how to recognise dependent libraries" >&5
3779 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
3780   echo $ac_n "(cached) $ac_c" 1>&6
3781 else
3782   lt_cv_file_magic_cmd='$MAGIC_CMD'
3783 lt_cv_file_magic_test_file=
3784 lt_cv_deplibs_check_method='unknown'
3785 # Need to set the preceding variable on all platforms that support
3786 # interlibrary dependencies.
3787 # 'none' -- dependencies not supported.
3788 # `unknown' -- same as none, but documents that we really don't know.
3789 # 'pass_all' -- all dependencies passed with no checks.
3790 # 'test_compile' -- check by making test program.
3791 # 'file_magic [[regex]]' -- check by looking for files in library path
3792 # which responds to the $file_magic_cmd with a given egrep regex.
3793 # If you have `file' or equivalent on your system and you're not sure
3794 # whether `pass_all' will *always* work, you probably want this one.
3795
3796 case $host_os in
3797 aix4* | aix5*)
3798   lt_cv_deplibs_check_method=pass_all
3799   ;;
3800
3801 beos*)
3802   lt_cv_deplibs_check_method=pass_all
3803   ;;
3804
3805 bsdi4*)
3806   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3807   lt_cv_file_magic_cmd='/usr/bin/file -L'
3808   lt_cv_file_magic_test_file=/shlib/libc.so
3809   ;;
3810
3811 cygwin* | mingw* | pw32*)
3812   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3813   lt_cv_file_magic_cmd='$OBJDUMP -f'
3814   ;;
3815
3816 darwin* | rhapsody*)
3817   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3818   lt_cv_file_magic_cmd='/usr/bin/file -L'
3819   case "$host_os" in
3820   rhapsody* | darwin1.[012])
3821     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3822     ;;
3823   *) # Darwin 1.3 on
3824     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3825     ;;
3826   esac
3827   ;;
3828
3829 freebsd*)
3830   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3831     case $host_cpu in
3832     i*86 )
3833       # Not sure whether the presence of OpenBSD here was a mistake.
3834       # Let's accept both of them until this is cleared up.
3835       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
3836       lt_cv_file_magic_cmd=/usr/bin/file
3837       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3838       ;;
3839     esac
3840   else
3841     lt_cv_deplibs_check_method=pass_all
3842   fi
3843   ;;
3844
3845 gnu*)
3846   lt_cv_deplibs_check_method=pass_all
3847   ;;
3848
3849 hpux10.20*|hpux11*)
3850   lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
3851   lt_cv_file_magic_cmd=/usr/bin/file
3852   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3853   ;;
3854
3855 irix5* | irix6* | nonstopux*)
3856   case $host_os in
3857   irix5* | nonstopux*)
3858     # this will be overridden with pass_all, but let us keep it just in case
3859     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3860     ;;
3861   *)
3862     case $LD in
3863     *-32|*"-32 ") libmagic=32-bit;;
3864     *-n32|*"-n32 ") libmagic=N32;;
3865     *-64|*"-64 ") libmagic=64-bit;;
3866     *) libmagic=never-match;;
3867     esac
3868     # this will be overridden with pass_all, but let us keep it just in case
3869     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3870     ;;
3871   esac
3872   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3873   lt_cv_deplibs_check_method=pass_all
3874   ;;
3875
3876 # This must be Linux ELF.
3877 linux-gnu*)
3878   case $host_cpu in
3879   alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
3880     lt_cv_deplibs_check_method=pass_all ;;
3881   *)
3882     # glibc up to 2.1.1 does not perform some relocations on ARM
3883     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3884   esac
3885   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3886   ;;
3887
3888 netbsd*)
3889   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3890     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3891   else
3892     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
3893   fi
3894   ;;
3895
3896 newos6*)
3897   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
3898   lt_cv_file_magic_cmd=/usr/bin/file
3899   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3900   ;;
3901
3902 openbsd*)
3903   lt_cv_file_magic_cmd=/usr/bin/file
3904   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3905   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3906     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
3907   else
3908     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3909   fi
3910   ;;
3911
3912 osf3* | osf4* | osf5*)
3913   # this will be overridden with pass_all, but let us keep it just in case
3914   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3915   lt_cv_file_magic_test_file=/shlib/libc.so
3916   lt_cv_deplibs_check_method=pass_all
3917   ;;
3918
3919 sco3.2v5*)
3920   lt_cv_deplibs_check_method=pass_all
3921   ;;
3922
3923 solaris*)
3924   lt_cv_deplibs_check_method=pass_all
3925   lt_cv_file_magic_test_file=/lib/libc.so
3926   ;;
3927
3928 sysv5uw[78]* | sysv4*uw2*)
3929   lt_cv_deplibs_check_method=pass_all
3930   ;;
3931
3932 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3933   case $host_vendor in
3934   motorola)
3935     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]'
3936     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3937     ;;
3938   ncr)
3939     lt_cv_deplibs_check_method=pass_all
3940     ;;
3941   sequent)
3942     lt_cv_file_magic_cmd='/bin/file'
3943     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
3944     ;;
3945   sni)
3946     lt_cv_file_magic_cmd='/bin/file'
3947     lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
3948     lt_cv_file_magic_test_file=/lib/libc.so
3949     ;;
3950   siemens)
3951     lt_cv_deplibs_check_method=pass_all
3952     ;;
3953   esac
3954   ;;
3955 esac
3956
3957 fi
3958
3959 echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
3960 file_magic_cmd=$lt_cv_file_magic_cmd
3961 deplibs_check_method=$lt_cv_deplibs_check_method
3962
3963 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3964 echo "configure:3965: checking for object suffix" >&5
3965 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3966   echo $ac_n "(cached) $ac_c" 1>&6
3967 else
3968   rm -f conftest*
3969 echo 'int i = 1;' > conftest.$ac_ext
3970 if { (eval echo configure:3971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3971   for ac_file in conftest.*; do
3972     case $ac_file in
3973     *.c) ;;
3974     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3975     esac
3976   done
3977 else
3978   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3979 fi
3980 rm -f conftest*
3981 fi
3982
3983 echo "$ac_t""$ac_cv_objext" 1>&6
3984 OBJEXT=$ac_cv_objext
3985 ac_objext=$ac_cv_objext
3986
3987
3988
3989
3990 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3991 echo "configure:3992: checking for executable suffix" >&5
3992 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3993   echo $ac_n "(cached) $ac_c" 1>&6
3994 else
3995   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3996   ac_cv_exeext=.exe
3997 else
3998   rm -f conftest*
3999   echo 'int main () { return 0; }' > conftest.$ac_ext
4000   ac_cv_exeext=
4001   if { (eval echo configure:4002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4002     for file in conftest.*; do
4003       case $file in
4004       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4005       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4006       esac
4007     done
4008   else
4009     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4010   fi
4011   rm -f conftest*
4012   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4013 fi
4014 fi
4015
4016 EXEEXT=""
4017 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4018 echo "$ac_t""${ac_cv_exeext}" 1>&6
4019 ac_exeext=$EXEEXT
4020
4021 if test $host != $build; then
4022   ac_tool_prefix=${host_alias}-
4023 else
4024   ac_tool_prefix=
4025 fi
4026
4027
4028
4029
4030 # Check for command to grab the raw symbol name followed by C symbol from nm.
4031 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
4032 echo "configure:4033: checking command to parse $NM output" >&5
4033 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
4034   echo $ac_n "(cached) $ac_c" 1>&6
4035 else
4036   
4037 # These are sane defaults that work on at least a few old systems.
4038 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4039
4040 # Character class describing NM global symbol codes.
4041 symcode='[BCDEGRST]'
4042
4043 # Regexp to match symbols that can be accessed directly from C.
4044 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
4045
4046 # Transform the above into a raw symbol and a C symbol.
4047 symxfrm='\1 \2\3 \3'
4048
4049 # Transform an extracted symbol line into a proper C declaration
4050 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
4051
4052 # Transform an extracted symbol line into symbol name and symbol address
4053 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'"
4054
4055 # Define system-specific variables.
4056 case $host_os in
4057 aix*)
4058   symcode='[BCDT]'
4059   ;;
4060 cygwin* | mingw* | pw32*)
4061   symcode='[ABCDGISTW]'
4062   ;;
4063 hpux*) # Its linker distinguishes data from code symbols
4064   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4065   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'"
4066   ;;
4067 irix* | nonstopux*)
4068   symcode='[BCDEGRST]'
4069   ;;
4070 osf*)
4071   symcode='[BCDEGQRST]'
4072   ;;
4073 solaris* | sysv5*)
4074   symcode='[BDT]'
4075   ;;
4076 sysv4)
4077   symcode='[DFNSTU]'
4078   ;;
4079 esac
4080
4081 # Handle CRLF in mingw tool chain
4082 opt_cr=
4083 case $host_os in
4084 mingw*)
4085   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4086   ;;
4087 esac
4088
4089 # If we're using GNU nm, then use its standard symbol codes.
4090 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
4091   symcode='[ABCDGISTW]'
4092 fi
4093
4094 # Try without a prefix undercore, then with it.
4095 for ac_symprfx in "" "_"; do
4096
4097   # Write the raw and C identifiers.
4098 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[         ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
4099
4100   # Check to see that the pipe works correctly.
4101   pipe_works=no
4102   rm -f conftest*
4103   cat > conftest.$ac_ext <<EOF
4104 #ifdef __cplusplus
4105 extern "C" {
4106 #endif
4107 char nm_test_var;
4108 void nm_test_func(){}
4109 #ifdef __cplusplus
4110 }
4111 #endif
4112 int main(){nm_test_var='a';nm_test_func();return(0);}
4113 EOF
4114
4115   if { (eval echo configure:4116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4116     # Now try to grab the symbols.
4117     nlist=conftest.nm
4118     if { (eval echo configure:4119: \"$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
4119       # Try sorting and uniquifying the output.
4120       if sort "$nlist" | uniq > "$nlist"T; then
4121         mv -f "$nlist"T "$nlist"
4122       else
4123         rm -f "$nlist"T
4124       fi
4125
4126       # Make sure that we snagged all the symbols we need.
4127       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
4128         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
4129           cat <<EOF > conftest.$ac_ext
4130 #ifdef __cplusplus
4131 extern "C" {
4132 #endif
4133
4134 EOF
4135           # Now generate the symbol file.
4136           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
4137
4138           cat <<EOF >> conftest.$ac_ext
4139 #if defined (__STDC__) && __STDC__
4140 # define lt_ptr void *
4141 #else
4142 # define lt_ptr char *
4143 # define const
4144 #endif
4145
4146 /* The mapping between symbol names and symbols. */
4147 const struct {
4148   const char *name;
4149   lt_ptr address;
4150 }
4151 lt_preloaded_symbols[] =
4152 {
4153 EOF
4154           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
4155           cat <<\EOF >> conftest.$ac_ext
4156   {0, (lt_ptr) 0}
4157 };
4158
4159 #ifdef __cplusplus
4160 }
4161 #endif
4162 EOF
4163           # Now try linking the two files.
4164           mv conftest.$ac_objext conftstm.$ac_objext
4165           save_LIBS="$LIBS"
4166           save_CFLAGS="$CFLAGS"
4167           LIBS="conftstm.$ac_objext"
4168           CFLAGS="$CFLAGS$no_builtin_flag"
4169           if { (eval echo configure:4170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
4170             pipe_works=yes
4171           fi
4172           LIBS="$save_LIBS"
4173           CFLAGS="$save_CFLAGS"
4174         else
4175           echo "cannot find nm_test_func in $nlist" >&5
4176         fi
4177       else
4178         echo "cannot find nm_test_var in $nlist" >&5
4179       fi
4180     else
4181       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
4182     fi
4183   else
4184     echo "$progname: failed program was:" >&5
4185     cat conftest.$ac_ext >&5
4186   fi
4187   rm -f conftest* conftst*
4188
4189   # Do not use the global_symbol_pipe unless it works.
4190   if test "$pipe_works" = yes; then
4191     break
4192   else
4193     lt_cv_sys_global_symbol_pipe=
4194   fi
4195 done
4196
4197 fi
4198
4199 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
4200 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4201   global_symbol_to_cdecl=
4202   global_symbol_to_c_name_address=
4203 else
4204   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
4205   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
4206 fi
4207 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
4208 then
4209   echo "$ac_t""failed" 1>&6
4210 else
4211   echo "$ac_t""ok" 1>&6
4212 fi
4213
4214 for ac_hdr in dlfcn.h
4215 do
4216 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4217 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4218 echo "configure:4219: checking for $ac_hdr" >&5
4219 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4220   echo $ac_n "(cached) $ac_c" 1>&6
4221 else
4222   cat > conftest.$ac_ext <<EOF
4223 #line 4224 "configure"
4224 #include "confdefs.h"
4225 #include <$ac_hdr>
4226 EOF
4227 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4228 { (eval echo configure:4229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4229 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4230 if test -z "$ac_err"; then
4231   rm -rf conftest*
4232   eval "ac_cv_header_$ac_safe=yes"
4233 else
4234   echo "$ac_err" >&5
4235   echo "configure: failed program was:" >&5
4236   cat conftest.$ac_ext >&5
4237   rm -rf conftest*
4238   eval "ac_cv_header_$ac_safe=no"
4239 fi
4240 rm -f conftest*
4241 fi
4242 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4243   echo "$ac_t""yes" 1>&6
4244     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4245   cat >> confdefs.h <<EOF
4246 #define $ac_tr_hdr 1
4247 EOF
4248  
4249 else
4250   echo "$ac_t""no" 1>&6
4251 fi
4252 done
4253
4254
4255
4256
4257
4258
4259 # Only perform the check for file, if the check method requires it
4260 case $deplibs_check_method in
4261 file_magic*)
4262   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
4263     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
4264 echo "configure:4265: checking for ${ac_tool_prefix}file" >&5
4265 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4266   echo $ac_n "(cached) $ac_c" 1>&6
4267 else
4268   case $MAGIC_CMD in
4269   /*)
4270   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4271   ;;
4272   ?:/*)
4273   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4274   ;;
4275   *)
4276   ac_save_MAGIC_CMD="$MAGIC_CMD"
4277   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4278   ac_dummy="/usr/bin:$PATH"
4279   for ac_dir in $ac_dummy; do
4280     test -z "$ac_dir" && ac_dir=.
4281     if test -f $ac_dir/${ac_tool_prefix}file; then
4282       lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
4283       if test -n "$file_magic_test_file"; then
4284         case $deplibs_check_method in
4285         "file_magic "*)
4286           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4287           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4288           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4289             egrep "$file_magic_regex" > /dev/null; then
4290             :
4291           else
4292             cat <<EOF 1>&2
4293
4294 *** Warning: the command libtool uses to detect shared libraries,
4295 *** $file_magic_cmd, produces output that libtool cannot recognize.
4296 *** The result is that libtool may fail to recognize shared libraries
4297 *** as such.  This will affect the creation of libtool libraries that
4298 *** depend on shared libraries, but programs linked with such libtool
4299 *** libraries will work regardless of this problem.  Nevertheless, you
4300 *** may want to report the problem to your system manager and/or to
4301 *** bug-libtool@gnu.org
4302
4303 EOF
4304           fi ;;
4305         esac
4306       fi
4307       break
4308     fi
4309   done
4310   IFS="$ac_save_ifs"
4311   MAGIC_CMD="$ac_save_MAGIC_CMD"
4312   ;;
4313 esac
4314 fi
4315
4316 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4317 if test -n "$MAGIC_CMD"; then
4318   echo "$ac_t""$MAGIC_CMD" 1>&6
4319 else
4320   echo "$ac_t""no" 1>&6
4321 fi
4322
4323 if test -z "$lt_cv_path_MAGIC_CMD"; then
4324   if test -n "$ac_tool_prefix"; then
4325     echo $ac_n "checking for file""... $ac_c" 1>&6
4326 echo "configure:4327: checking for file" >&5
4327 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
4328   echo $ac_n "(cached) $ac_c" 1>&6
4329 else
4330   case $MAGIC_CMD in
4331   /*)
4332   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4333   ;;
4334   ?:/*)
4335   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4336   ;;
4337   *)
4338   ac_save_MAGIC_CMD="$MAGIC_CMD"
4339   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4340   ac_dummy="/usr/bin:$PATH"
4341   for ac_dir in $ac_dummy; do
4342     test -z "$ac_dir" && ac_dir=.
4343     if test -f $ac_dir/file; then
4344       lt_cv_path_MAGIC_CMD="$ac_dir/file"
4345       if test -n "$file_magic_test_file"; then
4346         case $deplibs_check_method in
4347         "file_magic "*)
4348           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4349           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4350           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4351             egrep "$file_magic_regex" > /dev/null; then
4352             :
4353           else
4354             cat <<EOF 1>&2
4355
4356 *** Warning: the command libtool uses to detect shared libraries,
4357 *** $file_magic_cmd, produces output that libtool cannot recognize.
4358 *** The result is that libtool may fail to recognize shared libraries
4359 *** as such.  This will affect the creation of libtool libraries that
4360 *** depend on shared libraries, but programs linked with such libtool
4361 *** libraries will work regardless of this problem.  Nevertheless, you
4362 *** may want to report the problem to your system manager and/or to
4363 *** bug-libtool@gnu.org
4364
4365 EOF
4366           fi ;;
4367         esac
4368       fi
4369       break
4370     fi
4371   done
4372   IFS="$ac_save_ifs"
4373   MAGIC_CMD="$ac_save_MAGIC_CMD"
4374   ;;
4375 esac
4376 fi
4377
4378 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4379 if test -n "$MAGIC_CMD"; then
4380   echo "$ac_t""$MAGIC_CMD" 1>&6
4381 else
4382   echo "$ac_t""no" 1>&6
4383 fi
4384
4385   else
4386     MAGIC_CMD=:
4387   fi
4388 fi
4389
4390   fi
4391   ;;
4392 esac
4393
4394 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4395 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4396 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4397 echo "configure:4398: checking for $ac_word" >&5
4398 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4399   echo $ac_n "(cached) $ac_c" 1>&6
4400 else
4401   if test -n "$RANLIB"; then
4402   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4403 else
4404   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4405   ac_dummy="$PATH"
4406   for ac_dir in $ac_dummy; do
4407     test -z "$ac_dir" && ac_dir=.
4408     if test -f $ac_dir/$ac_word; then
4409       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4410       break
4411     fi
4412   done
4413   IFS="$ac_save_ifs"
4414 fi
4415 fi
4416 RANLIB="$ac_cv_prog_RANLIB"
4417 if test -n "$RANLIB"; then
4418   echo "$ac_t""$RANLIB" 1>&6
4419 else
4420   echo "$ac_t""no" 1>&6
4421 fi
4422
4423
4424 if test -z "$ac_cv_prog_RANLIB"; then
4425 if test -n "$ac_tool_prefix"; then
4426   # Extract the first word of "ranlib", so it can be a program name with args.
4427 set dummy ranlib; ac_word=$2
4428 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4429 echo "configure:4430: checking for $ac_word" >&5
4430 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
4431   echo $ac_n "(cached) $ac_c" 1>&6
4432 else
4433   if test -n "$RANLIB"; then
4434   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4435 else
4436   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4437   ac_dummy="$PATH"
4438   for ac_dir in $ac_dummy; do
4439     test -z "$ac_dir" && ac_dir=.
4440     if test -f $ac_dir/$ac_word; then
4441       ac_cv_prog_RANLIB="ranlib"
4442       break
4443     fi
4444   done
4445   IFS="$ac_save_ifs"
4446   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
4447 fi
4448 fi
4449 RANLIB="$ac_cv_prog_RANLIB"
4450 if test -n "$RANLIB"; then
4451   echo "$ac_t""$RANLIB" 1>&6
4452 else
4453   echo "$ac_t""no" 1>&6
4454 fi
4455
4456 else
4457   RANLIB=":"
4458 fi
4459 fi
4460
4461 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
4462 set dummy ${ac_tool_prefix}strip; ac_word=$2
4463 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4464 echo "configure:4465: checking for $ac_word" >&5
4465 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4466   echo $ac_n "(cached) $ac_c" 1>&6
4467 else
4468   if test -n "$STRIP"; then
4469   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4470 else
4471   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4472   ac_dummy="$PATH"
4473   for ac_dir in $ac_dummy; do
4474     test -z "$ac_dir" && ac_dir=.
4475     if test -f $ac_dir/$ac_word; then
4476       ac_cv_prog_STRIP="${ac_tool_prefix}strip"
4477       break
4478     fi
4479   done
4480   IFS="$ac_save_ifs"
4481 fi
4482 fi
4483 STRIP="$ac_cv_prog_STRIP"
4484 if test -n "$STRIP"; then
4485   echo "$ac_t""$STRIP" 1>&6
4486 else
4487   echo "$ac_t""no" 1>&6
4488 fi
4489
4490
4491 if test -z "$ac_cv_prog_STRIP"; then
4492 if test -n "$ac_tool_prefix"; then
4493   # Extract the first word of "strip", so it can be a program name with args.
4494 set dummy strip; ac_word=$2
4495 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4496 echo "configure:4497: checking for $ac_word" >&5
4497 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
4498   echo $ac_n "(cached) $ac_c" 1>&6
4499 else
4500   if test -n "$STRIP"; then
4501   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
4502 else
4503   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4504   ac_dummy="$PATH"
4505   for ac_dir in $ac_dummy; do
4506     test -z "$ac_dir" && ac_dir=.
4507     if test -f $ac_dir/$ac_word; then
4508       ac_cv_prog_STRIP="strip"
4509       break
4510     fi
4511   done
4512   IFS="$ac_save_ifs"
4513   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
4514 fi
4515 fi
4516 STRIP="$ac_cv_prog_STRIP"
4517 if test -n "$STRIP"; then
4518   echo "$ac_t""$STRIP" 1>&6
4519 else
4520   echo "$ac_t""no" 1>&6
4521 fi
4522
4523 else
4524   STRIP=":"
4525 fi
4526 fi
4527
4528
4529 enable_dlopen=yes
4530 enable_win32_dll=yes
4531
4532 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
4533 if test "${enable_libtool_lock+set}" = set; then
4534   enableval="$enable_libtool_lock"
4535   :
4536 fi
4537
4538 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
4539
4540 # Some flags need to be propagated to the compiler or linker for good
4541 # libtool support.
4542 case $host in
4543 *-*-irix6*)
4544   # Find out which ABI we are using.
4545   echo '#line 4546 "configure"' > conftest.$ac_ext
4546   if { (eval echo configure:4547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4547     case `/usr/bin/file conftest.$ac_objext` in
4548     *32-bit*)
4549       LD="${LD-ld} -32"
4550       ;;
4551     *N32*)
4552       LD="${LD-ld} -n32"
4553       ;;
4554     *64-bit*)
4555       LD="${LD-ld} -64"
4556       ;;
4557     esac
4558   fi
4559   rm -rf conftest*
4560   ;;
4561
4562 *-*-sco3.2v5*)
4563   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
4564   SAVE_CFLAGS="$CFLAGS"
4565   CFLAGS="$CFLAGS -belf"
4566   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
4567 echo "configure:4568: checking whether the C compiler needs -belf" >&5
4568 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
4569   echo $ac_n "(cached) $ac_c" 1>&6
4570 else
4571   
4572      ac_ext=c
4573 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4574 ac_cpp='$CPP $CPPFLAGS'
4575 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4576 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4577 cross_compiling=$ac_cv_prog_cc_cross
4578
4579      cat > conftest.$ac_ext <<EOF
4580 #line 4581 "configure"
4581 #include "confdefs.h"
4582
4583 int main() {
4584
4585 ; return 0; }
4586 EOF
4587 if { (eval echo configure:4588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4588   rm -rf conftest*
4589   lt_cv_cc_needs_belf=yes
4590 else
4591   echo "configure: failed program was:" >&5
4592   cat conftest.$ac_ext >&5
4593   rm -rf conftest*
4594   lt_cv_cc_needs_belf=no
4595 fi
4596 rm -f conftest*
4597      ac_ext=c
4598 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4599 ac_cpp='$CPP $CPPFLAGS'
4600 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4601 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4602 cross_compiling=$ac_cv_prog_cc_cross
4603
4604 fi
4605
4606 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
4607   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
4608     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
4609     CFLAGS="$SAVE_CFLAGS"
4610   fi
4611   ;;
4612
4613 *-*-cygwin* | *-*-mingw* | *-*-pw32*)
4614   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
4615 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
4616 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4617 echo "configure:4618: checking for $ac_word" >&5
4618 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4619   echo $ac_n "(cached) $ac_c" 1>&6
4620 else
4621   if test -n "$DLLTOOL"; then
4622   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4623 else
4624   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4625   ac_dummy="$PATH"
4626   for ac_dir in $ac_dummy; do
4627     test -z "$ac_dir" && ac_dir=.
4628     if test -f $ac_dir/$ac_word; then
4629       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
4630       break
4631     fi
4632   done
4633   IFS="$ac_save_ifs"
4634 fi
4635 fi
4636 DLLTOOL="$ac_cv_prog_DLLTOOL"
4637 if test -n "$DLLTOOL"; then
4638   echo "$ac_t""$DLLTOOL" 1>&6
4639 else
4640   echo "$ac_t""no" 1>&6
4641 fi
4642
4643
4644 if test -z "$ac_cv_prog_DLLTOOL"; then
4645 if test -n "$ac_tool_prefix"; then
4646   # Extract the first word of "dlltool", so it can be a program name with args.
4647 set dummy dlltool; ac_word=$2
4648 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4649 echo "configure:4650: checking for $ac_word" >&5
4650 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
4651   echo $ac_n "(cached) $ac_c" 1>&6
4652 else
4653   if test -n "$DLLTOOL"; then
4654   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
4655 else
4656   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4657   ac_dummy="$PATH"
4658   for ac_dir in $ac_dummy; do
4659     test -z "$ac_dir" && ac_dir=.
4660     if test -f $ac_dir/$ac_word; then
4661       ac_cv_prog_DLLTOOL="dlltool"
4662       break
4663     fi
4664   done
4665   IFS="$ac_save_ifs"
4666   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
4667 fi
4668 fi
4669 DLLTOOL="$ac_cv_prog_DLLTOOL"
4670 if test -n "$DLLTOOL"; then
4671   echo "$ac_t""$DLLTOOL" 1>&6
4672 else
4673   echo "$ac_t""no" 1>&6
4674 fi
4675
4676 else
4677   DLLTOOL="false"
4678 fi
4679 fi
4680
4681   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
4682 set dummy ${ac_tool_prefix}as; ac_word=$2
4683 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4684 echo "configure:4685: checking for $ac_word" >&5
4685 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4686   echo $ac_n "(cached) $ac_c" 1>&6
4687 else
4688   if test -n "$AS"; then
4689   ac_cv_prog_AS="$AS" # Let the user override the test.
4690 else
4691   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4692   ac_dummy="$PATH"
4693   for ac_dir in $ac_dummy; do
4694     test -z "$ac_dir" && ac_dir=.
4695     if test -f $ac_dir/$ac_word; then
4696       ac_cv_prog_AS="${ac_tool_prefix}as"
4697       break
4698     fi
4699   done
4700   IFS="$ac_save_ifs"
4701 fi
4702 fi
4703 AS="$ac_cv_prog_AS"
4704 if test -n "$AS"; then
4705   echo "$ac_t""$AS" 1>&6
4706 else
4707   echo "$ac_t""no" 1>&6
4708 fi
4709
4710
4711 if test -z "$ac_cv_prog_AS"; then
4712 if test -n "$ac_tool_prefix"; then
4713   # Extract the first word of "as", so it can be a program name with args.
4714 set dummy as; ac_word=$2
4715 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4716 echo "configure:4717: checking for $ac_word" >&5
4717 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
4718   echo $ac_n "(cached) $ac_c" 1>&6
4719 else
4720   if test -n "$AS"; then
4721   ac_cv_prog_AS="$AS" # Let the user override the test.
4722 else
4723   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4724   ac_dummy="$PATH"
4725   for ac_dir in $ac_dummy; do
4726     test -z "$ac_dir" && ac_dir=.
4727     if test -f $ac_dir/$ac_word; then
4728       ac_cv_prog_AS="as"
4729       break
4730     fi
4731   done
4732   IFS="$ac_save_ifs"
4733   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
4734 fi
4735 fi
4736 AS="$ac_cv_prog_AS"
4737 if test -n "$AS"; then
4738   echo "$ac_t""$AS" 1>&6
4739 else
4740   echo "$ac_t""no" 1>&6
4741 fi
4742
4743 else
4744   AS="false"
4745 fi
4746 fi
4747
4748   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4749 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4750 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4751 echo "configure:4752: checking for $ac_word" >&5
4752 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4753   echo $ac_n "(cached) $ac_c" 1>&6
4754 else
4755   if test -n "$OBJDUMP"; then
4756   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4757 else
4758   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4759   ac_dummy="$PATH"
4760   for ac_dir in $ac_dummy; do
4761     test -z "$ac_dir" && ac_dir=.
4762     if test -f $ac_dir/$ac_word; then
4763       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4764       break
4765     fi
4766   done
4767   IFS="$ac_save_ifs"
4768 fi
4769 fi
4770 OBJDUMP="$ac_cv_prog_OBJDUMP"
4771 if test -n "$OBJDUMP"; then
4772   echo "$ac_t""$OBJDUMP" 1>&6
4773 else
4774   echo "$ac_t""no" 1>&6
4775 fi
4776
4777
4778 if test -z "$ac_cv_prog_OBJDUMP"; then
4779 if test -n "$ac_tool_prefix"; then
4780   # Extract the first word of "objdump", so it can be a program name with args.
4781 set dummy objdump; ac_word=$2
4782 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4783 echo "configure:4784: checking for $ac_word" >&5
4784 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
4785   echo $ac_n "(cached) $ac_c" 1>&6
4786 else
4787   if test -n "$OBJDUMP"; then
4788   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4789 else
4790   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4791   ac_dummy="$PATH"
4792   for ac_dir in $ac_dummy; do
4793     test -z "$ac_dir" && ac_dir=.
4794     if test -f $ac_dir/$ac_word; then
4795       ac_cv_prog_OBJDUMP="objdump"
4796       break
4797     fi
4798   done
4799   IFS="$ac_save_ifs"
4800   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
4801 fi
4802 fi
4803 OBJDUMP="$ac_cv_prog_OBJDUMP"
4804 if test -n "$OBJDUMP"; then
4805   echo "$ac_t""$OBJDUMP" 1>&6
4806 else
4807   echo "$ac_t""no" 1>&6
4808 fi
4809
4810 else
4811   OBJDUMP="false"
4812 fi
4813 fi
4814
4815
4816   # recent cygwin and mingw systems supply a stub DllMain which the user
4817   # can override, but on older systems we have to supply one
4818   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
4819 echo "configure:4820: checking if libtool should supply DllMain function" >&5
4820 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
4821   echo $ac_n "(cached) $ac_c" 1>&6
4822 else
4823   cat > conftest.$ac_ext <<EOF
4824 #line 4825 "configure"
4825 #include "confdefs.h"
4826
4827 int main() {
4828 extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
4829       DllMain (0, 0, 0);
4830 ; return 0; }
4831 EOF
4832 if { (eval echo configure:4833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4833   rm -rf conftest*
4834   lt_cv_need_dllmain=no
4835 else
4836   echo "configure: failed program was:" >&5
4837   cat conftest.$ac_ext >&5
4838   rm -rf conftest*
4839   lt_cv_need_dllmain=yes
4840 fi
4841 rm -f conftest*
4842 fi
4843
4844 echo "$ac_t""$lt_cv_need_dllmain" 1>&6
4845
4846   case $host/$CC in
4847   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
4848     # old mingw systems require "-dll" to link a DLL, while more recent ones
4849     # require "-mdll"
4850     SAVE_CFLAGS="$CFLAGS"
4851     CFLAGS="$CFLAGS -mdll"
4852     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
4853 echo "configure:4854: checking how to link DLLs" >&5
4854 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
4855   echo $ac_n "(cached) $ac_c" 1>&6
4856 else
4857   cat > conftest.$ac_ext <<EOF
4858 #line 4859 "configure"
4859 #include "confdefs.h"
4860
4861 int main() {
4862
4863 ; return 0; }
4864 EOF
4865 if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4866   rm -rf conftest*
4867   lt_cv_cc_dll_switch=-mdll
4868 else
4869   echo "configure: failed program was:" >&5
4870   cat conftest.$ac_ext >&5
4871   rm -rf conftest*
4872   lt_cv_cc_dll_switch=-dll
4873 fi
4874 rm -f conftest*
4875 fi
4876
4877 echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
4878     CFLAGS="$SAVE_CFLAGS" ;;
4879   *-*-cygwin* | *-*-pw32*)
4880     # cygwin systems need to pass --dll to the linker, and not link
4881     # crt.o which will require a WinMain@16 definition.
4882     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
4883   esac
4884   ;;
4885   
4886 esac
4887
4888 # Sed substitution that helps us do robust quoting.  It backslashifies
4889 # metacharacters that are still active within double-quoted strings.
4890 Xsed='sed -e s/^X//'
4891 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
4892
4893 # Same as above, but do not quote variable references.
4894 double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
4895
4896 # Sed substitution to delay expansion of an escaped shell variable in a
4897 # double_quote_subst'ed string.
4898 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4899
4900 # Constants:
4901 rm="rm -f"
4902
4903 # Global variables:
4904 default_ofile=libtool
4905 can_build_shared=yes
4906
4907 # All known linkers require a `.a' archive for static linking (except M$VC,
4908 # which needs '.lib').
4909 libext=a
4910 ltmain="$ac_aux_dir/ltmain.sh"
4911 ofile="$default_ofile"
4912 with_gnu_ld="$lt_cv_prog_gnu_ld"
4913 need_locks="$enable_libtool_lock"
4914
4915 old_CC="$CC"
4916 old_CFLAGS="$CFLAGS"
4917
4918 # Set sane defaults for various variables
4919 test -z "$AR" && AR=ar
4920 test -z "$AR_FLAGS" && AR_FLAGS=cru
4921 test -z "$AS" && AS=as
4922 test -z "$CC" && CC=cc
4923 test -z "$DLLTOOL" && DLLTOOL=dlltool
4924 test -z "$LD" && LD=ld
4925 test -z "$LN_S" && LN_S="ln -s"
4926 test -z "$MAGIC_CMD" && MAGIC_CMD=file
4927 test -z "$NM" && NM=nm
4928 test -z "$OBJDUMP" && OBJDUMP=objdump
4929 test -z "$RANLIB" && RANLIB=:
4930 test -z "$STRIP" && STRIP=:
4931 test -z "$ac_objext" && ac_objext=o
4932
4933 if test x"$host" != x"$build"; then
4934   ac_tool_prefix=${host_alias}-
4935 else
4936   ac_tool_prefix=
4937 fi
4938
4939 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
4940 case $host_os in
4941 linux-gnu*) ;;
4942 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
4943 esac
4944
4945 case $host_os in
4946 aix3*)
4947   # AIX sometimes has problems with the GCC collect2 program.  For some
4948   # reason, if we set the COLLECT_NAMES environment variable, the problems
4949   # vanish in a puff of smoke.
4950   if test "X${COLLECT_NAMES+set}" != Xset; then
4951     COLLECT_NAMES=
4952     export COLLECT_NAMES
4953   fi
4954   ;;
4955 esac
4956
4957 # Determine commands to create old-style static archives.
4958 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
4959 old_postinstall_cmds='chmod 644 $oldlib'
4960 old_postuninstall_cmds=
4961
4962 if test -n "$RANLIB"; then
4963   case $host_os in
4964   openbsd*)
4965     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
4966     ;;
4967   *)
4968     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
4969     ;;
4970   esac
4971   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
4972 fi
4973
4974 # Allow CC to be a program name with arguments.
4975 set dummy $CC
4976 compiler="$2"
4977
4978 ## FIXME: this should be a separate macro
4979 ##
4980 echo $ac_n "checking for objdir""... $ac_c" 1>&6
4981 echo "configure:4982: checking for objdir" >&5
4982 rm -f .libs 2>/dev/null
4983 mkdir .libs 2>/dev/null
4984 if test -d .libs; then
4985   objdir=.libs
4986 else
4987   # MS-DOS does not allow filenames that begin with a dot.
4988   objdir=_libs
4989 fi
4990 rmdir .libs 2>/dev/null
4991 echo "$ac_t""$objdir" 1>&6
4992 ##
4993 ## END FIXME
4994
4995
4996 ## FIXME: this should be a separate macro
4997 ##
4998 # Check whether --with-pic or --without-pic was given.
4999 if test "${with_pic+set}" = set; then
5000   withval="$with_pic"
5001   pic_mode="$withval"
5002 else
5003   pic_mode=default
5004 fi
5005
5006 test -z "$pic_mode" && pic_mode=default
5007
5008 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
5009 # in isolation, and that seeing it set (from the cache) indicates that
5010 # the associated values are set (in the cache) correctly too.
5011 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
5012 echo "configure:5013: checking for $compiler option to produce PIC" >&5
5013 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
5014   echo $ac_n "(cached) $ac_c" 1>&6
5015 else
5016    lt_cv_prog_cc_pic=
5017   lt_cv_prog_cc_shlib=
5018   lt_cv_prog_cc_wl=
5019   lt_cv_prog_cc_static=
5020   lt_cv_prog_cc_no_builtin=
5021   lt_cv_prog_cc_can_build_shared=$can_build_shared
5022
5023   if test "$GCC" = yes; then
5024     lt_cv_prog_cc_wl='-Wl,'
5025     lt_cv_prog_cc_static='-static'
5026
5027     case $host_os in
5028     aix*)
5029       # Below there is a dirty hack to force normal static linking with -ldl
5030       # The problem is because libdl dynamically linked with both libc and
5031       # libC (AIX C++ library), which obviously doesn't included in libraries
5032       # list by gcc. This cause undefined symbols with -static flags.
5033       # This hack allows C programs to be linked with "-static -ldl", but
5034       # not sure about C++ programs.
5035       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
5036       ;;
5037     amigaos*)
5038       # FIXME: we need at least 68020 code to build shared libraries, but
5039       # adding the `-m68020' flag to GCC prevents building anything better,
5040       # like `-m68040'.
5041       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
5042       ;;
5043     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5044       # PIC is the default for these OSes.
5045       ;;
5046     darwin* | rhapsody*)
5047       # PIC is the default on this platform
5048       # Common symbols not allowed in MH_DYLIB files
5049       lt_cv_prog_cc_pic='-fno-common'
5050       ;;
5051     cygwin* | mingw* | pw32* | os2*)
5052       # This hack is so that the source file can tell whether it is being
5053       # built for inclusion in a dll (and should export symbols for example).
5054       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5055       ;;
5056     sysv4*MP*)
5057       if test -d /usr/nec; then
5058          lt_cv_prog_cc_pic=-Kconform_pic
5059       fi
5060       ;;
5061     *)
5062       lt_cv_prog_cc_pic='-fPIC'
5063       ;;
5064     esac
5065   else
5066     # PORTME Check for PIC flags for the system compiler.
5067     case $host_os in
5068     aix3* | aix4* | aix5*)
5069       lt_cv_prog_cc_wl='-Wl,'
5070       # All AIX code is PIC.
5071       if test "$host_cpu" = ia64; then
5072         # AIX 5 now supports IA64 processor
5073         lt_cv_prog_cc_static='-Bstatic'
5074       else
5075         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
5076       fi
5077       ;;
5078
5079     hpux9* | hpux10* | hpux11*)
5080       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
5081       lt_cv_prog_cc_wl='-Wl,'
5082       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
5083       lt_cv_prog_cc_pic='+Z'
5084       ;;
5085
5086     irix5* | irix6* | nonstopux*)
5087       lt_cv_prog_cc_wl='-Wl,'
5088       lt_cv_prog_cc_static='-non_shared'
5089       # PIC (with -KPIC) is the default.
5090       ;;
5091
5092     cygwin* | mingw* | pw32* | os2*)
5093       # This hack is so that the source file can tell whether it is being
5094       # built for inclusion in a dll (and should export symbols for example).
5095       lt_cv_prog_cc_pic='-DDLL_EXPORT'
5096       ;;
5097
5098     newsos6)
5099       lt_cv_prog_cc_pic='-KPIC'
5100       lt_cv_prog_cc_static='-Bstatic'
5101       ;;
5102
5103     osf3* | osf4* | osf5*)
5104       # All OSF/1 code is PIC.
5105       lt_cv_prog_cc_wl='-Wl,'
5106       lt_cv_prog_cc_static='-non_shared'
5107       ;;
5108
5109     sco3.2v5*)
5110       lt_cv_prog_cc_pic='-Kpic'
5111       lt_cv_prog_cc_static='-dn'
5112       lt_cv_prog_cc_shlib='-belf'
5113       ;;
5114
5115     solaris*)
5116       lt_cv_prog_cc_pic='-KPIC'
5117       lt_cv_prog_cc_static='-Bstatic'
5118       lt_cv_prog_cc_wl='-Wl,'
5119       ;;
5120
5121     sunos4*)
5122       lt_cv_prog_cc_pic='-PIC'
5123       lt_cv_prog_cc_static='-Bstatic'
5124       lt_cv_prog_cc_wl='-Qoption ld '
5125       ;;
5126
5127     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5128       lt_cv_prog_cc_pic='-KPIC'
5129       lt_cv_prog_cc_static='-Bstatic'
5130       lt_cv_prog_cc_wl='-Wl,'
5131       ;;
5132
5133     uts4*)
5134       lt_cv_prog_cc_pic='-pic'
5135       lt_cv_prog_cc_static='-Bstatic'
5136       ;;
5137
5138     sysv4*MP*)
5139       if test -d /usr/nec ;then
5140         lt_cv_prog_cc_pic='-Kconform_pic'
5141         lt_cv_prog_cc_static='-Bstatic'
5142       fi
5143       ;;
5144
5145     *)
5146       lt_cv_prog_cc_can_build_shared=no
5147       ;;
5148     esac
5149   fi
5150
5151 fi
5152
5153 if test -z "$lt_cv_prog_cc_pic"; then
5154   echo "$ac_t""none" 1>&6
5155 else
5156   echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
5157
5158   # Check to make sure the pic_flag actually works.
5159   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
5160 echo "configure:5161: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
5161   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
5162   echo $ac_n "(cached) $ac_c" 1>&6
5163 else
5164       save_CFLAGS="$CFLAGS"
5165     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
5166     cat > conftest.$ac_ext <<EOF
5167 #line 5168 "configure"
5168 #include "confdefs.h"
5169
5170 int main() {
5171
5172 ; return 0; }
5173 EOF
5174 if { (eval echo configure:5175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5175   rm -rf conftest*
5176         case $host_os in
5177       hpux9* | hpux10* | hpux11*)
5178         # On HP-UX, both CC and GCC only warn that PIC is supported... then
5179         # they create non-PIC objects.  So, if there were any warnings, we
5180         # assume that PIC is not supported.
5181         if test -s conftest.err; then
5182           lt_cv_prog_cc_pic_works=no
5183         else
5184           lt_cv_prog_cc_pic_works=yes
5185         fi
5186         ;;
5187       *)
5188         lt_cv_prog_cc_pic_works=yes
5189         ;;
5190       esac
5191     
5192 else
5193   echo "configure: failed program was:" >&5
5194   cat conftest.$ac_ext >&5
5195   rm -rf conftest*
5196         lt_cv_prog_cc_pic_works=no
5197     
5198 fi
5199 rm -f conftest*
5200     CFLAGS="$save_CFLAGS"
5201   
5202 fi
5203
5204
5205   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
5206     lt_cv_prog_cc_pic=
5207     lt_cv_prog_cc_can_build_shared=no
5208   else
5209     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
5210   fi
5211
5212   echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
5213 fi
5214 ##
5215 ## END FIXME
5216
5217 # Check for any special shared library compilation flags.
5218 if test -n "$lt_cv_prog_cc_shlib"; then
5219   echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
5220   if echo "$old_CC $old_CFLAGS " | egrep -e "[  ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
5221   else
5222    echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
5223     lt_cv_prog_cc_can_build_shared=no
5224   fi
5225 fi
5226
5227 ## FIXME: this should be a separate macro
5228 ##
5229 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
5230 echo "configure:5231: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
5231 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
5232   echo $ac_n "(cached) $ac_c" 1>&6
5233 else
5234     lt_cv_prog_cc_static_works=no
5235   save_LDFLAGS="$LDFLAGS"
5236   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
5237   cat > conftest.$ac_ext <<EOF
5238 #line 5239 "configure"
5239 #include "confdefs.h"
5240
5241 int main() {
5242
5243 ; return 0; }
5244 EOF
5245 if { (eval echo configure:5246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5246   rm -rf conftest*
5247   lt_cv_prog_cc_static_works=yes
5248 else
5249   echo "configure: failed program was:" >&5
5250   cat conftest.$ac_ext >&5
5251 fi
5252 rm -f conftest*
5253   LDFLAGS="$save_LDFLAGS"
5254
5255 fi
5256
5257
5258 # Belt *and* braces to stop my trousers falling down:
5259 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
5260 echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
5261
5262 pic_flag="$lt_cv_prog_cc_pic"
5263 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
5264 wl="$lt_cv_prog_cc_wl"
5265 link_static_flag="$lt_cv_prog_cc_static"
5266 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
5267 can_build_shared="$lt_cv_prog_cc_can_build_shared"
5268 ##
5269 ## END FIXME
5270
5271
5272 ## FIXME: this should be a separate macro
5273 ##
5274 # Check to see if options -o and -c are simultaneously supported by compiler
5275 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
5276 echo "configure:5277: checking if $compiler supports -c -o file.$ac_objext" >&5
5277 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
5278   echo $ac_n "(cached) $ac_c" 1>&6
5279 else
5280   
5281 $rm -r conftest 2>/dev/null
5282 mkdir conftest
5283 cd conftest
5284 echo "int some_variable = 0;" > conftest.$ac_ext
5285 mkdir out
5286 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
5287 # that will create temporary files in the current directory regardless of
5288 # the output directory.  Thus, making CWD read-only will cause this test
5289 # to fail, enabling locking or at least warning the user not to do parallel
5290 # builds.
5291 chmod -w .
5292 save_CFLAGS="$CFLAGS"
5293 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
5294 compiler_c_o=no
5295 if { (eval echo configure:5296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
5296   # The compiler can only warn and ignore the option if not recognized
5297   # So say no if there are warnings
5298   if test -s out/conftest.err; then
5299     lt_cv_compiler_c_o=no
5300   else
5301     lt_cv_compiler_c_o=yes
5302   fi
5303 else
5304   # Append any errors to the config.log.
5305   cat out/conftest.err 1>&5
5306   lt_cv_compiler_c_o=no
5307 fi
5308 CFLAGS="$save_CFLAGS"
5309 chmod u+w .
5310 $rm conftest* out/*
5311 rmdir out
5312 cd ..
5313 rmdir conftest
5314 $rm -r conftest 2>/dev/null
5315
5316 fi
5317
5318 compiler_c_o=$lt_cv_compiler_c_o
5319 echo "$ac_t""$compiler_c_o" 1>&6
5320
5321 if test x"$compiler_c_o" = x"yes"; then
5322   # Check to see if we can write to a .lo
5323   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
5324 echo "configure:5325: checking if $compiler supports -c -o file.lo" >&5
5325   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
5326   echo $ac_n "(cached) $ac_c" 1>&6
5327 else
5328   
5329   lt_cv_compiler_o_lo=no
5330   save_CFLAGS="$CFLAGS"
5331   CFLAGS="$CFLAGS -c -o conftest.lo"
5332   save_objext="$ac_objext"
5333   ac_objext=lo
5334   cat > conftest.$ac_ext <<EOF
5335 #line 5336 "configure"
5336 #include "confdefs.h"
5337
5338 int main() {
5339 int some_variable = 0;
5340 ; return 0; }
5341 EOF
5342 if { (eval echo configure:5343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5343   rm -rf conftest*
5344       # The compiler can only warn and ignore the option if not recognized
5345     # So say no if there are warnings
5346     if test -s conftest.err; then
5347       lt_cv_compiler_o_lo=no
5348     else
5349       lt_cv_compiler_o_lo=yes
5350     fi
5351   
5352 else
5353   echo "configure: failed program was:" >&5
5354   cat conftest.$ac_ext >&5
5355 fi
5356 rm -f conftest*
5357   ac_objext="$save_objext"
5358   CFLAGS="$save_CFLAGS"
5359   
5360 fi
5361
5362   compiler_o_lo=$lt_cv_compiler_o_lo
5363   echo "$ac_t""$compiler_o_lo" 1>&6
5364 else
5365   compiler_o_lo=no
5366 fi
5367 ##
5368 ## END FIXME
5369
5370 ## FIXME: this should be a separate macro
5371 ##
5372 # Check to see if we can do hard links to lock some files if needed
5373 hard_links="nottested"
5374 if test "$compiler_c_o" = no && test "$need_locks" != no; then
5375   # do not overwrite the value of need_locks provided by the user
5376   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
5377 echo "configure:5378: checking if we can lock with hard links" >&5
5378   hard_links=yes
5379   $rm conftest*
5380   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5381   touch conftest.a
5382   ln conftest.a conftest.b 2>&5 || hard_links=no
5383   ln conftest.a conftest.b 2>/dev/null && hard_links=no
5384   echo "$ac_t""$hard_links" 1>&6
5385   if test "$hard_links" = no; then
5386     echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
5387     need_locks=warn
5388   fi
5389 else
5390   need_locks=no
5391 fi
5392 ##
5393 ## END FIXME
5394
5395 ## FIXME: this should be a separate macro
5396 ##
5397 if test "$GCC" = yes; then
5398   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
5399   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
5400 echo "configure:5401: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
5401   echo "int some_variable = 0;" > conftest.$ac_ext
5402   save_CFLAGS="$CFLAGS"
5403   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
5404   compiler_rtti_exceptions=no
5405   cat > conftest.$ac_ext <<EOF
5406 #line 5407 "configure"
5407 #include "confdefs.h"
5408
5409 int main() {
5410 int some_variable = 0;
5411 ; return 0; }
5412 EOF
5413 if { (eval echo configure:5414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5414   rm -rf conftest*
5415       # The compiler can only warn and ignore the option if not recognized
5416     # So say no if there are warnings
5417     if test -s conftest.err; then
5418       compiler_rtti_exceptions=no
5419     else
5420       compiler_rtti_exceptions=yes
5421     fi
5422   
5423 else
5424   echo "configure: failed program was:" >&5
5425   cat conftest.$ac_ext >&5
5426 fi
5427 rm -f conftest*
5428   CFLAGS="$save_CFLAGS"
5429   echo "$ac_t""$compiler_rtti_exceptions" 1>&6
5430
5431   if test "$compiler_rtti_exceptions" = "yes"; then
5432     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
5433   else
5434     no_builtin_flag=' -fno-builtin'
5435   fi
5436 fi
5437 ##
5438 ## END FIXME
5439
5440 ## FIXME: this should be a separate macro
5441 ##
5442 # See if the linker supports building shared libraries.
5443 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
5444 echo "configure:5445: checking whether the linker ($LD) supports shared libraries" >&5
5445
5446 allow_undefined_flag=
5447 no_undefined_flag=
5448 need_lib_prefix=unknown
5449 need_version=unknown
5450 # when you set need_version to no, make sure it does not cause -set_version
5451 # flags to be left without arguments
5452 archive_cmds=
5453 archive_expsym_cmds=
5454 old_archive_from_new_cmds=
5455 old_archive_from_expsyms_cmds=
5456 export_dynamic_flag_spec=
5457 whole_archive_flag_spec=
5458 thread_safe_flag_spec=
5459 hardcode_into_libs=no
5460 hardcode_libdir_flag_spec=
5461 hardcode_libdir_separator=
5462 hardcode_direct=no
5463 hardcode_minus_L=no
5464 hardcode_shlibpath_var=unsupported
5465 runpath_var=
5466 link_all_deplibs=unknown
5467 always_export_symbols=no
5468 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5469 # include_expsyms should be a list of space-separated symbols to be *always*
5470 # included in the symbol list
5471 include_expsyms=
5472 # exclude_expsyms can be an egrep regular expression of symbols to exclude
5473 # it will be wrapped by ` (' and `)$', so one must not match beginning or
5474 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5475 # as well as any symbol that contains `d'.
5476 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
5477 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5478 # platforms (ab)use it in PIC code, but their linkers get confused if
5479 # the symbol is explicitly referenced.  Since portable code cannot
5480 # rely on this symbol name, it's probably fine to never include it in
5481 # preloaded symbol tables.
5482 extract_expsyms_cmds=
5483
5484 case $host_os in
5485 cygwin* | mingw* | pw32*)
5486   # FIXME: the MSVC++ port hasn't been tested in a loooong time
5487   # When not using gcc, we currently assume that we are using
5488   # Microsoft Visual C++.
5489   if test "$GCC" != yes; then
5490     with_gnu_ld=no
5491   fi
5492   ;;
5493 openbsd*)
5494   with_gnu_ld=no
5495   ;;
5496 esac
5497
5498 ld_shlibs=yes
5499 if test "$with_gnu_ld" = yes; then
5500   # If archive_cmds runs LD, not CC, wlarc should be empty
5501   wlarc='${wl}'
5502
5503   # See if GNU ld supports shared libraries.
5504   case $host_os in
5505   aix3* | aix4* | aix5*)
5506     # On AIX, the GNU linker is very broken
5507     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
5508     ld_shlibs=no
5509     cat <<EOF 1>&2
5510
5511 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5512 *** to be unable to reliably create shared libraries on AIX.
5513 *** Therefore, libtool is disabling shared libraries support.  If you
5514 *** really care for shared libraries, you may want to modify your PATH
5515 *** so that a non-GNU linker is found, and then restart.
5516
5517 EOF
5518     ;;
5519
5520   amigaos*)
5521     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)'
5522     hardcode_libdir_flag_spec='-L$libdir'
5523     hardcode_minus_L=yes
5524
5525     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5526     # that the semantics of dynamic libraries on AmigaOS, at least up
5527     # to version 4, is to share data among multiple programs linked
5528     # with the same dynamic library.  Since this doesn't match the
5529     # behavior of shared libraries on other platforms, we can use
5530     # them.
5531     ld_shlibs=no
5532     ;;
5533
5534   beos*)
5535     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5536       allow_undefined_flag=unsupported
5537       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5538       # support --undefined.  This deserves some investigation.  FIXME
5539       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5540     else
5541       ld_shlibs=no
5542     fi
5543     ;;
5544
5545   cygwin* | mingw* | pw32*)
5546     # hardcode_libdir_flag_spec is actually meaningless, as there is
5547     # no search path for DLLs.
5548     hardcode_libdir_flag_spec='-L$libdir'
5549     allow_undefined_flag=unsupported
5550     always_export_symbols=yes
5551
5552     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5553       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5554       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5555       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5556       else $CC -o impgen impgen.c ; fi)~
5557       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5558
5559     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5560
5561     # cygwin and mingw dlls have different entry points and sets of symbols
5562     # to exclude.
5563     # FIXME: what about values for MSVC?
5564     dll_entry=__cygwin_dll_entry@12
5565     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5566     case $host_os in
5567     mingw*)
5568       # mingw values
5569       dll_entry=_DllMainCRTStartup@12
5570       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5571       ;;
5572     esac
5573
5574     # mingw and cygwin differ, and it's simplest to just exclude the union
5575     # of the two symbol sets.
5576     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5577
5578     # recent cygwin and mingw systems supply a stub DllMain which the user
5579     # can override, but on older systems we have to supply one (in ltdll.c)
5580     if test "x$lt_cv_need_dllmain" = "xyes"; then
5581       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5582       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~
5583         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5584     else
5585       ltdll_obj=
5586       ltdll_cmds=
5587     fi
5588
5589     # Extract the symbol export list from an `--export-all' def file,
5590     # then regenerate the def file from the symbol export list, so that
5591     # the compiled dll only exports the symbol export list.
5592     # Be careful not to strip the DATA tag left be newer dlltools.
5593     export_symbols_cmds="$ltdll_cmds"'
5594       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5595       sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5596
5597     # If the export-symbols file already is a .def file (1st line
5598     # is EXPORTS), use it as is.
5599     # If DATA tags from a recent dlltool are present, honour them!
5600     archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
5601         cp $export_symbols $output_objdir/$soname-def;
5602       else
5603         echo EXPORTS > $output_objdir/$soname-def;
5604         _lt_hint=1;
5605         cat $export_symbols | while read symbol; do
5606          set dummy \$symbol;
5607          case \$# in
5608            2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5609            4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
5610            *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
5611          esac;
5612          _lt_hint=`expr 1 + \$_lt_hint`;
5613         done;
5614       fi~
5615       '"$ltdll_cmds"'
5616       $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~
5617       $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~
5618       $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~
5619       $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~
5620       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5621     ;;
5622
5623   netbsd*)
5624     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5625       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5626       wlarc=
5627     else
5628       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5629       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5630     fi
5631     ;;
5632
5633   solaris* | sysv5*)
5634     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5635       ld_shlibs=no
5636       cat <<EOF 1>&2
5637
5638 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5639 *** create shared libraries on Solaris systems.  Therefore, libtool
5640 *** is disabling shared libraries support.  We urge you to upgrade GNU
5641 *** binutils to release 2.9.1 or newer.  Another option is to modify
5642 *** your PATH or compiler configuration so that the native linker is
5643 *** used, and then restart.
5644
5645 EOF
5646     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5647       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5648       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5649     else
5650       ld_shlibs=no
5651     fi
5652     ;;
5653
5654   sunos4*)
5655     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5656     wlarc=
5657     hardcode_direct=yes
5658     hardcode_shlibpath_var=no
5659     ;;
5660
5661   *)
5662     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5663       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5664       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5665     else
5666       ld_shlibs=no
5667     fi
5668     ;;
5669   esac
5670
5671   if test "$ld_shlibs" = yes; then
5672     runpath_var=LD_RUN_PATH
5673     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
5674     export_dynamic_flag_spec='${wl}--export-dynamic'
5675     case $host_os in
5676     cygwin* | mingw* | pw32*)
5677       # dlltool doesn't understand --whole-archive et. al.
5678       whole_archive_flag_spec=
5679       ;;
5680     *)
5681       # ancient GNU ld didn't support --whole-archive et. al.
5682       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5683         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5684       else
5685         whole_archive_flag_spec=
5686       fi
5687       ;;
5688     esac
5689   fi
5690 else
5691   # PORTME fill in a description of your system's linker (not GNU ld)
5692   case $host_os in
5693   aix3*)
5694     allow_undefined_flag=unsupported
5695     always_export_symbols=yes
5696     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'
5697     # Note: this linker hardcodes the directories in LIBPATH if there
5698     # are no directories specified by -L.
5699     hardcode_minus_L=yes
5700     if test "$GCC" = yes && test -z "$link_static_flag"; then
5701       # Neither direct hardcoding nor static linking is supported with a
5702       # broken collect2.
5703       hardcode_direct=unsupported
5704     fi
5705     ;;
5706
5707   aix4* | aix5*)
5708     if test "$host_cpu" = ia64; then
5709       # On IA64, the linker does run time linking by default, so we don't
5710       # have to do anything special.
5711       aix_use_runtimelinking=no
5712       exp_sym_flag='-Bexport'
5713       no_entry_flag=""
5714     else
5715       aix_use_runtimelinking=no
5716
5717       # Test if we are trying to use run time linking or normal
5718       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5719       # need to do runtime linking.
5720       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
5721         for ld_flag in $LDFLAGS; do
5722           case $ld_flag in
5723           *-brtl*)
5724             aix_use_runtimelinking=yes
5725             break
5726           ;;
5727           esac
5728         done
5729       esac
5730
5731       exp_sym_flag='-bexport'
5732       no_entry_flag='-bnoentry'
5733     fi
5734
5735     # When large executables or shared objects are built, AIX ld can
5736     # have problems creating the table of contents.  If linking a library
5737     # or program results in "error TOC overflow" add -mminimal-toc to
5738     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5739     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5740
5741     hardcode_direct=yes
5742     archive_cmds=''
5743     hardcode_libdir_separator=':'
5744     if test "$GCC" = yes; then
5745       case $host_os in aix4.[012]|aix4.[012].*)
5746         collect2name=`${CC} -print-prog-name=collect2`
5747         if test -f "$collect2name" && \
5748           strings "$collect2name" | grep resolve_lib_name >/dev/null
5749         then
5750           # We have reworked collect2
5751           hardcode_direct=yes
5752         else
5753           # We have old collect2
5754           hardcode_direct=unsupported
5755           # It fails to find uninstalled libraries when the uninstalled
5756           # path is not listed in the libpath.  Setting hardcode_minus_L
5757           # to unsupported forces relinking
5758           hardcode_minus_L=yes
5759           hardcode_libdir_flag_spec='-L$libdir'
5760           hardcode_libdir_separator=
5761         fi
5762       esac
5763
5764       shared_flag='-shared'
5765     else
5766       # not using gcc
5767       if test "$host_cpu" = ia64; then
5768         shared_flag='${wl}-G'
5769       else
5770         if test "$aix_use_runtimelinking" = yes; then
5771           shared_flag='${wl}-G'
5772         else
5773           shared_flag='${wl}-bM:SRE'
5774         fi
5775       fi
5776     fi
5777
5778     # It seems that -bexpall can do strange things, so it is better to
5779     # generate a list of symbols to export.
5780     always_export_symbols=yes
5781     if test "$aix_use_runtimelinking" = yes; then
5782       # Warning - without using the other runtime loading flags (-brtl),
5783       # -berok will link without error, but may produce a broken library.
5784       allow_undefined_flag='-berok'
5785       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
5786       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"
5787     else
5788       if test "$host_cpu" = ia64; then
5789         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
5790         allow_undefined_flag="-z nodefs"
5791         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"
5792       else
5793         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
5794         # Warning - without using the other run time loading flags,
5795         # -berok will link without error, but may produce a broken library.
5796         allow_undefined_flag='${wl}-berok'
5797         # This is a bit strange, but is similar to how AIX traditionally builds
5798         # it's shared libraries.
5799         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'
5800       fi
5801     fi
5802     ;;
5803
5804   amigaos*)
5805     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)'
5806     hardcode_libdir_flag_spec='-L$libdir'
5807     hardcode_minus_L=yes
5808     # see comment about different semantics on the GNU ld section
5809     ld_shlibs=no
5810     ;;
5811
5812   cygwin* | mingw* | pw32*)
5813     # When not using gcc, we currently assume that we are using
5814     # Microsoft Visual C++.
5815     # hardcode_libdir_flag_spec is actually meaningless, as there is
5816     # no search path for DLLs.
5817     hardcode_libdir_flag_spec=' '
5818     allow_undefined_flag=unsupported
5819     # Tell ltmain to make .lib files, not .a files.
5820     libext=lib
5821     # FIXME: Setting linknames here is a bad hack.
5822     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5823     # The linker will automatically build a .lib file if we build a DLL.
5824     old_archive_from_new_cmds='true'
5825     # FIXME: Should let the user specify the lib program.
5826     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
5827     fix_srcfile_path='`cygpath -w "$srcfile"`'
5828     ;;
5829
5830   darwin* | rhapsody*)
5831     case "$host_os" in
5832     rhapsody* | darwin1.[012])
5833       allow_undefined_flag='-undefined suppress'
5834       ;;
5835     *) # Darwin 1.3 on
5836       allow_undefined_flag='-flat_namespace -undefined suppress'
5837       ;;
5838     esac
5839     # FIXME: Relying on posixy $() will cause problems for
5840     #        cross-compilation, but unfortunately the echo tests do not
5841     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5842     #        `"' quotes if we put them in here... so don't!
5843     archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
5844     # We need to add '_' to the symbols in $export_symbols first
5845     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
5846     hardcode_direct=yes
5847     hardcode_shlibpath_var=no
5848     whole_archive_flag_spec='-all_load $convenience'
5849     ;;
5850
5851   freebsd1*)
5852     ld_shlibs=no
5853     ;;
5854
5855   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5856   # support.  Future versions do this automatically, but an explicit c++rt0.o
5857   # does not break anything, and helps significantly (at the cost of a little
5858   # extra space).
5859   freebsd2.2*)
5860     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5861     hardcode_libdir_flag_spec='-R$libdir'
5862     hardcode_direct=yes
5863     hardcode_shlibpath_var=no
5864     ;;
5865
5866   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5867   freebsd2*)
5868     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5869     hardcode_direct=yes
5870     hardcode_minus_L=yes
5871     hardcode_shlibpath_var=no
5872     ;;
5873
5874   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5875   freebsd*)
5876     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5877     hardcode_libdir_flag_spec='-R$libdir'
5878     hardcode_direct=yes
5879     hardcode_shlibpath_var=no
5880     ;;
5881
5882   hpux9* | hpux10* | hpux11*)
5883     case $host_os in
5884     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' ;;
5885     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
5886     esac
5887     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
5888     hardcode_libdir_separator=:
5889     hardcode_direct=yes
5890     hardcode_minus_L=yes # Not in the search PATH, but as the default
5891                          # location of the library.
5892     export_dynamic_flag_spec='${wl}-E'
5893     ;;
5894
5895   irix5* | irix6* | nonstopux*)
5896     if test "$GCC" = yes; then
5897       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'
5898       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5899     else
5900       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'
5901       hardcode_libdir_flag_spec='-rpath $libdir'
5902     fi
5903     hardcode_libdir_separator=:
5904     link_all_deplibs=yes
5905     ;;
5906
5907   netbsd*)
5908     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5909       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5910     else
5911       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5912     fi
5913     hardcode_libdir_flag_spec='-R$libdir'
5914     hardcode_direct=yes
5915     hardcode_shlibpath_var=no
5916     ;;
5917
5918   newsos6)
5919     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5920     hardcode_direct=yes
5921     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5922     hardcode_libdir_separator=:
5923     hardcode_shlibpath_var=no
5924     ;;
5925
5926   openbsd*)
5927     hardcode_direct=yes
5928     hardcode_shlibpath_var=no
5929     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5930       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5931       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5932       export_dynamic_flag_spec='${wl}-E'
5933     else
5934       case "$host_os" in
5935       openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
5936         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5937         hardcode_libdir_flag_spec='-R$libdir'
5938         ;;
5939       *)
5940         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5941         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
5942         ;;
5943       esac
5944     fi
5945     ;;
5946
5947   os2*)
5948     hardcode_libdir_flag_spec='-L$libdir'
5949     hardcode_minus_L=yes
5950     allow_undefined_flag=unsupported
5951     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'
5952     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5953     ;;
5954
5955   osf3*)
5956     if test "$GCC" = yes; then
5957       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5958       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'
5959     else
5960       allow_undefined_flag=' -expect_unresolved \*'
5961       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'
5962     fi
5963     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5964     hardcode_libdir_separator=:
5965     ;;
5966
5967   osf4* | osf5*)        # as osf3* with the addition of -msym flag
5968     if test "$GCC" = yes; then
5969       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
5970       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'
5971       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
5972     else
5973       allow_undefined_flag=' -expect_unresolved \*'
5974       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'
5975       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
5976       $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'
5977
5978       #Both c and cxx compiler support -rpath directly
5979       hardcode_libdir_flag_spec='-rpath $libdir'
5980     fi
5981     hardcode_libdir_separator=:
5982     ;;
5983
5984   sco3.2v5*)
5985     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5986     hardcode_shlibpath_var=no
5987     runpath_var=LD_RUN_PATH
5988     hardcode_runpath_var=yes
5989     export_dynamic_flag_spec='${wl}-Bexport'
5990     ;;
5991
5992   solaris*)
5993     # gcc --version < 3.0 without binutils cannot create self contained
5994     # shared libraries reliably, requiring libgcc.a to resolve some of
5995     # the object symbols generated in some cases.  Libraries that use
5996     # assert need libgcc.a to resolve __eprintf, for example.  Linking
5997     # a copy of libgcc.a into every shared library to guarantee resolving
5998     # such symbols causes other problems:  According to Tim Van Holder
5999     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
6000     # (to the application) exception stack for one thing.
6001     no_undefined_flag=' -z defs'
6002     if test "$GCC" = yes; then
6003       case `$CC --version 2>/dev/null` in
6004       [12].*)
6005         cat <<EOF 1>&2
6006
6007 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
6008 *** create self contained shared libraries on Solaris systems, without
6009 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
6010 *** -no-undefined support, which will at least allow you to build shared
6011 *** libraries.  However, you may find that when you link such libraries
6012 *** into an application without using GCC, you have to manually add
6013 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
6014 *** upgrade to a newer version of GCC.  Another option is to rebuild your
6015 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
6016
6017 EOF
6018         no_undefined_flag=
6019         ;;
6020       esac
6021     fi
6022     # $CC -shared without GNU ld will not create a library from C++
6023     # object files and a static libstdc++, better avoid it by now
6024     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6025     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6026                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6027     hardcode_libdir_flag_spec='-R$libdir'
6028     hardcode_shlibpath_var=no
6029     case $host_os in
6030     solaris2.[0-5] | solaris2.[0-5].*) ;;
6031     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
6032       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
6033     esac
6034     link_all_deplibs=yes
6035     ;;
6036
6037   sunos4*)
6038     if test "x$host_vendor" = xsequent; then
6039       # Use $CC to link under sequent, because it throws in some extra .o
6040       # files that make .init and .fini sections work.
6041       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6042     else
6043       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6044     fi
6045     hardcode_libdir_flag_spec='-L$libdir'
6046     hardcode_direct=yes
6047     hardcode_minus_L=yes
6048     hardcode_shlibpath_var=no
6049     ;;
6050
6051   sysv4)
6052     case $host_vendor in
6053       sni)
6054         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6055         hardcode_direct=yes # is this really true???
6056         ;;
6057       siemens)
6058         ## LD is ld it makes a PLAMLIB
6059         ## CC just makes a GrossModule.
6060         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6061         reload_cmds='$CC -r -o $output$reload_objs'
6062         hardcode_direct=no
6063         ;;
6064       motorola)
6065         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6066         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
6067         ;;
6068     esac
6069     runpath_var='LD_RUN_PATH'
6070     hardcode_shlibpath_var=no
6071     ;;
6072
6073   sysv4.3*)
6074     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6075     hardcode_shlibpath_var=no
6076     export_dynamic_flag_spec='-Bexport'
6077     ;;
6078
6079   sysv5*)
6080     no_undefined_flag=' -z text'
6081     # $CC -shared without GNU ld will not create a library from C++
6082     # object files and a static libstdc++, better avoid it by now
6083     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6084     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6085                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6086     hardcode_libdir_flag_spec=
6087     hardcode_shlibpath_var=no
6088     runpath_var='LD_RUN_PATH'
6089     ;;
6090
6091   uts4*)
6092     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6093     hardcode_libdir_flag_spec='-L$libdir'
6094     hardcode_shlibpath_var=no
6095     ;;
6096
6097   dgux*)
6098     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6099     hardcode_libdir_flag_spec='-L$libdir'
6100     hardcode_shlibpath_var=no
6101     ;;
6102
6103   sysv4*MP*)
6104     if test -d /usr/nec; then
6105       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6106       hardcode_shlibpath_var=no
6107       runpath_var=LD_RUN_PATH
6108       hardcode_runpath_var=yes
6109       ld_shlibs=yes
6110     fi
6111     ;;
6112
6113   sysv4.2uw2*)
6114     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6115     hardcode_direct=yes
6116     hardcode_minus_L=no
6117     hardcode_shlibpath_var=no
6118     hardcode_runpath_var=yes
6119     runpath_var=LD_RUN_PATH
6120     ;;
6121
6122   sysv5uw7* | unixware7*)
6123     no_undefined_flag='${wl}-z ${wl}text'
6124     if test "$GCC" = yes; then
6125       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6126     else
6127       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6128     fi
6129     runpath_var='LD_RUN_PATH'
6130     hardcode_shlibpath_var=no
6131     ;;
6132
6133   *)
6134     ld_shlibs=no
6135     ;;
6136   esac
6137 fi
6138 echo "$ac_t""$ld_shlibs" 1>&6
6139 test "$ld_shlibs" = no && can_build_shared=no
6140 ##
6141 ## END FIXME
6142
6143 ## FIXME: this should be a separate macro
6144 ##
6145 # Check hardcoding attributes.
6146 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
6147 echo "configure:6148: checking how to hardcode library paths into programs" >&5
6148 hardcode_action=
6149 if test -n "$hardcode_libdir_flag_spec" || \
6150    test -n "$runpath_var"; then
6151
6152   # We can hardcode non-existant directories.
6153   if test "$hardcode_direct" != no &&
6154      # If the only mechanism to avoid hardcoding is shlibpath_var, we
6155      # have to relink, otherwise we might link with an installed library
6156      # when we should be linking with a yet-to-be-installed one
6157      ## test "$hardcode_shlibpath_var" != no &&
6158      test "$hardcode_minus_L" != no; then
6159     # Linking always hardcodes the temporary library directory.
6160     hardcode_action=relink
6161   else
6162     # We can link without hardcoding, and we can hardcode nonexisting dirs.
6163     hardcode_action=immediate
6164   fi
6165 else
6166   # We cannot hardcode anything, or else we can only hardcode existing
6167   # directories.
6168   hardcode_action=unsupported
6169 fi
6170 echo "$ac_t""$hardcode_action" 1>&6
6171 ##
6172 ## END FIXME
6173
6174 ## FIXME: this should be a separate macro
6175 ##
6176 striplib=
6177 old_striplib=
6178 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
6179 echo "configure:6180: checking whether stripping libraries is possible" >&5
6180 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
6181   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
6182   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
6183   echo "$ac_t""yes" 1>&6
6184 else
6185   echo "$ac_t""no" 1>&6
6186 fi
6187 ##
6188 ## END FIXME
6189
6190 reload_cmds='$LD$reload_flag -o $output$reload_objs'
6191 test -z "$deplibs_check_method" && deplibs_check_method=unknown
6192
6193 ## FIXME: this should be a separate macro
6194 ##
6195 # PORTME Fill in your ld.so characteristics
6196 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
6197 echo "configure:6198: checking dynamic linker characteristics" >&5
6198 library_names_spec=
6199 libname_spec='lib$name'
6200 soname_spec=
6201 postinstall_cmds=
6202 postuninstall_cmds=
6203 finish_cmds=
6204 finish_eval=
6205 shlibpath_var=
6206 shlibpath_overrides_runpath=unknown
6207 version_type=none
6208 dynamic_linker="$host_os ld.so"
6209 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6210 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
6211
6212 case $host_os in
6213 aix3*)
6214   version_type=linux
6215   library_names_spec='${libname}${release}.so$versuffix $libname.a'
6216   shlibpath_var=LIBPATH
6217
6218   # AIX has no versioning support, so we append a major version to the name.
6219   soname_spec='${libname}${release}.so$major'
6220   ;;
6221
6222 aix4* | aix5*)
6223   version_type=linux
6224   need_lib_prefix=no
6225   need_version=no
6226   hardcode_into_libs=yes
6227   if test "$host_cpu" = ia64; then
6228     # AIX 5 supports IA64
6229     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
6230     shlibpath_var=LD_LIBRARY_PATH
6231   else
6232     # With GCC up to 2.95.x, collect2 would create an import file
6233     # for dependence libraries.  The import file would start with
6234     # the line `#! .'.  This would cause the generated library to
6235     # depend on `.', always an invalid library.  This was fixed in
6236     # development snapshots of GCC prior to 3.0.
6237     case $host_os in
6238       aix4 | aix4.[01] | aix4.[01].*)
6239         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
6240              echo ' yes '
6241              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
6242           :
6243         else
6244           can_build_shared=no
6245         fi
6246         ;;
6247     esac
6248     # AIX (on Power*) has no versioning support, so currently we can
6249     # not hardcode correct soname into executable. Probably we can
6250     # add versioning support to collect2, so additional links can
6251     # be useful in future.
6252     if test "$aix_use_runtimelinking" = yes; then
6253       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
6254       # instead of lib<name>.a to let people know that these are not
6255       # typical AIX shared libraries.
6256       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6257     else
6258       # We preserve .a as extension for shared libraries through AIX4.2
6259       # and later when we are not doing run time linking.
6260       library_names_spec='${libname}${release}.a $libname.a'
6261       soname_spec='${libname}${release}.so$major'
6262     fi
6263     shlibpath_var=LIBPATH
6264   fi
6265   hardcode_into_libs=yes
6266   ;;
6267
6268 amigaos*)
6269   library_names_spec='$libname.ixlibrary $libname.a'
6270   # Create ${libname}_ixlibrary.a entries in /sys/libs.
6271   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'
6272   ;;
6273
6274 beos*)
6275   library_names_spec='${libname}.so'
6276   dynamic_linker="$host_os ld.so"
6277   shlibpath_var=LIBRARY_PATH
6278   ;;
6279
6280 bsdi4*)
6281   version_type=linux
6282   need_version=no
6283   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6284   soname_spec='${libname}${release}.so$major'
6285   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
6286   shlibpath_var=LD_LIBRARY_PATH
6287   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
6288   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
6289   export_dynamic_flag_spec=-rdynamic
6290   # the default ld.so.conf also contains /usr/contrib/lib and
6291   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
6292   # libtool to hard-code these into programs
6293   ;;
6294
6295 cygwin* | mingw* | pw32*)
6296   version_type=windows
6297   need_version=no
6298   need_lib_prefix=no
6299   case $GCC,$host_os in
6300   yes,cygwin*)
6301     library_names_spec='$libname.dll.a'
6302     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6303     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
6304       dldir=$destdir/`dirname \$dlpath`~
6305       test -d \$dldir || mkdir -p \$dldir~
6306       $install_prog .libs/$dlname \$dldir/$dlname'
6307     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
6308       dlpath=$dir/\$dldll~
6309        $rm \$dlpath'
6310     ;;
6311   yes,mingw*)
6312     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
6313     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
6314     ;;
6315   yes,pw32*)
6316     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
6317     ;;
6318   *)
6319     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
6320     ;;
6321   esac
6322   dynamic_linker='Win32 ld.exe'
6323   # FIXME: first we should search . and the directory the executable is in
6324   shlibpath_var=PATH
6325   ;;
6326
6327 darwin* | rhapsody*)
6328   dynamic_linker="$host_os dyld"
6329   version_type=darwin
6330   need_lib_prefix=no
6331   need_version=no
6332   # FIXME: Relying on posixy $() will cause problems for
6333   #        cross-compilation, but unfortunately the echo tests do not
6334   #        yet detect zsh echo's removal of \ escapes.
6335   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)'
6336   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
6337   shlibpath_overrides_runpath=yes
6338   shlibpath_var=DYLD_LIBRARY_PATH
6339   ;;
6340
6341 freebsd1*)
6342   dynamic_linker=no
6343   ;;
6344
6345 freebsd*)
6346   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
6347   version_type=freebsd-$objformat
6348   case $version_type in
6349     freebsd-elf*)
6350       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
6351       need_version=no
6352       need_lib_prefix=no
6353       ;;
6354     freebsd-*)
6355       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
6356       need_version=yes
6357       ;;
6358   esac
6359   shlibpath_var=LD_LIBRARY_PATH
6360   case $host_os in
6361   freebsd2*)
6362     shlibpath_overrides_runpath=yes
6363     ;;
6364   *)
6365     shlibpath_overrides_runpath=no
6366     hardcode_into_libs=yes
6367     ;;
6368   esac
6369   ;;
6370
6371 gnu*)
6372   version_type=linux
6373   need_lib_prefix=no
6374   need_version=no
6375   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
6376   soname_spec='${libname}${release}.so$major'
6377   shlibpath_var=LD_LIBRARY_PATH
6378   hardcode_into_libs=yes
6379   ;;
6380
6381 hpux9* | hpux10* | hpux11*)
6382   # Give a soname corresponding to the major version so that dld.sl refuses to
6383   # link against other versions.
6384   dynamic_linker="$host_os dld.sl"
6385   version_type=sunos
6386   need_lib_prefix=no
6387   need_version=no
6388   shlibpath_var=SHLIB_PATH
6389   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
6390   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
6391   soname_spec='${libname}${release}.sl$major'
6392   # HP-UX runs *really* slowly unless shared libraries are mode 555.
6393   postinstall_cmds='chmod 555 $lib'
6394   ;;
6395
6396 irix5* | irix6* | nonstopux*)
6397   case $host_os in
6398     nonstopux*) version_type=nonstopux ;;
6399     *)          version_type=irix ;;
6400   esac
6401   need_lib_prefix=no
6402   need_version=no
6403   soname_spec='${libname}${release}.so$major'
6404   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
6405   case $host_os in
6406   irix5* | nonstopux*)
6407     libsuff= shlibsuff=
6408     ;;
6409   *)
6410     case $LD in # libtool.m4 will add one of these switches to LD
6411     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
6412     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
6413     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
6414     *) libsuff= shlibsuff= libmagic=never-match;;
6415     esac
6416     ;;
6417   esac
6418   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
6419   shlibpath_overrides_runpath=no
6420   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
6421   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
6422   ;;
6423
6424 # No shared lib support for Linux oldld, aout, or coff.
6425 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
6426   dynamic_linker=no
6427   ;;
6428
6429 # This must be Linux ELF.
6430 linux-gnu*)
6431   version_type=linux
6432   need_lib_prefix=no
6433   need_version=no
6434   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6435   soname_spec='${libname}${release}.so$major'
6436   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
6437   shlibpath_var=LD_LIBRARY_PATH
6438   shlibpath_overrides_runpath=no
6439   # This implies no fast_install, which is unacceptable.
6440   # Some rework will be needed to allow for fast_install
6441   # before this can be enabled.
6442   hardcode_into_libs=yes
6443
6444   # We used to test for /lib/ld.so.1 and disable shared libraries on
6445   # powerpc, because MkLinux only supported shared libraries with the
6446   # GNU dynamic linker.  Since this was broken with cross compilers,
6447   # most powerpc-linux boxes support dynamic linking these days and
6448   # people can always --disable-shared, the test was removed, and we
6449   # assume the GNU/Linux dynamic linker is in use.
6450   dynamic_linker='GNU/Linux ld.so'
6451   ;;
6452
6453 netbsd*)
6454   version_type=sunos
6455   need_lib_prefix=no
6456   need_version=no
6457   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6458     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6459     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6460     dynamic_linker='NetBSD (a.out) ld.so'
6461   else
6462     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
6463     soname_spec='${libname}${release}.so$major'
6464     dynamic_linker='NetBSD ld.elf_so'
6465   fi
6466   shlibpath_var=LD_LIBRARY_PATH
6467   shlibpath_overrides_runpath=yes
6468   hardcode_into_libs=yes
6469   ;;
6470
6471 newsos6)
6472   version_type=linux
6473   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6474   shlibpath_var=LD_LIBRARY_PATH
6475   shlibpath_overrides_runpath=yes
6476   ;;
6477
6478 openbsd*)
6479   version_type=sunos
6480   need_lib_prefix=no
6481   need_version=no
6482   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6483     case "$host_os" in
6484     openbsd2.[89] | openbsd2.[89].*)
6485       shlibpath_overrides_runpath=no
6486       ;;
6487     *)
6488       shlibpath_overrides_runpath=yes
6489       ;;
6490     esac
6491   else
6492     shlibpath_overrides_runpath=yes
6493   fi
6494   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6495   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
6496   shlibpath_var=LD_LIBRARY_PATH
6497   ;;
6498
6499 os2*)
6500   libname_spec='$name'
6501   need_lib_prefix=no
6502   library_names_spec='$libname.dll $libname.a'
6503   dynamic_linker='OS/2 ld.exe'
6504   shlibpath_var=LIBPATH
6505   ;;
6506
6507 osf3* | osf4* | osf5*)
6508   version_type=osf
6509   need_version=no
6510   soname_spec='${libname}${release}.so$major'
6511   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6512   shlibpath_var=LD_LIBRARY_PATH
6513   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
6514   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
6515   hardcode_into_libs=yes
6516   ;;
6517
6518 sco3.2v5*)
6519   version_type=osf
6520   soname_spec='${libname}${release}.so$major'
6521   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6522   shlibpath_var=LD_LIBRARY_PATH
6523   ;;
6524
6525 solaris*)
6526   version_type=linux
6527   need_lib_prefix=no
6528   need_version=no
6529   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6530   soname_spec='${libname}${release}.so$major'
6531   shlibpath_var=LD_LIBRARY_PATH
6532   shlibpath_overrides_runpath=yes
6533   hardcode_into_libs=yes
6534   # ldd complains unless libraries are executable
6535   postinstall_cmds='chmod +x $lib'
6536   ;;
6537
6538 sunos4*)
6539   version_type=sunos
6540   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
6541   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
6542   shlibpath_var=LD_LIBRARY_PATH
6543   shlibpath_overrides_runpath=yes
6544   if test "$with_gnu_ld" = yes; then
6545     need_lib_prefix=no
6546   fi
6547   need_version=yes
6548   ;;
6549
6550 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6551   version_type=linux
6552   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6553   soname_spec='${libname}${release}.so$major'
6554   shlibpath_var=LD_LIBRARY_PATH
6555   case $host_vendor in
6556     sni)
6557       shlibpath_overrides_runpath=no
6558       need_lib_prefix=no
6559       export_dynamic_flag_spec='${wl}-Blargedynsym'
6560       runpath_var=LD_RUN_PATH
6561       ;;
6562     siemens)
6563       need_lib_prefix=no
6564       ;;
6565     motorola)
6566       need_lib_prefix=no
6567       need_version=no
6568       shlibpath_overrides_runpath=no
6569       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
6570       ;;
6571   esac
6572   ;;
6573
6574 uts4*)
6575   version_type=linux
6576   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6577   soname_spec='${libname}${release}.so$major'
6578   shlibpath_var=LD_LIBRARY_PATH
6579   ;;
6580
6581 dgux*)
6582   version_type=linux
6583   need_lib_prefix=no
6584   need_version=no
6585   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
6586   soname_spec='${libname}${release}.so$major'
6587   shlibpath_var=LD_LIBRARY_PATH
6588   ;;
6589
6590 sysv4*MP*)
6591   if test -d /usr/nec ;then
6592     version_type=linux
6593     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
6594     soname_spec='$libname.so.$major'
6595     shlibpath_var=LD_LIBRARY_PATH
6596   fi
6597   ;;
6598
6599 *)
6600   dynamic_linker=no
6601   ;;
6602 esac
6603 echo "$ac_t""$dynamic_linker" 1>&6
6604 test "$dynamic_linker" = no && can_build_shared=no
6605 ##
6606 ## END FIXME
6607
6608 ## FIXME: this should be a separate macro
6609 ##
6610 # Report the final consequences.
6611 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
6612 echo "configure:6613: checking if libtool supports shared libraries" >&5
6613 echo "$ac_t""$can_build_shared" 1>&6
6614 ##
6615 ## END FIXME
6616
6617 ## FIXME: this should be a separate macro
6618 ##
6619 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
6620 echo "configure:6621: checking whether to build shared libraries" >&5
6621 test "$can_build_shared" = "no" && enable_shared=no
6622
6623 # On AIX, shared libraries and static libraries use the same namespace, and
6624 # are all built from PIC.
6625 case "$host_os" in
6626 aix3*)
6627   test "$enable_shared" = yes && enable_static=no
6628   if test -n "$RANLIB"; then
6629     archive_cmds="$archive_cmds~\$RANLIB \$lib"
6630     postinstall_cmds='$RANLIB $lib'
6631   fi
6632   ;;
6633
6634 aix4*)
6635   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6636     test "$enable_shared" = yes && enable_static=no
6637   fi
6638   ;;
6639 esac
6640 echo "$ac_t""$enable_shared" 1>&6
6641 ##
6642 ## END FIXME
6643
6644 ## FIXME: this should be a separate macro
6645 ##
6646 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
6647 echo "configure:6648: checking whether to build static libraries" >&5
6648 # Make sure either enable_shared or enable_static is yes.
6649 test "$enable_shared" = yes || enable_static=yes
6650 echo "$ac_t""$enable_static" 1>&6
6651 ##
6652 ## END FIXME
6653
6654 if test "$hardcode_action" = relink; then
6655   # Fast installation is not supported
6656   enable_fast_install=no
6657 elif test "$shlibpath_overrides_runpath" = yes ||
6658      test "$enable_shared" = no; then
6659   # Fast installation is not necessary
6660   enable_fast_install=needless
6661 fi
6662
6663 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6664 if test "$GCC" = yes; then
6665   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6666 fi
6667
6668 if test "x$enable_dlopen" != xyes; then
6669   enable_dlopen=unknown
6670   enable_dlopen_self=unknown
6671   enable_dlopen_self_static=unknown
6672 else
6673   lt_cv_dlopen=no
6674   lt_cv_dlopen_libs=
6675
6676   case $host_os in
6677   beos*)
6678     lt_cv_dlopen="load_add_on"
6679     lt_cv_dlopen_libs=
6680     lt_cv_dlopen_self=yes
6681     ;;
6682
6683   cygwin* | mingw* | pw32*)
6684     lt_cv_dlopen="LoadLibrary"
6685     lt_cv_dlopen_libs=
6686    ;;
6687
6688   *)
6689     echo $ac_n "checking for shl_load""... $ac_c" 1>&6
6690 echo "configure:6691: checking for shl_load" >&5
6691 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
6692   echo $ac_n "(cached) $ac_c" 1>&6
6693 else
6694   cat > conftest.$ac_ext <<EOF
6695 #line 6696 "configure"
6696 #include "confdefs.h"
6697 /* System header to define __stub macros and hopefully few prototypes,
6698     which can conflict with char shl_load(); below.  */
6699 #include <assert.h>
6700 /* Override any gcc2 internal prototype to avoid an error.  */
6701 /* We use char because int might match the return type of a gcc2
6702     builtin and then its argument prototype would still apply.  */
6703 char shl_load();
6704 char (*f)();
6705
6706 int main() {
6707
6708 /* The GNU C library defines this for functions which it implements
6709     to always fail with ENOSYS.  Some functions are actually named
6710     something starting with __ and the normal name is an alias.  */
6711 #if defined (__stub_shl_load) || defined (__stub___shl_load)
6712 choke me
6713 #else
6714 f = shl_load;
6715 #endif
6716
6717 ; return 0; }
6718 EOF
6719 if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6720   rm -rf conftest*
6721   eval "ac_cv_func_shl_load=yes"
6722 else
6723   echo "configure: failed program was:" >&5
6724   cat conftest.$ac_ext >&5
6725   rm -rf conftest*
6726   eval "ac_cv_func_shl_load=no"
6727 fi
6728 rm -f conftest*
6729 fi
6730
6731 if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
6732   echo "$ac_t""yes" 1>&6
6733   lt_cv_dlopen="shl_load"
6734 else
6735   echo "$ac_t""no" 1>&6
6736 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
6737 echo "configure:6738: checking for shl_load in -ldld" >&5
6738 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
6739 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6740   echo $ac_n "(cached) $ac_c" 1>&6
6741 else
6742   ac_save_LIBS="$LIBS"
6743 LIBS="-ldld  $LIBS"
6744 cat > conftest.$ac_ext <<EOF
6745 #line 6746 "configure"
6746 #include "confdefs.h"
6747 /* Override any gcc2 internal prototype to avoid an error.  */
6748 /* We use char because int might match the return type of a gcc2
6749     builtin and then its argument prototype would still apply.  */
6750 char shl_load();
6751
6752 int main() {
6753 shl_load()
6754 ; return 0; }
6755 EOF
6756 if { (eval echo configure:6757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6757   rm -rf conftest*
6758   eval "ac_cv_lib_$ac_lib_var=yes"
6759 else
6760   echo "configure: failed program was:" >&5
6761   cat conftest.$ac_ext >&5
6762   rm -rf conftest*
6763   eval "ac_cv_lib_$ac_lib_var=no"
6764 fi
6765 rm -f conftest*
6766 LIBS="$ac_save_LIBS"
6767
6768 fi
6769 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6770   echo "$ac_t""yes" 1>&6
6771   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
6772 else
6773   echo "$ac_t""no" 1>&6
6774 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
6775 echo "configure:6776: checking for dlopen" >&5
6776 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
6777   echo $ac_n "(cached) $ac_c" 1>&6
6778 else
6779   cat > conftest.$ac_ext <<EOF
6780 #line 6781 "configure"
6781 #include "confdefs.h"
6782 /* System header to define __stub macros and hopefully few prototypes,
6783     which can conflict with char dlopen(); below.  */
6784 #include <assert.h>
6785 /* Override any gcc2 internal prototype to avoid an error.  */
6786 /* We use char because int might match the return type of a gcc2
6787     builtin and then its argument prototype would still apply.  */
6788 char dlopen();
6789 char (*f)();
6790
6791 int main() {
6792
6793 /* The GNU C library defines this for functions which it implements
6794     to always fail with ENOSYS.  Some functions are actually named
6795     something starting with __ and the normal name is an alias.  */
6796 #if defined (__stub_dlopen) || defined (__stub___dlopen)
6797 choke me
6798 #else
6799 f = dlopen;
6800 #endif
6801
6802 ; return 0; }
6803 EOF
6804 if { (eval echo configure:6805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6805   rm -rf conftest*
6806   eval "ac_cv_func_dlopen=yes"
6807 else
6808   echo "configure: failed program was:" >&5
6809   cat conftest.$ac_ext >&5
6810   rm -rf conftest*
6811   eval "ac_cv_func_dlopen=no"
6812 fi
6813 rm -f conftest*
6814 fi
6815
6816 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
6817   echo "$ac_t""yes" 1>&6
6818   lt_cv_dlopen="dlopen"
6819 else
6820   echo "$ac_t""no" 1>&6
6821 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
6822 echo "configure:6823: checking for dlopen in -ldl" >&5
6823 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
6824 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6825   echo $ac_n "(cached) $ac_c" 1>&6
6826 else
6827   ac_save_LIBS="$LIBS"
6828 LIBS="-ldl  $LIBS"
6829 cat > conftest.$ac_ext <<EOF
6830 #line 6831 "configure"
6831 #include "confdefs.h"
6832 /* Override any gcc2 internal prototype to avoid an error.  */
6833 /* We use char because int might match the return type of a gcc2
6834     builtin and then its argument prototype would still apply.  */
6835 char dlopen();
6836
6837 int main() {
6838 dlopen()
6839 ; return 0; }
6840 EOF
6841 if { (eval echo configure:6842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6842   rm -rf conftest*
6843   eval "ac_cv_lib_$ac_lib_var=yes"
6844 else
6845   echo "configure: failed program was:" >&5
6846   cat conftest.$ac_ext >&5
6847   rm -rf conftest*
6848   eval "ac_cv_lib_$ac_lib_var=no"
6849 fi
6850 rm -f conftest*
6851 LIBS="$ac_save_LIBS"
6852
6853 fi
6854 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6855   echo "$ac_t""yes" 1>&6
6856   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
6857 else
6858   echo "$ac_t""no" 1>&6
6859 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
6860 echo "configure:6861: checking for dlopen in -lsvld" >&5
6861 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
6862 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6863   echo $ac_n "(cached) $ac_c" 1>&6
6864 else
6865   ac_save_LIBS="$LIBS"
6866 LIBS="-lsvld  $LIBS"
6867 cat > conftest.$ac_ext <<EOF
6868 #line 6869 "configure"
6869 #include "confdefs.h"
6870 /* Override any gcc2 internal prototype to avoid an error.  */
6871 /* We use char because int might match the return type of a gcc2
6872     builtin and then its argument prototype would still apply.  */
6873 char dlopen();
6874
6875 int main() {
6876 dlopen()
6877 ; return 0; }
6878 EOF
6879 if { (eval echo configure:6880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6880   rm -rf conftest*
6881   eval "ac_cv_lib_$ac_lib_var=yes"
6882 else
6883   echo "configure: failed program was:" >&5
6884   cat conftest.$ac_ext >&5
6885   rm -rf conftest*
6886   eval "ac_cv_lib_$ac_lib_var=no"
6887 fi
6888 rm -f conftest*
6889 LIBS="$ac_save_LIBS"
6890
6891 fi
6892 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6893   echo "$ac_t""yes" 1>&6
6894   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
6895 else
6896   echo "$ac_t""no" 1>&6
6897 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
6898 echo "configure:6899: checking for dld_link in -ldld" >&5
6899 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
6900 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6901   echo $ac_n "(cached) $ac_c" 1>&6
6902 else
6903   ac_save_LIBS="$LIBS"
6904 LIBS="-ldld  $LIBS"
6905 cat > conftest.$ac_ext <<EOF
6906 #line 6907 "configure"
6907 #include "confdefs.h"
6908 /* Override any gcc2 internal prototype to avoid an error.  */
6909 /* We use char because int might match the return type of a gcc2
6910     builtin and then its argument prototype would still apply.  */
6911 char dld_link();
6912
6913 int main() {
6914 dld_link()
6915 ; return 0; }
6916 EOF
6917 if { (eval echo configure:6918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6918   rm -rf conftest*
6919   eval "ac_cv_lib_$ac_lib_var=yes"
6920 else
6921   echo "configure: failed program was:" >&5
6922   cat conftest.$ac_ext >&5
6923   rm -rf conftest*
6924   eval "ac_cv_lib_$ac_lib_var=no"
6925 fi
6926 rm -f conftest*
6927 LIBS="$ac_save_LIBS"
6928
6929 fi
6930 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6931   echo "$ac_t""yes" 1>&6
6932   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
6933 else
6934   echo "$ac_t""no" 1>&6
6935 fi
6936
6937               
6938 fi
6939
6940             
6941 fi
6942
6943           
6944 fi
6945
6946         
6947 fi
6948
6949       
6950 fi
6951
6952     ;;
6953   esac
6954
6955   if test "x$lt_cv_dlopen" != xno; then
6956     enable_dlopen=yes
6957   else
6958     enable_dlopen=no
6959   fi
6960
6961   case $lt_cv_dlopen in
6962   dlopen)
6963     save_CPPFLAGS="$CPPFLAGS"
6964         test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
6965
6966     save_LDFLAGS="$LDFLAGS"
6967     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
6968
6969     save_LIBS="$LIBS"
6970     LIBS="$lt_cv_dlopen_libs $LIBS"
6971
6972     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
6973 echo "configure:6974: checking whether a program can dlopen itself" >&5
6974 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
6975   echo $ac_n "(cached) $ac_c" 1>&6
6976 else
6977           if test "$cross_compiling" = yes; then :
6978   lt_cv_dlopen_self=cross
6979 else
6980     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
6981   lt_status=$lt_dlunknown
6982   cat > conftest.$ac_ext <<EOF
6983 #line 6984 "configure"
6984 #include "confdefs.h"
6985
6986 #if HAVE_DLFCN_H
6987 #include <dlfcn.h>
6988 #endif
6989
6990 #include <stdio.h>
6991
6992 #ifdef RTLD_GLOBAL
6993 #  define LT_DLGLOBAL           RTLD_GLOBAL
6994 #else
6995 #  ifdef DL_GLOBAL
6996 #    define LT_DLGLOBAL         DL_GLOBAL
6997 #  else
6998 #    define LT_DLGLOBAL         0
6999 #  endif
7000 #endif
7001
7002 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7003    find out it does not work in some platform. */
7004 #ifndef LT_DLLAZY_OR_NOW
7005 #  ifdef RTLD_LAZY
7006 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7007 #  else
7008 #    ifdef DL_LAZY
7009 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7010 #    else
7011 #      ifdef RTLD_NOW
7012 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7013 #      else
7014 #        ifdef DL_NOW
7015 #          define LT_DLLAZY_OR_NOW      DL_NOW
7016 #        else
7017 #          define LT_DLLAZY_OR_NOW      0
7018 #        endif
7019 #      endif
7020 #    endif
7021 #  endif
7022 #endif
7023
7024 #ifdef __cplusplus
7025 extern "C" void exit (int);
7026 #endif
7027
7028 void fnord() { int i=42;}
7029 int main ()
7030 {
7031   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7032   int status = $lt_dlunknown;
7033
7034   if (self)
7035     {
7036       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7037       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7038       /* dlclose (self); */
7039     }
7040
7041     exit (status);
7042 }
7043 EOF
7044   if { (eval echo configure:7045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7045     (./conftest; exit; ) 2>/dev/null
7046     lt_status=$?
7047     case x$lt_status in
7048       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
7049       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
7050       x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
7051     esac
7052   else :
7053     # compilation failed
7054     lt_cv_dlopen_self=no
7055   fi
7056 fi
7057 rm -fr conftest*
7058
7059     
7060 fi
7061
7062 echo "$ac_t""$lt_cv_dlopen_self" 1>&6
7063
7064     if test "x$lt_cv_dlopen_self" = xyes; then
7065       LDFLAGS="$LDFLAGS $link_static_flag"
7066       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
7067 echo "configure:7068: checking whether a statically linked program can dlopen itself" >&5
7068 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
7069   echo $ac_n "(cached) $ac_c" 1>&6
7070 else
7071           if test "$cross_compiling" = yes; then :
7072   lt_cv_dlopen_self_static=cross
7073 else
7074     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
7075   lt_status=$lt_dlunknown
7076   cat > conftest.$ac_ext <<EOF
7077 #line 7078 "configure"
7078 #include "confdefs.h"
7079
7080 #if HAVE_DLFCN_H
7081 #include <dlfcn.h>
7082 #endif
7083
7084 #include <stdio.h>
7085
7086 #ifdef RTLD_GLOBAL
7087 #  define LT_DLGLOBAL           RTLD_GLOBAL
7088 #else
7089 #  ifdef DL_GLOBAL
7090 #    define LT_DLGLOBAL         DL_GLOBAL
7091 #  else
7092 #    define LT_DLGLOBAL         0
7093 #  endif
7094 #endif
7095
7096 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
7097    find out it does not work in some platform. */
7098 #ifndef LT_DLLAZY_OR_NOW
7099 #  ifdef RTLD_LAZY
7100 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
7101 #  else
7102 #    ifdef DL_LAZY
7103 #      define LT_DLLAZY_OR_NOW          DL_LAZY
7104 #    else
7105 #      ifdef RTLD_NOW
7106 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
7107 #      else
7108 #        ifdef DL_NOW
7109 #          define LT_DLLAZY_OR_NOW      DL_NOW
7110 #        else
7111 #          define LT_DLLAZY_OR_NOW      0
7112 #        endif
7113 #      endif
7114 #    endif
7115 #  endif
7116 #endif
7117
7118 #ifdef __cplusplus
7119 extern "C" void exit (int);
7120 #endif
7121
7122 void fnord() { int i=42;}
7123 int main ()
7124 {
7125   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
7126   int status = $lt_dlunknown;
7127
7128   if (self)
7129     {
7130       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
7131       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
7132       /* dlclose (self); */
7133     }
7134
7135     exit (status);
7136 }
7137 EOF
7138   if { (eval echo configure:7139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
7139     (./conftest; exit; ) 2>/dev/null
7140     lt_status=$?
7141     case x$lt_status in
7142       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
7143       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
7144       x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
7145     esac
7146   else :
7147     # compilation failed
7148     lt_cv_dlopen_self_static=no
7149   fi
7150 fi
7151 rm -fr conftest*
7152
7153       
7154 fi
7155
7156 echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
7157     fi
7158
7159     CPPFLAGS="$save_CPPFLAGS"
7160     LDFLAGS="$save_LDFLAGS"
7161     LIBS="$save_LIBS"
7162     ;;
7163   esac
7164
7165   case $lt_cv_dlopen_self in
7166   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
7167   *) enable_dlopen_self=unknown ;;
7168   esac
7169
7170   case $lt_cv_dlopen_self_static in
7171   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
7172   *) enable_dlopen_self_static=unknown ;;
7173   esac
7174 fi
7175
7176
7177 ## FIXME: this should be a separate macro
7178 ##
7179 if test "$enable_shared" = yes && test "$GCC" = yes; then
7180   case $archive_cmds in
7181   *'~'*)
7182     # FIXME: we may have to deal with multi-command sequences.
7183     ;;
7184   '$CC '*)
7185     # Test whether the compiler implicitly links with -lc since on some
7186     # systems, -lgcc has to come before -lc. If gcc already passes -lc
7187     # to ld, don't add -lc before -lgcc.
7188     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
7189 echo "configure:7190: checking whether -lc should be explicitly linked in" >&5
7190     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
7191   echo $ac_n "(cached) $ac_c" 1>&6
7192 else
7193   $rm conftest*
7194     echo 'static int dummy;' > conftest.$ac_ext
7195
7196     if { (eval echo configure:7197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7197       soname=conftest
7198       lib=conftest
7199       libobjs=conftest.$ac_objext
7200       deplibs=
7201       wl=$lt_cv_prog_cc_wl
7202       compiler_flags=-v
7203       linker_flags=-v
7204       verstring=
7205       output_objdir=.
7206       libname=conftest
7207       save_allow_undefined_flag=$allow_undefined_flag
7208       allow_undefined_flag=
7209       if { (eval echo configure:7210: \"$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; }
7210       then
7211         lt_cv_archive_cmds_need_lc=no
7212       else
7213         lt_cv_archive_cmds_need_lc=yes
7214       fi
7215       allow_undefined_flag=$save_allow_undefined_flag
7216     else
7217       cat conftest.err 1>&5
7218     fi
7219 fi
7220
7221     echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
7222     ;;
7223   esac
7224 fi
7225 need_lc=${lt_cv_archive_cmds_need_lc-yes}
7226 ##
7227 ## END FIXME
7228
7229 ## FIXME: this should be a separate macro
7230 ##
7231 # The second clause should only fire when bootstrapping the
7232 # libtool distribution, otherwise you forgot to ship ltmain.sh
7233 # with your package, and you will get complaints that there are
7234 # no rules to generate ltmain.sh.
7235 if test -f "$ltmain"; then
7236   :
7237 else
7238   # If there is no Makefile yet, we rely on a make rule to execute
7239   # `config.status --recheck' to rerun these tests and create the
7240   # libtool script then.
7241   test -f Makefile && make "$ltmain"
7242 fi
7243
7244 if test -f "$ltmain"; then
7245   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
7246   $rm -f "${ofile}T"
7247
7248   echo creating $ofile
7249
7250   # Now quote all the things that may contain metacharacters while being
7251   # careful not to overquote the AC_SUBSTed values.  We take copies of the
7252   # variables and quote the copies for generation of the libtool script.
7253   for var in echo old_CC old_CFLAGS SED \
7254     AR AR_FLAGS CC LD LN_S NM SHELL \
7255     reload_flag reload_cmds wl \
7256     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
7257     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
7258     library_names_spec soname_spec \
7259     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
7260     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
7261     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
7262     old_striplib striplib file_magic_cmd export_symbols_cmds \
7263     deplibs_check_method allow_undefined_flag no_undefined_flag \
7264     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
7265     global_symbol_to_c_name_address \
7266     hardcode_libdir_flag_spec hardcode_libdir_separator  \
7267     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
7268     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
7269
7270     case $var in
7271     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
7272     old_postinstall_cmds | old_postuninstall_cmds | \
7273     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
7274     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
7275     postinstall_cmds | postuninstall_cmds | \
7276     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
7277       # Double-quote double-evaled strings.
7278       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
7279       ;;
7280     *)
7281       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
7282       ;;
7283     esac
7284   done
7285
7286   cat <<__EOF__ > "${ofile}T"
7287 #! $SHELL
7288
7289 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7290 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
7291 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7292 #
7293 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
7294 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7295 #
7296 # This program is free software; you can redistribute it and/or modify
7297 # it under the terms of the GNU General Public License as published by
7298 # the Free Software Foundation; either version 2 of the License, or
7299 # (at your option) any later version.
7300 #
7301 # This program is distributed in the hope that it will be useful, but
7302 # WITHOUT ANY WARRANTY; without even the implied warranty of
7303 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7304 # General Public License for more details.
7305 #
7306 # You should have received a copy of the GNU General Public License
7307 # along with this program; if not, write to the Free Software
7308 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7309 #
7310 # As a special exception to the GNU General Public License, if you
7311 # distribute this file as part of a program that contains a
7312 # configuration script generated by Autoconf, you may include it under
7313 # the same distribution terms that you use for the rest of that program.
7314
7315 # A sed that does not truncate output.
7316 SED=$lt_SED
7317
7318 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
7319 Xsed="${SED} -e s/^X//"
7320
7321 # The HP-UX ksh and POSIX shell print the target directory to stdout
7322 # if CDPATH is set.
7323 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
7324
7325 # ### BEGIN LIBTOOL CONFIG
7326
7327 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7328
7329 # Shell to use when invoking shell scripts.
7330 SHELL=$lt_SHELL
7331
7332 # Whether or not to build shared libraries.
7333 build_libtool_libs=$enable_shared
7334
7335 # Whether or not to build static libraries.
7336 build_old_libs=$enable_static
7337
7338 # Whether or not to add -lc for building shared libraries.
7339 build_libtool_need_lc=$need_lc
7340
7341 # Whether or not to optimize for fast installation.
7342 fast_install=$enable_fast_install
7343
7344 # The host system.
7345 host_alias=$host_alias
7346 host=$host
7347
7348 # An echo program that does not interpret backslashes.
7349 echo=$lt_echo
7350
7351 # The archiver.
7352 AR=$lt_AR
7353 AR_FLAGS=$lt_AR_FLAGS
7354
7355 # The default C compiler.
7356 CC=$lt_CC
7357
7358 # Is the compiler the GNU C compiler?
7359 with_gcc=$GCC
7360
7361 # The linker used to build libraries.
7362 LD=$lt_LD
7363
7364 # Whether we need hard or soft links.
7365 LN_S=$lt_LN_S
7366
7367 # A BSD-compatible nm program.
7368 NM=$lt_NM
7369
7370 # A symbol stripping program
7371 STRIP=$STRIP
7372
7373 # Used to examine libraries when file_magic_cmd begins "file"
7374 MAGIC_CMD=$MAGIC_CMD
7375
7376 # Used on cygwin: DLL creation program.
7377 DLLTOOL="$DLLTOOL"
7378
7379 # Used on cygwin: object dumper.
7380 OBJDUMP="$OBJDUMP"
7381
7382 # Used on cygwin: assembler.
7383 AS="$AS"
7384
7385 # The name of the directory that contains temporary libtool files.
7386 objdir=$objdir
7387
7388 # How to create reloadable object files.
7389 reload_flag=$lt_reload_flag
7390 reload_cmds=$lt_reload_cmds
7391
7392 # How to pass a linker flag through the compiler.
7393 wl=$lt_wl
7394
7395 # Object file suffix (normally "o").
7396 objext="$ac_objext"
7397
7398 # Old archive suffix (normally "a").
7399 libext="$libext"
7400
7401 # Executable file suffix (normally "").
7402 exeext="$exeext"
7403
7404 # Additional compiler flags for building library objects.
7405 pic_flag=$lt_pic_flag
7406 pic_mode=$pic_mode
7407
7408 # Does compiler simultaneously support -c and -o options?
7409 compiler_c_o=$lt_compiler_c_o
7410
7411 # Can we write directly to a .lo ?
7412 compiler_o_lo=$lt_compiler_o_lo
7413
7414 # Must we lock files when doing compilation ?
7415 need_locks=$lt_need_locks
7416
7417 # Do we need the lib prefix for modules?
7418 need_lib_prefix=$need_lib_prefix
7419
7420 # Do we need a version for libraries?
7421 need_version=$need_version
7422
7423 # Whether dlopen is supported.
7424 dlopen_support=$enable_dlopen
7425
7426 # Whether dlopen of programs is supported.
7427 dlopen_self=$enable_dlopen_self
7428
7429 # Whether dlopen of statically linked programs is supported.
7430 dlopen_self_static=$enable_dlopen_self_static
7431
7432 # Compiler flag to prevent dynamic linking.
7433 link_static_flag=$lt_link_static_flag
7434
7435 # Compiler flag to turn off builtin functions.
7436 no_builtin_flag=$lt_no_builtin_flag
7437
7438 # Compiler flag to allow reflexive dlopens.
7439 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
7440
7441 # Compiler flag to generate shared objects directly from archives.
7442 whole_archive_flag_spec=$lt_whole_archive_flag_spec
7443
7444 # Compiler flag to generate thread-safe objects.
7445 thread_safe_flag_spec=$lt_thread_safe_flag_spec
7446
7447 # Library versioning type.
7448 version_type=$version_type
7449
7450 # Format of library name prefix.
7451 libname_spec=$lt_libname_spec
7452
7453 # List of archive names.  First name is the real one, the rest are links.
7454 # The last name is the one that the linker finds with -lNAME.
7455 library_names_spec=$lt_library_names_spec
7456
7457 # The coded name of the library, if different from the real name.
7458 soname_spec=$lt_soname_spec
7459
7460 # Commands used to build and install an old-style archive.
7461 RANLIB=$lt_RANLIB
7462 old_archive_cmds=$lt_old_archive_cmds
7463 old_postinstall_cmds=$lt_old_postinstall_cmds
7464 old_postuninstall_cmds=$lt_old_postuninstall_cmds
7465
7466 # Create an old-style archive from a shared archive.
7467 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
7468
7469 # Create a temporary old-style archive to link instead of a shared archive.
7470 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
7471
7472 # Commands used to build and install a shared archive.
7473 archive_cmds=$lt_archive_cmds
7474 archive_expsym_cmds=$lt_archive_expsym_cmds
7475 postinstall_cmds=$lt_postinstall_cmds
7476 postuninstall_cmds=$lt_postuninstall_cmds
7477
7478 # Commands to strip libraries.
7479 old_striplib=$lt_old_striplib
7480 striplib=$lt_striplib
7481
7482 # Method to check whether dependent libraries are shared objects.
7483 deplibs_check_method=$lt_deplibs_check_method
7484
7485 # Command to use when deplibs_check_method == file_magic.
7486 file_magic_cmd=$lt_file_magic_cmd
7487
7488 # Flag that allows shared libraries with undefined symbols to be built.
7489 allow_undefined_flag=$lt_allow_undefined_flag
7490
7491 # Flag that forces no undefined symbols.
7492 no_undefined_flag=$lt_no_undefined_flag
7493
7494 # Commands used to finish a libtool library installation in a directory.
7495 finish_cmds=$lt_finish_cmds
7496
7497 # Same as above, but a single script fragment to be evaled but not shown.
7498 finish_eval=$lt_finish_eval
7499
7500 # Take the output of nm and produce a listing of raw symbols and C names.
7501 global_symbol_pipe=$lt_global_symbol_pipe
7502
7503 # Transform the output of nm in a proper C declaration
7504 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
7505
7506 # Transform the output of nm in a C name address pair
7507 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
7508
7509 # This is the shared library runtime path variable.
7510 runpath_var=$runpath_var
7511
7512 # This is the shared library path variable.
7513 shlibpath_var=$shlibpath_var
7514
7515 # Is shlibpath searched before the hard-coded library search path?
7516 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
7517
7518 # How to hardcode a shared library path into an executable.
7519 hardcode_action=$hardcode_action
7520
7521 # Whether we should hardcode library paths into libraries.
7522 hardcode_into_libs=$hardcode_into_libs
7523
7524 # Flag to hardcode \$libdir into a binary during linking.
7525 # This must work even if \$libdir does not exist.
7526 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
7527
7528 # Whether we need a single -rpath flag with a separated argument.
7529 hardcode_libdir_separator=$lt_hardcode_libdir_separator
7530
7531 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
7532 # resulting binary.
7533 hardcode_direct=$hardcode_direct
7534
7535 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7536 # resulting binary.
7537 hardcode_minus_L=$hardcode_minus_L
7538
7539 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7540 # the resulting binary.
7541 hardcode_shlibpath_var=$hardcode_shlibpath_var
7542
7543 # Variables whose values should be saved in libtool wrapper scripts and
7544 # restored at relink time.
7545 variables_saved_for_relink="$variables_saved_for_relink"
7546
7547 # Whether libtool must link a program against all its dependency libraries.
7548 link_all_deplibs=$link_all_deplibs
7549
7550 # Compile-time system search path for libraries
7551 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
7552
7553 # Run-time system search path for libraries
7554 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
7555
7556 # Fix the shell variable \$srcfile for the compiler.
7557 fix_srcfile_path="$fix_srcfile_path"
7558
7559 # Set to yes if exported symbols are required.
7560 always_export_symbols=$always_export_symbols
7561
7562 # The commands to list exported symbols.
7563 export_symbols_cmds=$lt_export_symbols_cmds
7564
7565 # The commands to extract the exported symbol list from a shared archive.
7566 extract_expsyms_cmds=$lt_extract_expsyms_cmds
7567
7568 # Symbols that should not be listed in the preloaded symbols.
7569 exclude_expsyms=$lt_exclude_expsyms
7570
7571 # Symbols that must always be exported.
7572 include_expsyms=$lt_include_expsyms
7573
7574 # ### END LIBTOOL CONFIG
7575
7576 __EOF__
7577
7578   case $host_os in
7579   aix3*)
7580     cat <<\EOF >> "${ofile}T"
7581
7582 # AIX sometimes has problems with the GCC collect2 program.  For some
7583 # reason, if we set the COLLECT_NAMES environment variable, the problems
7584 # vanish in a puff of smoke.
7585 if test "X${COLLECT_NAMES+set}" != Xset; then
7586   COLLECT_NAMES=
7587   export COLLECT_NAMES
7588 fi
7589 EOF
7590     ;;
7591   esac
7592
7593   case $host_os in
7594   cygwin* | mingw* | pw32* | os2*)
7595     cat <<'EOF' >> "${ofile}T"
7596       # This is a source program that is used to create dlls on Windows
7597       # Don't remove nor modify the starting and closing comments
7598 # /* ltdll.c starts here */
7599 # #define WIN32_LEAN_AND_MEAN
7600 # #include <windows.h>
7601 # #undef WIN32_LEAN_AND_MEAN
7602 # #include <stdio.h>
7603 #
7604 # #ifndef __CYGWIN__
7605 # #  ifdef __CYGWIN32__
7606 # #    define __CYGWIN__ __CYGWIN32__
7607 # #  endif
7608 # #endif
7609 #
7610 # #ifdef __cplusplus
7611 # extern "C" {
7612 # #endif
7613 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7614 # #ifdef __cplusplus
7615 # }
7616 # #endif
7617 #
7618 # #ifdef __CYGWIN__
7619 # #include <cygwin/cygwin_dll.h>
7620 # DECLARE_CYGWIN_DLL( DllMain );
7621 # #endif
7622 # HINSTANCE __hDllInstance_base;
7623 #
7624 # BOOL APIENTRY
7625 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7626 # {
7627 #   __hDllInstance_base = hInst;
7628 #   return TRUE;
7629 # }
7630 # /* ltdll.c ends here */
7631         # This is a source program that is used to create import libraries
7632         # on Windows for dlls which lack them. Don't remove nor modify the
7633         # starting and closing comments
7634 # /* impgen.c starts here */
7635 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
7636 #
7637 #  This file is part of GNU libtool.
7638 #
7639 #  This program is free software; you can redistribute it and/or modify
7640 #  it under the terms of the GNU General Public License as published by
7641 #  the Free Software Foundation; either version 2 of the License, or
7642 #  (at your option) any later version.
7643 #
7644 #  This program is distributed in the hope that it will be useful,
7645 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7646 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7647 #  GNU General Public License for more details.
7648 #
7649 #  You should have received a copy of the GNU General Public License
7650 #  along with this program; if not, write to the Free Software
7651 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7652 #  */
7653 #
7654 # #include <stdio.h>            /* for printf() */
7655 # #include <unistd.h>           /* for open(), lseek(), read() */
7656 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
7657 # #include <string.h>           /* for strdup() */
7658 #
7659 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
7660 # #ifndef O_BINARY
7661 # #define O_BINARY 0
7662 # #endif
7663 #
7664 # static unsigned int
7665 # pe_get16 (fd, offset)
7666 #      int fd;
7667 #      int offset;
7668 # {
7669 #   unsigned char b[2];
7670 #   lseek (fd, offset, SEEK_SET);
7671 #   read (fd, b, 2);
7672 #   return b[0] + (b[1]<<8);
7673 # }
7674 #
7675 # static unsigned int
7676 # pe_get32 (fd, offset)
7677 #     int fd;
7678 #     int offset;
7679 # {
7680 #   unsigned char b[4];
7681 #   lseek (fd, offset, SEEK_SET);
7682 #   read (fd, b, 4);
7683 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7684 # }
7685 #
7686 # static unsigned int
7687 # pe_as32 (ptr)
7688 #      void *ptr;
7689 # {
7690 #   unsigned char *b = ptr;
7691 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
7692 # }
7693 #
7694 # int
7695 # main (argc, argv)
7696 #     int argc;
7697 #     char *argv[];
7698 # {
7699 #     int dll;
7700 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
7701 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
7702 #     unsigned long name_rvas, nexp;
7703 #     unsigned char *expdata, *erva;
7704 #     char *filename, *dll_name;
7705 #
7706 #     filename = argv[1];
7707 #
7708 #     dll = open(filename, O_RDONLY|O_BINARY);
7709 #     if (dll < 1)
7710 #       return 1;
7711 #
7712 #     dll_name = filename;
7713 #
7714 #     for (i=0; filename[i]; i++)
7715 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
7716 #           dll_name = filename + i +1;
7717 #
7718 #     pe_header_offset = pe_get32 (dll, 0x3c);
7719 #     opthdr_ofs = pe_header_offset + 4 + 20;
7720 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
7721 #
7722 #     if (num_entries < 1) /* no exports */
7723 #       return 1;
7724 #
7725 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
7726 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
7727 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
7728 #     secptr = (pe_header_offset + 4 + 20 +
7729 #             pe_get16 (dll, pe_header_offset + 4 + 16));
7730 #
7731 #     expptr = 0;
7732 #     for (i = 0; i < nsections; i++)
7733 #     {
7734 #       char sname[8];
7735 #       unsigned long secptr1 = secptr + 40 * i;
7736 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
7737 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
7738 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
7739 #       lseek(dll, secptr1, SEEK_SET);
7740 #       read(dll, sname, 8);
7741 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
7742 #       {
7743 #           expptr = fptr + (export_rva - vaddr);
7744 #           if (export_rva + export_size > vaddr + vsize)
7745 #               export_size = vsize - (export_rva - vaddr);
7746 #           break;
7747 #       }
7748 #     }
7749 #
7750 #     expdata = (unsigned char*)malloc(export_size);
7751 #     lseek (dll, expptr, SEEK_SET);
7752 #     read (dll, expdata, export_size);
7753 #     erva = expdata - export_rva;
7754 #
7755 #     nexp = pe_as32 (expdata+24);
7756 #     name_rvas = pe_as32 (expdata+32);
7757 #
7758 #     printf ("EXPORTS\n");
7759 #     for (i = 0; i<nexp; i++)
7760 #     {
7761 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
7762 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
7763 #     }
7764 #
7765 #     return 0;
7766 # }
7767 # /* impgen.c ends here */
7768
7769 EOF
7770     ;;
7771   esac
7772
7773   # We use sed instead of cat because bash on DJGPP gets confused if
7774   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7775   # text mode, it properly converts lines to CR/LF.  This bash problem
7776   # is reportedly fixed, but why not run on old versions too?
7777   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
7778
7779   mv -f "${ofile}T" "$ofile" || \
7780     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
7781   chmod +x "$ofile"
7782 fi
7783 ##
7784 ## END FIXME
7785
7786
7787
7788
7789
7790 # This can be used to rebuild libtool when needed
7791 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7792
7793 # Always use our own libtool.
7794 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7795
7796 # Prevent multiple expansion
7797
7798
7799
7800 for ac_prog in mawk gawk nawk awk
7801 do
7802 # Extract the first word of "$ac_prog", so it can be a program name with args.
7803 set dummy $ac_prog; ac_word=$2
7804 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7805 echo "configure:7806: checking for $ac_word" >&5
7806 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
7807   echo $ac_n "(cached) $ac_c" 1>&6
7808 else
7809   if test -n "$AWK"; then
7810   ac_cv_prog_AWK="$AWK" # Let the user override the test.
7811 else
7812   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7813   ac_dummy="$PATH"
7814   for ac_dir in $ac_dummy; do
7815     test -z "$ac_dir" && ac_dir=.
7816     if test -f $ac_dir/$ac_word; then
7817       ac_cv_prog_AWK="$ac_prog"
7818       break
7819     fi
7820   done
7821   IFS="$ac_save_ifs"
7822 fi
7823 fi
7824 AWK="$ac_cv_prog_AWK"
7825 if test -n "$AWK"; then
7826   echo "$ac_t""$AWK" 1>&6
7827 else
7828   echo "$ac_t""no" 1>&6
7829 fi
7830
7831 test -n "$AWK" && break
7832 done
7833
7834 # test for ln hardlink support
7835 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
7836 echo "configure:7837: checking whether ln works" >&5
7837 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
7838   echo $ac_n "(cached) $ac_c" 1>&6
7839 else
7840   rm -f conftest.src conftest.dst
7841 echo "conftest" > conftest.src
7842 if ln conftest.src conftest.dst 2>/dev/null
7843 then
7844   ol_cv_prog_LN_H="ln"
7845 else
7846   ol_cv_prog_LN_H="cp"
7847 fi
7848 rm -f conftest.src conftest.dst
7849
7850 fi
7851 LN_H="$ol_cv_prog_LN_H"
7852 if test "$ol_cv_prog_LN_H" = "ln"; then
7853         echo "$ac_t""yes" 1>&6
7854 else
7855         echo "$ac_t""no" 1>&6
7856 fi
7857
7858 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
7859 echo "configure:7860: checking whether ln -s works" >&5
7860 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
7861   echo $ac_n "(cached) $ac_c" 1>&6
7862 else
7863   rm -f conftestdata
7864 if ln -s X conftestdata 2>/dev/null
7865 then
7866   rm -f conftestdata
7867   ac_cv_prog_LN_S="ln -s"
7868 else
7869   ac_cv_prog_LN_S=ln
7870 fi
7871 fi
7872 LN_S="$ac_cv_prog_LN_S"
7873 if test "$ac_cv_prog_LN_S" = "ln -s"; then
7874   echo "$ac_t""yes" 1>&6
7875 else
7876   echo "$ac_t""no" 1>&6
7877 fi
7878
7879
7880 # Extract the first word of "sendmail", so it can be a program name with args.
7881 set dummy sendmail; ac_word=$2
7882 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7883 echo "configure:7884: checking for $ac_word" >&5
7884 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
7885   echo $ac_n "(cached) $ac_c" 1>&6
7886 else
7887   case "$SENDMAIL" in
7888   /*)
7889   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
7890   ;;
7891   ?:/*)
7892   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
7893   ;;
7894   *)
7895   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7896   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
7897   for ac_dir in $ac_dummy; do 
7898     test -z "$ac_dir" && ac_dir=.
7899     if test -f $ac_dir/$ac_word; then
7900       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
7901       break
7902     fi
7903   done
7904   IFS="$ac_save_ifs"
7905   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
7906   ;;
7907 esac
7908 fi
7909 SENDMAIL="$ac_cv_path_SENDMAIL"
7910 if test -n "$SENDMAIL"; then
7911   echo "$ac_t""$SENDMAIL" 1>&6
7912 else
7913   echo "$ac_t""no" 1>&6
7914 fi
7915
7916 # Extract the first word of "vi", so it can be a program name with args.
7917 set dummy vi; ac_word=$2
7918 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7919 echo "configure:7920: checking for $ac_word" >&5
7920 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
7921   echo $ac_n "(cached) $ac_c" 1>&6
7922 else
7923   case "$EDITOR" in
7924   /*)
7925   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
7926   ;;
7927   ?:/*)
7928   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
7929   ;;
7930   *)
7931   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7932   ac_dummy="$PATH:/usr/ucb"
7933   for ac_dir in $ac_dummy; do 
7934     test -z "$ac_dir" && ac_dir=.
7935     if test -f $ac_dir/$ac_word; then
7936       ac_cv_path_EDITOR="$ac_dir/$ac_word"
7937       break
7938     fi
7939   done
7940   IFS="$ac_save_ifs"
7941   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
7942   ;;
7943 esac
7944 fi
7945 EDITOR="$ac_cv_path_EDITOR"
7946 if test -n "$EDITOR"; then
7947   echo "$ac_t""$EDITOR" 1>&6
7948 else
7949   echo "$ac_t""no" 1>&6
7950 fi
7951
7952
7953 ol_link_perl=no
7954 if test $ol_enable_perl != no ; then
7955         # Extract the first word of "perl", so it can be a program name with args.
7956 set dummy perl; ac_word=$2
7957 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7958 echo "configure:7959: checking for $ac_word" >&5
7959 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
7960   echo $ac_n "(cached) $ac_c" 1>&6
7961 else
7962   case "$PERLBIN" in
7963   /*)
7964   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
7965   ;;
7966   ?:/*)
7967   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
7968   ;;
7969   *)
7970   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7971   ac_dummy="$PATH"
7972   for ac_dir in $ac_dummy; do 
7973     test -z "$ac_dir" && ac_dir=.
7974     if test -f $ac_dir/$ac_word; then
7975       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
7976       break
7977     fi
7978   done
7979   IFS="$ac_save_ifs"
7980   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
7981   ;;
7982 esac
7983 fi
7984 PERLBIN="$ac_cv_path_PERLBIN"
7985 if test -n "$PERLBIN"; then
7986   echo "$ac_t""$PERLBIN" 1>&6
7987 else
7988   echo "$ac_t""no" 1>&6
7989 fi
7990
7991
7992         if test "no$PERLBIN" = "no" ; then
7993                 if test $ol_enable_perl = yes ; then
7994                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
7995                 fi
7996
7997         else
7998                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
7999                 if test x"$ol_with_perl_module" = "xstatic" ; then
8000                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
8001                 else
8002                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
8003                 fi
8004                                 ol_link_perl=yes
8005         fi
8006 fi
8007
8008 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
8009 echo "configure:8010: checking how to run the C preprocessor" >&5
8010 # On Suns, sometimes $CPP names a directory.
8011 if test -n "$CPP" && test -d "$CPP"; then
8012   CPP=
8013 fi
8014 if test -z "$CPP"; then
8015 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
8016   echo $ac_n "(cached) $ac_c" 1>&6
8017 else
8018     # This must be in double quotes, not single quotes, because CPP may get
8019   # substituted into the Makefile and "${CC-cc}" will confuse make.
8020   CPP="${CC-cc} -E"
8021   # On the NeXT, cc -E runs the code through the compiler's parser,
8022   # not just through cpp.
8023   cat > conftest.$ac_ext <<EOF
8024 #line 8025 "configure"
8025 #include "confdefs.h"
8026 #include <assert.h>
8027 Syntax Error
8028 EOF
8029 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8030 { (eval echo configure:8031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8031 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8032 if test -z "$ac_err"; then
8033   :
8034 else
8035   echo "$ac_err" >&5
8036   echo "configure: failed program was:" >&5
8037   cat conftest.$ac_ext >&5
8038   rm -rf conftest*
8039   CPP="${CC-cc} -E -traditional-cpp"
8040   cat > conftest.$ac_ext <<EOF
8041 #line 8042 "configure"
8042 #include "confdefs.h"
8043 #include <assert.h>
8044 Syntax Error
8045 EOF
8046 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8047 { (eval echo configure:8048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8048 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8049 if test -z "$ac_err"; then
8050   :
8051 else
8052   echo "$ac_err" >&5
8053   echo "configure: failed program was:" >&5
8054   cat conftest.$ac_ext >&5
8055   rm -rf conftest*
8056   CPP="${CC-cc} -nologo -E"
8057   cat > conftest.$ac_ext <<EOF
8058 #line 8059 "configure"
8059 #include "confdefs.h"
8060 #include <assert.h>
8061 Syntax Error
8062 EOF
8063 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8064 { (eval echo configure:8065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8065 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8066 if test -z "$ac_err"; then
8067   :
8068 else
8069   echo "$ac_err" >&5
8070   echo "configure: failed program was:" >&5
8071   cat conftest.$ac_ext >&5
8072   rm -rf conftest*
8073   CPP=/lib/cpp
8074 fi
8075 rm -f conftest*
8076 fi
8077 rm -f conftest*
8078 fi
8079 rm -f conftest*
8080   ac_cv_prog_CPP="$CPP"
8081 fi
8082   CPP="$ac_cv_prog_CPP"
8083 else
8084   ac_cv_prog_CPP="$CPP"
8085 fi
8086 echo "$ac_t""$CPP" 1>&6
8087
8088
8089 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
8090         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
8091
8092 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
8093         echo "configure: warning: programs compiled here do run here..." 1>&2
8094         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
8095
8096 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
8097         echo "configure: warning: programs compiled here do not run here..." 1>&2
8098         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
8099 fi
8100
8101
8102 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
8103 echo "configure:8104: checking for Cygwin environment" >&5
8104 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
8105   echo $ac_n "(cached) $ac_c" 1>&6
8106 else
8107   cat > conftest.$ac_ext <<EOF
8108 #line 8109 "configure"
8109 #include "confdefs.h"
8110
8111 int main() {
8112
8113 #ifndef __CYGWIN__
8114 #define __CYGWIN__ __CYGWIN32__
8115 #endif
8116 return __CYGWIN__;
8117 ; return 0; }
8118 EOF
8119 if { (eval echo configure:8120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8120   rm -rf conftest*
8121   ac_cv_cygwin=yes
8122 else
8123   echo "configure: failed program was:" >&5
8124   cat conftest.$ac_ext >&5
8125   rm -rf conftest*
8126   ac_cv_cygwin=no
8127 fi
8128 rm -f conftest*
8129 fi
8130
8131 echo "$ac_t""$ac_cv_cygwin" 1>&6
8132 CYGWIN=
8133 test "$ac_cv_cygwin" = yes && CYGWIN=yes
8134 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
8135 echo "configure:8136: checking for mingw32 environment" >&5
8136 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
8137   echo $ac_n "(cached) $ac_c" 1>&6
8138 else
8139   cat > conftest.$ac_ext <<EOF
8140 #line 8141 "configure"
8141 #include "confdefs.h"
8142
8143 int main() {
8144 return __MINGW32__;
8145 ; return 0; }
8146 EOF
8147 if { (eval echo configure:8148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8148   rm -rf conftest*
8149   ac_cv_mingw32=yes
8150 else
8151   echo "configure: failed program was:" >&5
8152   cat conftest.$ac_ext >&5
8153   rm -rf conftest*
8154   ac_cv_mingw32=no
8155 fi
8156 rm -f conftest*
8157 fi
8158
8159 echo "$ac_t""$ac_cv_mingw32" 1>&6
8160 MINGW32=
8161 test "$ac_cv_mingw32" = yes && MINGW32=yes
8162
8163
8164
8165 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
8166 echo "configure:8167: checking for executable suffix" >&5
8167 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
8168   echo $ac_n "(cached) $ac_c" 1>&6
8169 else
8170   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
8171   ac_cv_exeext=.exe
8172 else
8173   rm -f conftest*
8174   echo 'int main () { return 0; }' > conftest.$ac_ext
8175   ac_cv_exeext=
8176   if { (eval echo configure:8177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
8177     for file in conftest.*; do
8178       case $file in
8179       *.c | *.C | *.o | *.obj | *.xcoff) ;;
8180       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
8181       esac
8182     done
8183   else
8184     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
8185   fi
8186   rm -f conftest*
8187   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
8188 fi
8189 fi
8190
8191 EXEEXT=""
8192 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
8193 echo "$ac_t""${ac_cv_exeext}" 1>&6
8194 ac_exeext=$EXEEXT
8195
8196 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
8197 echo "configure:8198: checking for object suffix" >&5
8198 if eval "test \"\${ac_cv_objext+set}\" = set"; then
8199   echo $ac_n "(cached) $ac_c" 1>&6
8200 else
8201   rm -f conftest*
8202 echo 'int i = 1;' > conftest.$ac_ext
8203 if { (eval echo configure:8204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8204   for ac_file in conftest.*; do
8205     case $ac_file in
8206     *.c) ;;
8207     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
8208     esac
8209   done
8210 else
8211   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
8212 fi
8213 rm -f conftest*
8214 fi
8215
8216 echo "$ac_t""$ac_cv_objext" 1>&6
8217 OBJEXT=$ac_cv_objext
8218 ac_objext=$ac_cv_objext
8219
8220
8221 cat >> confdefs.h <<EOF
8222 #define EXEEXT "${EXEEXT}"
8223 EOF
8224
8225
8226 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
8227 echo "configure:8228: checking for be_app in -lbe" >&5
8228 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
8229 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8230   echo $ac_n "(cached) $ac_c" 1>&6
8231 else
8232   ac_save_LIBS="$LIBS"
8233 LIBS="-lbe -lroot -lnet $LIBS"
8234 cat > conftest.$ac_ext <<EOF
8235 #line 8236 "configure"
8236 #include "confdefs.h"
8237 /* Override any gcc2 internal prototype to avoid an error.  */
8238 /* We use char because int might match the return type of a gcc2
8239     builtin and then its argument prototype would still apply.  */
8240 char be_app();
8241
8242 int main() {
8243 be_app()
8244 ; return 0; }
8245 EOF
8246 if { (eval echo configure:8247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8247   rm -rf conftest*
8248   eval "ac_cv_lib_$ac_lib_var=yes"
8249 else
8250   echo "configure: failed program was:" >&5
8251   cat conftest.$ac_ext >&5
8252   rm -rf conftest*
8253   eval "ac_cv_lib_$ac_lib_var=no"
8254 fi
8255 rm -f conftest*
8256 LIBS="$ac_save_LIBS"
8257
8258 fi
8259 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8260   echo "$ac_t""yes" 1>&6
8261   LIBS="$LIBS -lbe -lroot -lnet"
8262 else
8263   echo "$ac_t""no" 1>&6
8264 :
8265 fi
8266
8267
8268
8269
8270
8271 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
8272 echo "configure:8273: checking for ${CC-cc} option to accept ANSI C" >&5
8273 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
8274   echo $ac_n "(cached) $ac_c" 1>&6
8275 else
8276   am_cv_prog_cc_stdc=no
8277 ac_save_CC="$CC"
8278 # Don't try gcc -ansi; that turns off useful extensions and
8279 # breaks some systems' header files.
8280 # AIX                   -qlanglvl=ansi
8281 # Ultrix and OSF/1      -std1
8282 # HP-UX 10.20 and later -Ae
8283 # HP-UX older versions  -Aa -D_HPUX_SOURCE
8284 # SVR4                  -Xc -D__EXTENSIONS__
8285 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
8286 do
8287   CC="$ac_save_CC $ac_arg"
8288   cat > conftest.$ac_ext <<EOF
8289 #line 8290 "configure"
8290 #include "confdefs.h"
8291 #include <stdarg.h>
8292 #include <stdio.h>
8293 #include <sys/types.h>
8294 #include <sys/stat.h>
8295 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
8296 struct buf { int x; };
8297 FILE * (*rcsopen) (struct buf *, struct stat *, int);
8298 static char *e (p, i)
8299      char **p;
8300      int i;
8301 {
8302   return p[i];
8303 }
8304 static char *f (char * (*g) (char **, int), char **p, ...)
8305 {
8306   char *s;
8307   va_list v;
8308   va_start (v,p);
8309   s = g (p, va_arg (v,int));
8310   va_end (v);
8311   return s;
8312 }
8313 int test (int i, double x);
8314 struct s1 {int (*f) (int a);};
8315 struct s2 {int (*f) (double a);};
8316 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
8317 int argc;
8318 char **argv;
8319
8320 int main() {
8321
8322 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
8323
8324 ; return 0; }
8325 EOF
8326 if { (eval echo configure:8327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8327   rm -rf conftest*
8328   am_cv_prog_cc_stdc="$ac_arg"; break
8329 else
8330   echo "configure: failed program was:" >&5
8331   cat conftest.$ac_ext >&5
8332 fi
8333 rm -f conftest*
8334 done
8335 CC="$ac_save_CC"
8336
8337 fi
8338
8339 if test -z "$am_cv_prog_cc_stdc"; then
8340   echo "$ac_t""none needed" 1>&6
8341 else
8342   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
8343 fi
8344 case "x$am_cv_prog_cc_stdc" in
8345   x|xno) ;;
8346   *) CC="$CC $am_cv_prog_cc_stdc" ;;
8347 esac
8348
8349 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
8350         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
8351 fi
8352
8353 # test for make depend flag
8354 OL_MKDEP=
8355 OL_MKDEP_FLAGS=
8356 if test -z "${MKDEP}"; then
8357         OL_MKDEP="${CC-cc}"
8358         if test -z "${MKDEP_FLAGS}"; then
8359                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
8360 echo "configure:8361: checking for ${OL_MKDEP} depend flag" >&5
8361 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
8362   echo $ac_n "(cached) $ac_c" 1>&6
8363 else
8364   
8365                         ol_cv_mkdep=no
8366                         for flag in "-M" "-xM"; do
8367                                 cat > conftest.c <<EOF
8368  noCode;
8369 EOF
8370                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
8371                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
8372                                 then
8373                                         if test ! -f conftest."${ac_object}" ; then
8374                                                 ol_cv_mkdep=$flag
8375                                                 OL_MKDEP_FLAGS="$flag"
8376                                                 break
8377                                         fi
8378                                 fi
8379                         done
8380                         rm -f conftest*
8381                 
8382 fi
8383
8384 echo "$ac_t""$ol_cv_mkdep" 1>&6
8385         else
8386                 cc_cv_mkdep=yes
8387                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8388         fi
8389 else
8390         cc_cv_mkdep=yes
8391         OL_MKDEP="${MKDEP}"
8392         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
8393 fi
8394
8395
8396
8397 if test "${ol_cv_mkdep}" = no ; then
8398         # this will soon become an error
8399         echo "configure: warning: do not know how to generate dependencies" 1>&2
8400 fi
8401
8402 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
8403 echo "configure:8404: checking for afopen in -ls" >&5
8404 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
8405 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8406   echo $ac_n "(cached) $ac_c" 1>&6
8407 else
8408   ac_save_LIBS="$LIBS"
8409 LIBS="-ls  $LIBS"
8410 cat > conftest.$ac_ext <<EOF
8411 #line 8412 "configure"
8412 #include "confdefs.h"
8413 /* Override any gcc2 internal prototype to avoid an error.  */
8414 /* We use char because int might match the return type of a gcc2
8415     builtin and then its argument prototype would still apply.  */
8416 char afopen();
8417
8418 int main() {
8419 afopen()
8420 ; return 0; }
8421 EOF
8422 if { (eval echo configure:8423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8423   rm -rf conftest*
8424   eval "ac_cv_lib_$ac_lib_var=yes"
8425 else
8426   echo "configure: failed program was:" >&5
8427   cat conftest.$ac_ext >&5
8428   rm -rf conftest*
8429   eval "ac_cv_lib_$ac_lib_var=no"
8430 fi
8431 rm -f conftest*
8432 LIBS="$ac_save_LIBS"
8433
8434 fi
8435 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8436   echo "$ac_t""yes" 1>&6
8437   
8438         AUTH_LIBS=-ls
8439         cat >> confdefs.h <<\EOF
8440 #define HAVE_AIX_SECURITY 1
8441 EOF
8442
8443
8444 else
8445   echo "$ac_t""no" 1>&6
8446 fi
8447
8448
8449 case "$target" in
8450 *-ibm-openedition)
8451         ac_cv_func_getopt=no
8452         cat >> confdefs.h <<\EOF
8453 #define BOTH_STRINGS_H 1
8454 EOF
8455
8456         ;;
8457 esac
8458
8459 ol_link_modules=no
8460 if test $ol_enable_modules != no ; then
8461         for ac_hdr in ltdl.h
8462 do
8463 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8464 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8465 echo "configure:8466: checking for $ac_hdr" >&5
8466 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
8467   echo $ac_n "(cached) $ac_c" 1>&6
8468 else
8469   cat > conftest.$ac_ext <<EOF
8470 #line 8471 "configure"
8471 #include "confdefs.h"
8472 #include <$ac_hdr>
8473 EOF
8474 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8475 { (eval echo configure:8476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8476 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8477 if test -z "$ac_err"; then
8478   rm -rf conftest*
8479   eval "ac_cv_header_$ac_safe=yes"
8480 else
8481   echo "$ac_err" >&5
8482   echo "configure: failed program was:" >&5
8483   cat conftest.$ac_ext >&5
8484   rm -rf conftest*
8485   eval "ac_cv_header_$ac_safe=no"
8486 fi
8487 rm -f conftest*
8488 fi
8489 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8490   echo "$ac_t""yes" 1>&6
8491     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8492   cat >> confdefs.h <<EOF
8493 #define $ac_tr_hdr 1
8494 EOF
8495  
8496 else
8497   echo "$ac_t""no" 1>&6
8498 fi
8499 done
8500
8501
8502         if test $ac_cv_header_ltdl_h = no ; then
8503                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
8504         fi
8505
8506         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
8507 echo "configure:8508: checking for lt_dlinit in -lltdl" >&5
8508 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
8509 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8510   echo $ac_n "(cached) $ac_c" 1>&6
8511 else
8512   ac_save_LIBS="$LIBS"
8513 LIBS="-lltdl  $LIBS"
8514 cat > conftest.$ac_ext <<EOF
8515 #line 8516 "configure"
8516 #include "confdefs.h"
8517 /* Override any gcc2 internal prototype to avoid an error.  */
8518 /* We use char because int might match the return type of a gcc2
8519     builtin and then its argument prototype would still apply.  */
8520 char lt_dlinit();
8521
8522 int main() {
8523 lt_dlinit()
8524 ; return 0; }
8525 EOF
8526 if { (eval echo configure:8527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8527   rm -rf conftest*
8528   eval "ac_cv_lib_$ac_lib_var=yes"
8529 else
8530   echo "configure: failed program was:" >&5
8531   cat conftest.$ac_ext >&5
8532   rm -rf conftest*
8533   eval "ac_cv_lib_$ac_lib_var=no"
8534 fi
8535 rm -f conftest*
8536 LIBS="$ac_save_LIBS"
8537
8538 fi
8539 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8540   echo "$ac_t""yes" 1>&6
8541   
8542                 MODULES_LIBS=-lltdl
8543                 cat >> confdefs.h <<\EOF
8544 #define HAVE_LIBLTDL 1
8545 EOF
8546
8547         
8548 else
8549   echo "$ac_t""no" 1>&6
8550 fi
8551
8552
8553         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
8554                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
8555         fi
8556         ol_link_modules=yes
8557 else
8558         ol_with_bdb_module=static
8559         ol_with_dnssrv_module=static
8560         ol_with_ldap_module=static
8561         ol_with_ldbm_module=static
8562         ol_with_meta_module=static
8563         ol_with_monitor_module=static
8564         ol_with_null_module=static
8565         ol_with_passwd_module=static
8566         ol_with_perl_module=static
8567         ol_with_shell_module=static
8568         ol_with_sql_module=static
8569 fi
8570
8571 # test for EBCDIC
8572 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
8573 echo "configure:8574: checking for EBCDIC" >&5
8574 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
8575   echo $ac_n "(cached) $ac_c" 1>&6
8576 else
8577   
8578         cat > conftest.$ac_ext <<EOF
8579 #line 8580 "configure"
8580 #include "confdefs.h"
8581
8582 #if !('M' == 0xd4)
8583 #include <__ASCII__/generate_error.h>
8584 #endif
8585
8586 EOF
8587 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8588 { (eval echo configure:8589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8589 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8590 if test -z "$ac_err"; then
8591   rm -rf conftest*
8592   ol_cv_cpp_ebcdic=yes
8593 else
8594   echo "$ac_err" >&5
8595   echo "configure: failed program was:" >&5
8596   cat conftest.$ac_ext >&5
8597   rm -rf conftest*
8598   ol_cv_cpp_ebcdic=no
8599 fi
8600 rm -f conftest*
8601 fi
8602
8603 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
8604 if test $ol_cv_cpp_ebcdic = yes ; then
8605         cat >> confdefs.h <<\EOF
8606 #define HAVE_EBCDIC 1
8607 EOF
8608
8609 fi
8610
8611 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8612 echo "configure:8613: checking for ANSI C header files" >&5
8613 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
8614   echo $ac_n "(cached) $ac_c" 1>&6
8615 else
8616   cat > conftest.$ac_ext <<EOF
8617 #line 8618 "configure"
8618 #include "confdefs.h"
8619 #include <stdlib.h>
8620 #include <stdarg.h>
8621 #include <string.h>
8622 #include <float.h>
8623 EOF
8624 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8625 { (eval echo configure:8626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8626 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8627 if test -z "$ac_err"; then
8628   rm -rf conftest*
8629   ol_cv_header_stdc=yes
8630 else
8631   echo "$ac_err" >&5
8632   echo "configure: failed program was:" >&5
8633   cat conftest.$ac_ext >&5
8634   rm -rf conftest*
8635   ol_cv_header_stdc=no
8636 fi
8637 rm -f conftest*
8638
8639 if test $ol_cv_header_stdc = yes; then
8640   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8641 cat > conftest.$ac_ext <<EOF
8642 #line 8643 "configure"
8643 #include "confdefs.h"
8644 #include <string.h>
8645 EOF
8646 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8647   egrep "memchr" >/dev/null 2>&1; then
8648   :
8649 else
8650   rm -rf conftest*
8651   ol_cv_header_stdc=no
8652 fi
8653 rm -f conftest*
8654
8655 fi
8656
8657 if test $ol_cv_header_stdc = yes; then
8658   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8659 cat > conftest.$ac_ext <<EOF
8660 #line 8661 "configure"
8661 #include "confdefs.h"
8662 #include <stdlib.h>
8663 EOF
8664 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8665   egrep "free" >/dev/null 2>&1; then
8666   :
8667 else
8668   rm -rf conftest*
8669   ol_cv_header_stdc=no
8670 fi
8671 rm -f conftest*
8672
8673 fi
8674
8675 if test $ol_cv_header_stdc = yes; then
8676   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8677 if test "$cross_compiling" = yes; then
8678   :
8679 else
8680   cat > conftest.$ac_ext <<EOF
8681 #line 8682 "configure"
8682 #include "confdefs.h"
8683 #include <ctype.h>
8684 #ifndef HAVE_EBCDIC
8685 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8686 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8687 #else
8688 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
8689                 || ('j' <= (c) && (c) <= 'r') \
8690                 || ('s' <= (c) && (c) <= 'z'))
8691 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
8692 #endif
8693 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8694 int main () { int i; for (i = 0; i < 256; i++)
8695 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8696 exit (0); }
8697
8698 EOF
8699 if { (eval echo configure:8700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8700 then
8701   :
8702 else
8703   echo "configure: failed program was:" >&5
8704   cat conftest.$ac_ext >&5
8705   rm -fr conftest*
8706   ol_cv_header_stdc=no
8707 fi
8708 rm -fr conftest*
8709 fi
8710
8711 fi
8712 fi
8713
8714 echo "$ac_t""$ol_cv_header_stdc" 1>&6
8715 if test $ol_cv_header_stdc = yes; then
8716   cat >> confdefs.h <<\EOF
8717 #define STDC_HEADERS 1
8718 EOF
8719
8720 fi
8721 ac_cv_header_stdc=disable
8722
8723
8724 if test $ol_cv_header_stdc != yes; then
8725         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
8726 fi
8727
8728 ac_header_dirent=no
8729 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8730 do
8731 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8732 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8733 echo "configure:8734: checking for $ac_hdr that defines DIR" >&5
8734 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
8735   echo $ac_n "(cached) $ac_c" 1>&6
8736 else
8737   cat > conftest.$ac_ext <<EOF
8738 #line 8739 "configure"
8739 #include "confdefs.h"
8740 #include <sys/types.h>
8741 #include <$ac_hdr>
8742 int main() {
8743 DIR *dirp = 0;
8744 ; return 0; }
8745 EOF
8746 if { (eval echo configure:8747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8747   rm -rf conftest*
8748   eval "ac_cv_header_dirent_$ac_safe=yes"
8749 else
8750   echo "configure: failed program was:" >&5
8751   cat conftest.$ac_ext >&5
8752   rm -rf conftest*
8753   eval "ac_cv_header_dirent_$ac_safe=no"
8754 fi
8755 rm -f conftest*
8756 fi
8757 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8758   echo "$ac_t""yes" 1>&6
8759     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8760   cat >> confdefs.h <<EOF
8761 #define $ac_tr_hdr 1
8762 EOF
8763  ac_header_dirent=$ac_hdr; break
8764 else
8765   echo "$ac_t""no" 1>&6
8766 fi
8767 done
8768 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8769 if test $ac_header_dirent = dirent.h; then
8770 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8771 echo "configure:8772: checking for opendir in -ldir" >&5
8772 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
8773 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8774   echo $ac_n "(cached) $ac_c" 1>&6
8775 else
8776   ac_save_LIBS="$LIBS"
8777 LIBS="-ldir  $LIBS"
8778 cat > conftest.$ac_ext <<EOF
8779 #line 8780 "configure"
8780 #include "confdefs.h"
8781 /* Override any gcc2 internal prototype to avoid an error.  */
8782 /* We use char because int might match the return type of a gcc2
8783     builtin and then its argument prototype would still apply.  */
8784 char opendir();
8785
8786 int main() {
8787 opendir()
8788 ; return 0; }
8789 EOF
8790 if { (eval echo configure:8791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8791   rm -rf conftest*
8792   eval "ac_cv_lib_$ac_lib_var=yes"
8793 else
8794   echo "configure: failed program was:" >&5
8795   cat conftest.$ac_ext >&5
8796   rm -rf conftest*
8797   eval "ac_cv_lib_$ac_lib_var=no"
8798 fi
8799 rm -f conftest*
8800 LIBS="$ac_save_LIBS"
8801
8802 fi
8803 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8804   echo "$ac_t""yes" 1>&6
8805   LIBS="$LIBS -ldir"
8806 else
8807   echo "$ac_t""no" 1>&6
8808 fi
8809
8810 else
8811 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8812 echo "configure:8813: checking for opendir in -lx" >&5
8813 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
8814 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
8815   echo $ac_n "(cached) $ac_c" 1>&6
8816 else
8817   ac_save_LIBS="$LIBS"
8818 LIBS="-lx  $LIBS"
8819 cat > conftest.$ac_ext <<EOF
8820 #line 8821 "configure"
8821 #include "confdefs.h"
8822 /* Override any gcc2 internal prototype to avoid an error.  */
8823 /* We use char because int might match the return type of a gcc2
8824     builtin and then its argument prototype would still apply.  */
8825 char opendir();
8826
8827 int main() {
8828 opendir()
8829 ; return 0; }
8830 EOF
8831 if { (eval echo configure:8832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8832   rm -rf conftest*
8833   eval "ac_cv_lib_$ac_lib_var=yes"
8834 else
8835   echo "configure: failed program was:" >&5
8836   cat conftest.$ac_ext >&5
8837   rm -rf conftest*
8838   eval "ac_cv_lib_$ac_lib_var=no"
8839 fi
8840 rm -f conftest*
8841 LIBS="$ac_save_LIBS"
8842
8843 fi
8844 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8845   echo "$ac_t""yes" 1>&6
8846   LIBS="$LIBS -lx"
8847 else
8848   echo "$ac_t""no" 1>&6
8849 fi
8850
8851 fi
8852
8853 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8854 echo "configure:8855: checking for sys/wait.h that is POSIX.1 compatible" >&5
8855 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
8856   echo $ac_n "(cached) $ac_c" 1>&6
8857 else
8858   cat > conftest.$ac_ext <<EOF
8859 #line 8860 "configure"
8860 #include "confdefs.h"
8861 #include <sys/types.h>
8862 #include <sys/wait.h>
8863 #ifndef WEXITSTATUS
8864 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8865 #endif
8866 #ifndef WIFEXITED
8867 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8868 #endif
8869 int main() {
8870 int s;
8871 wait (&s);
8872 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8873 ; return 0; }
8874 EOF
8875 if { (eval echo configure:8876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8876   rm -rf conftest*
8877   ac_cv_header_sys_wait_h=yes
8878 else
8879   echo "configure: failed program was:" >&5
8880   cat conftest.$ac_ext >&5
8881   rm -rf conftest*
8882   ac_cv_header_sys_wait_h=no
8883 fi
8884 rm -f conftest*
8885 fi
8886
8887 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8888 if test $ac_cv_header_sys_wait_h = yes; then
8889   cat >> confdefs.h <<\EOF
8890 #define HAVE_SYS_WAIT_H 1
8891 EOF
8892
8893 fi
8894
8895 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8896 echo "configure:8897: checking POSIX termios" >&5
8897 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
8898   echo $ac_n "(cached) $ac_c" 1>&6
8899 else
8900   cat > conftest.$ac_ext <<EOF
8901 #line 8902 "configure"
8902 #include "confdefs.h"
8903 #include <sys/types.h>
8904 #include <unistd.h>
8905 #include <termios.h>
8906 int main() {
8907 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8908    tcgetattr(0, 0);
8909 ; return 0; }
8910 EOF
8911 if { (eval echo configure:8912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8912   rm -rf conftest*
8913   am_cv_sys_posix_termios=yes
8914 else
8915   echo "configure: failed program was:" >&5
8916   cat conftest.$ac_ext >&5
8917   rm -rf conftest*
8918   am_cv_sys_posix_termios=no
8919 fi
8920 rm -f conftest*
8921 fi
8922
8923 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8924
8925
8926  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8927 echo "configure:8928: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8928 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
8929   echo $ac_n "(cached) $ac_c" 1>&6
8930 else
8931   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8932
8933   gwinsz_in_termios_h=no
8934   if test $am_cv_sys_posix_termios = yes; then
8935     cat > conftest.$ac_ext <<EOF
8936 #line 8937 "configure"
8937 #include "confdefs.h"
8938 #include <sys/types.h>
8939 #     include <termios.h>
8940 #     ifdef TIOCGWINSZ
8941         yes
8942 #     endif
8943     
8944 EOF
8945 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8946   egrep "yes" >/dev/null 2>&1; then
8947   rm -rf conftest*
8948   gwinsz_in_termios_h=yes
8949 fi
8950 rm -f conftest*
8951
8952   fi
8953
8954   if test $gwinsz_in_termios_h = no; then
8955     cat > conftest.$ac_ext <<EOF
8956 #line 8957 "configure"
8957 #include "confdefs.h"
8958 #include <sys/types.h>
8959 #     include <sys/ioctl.h>
8960 #     ifdef TIOCGWINSZ
8961         yes
8962 #     endif
8963     
8964 EOF
8965 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8966   egrep "yes" >/dev/null 2>&1; then
8967   rm -rf conftest*
8968   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8969 fi
8970 rm -f conftest*
8971
8972   fi
8973   
8974 fi
8975
8976 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8977   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8978     cat >> confdefs.h <<\EOF
8979 #define GWINSZ_IN_SYS_IOCTL 1
8980 EOF
8981
8982   fi
8983
8984 if test $am_cv_sys_posix_termios = yes ; then
8985         cat >> confdefs.h <<\EOF
8986 #define HAVE_POSIX_TERMIOS 1
8987 EOF
8988
8989 fi
8990
8991 for ac_hdr in \
8992         arpa/inet.h             \
8993         arpa/nameser.h  \
8994         assert.h                \
8995         conio.h                 \
8996         crypt.h                 \
8997         direct.h                \
8998         errno.h                 \
8999         fcntl.h                 \
9000         filio.h                 \
9001         getopt.h                \
9002         grp.h                   \
9003         io.h                    \
9004         libutil.h               \
9005         limits.h                \
9006         locale.h                \
9007         netinet/tcp.h   \
9008         malloc.h                \
9009         memory.h                \
9010         psap.h                  \
9011         pwd.h                   \
9012         process.h               \
9013         resolv.h                \
9014         sgtty.h                 \
9015         shadow.h                \
9016         stddef.h                \
9017         string.h                \
9018         strings.h               \
9019         sysexits.h              \
9020         sys/file.h              \
9021         sys/filio.h             \
9022         sys/errno.h             \
9023         sys/ioctl.h             \
9024         sys/param.h             \
9025         sys/resource.h  \
9026         sys/select.h    \
9027         sys/socket.h    \
9028         sys/syslog.h    \
9029         sys/time.h              \
9030         sys/types.h             \
9031         syslog.h                \
9032         termios.h               \
9033         unistd.h                \
9034         winsock.h               \
9035         winsock2.h              \
9036
9037 do
9038 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9039 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9040 echo "configure:9041: checking for $ac_hdr" >&5
9041 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9042   echo $ac_n "(cached) $ac_c" 1>&6
9043 else
9044   cat > conftest.$ac_ext <<EOF
9045 #line 9046 "configure"
9046 #include "confdefs.h"
9047 #include <$ac_hdr>
9048 EOF
9049 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9050 { (eval echo configure:9051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9051 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9052 if test -z "$ac_err"; then
9053   rm -rf conftest*
9054   eval "ac_cv_header_$ac_safe=yes"
9055 else
9056   echo "$ac_err" >&5
9057   echo "configure: failed program was:" >&5
9058   cat conftest.$ac_ext >&5
9059   rm -rf conftest*
9060   eval "ac_cv_header_$ac_safe=no"
9061 fi
9062 rm -f conftest*
9063 fi
9064 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9065   echo "$ac_t""yes" 1>&6
9066     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9067   cat >> confdefs.h <<EOF
9068 #define $ac_tr_hdr 1
9069 EOF
9070  
9071 else
9072   echo "$ac_t""no" 1>&6
9073 fi
9074 done
9075
9076
9077
9078
9079 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
9080 echo "configure:9081: checking for dlopen" >&5
9081 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
9082   echo $ac_n "(cached) $ac_c" 1>&6
9083 else
9084   cat > conftest.$ac_ext <<EOF
9085 #line 9086 "configure"
9086 #include "confdefs.h"
9087 /* System header to define __stub macros and hopefully few prototypes,
9088     which can conflict with char dlopen(); below.  */
9089 #include <assert.h>
9090 /* Override any gcc2 internal prototype to avoid an error.  */
9091 /* We use char because int might match the return type of a gcc2
9092     builtin and then its argument prototype would still apply.  */
9093 char dlopen();
9094 char (*f)();
9095
9096 int main() {
9097
9098 /* The GNU C library defines this for functions which it implements
9099     to always fail with ENOSYS.  Some functions are actually named
9100     something starting with __ and the normal name is an alias.  */
9101 #if defined (__stub_dlopen) || defined (__stub___dlopen)
9102 choke me
9103 #else
9104 f = dlopen;
9105 #endif
9106
9107 ; return 0; }
9108 EOF
9109 if { (eval echo configure:9110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9110   rm -rf conftest*
9111   eval "ac_cv_func_dlopen=yes"
9112 else
9113   echo "configure: failed program was:" >&5
9114   cat conftest.$ac_ext >&5
9115   rm -rf conftest*
9116   eval "ac_cv_func_dlopen=no"
9117 fi
9118 rm -f conftest*
9119 fi
9120
9121 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
9122   echo "$ac_t""yes" 1>&6
9123   :
9124 else
9125   echo "$ac_t""no" 1>&6
9126 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
9127 echo "configure:9128: checking for dlopen in -ldl" >&5
9128 ac_lib_var=`echo dl'_'dlopen | 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="-ldl  $LIBS"
9134 cat > conftest.$ac_ext <<EOF
9135 #line 9136 "configure"
9136 #include "confdefs.h"
9137 /* Override any gcc2 internal prototype to avoid an error.  */
9138 /* We use char because int might match the return type of a gcc2
9139     builtin and then its argument prototype would still apply.  */
9140 char dlopen();
9141
9142 int main() {
9143 dlopen()
9144 ; return 0; }
9145 EOF
9146 if { (eval echo configure:9147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9147   rm -rf conftest*
9148   eval "ac_cv_lib_$ac_lib_var=yes"
9149 else
9150   echo "configure: failed program was:" >&5
9151   cat conftest.$ac_ext >&5
9152   rm -rf conftest*
9153   eval "ac_cv_lib_$ac_lib_var=no"
9154 fi
9155 rm -f conftest*
9156 LIBS="$ac_save_LIBS"
9157
9158 fi
9159 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9160   echo "$ac_t""yes" 1>&6
9161     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9162     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9163   cat >> confdefs.h <<EOF
9164 #define $ac_tr_lib 1
9165 EOF
9166
9167   LIBS="-ldl $LIBS"
9168
9169 else
9170   echo "$ac_t""no" 1>&6
9171 fi
9172
9173 fi
9174
9175
9176 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
9177 echo "configure:9178: checking for sigset in -lV3" >&5
9178 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
9179 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9180   echo $ac_n "(cached) $ac_c" 1>&6
9181 else
9182   ac_save_LIBS="$LIBS"
9183 LIBS="-lV3  $LIBS"
9184 cat > conftest.$ac_ext <<EOF
9185 #line 9186 "configure"
9186 #include "confdefs.h"
9187 /* Override any gcc2 internal prototype to avoid an error.  */
9188 /* We use char because int might match the return type of a gcc2
9189     builtin and then its argument prototype would still apply.  */
9190 char sigset();
9191
9192 int main() {
9193 sigset()
9194 ; return 0; }
9195 EOF
9196 if { (eval echo configure:9197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9197   rm -rf conftest*
9198   eval "ac_cv_lib_$ac_lib_var=yes"
9199 else
9200   echo "configure: failed program was:" >&5
9201   cat conftest.$ac_ext >&5
9202   rm -rf conftest*
9203   eval "ac_cv_lib_$ac_lib_var=no"
9204 fi
9205 rm -f conftest*
9206 LIBS="$ac_save_LIBS"
9207
9208 fi
9209 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9210   echo "$ac_t""yes" 1>&6
9211     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9212     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9213   cat >> confdefs.h <<EOF
9214 #define $ac_tr_lib 1
9215 EOF
9216
9217   LIBS="-lV3 $LIBS"
9218
9219 else
9220   echo "$ac_t""no" 1>&6
9221 fi
9222
9223
9224 echo $ac_n "checking for winsock""... $ac_c" 1>&6
9225 echo "configure:9226: checking for winsock" >&5
9226 save_LIBS="$LIBS"
9227 for curlib in ws2_32 wsock32; do
9228         LIBS="$LIBS -l$curlib"
9229         cat > conftest.$ac_ext <<EOF
9230 #line 9231 "configure"
9231 #include "confdefs.h"
9232
9233                         char socket@12();
9234                         char select@20();
9235                         char closesocket@4();
9236                         char gethostname@8();
9237                         
9238 int main() {
9239
9240                         socket@12();
9241                         select@20();
9242                         closesocket@4();
9243                         gethostname@8();
9244                         
9245 ; return 0; }
9246 EOF
9247 if { (eval echo configure:9248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9248   rm -rf conftest*
9249   have_winsock=yes
9250 else
9251   echo "configure: failed program was:" >&5
9252   cat conftest.$ac_ext >&5
9253   rm -rf conftest*
9254   have_winsock=no
9255 fi
9256 rm -f conftest*
9257
9258         if test $have_winsock = yes; then
9259                 cat >> confdefs.h <<\EOF
9260 #define HAVE_WINSOCK 1
9261 EOF
9262
9263                 ac_cv_func_socket=yes
9264                 ac_cv_func_select=yes
9265                 ac_cv_func_closesocket=yes
9266                 ac_cv_func_gethostname=yes
9267                 if test $curlib = ws2_32; then
9268                         have_winsock=winsock2
9269                         cat >> confdefs.h <<\EOF
9270 #define HAVE_WINSOCK2 1
9271 EOF
9272
9273                 fi
9274                 break
9275         fi
9276         LIBS="$save_LIBS"
9277 done
9278 echo "$ac_t""$have_winsock" 1>&6
9279
9280
9281 echo $ac_n "checking for socket""... $ac_c" 1>&6
9282 echo "configure:9283: checking for socket" >&5
9283 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
9284   echo $ac_n "(cached) $ac_c" 1>&6
9285 else
9286   cat > conftest.$ac_ext <<EOF
9287 #line 9288 "configure"
9288 #include "confdefs.h"
9289 /* System header to define __stub macros and hopefully few prototypes,
9290     which can conflict with char socket(); below.  */
9291 #include <assert.h>
9292 /* Override any gcc2 internal prototype to avoid an error.  */
9293 /* We use char because int might match the return type of a gcc2
9294     builtin and then its argument prototype would still apply.  */
9295 char socket();
9296 char (*f)();
9297
9298 int main() {
9299
9300 /* The GNU C library defines this for functions which it implements
9301     to always fail with ENOSYS.  Some functions are actually named
9302     something starting with __ and the normal name is an alias.  */
9303 #if defined (__stub_socket) || defined (__stub___socket)
9304 choke me
9305 #else
9306 f = socket;
9307 #endif
9308
9309 ; return 0; }
9310 EOF
9311 if { (eval echo configure:9312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9312   rm -rf conftest*
9313   eval "ac_cv_func_socket=yes"
9314 else
9315   echo "configure: failed program was:" >&5
9316   cat conftest.$ac_ext >&5
9317   rm -rf conftest*
9318   eval "ac_cv_func_socket=no"
9319 fi
9320 rm -f conftest*
9321 fi
9322
9323 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
9324   echo "$ac_t""yes" 1>&6
9325   :
9326 else
9327   echo "$ac_t""no" 1>&6
9328         
9329         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
9330 echo "configure:9331: checking for main in -lsocket" >&5
9331 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
9332 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9333   echo $ac_n "(cached) $ac_c" 1>&6
9334 else
9335   ac_save_LIBS="$LIBS"
9336 LIBS="-lsocket  $LIBS"
9337 cat > conftest.$ac_ext <<EOF
9338 #line 9339 "configure"
9339 #include "confdefs.h"
9340
9341 int main() {
9342 main()
9343 ; return 0; }
9344 EOF
9345 if { (eval echo configure:9346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9346   rm -rf conftest*
9347   eval "ac_cv_lib_$ac_lib_var=yes"
9348 else
9349   echo "configure: failed program was:" >&5
9350   cat conftest.$ac_ext >&5
9351   rm -rf conftest*
9352   eval "ac_cv_lib_$ac_lib_var=no"
9353 fi
9354 rm -f conftest*
9355 LIBS="$ac_save_LIBS"
9356
9357 fi
9358 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9359   echo "$ac_t""yes" 1>&6
9360     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9361     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9362   cat >> confdefs.h <<EOF
9363 #define $ac_tr_lib 1
9364 EOF
9365
9366   LIBS="-lsocket $LIBS"
9367
9368 else
9369   echo "$ac_t""no" 1>&6
9370 fi
9371
9372         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
9373 echo "configure:9374: checking for main in -lnet" >&5
9374 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
9375 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9376   echo $ac_n "(cached) $ac_c" 1>&6
9377 else
9378   ac_save_LIBS="$LIBS"
9379 LIBS="-lnet  $LIBS"
9380 cat > conftest.$ac_ext <<EOF
9381 #line 9382 "configure"
9382 #include "confdefs.h"
9383
9384 int main() {
9385 main()
9386 ; return 0; }
9387 EOF
9388 if { (eval echo configure:9389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9389   rm -rf conftest*
9390   eval "ac_cv_lib_$ac_lib_var=yes"
9391 else
9392   echo "configure: failed program was:" >&5
9393   cat conftest.$ac_ext >&5
9394   rm -rf conftest*
9395   eval "ac_cv_lib_$ac_lib_var=no"
9396 fi
9397 rm -f conftest*
9398 LIBS="$ac_save_LIBS"
9399
9400 fi
9401 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9402   echo "$ac_t""yes" 1>&6
9403     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9404     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9405   cat >> confdefs.h <<EOF
9406 #define $ac_tr_lib 1
9407 EOF
9408
9409   LIBS="-lnet $LIBS"
9410
9411 else
9412   echo "$ac_t""no" 1>&6
9413 fi
9414
9415         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
9416 echo "configure:9417: checking for main in -lnsl_s" >&5
9417 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
9418 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9419   echo $ac_n "(cached) $ac_c" 1>&6
9420 else
9421   ac_save_LIBS="$LIBS"
9422 LIBS="-lnsl_s  $LIBS"
9423 cat > conftest.$ac_ext <<EOF
9424 #line 9425 "configure"
9425 #include "confdefs.h"
9426
9427 int main() {
9428 main()
9429 ; return 0; }
9430 EOF
9431 if { (eval echo configure:9432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9432   rm -rf conftest*
9433   eval "ac_cv_lib_$ac_lib_var=yes"
9434 else
9435   echo "configure: failed program was:" >&5
9436   cat conftest.$ac_ext >&5
9437   rm -rf conftest*
9438   eval "ac_cv_lib_$ac_lib_var=no"
9439 fi
9440 rm -f conftest*
9441 LIBS="$ac_save_LIBS"
9442
9443 fi
9444 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9445   echo "$ac_t""yes" 1>&6
9446     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9447     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9448   cat >> confdefs.h <<EOF
9449 #define $ac_tr_lib 1
9450 EOF
9451
9452   LIBS="-lnsl_s $LIBS"
9453
9454 else
9455   echo "$ac_t""no" 1>&6
9456 fi
9457
9458         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
9459 echo "configure:9460: checking for main in -lnsl" >&5
9460 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
9461 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9462   echo $ac_n "(cached) $ac_c" 1>&6
9463 else
9464   ac_save_LIBS="$LIBS"
9465 LIBS="-lnsl  $LIBS"
9466 cat > conftest.$ac_ext <<EOF
9467 #line 9468 "configure"
9468 #include "confdefs.h"
9469
9470 int main() {
9471 main()
9472 ; return 0; }
9473 EOF
9474 if { (eval echo configure:9475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9475   rm -rf conftest*
9476   eval "ac_cv_lib_$ac_lib_var=yes"
9477 else
9478   echo "configure: failed program was:" >&5
9479   cat conftest.$ac_ext >&5
9480   rm -rf conftest*
9481   eval "ac_cv_lib_$ac_lib_var=no"
9482 fi
9483 rm -f conftest*
9484 LIBS="$ac_save_LIBS"
9485
9486 fi
9487 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9488   echo "$ac_t""yes" 1>&6
9489     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9490     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9491   cat >> confdefs.h <<EOF
9492 #define $ac_tr_lib 1
9493 EOF
9494
9495   LIBS="-lnsl $LIBS"
9496
9497 else
9498   echo "$ac_t""no" 1>&6
9499 fi
9500
9501         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
9502 echo "configure:9503: checking for socket in -linet" >&5
9503 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
9504 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9505   echo $ac_n "(cached) $ac_c" 1>&6
9506 else
9507   ac_save_LIBS="$LIBS"
9508 LIBS="-linet  $LIBS"
9509 cat > conftest.$ac_ext <<EOF
9510 #line 9511 "configure"
9511 #include "confdefs.h"
9512 /* Override any gcc2 internal prototype to avoid an error.  */
9513 /* We use char because int might match the return type of a gcc2
9514     builtin and then its argument prototype would still apply.  */
9515 char socket();
9516
9517 int main() {
9518 socket()
9519 ; return 0; }
9520 EOF
9521 if { (eval echo configure:9522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9522   rm -rf conftest*
9523   eval "ac_cv_lib_$ac_lib_var=yes"
9524 else
9525   echo "configure: failed program was:" >&5
9526   cat conftest.$ac_ext >&5
9527   rm -rf conftest*
9528   eval "ac_cv_lib_$ac_lib_var=no"
9529 fi
9530 rm -f conftest*
9531 LIBS="$ac_save_LIBS"
9532
9533 fi
9534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9535   echo "$ac_t""yes" 1>&6
9536     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9537     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9538   cat >> confdefs.h <<EOF
9539 #define $ac_tr_lib 1
9540 EOF
9541
9542   LIBS="-linet $LIBS"
9543
9544 else
9545   echo "$ac_t""no" 1>&6
9546 fi
9547
9548         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
9549 echo "configure:9550: checking for main in -lgen" >&5
9550 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
9551 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9552   echo $ac_n "(cached) $ac_c" 1>&6
9553 else
9554   ac_save_LIBS="$LIBS"
9555 LIBS="-lgen  $LIBS"
9556 cat > conftest.$ac_ext <<EOF
9557 #line 9558 "configure"
9558 #include "confdefs.h"
9559
9560 int main() {
9561 main()
9562 ; return 0; }
9563 EOF
9564 if { (eval echo configure:9565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9565   rm -rf conftest*
9566   eval "ac_cv_lib_$ac_lib_var=yes"
9567 else
9568   echo "configure: failed program was:" >&5
9569   cat conftest.$ac_ext >&5
9570   rm -rf conftest*
9571   eval "ac_cv_lib_$ac_lib_var=no"
9572 fi
9573 rm -f conftest*
9574 LIBS="$ac_save_LIBS"
9575
9576 fi
9577 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9578   echo "$ac_t""yes" 1>&6
9579     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9580     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9581   cat >> confdefs.h <<EOF
9582 #define $ac_tr_lib 1
9583 EOF
9584
9585   LIBS="-lgen $LIBS"
9586
9587 else
9588   echo "$ac_t""no" 1>&6
9589 fi
9590
9591
9592 fi
9593
9594
9595 echo $ac_n "checking for select""... $ac_c" 1>&6
9596 echo "configure:9597: checking for select" >&5
9597 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
9598   echo $ac_n "(cached) $ac_c" 1>&6
9599 else
9600   cat > conftest.$ac_ext <<EOF
9601 #line 9602 "configure"
9602 #include "confdefs.h"
9603 /* System header to define __stub macros and hopefully few prototypes,
9604     which can conflict with char select(); below.  */
9605 #include <assert.h>
9606 /* Override any gcc2 internal prototype to avoid an error.  */
9607 /* We use char because int might match the return type of a gcc2
9608     builtin and then its argument prototype would still apply.  */
9609 char select();
9610 char (*f)();
9611
9612 int main() {
9613
9614 /* The GNU C library defines this for functions which it implements
9615     to always fail with ENOSYS.  Some functions are actually named
9616     something starting with __ and the normal name is an alias.  */
9617 #if defined (__stub_select) || defined (__stub___select)
9618 choke me
9619 #else
9620 f = select;
9621 #endif
9622
9623 ; return 0; }
9624 EOF
9625 if { (eval echo configure:9626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9626   rm -rf conftest*
9627   eval "ac_cv_func_select=yes"
9628 else
9629   echo "configure: failed program was:" >&5
9630   cat conftest.$ac_ext >&5
9631   rm -rf conftest*
9632   eval "ac_cv_func_select=no"
9633 fi
9634 rm -f conftest*
9635 fi
9636
9637 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
9638   echo "$ac_t""yes" 1>&6
9639   :
9640 else
9641   echo "$ac_t""no" 1>&6
9642 { echo "configure: error: select() required." 1>&2; exit 1; }
9643 fi
9644
9645
9646 if test "${ac_cv_header_winsock_h}" != yes; then
9647                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
9648 echo "configure:9649: checking types of arguments for select()" >&5
9649  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
9650   echo $ac_n "(cached) $ac_c" 1>&6
9651 else
9652    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
9653   echo $ac_n "(cached) $ac_c" 1>&6
9654 else
9655     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
9656   echo $ac_n "(cached) $ac_c" 1>&6
9657 else
9658      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
9659      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
9660       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
9661        cat > conftest.$ac_ext <<EOF
9662 #line 9663 "configure"
9663 #include "confdefs.h"
9664 #ifdef HAVE_SYS_TYPES_H
9665 #include <sys/types.h>
9666 #endif
9667 #ifdef HAVE_SYS_TIME_H
9668 #include <sys/time.h>
9669 #endif
9670 #ifdef HAVE_SYS_SELECT_H
9671 #include <sys/select.h>
9672 #endif
9673 #ifdef HAVE_SYS_SOCKET_H
9674 #include <sys/socket.h>
9675 #endif
9676 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);
9677 int main() {
9678
9679 ; return 0; }
9680 EOF
9681 if { (eval echo configure:9682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9682   rm -rf conftest*
9683           ac_not_found=no ; break 3
9684 else
9685   echo "configure: failed program was:" >&5
9686   cat conftest.$ac_ext >&5
9687   rm -rf conftest*
9688   ac_not_found=yes
9689 fi
9690 rm -f conftest*
9691       done
9692      done
9693     done
9694    
9695 fi
9696   
9697 fi
9698  
9699 fi
9700  if test "$ac_not_found" = yes; then
9701   ac_cv_func_select_arg1=int 
9702   ac_cv_func_select_arg234='int *' 
9703   ac_cv_func_select_arg5='struct timeval *'
9704  fi
9705  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
9706  cat >> confdefs.h <<EOF
9707 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
9708 EOF
9709
9710  cat >> confdefs.h <<EOF
9711 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
9712 EOF
9713
9714  cat >> confdefs.h <<EOF
9715 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
9716 EOF
9717
9718
9719 fi
9720
9721
9722 for ac_hdr in regex.h 
9723 do
9724 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9725 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9726 echo "configure:9727: checking for $ac_hdr" >&5
9727 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9728   echo $ac_n "(cached) $ac_c" 1>&6
9729 else
9730   cat > conftest.$ac_ext <<EOF
9731 #line 9732 "configure"
9732 #include "confdefs.h"
9733 #include <$ac_hdr>
9734 EOF
9735 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9736 { (eval echo configure:9737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9737 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9738 if test -z "$ac_err"; then
9739   rm -rf conftest*
9740   eval "ac_cv_header_$ac_safe=yes"
9741 else
9742   echo "$ac_err" >&5
9743   echo "configure: failed program was:" >&5
9744   cat conftest.$ac_ext >&5
9745   rm -rf conftest*
9746   eval "ac_cv_header_$ac_safe=no"
9747 fi
9748 rm -f conftest*
9749 fi
9750 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9751   echo "$ac_t""yes" 1>&6
9752     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9753   cat >> confdefs.h <<EOF
9754 #define $ac_tr_hdr 1
9755 EOF
9756  
9757 else
9758   echo "$ac_t""no" 1>&6
9759 fi
9760 done
9761
9762 if test "$ac_cv_header_regex_h" != yes ; then
9763         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
9764 fi
9765
9766 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
9767 echo "configure:9768: checking for library containing regfree" >&5
9768 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
9769   echo $ac_n "(cached) $ac_c" 1>&6
9770 else
9771   ac_func_search_save_LIBS="$LIBS"
9772 ac_cv_search_regfree="no"
9773 cat > conftest.$ac_ext <<EOF
9774 #line 9775 "configure"
9775 #include "confdefs.h"
9776 /* Override any gcc2 internal prototype to avoid an error.  */
9777 /* We use char because int might match the return type of a gcc2
9778     builtin and then its argument prototype would still apply.  */
9779 char regfree();
9780
9781 int main() {
9782 regfree()
9783 ; return 0; }
9784 EOF
9785 if { (eval echo configure:9786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9786   rm -rf conftest*
9787   ac_cv_search_regfree="none required"
9788 else
9789   echo "configure: failed program was:" >&5
9790   cat conftest.$ac_ext >&5
9791 fi
9792 rm -f conftest*
9793 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
9794 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9795 cat > conftest.$ac_ext <<EOF
9796 #line 9797 "configure"
9797 #include "confdefs.h"
9798 /* Override any gcc2 internal prototype to avoid an error.  */
9799 /* We use char because int might match the return type of a gcc2
9800     builtin and then its argument prototype would still apply.  */
9801 char regfree();
9802
9803 int main() {
9804 regfree()
9805 ; return 0; }
9806 EOF
9807 if { (eval echo configure:9808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9808   rm -rf conftest*
9809   ac_cv_search_regfree="-l$ac_lib"
9810 break
9811 else
9812   echo "configure: failed program was:" >&5
9813   cat conftest.$ac_ext >&5
9814 fi
9815 rm -f conftest*
9816 done
9817 LIBS="$ac_func_search_save_LIBS"
9818 fi
9819
9820 echo "$ac_t""$ac_cv_search_regfree" 1>&6
9821 if test "$ac_cv_search_regfree" != "no"; then
9822   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
9823   :
9824 else :
9825   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
9826 fi
9827
9828
9829 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
9830 echo "configure:9831: checking for compatible POSIX regex" >&5
9831 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
9832   echo $ac_n "(cached) $ac_c" 1>&6
9833 else
9834   
9835         if test "$cross_compiling" = yes; then
9836   ol_cv_c_posix_regex=cross
9837 else
9838   cat > conftest.$ac_ext <<EOF
9839 #line 9840 "configure"
9840 #include "confdefs.h"
9841
9842 #include <sys/types.h>
9843 #include <regex.h>
9844 static char *pattern, *string;
9845 main()
9846 {
9847         int rc;
9848         regex_t re;
9849
9850         pattern = "^A";
9851
9852         if(regcomp(&re, pattern, 0)) {
9853                 return -1;
9854         }
9855         
9856         string = "ALL MATCH";
9857         
9858         rc = regexec(&re, string, 0, (void*)0, 0);
9859
9860         regfree(&re);
9861
9862         return rc;
9863 }
9864 EOF
9865 if { (eval echo configure:9866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9866 then
9867   ol_cv_c_posix_regex=yes
9868 else
9869   echo "configure: failed program was:" >&5
9870   cat conftest.$ac_ext >&5
9871   rm -fr conftest*
9872   ol_cv_c_posix_regex=no
9873 fi
9874 rm -fr conftest*
9875 fi
9876
9877 fi
9878
9879 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
9880
9881 if test "$ol_cv_c_posix_regex" = no ; then
9882         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
9883 fi
9884
9885
9886 have_uuid=no
9887 for ac_hdr in sys/uuid.h
9888 do
9889 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9890 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9891 echo "configure:9892: checking for $ac_hdr" >&5
9892 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
9893   echo $ac_n "(cached) $ac_c" 1>&6
9894 else
9895   cat > conftest.$ac_ext <<EOF
9896 #line 9897 "configure"
9897 #include "confdefs.h"
9898 #include <$ac_hdr>
9899 EOF
9900 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9901 { (eval echo configure:9902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9902 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9903 if test -z "$ac_err"; then
9904   rm -rf conftest*
9905   eval "ac_cv_header_$ac_safe=yes"
9906 else
9907   echo "$ac_err" >&5
9908   echo "configure: failed program was:" >&5
9909   cat conftest.$ac_ext >&5
9910   rm -rf conftest*
9911   eval "ac_cv_header_$ac_safe=no"
9912 fi
9913 rm -f conftest*
9914 fi
9915 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9916   echo "$ac_t""yes" 1>&6
9917     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9918   cat >> confdefs.h <<EOF
9919 #define $ac_tr_hdr 1
9920 EOF
9921  
9922 else
9923   echo "$ac_t""no" 1>&6
9924 fi
9925 done
9926
9927 if test $ac_cv_header_sys_uuid_h = yes ; then
9928         save_LIBS="$LIBS"
9929         
9930 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
9931 echo "configure:9932: checking for library containing uuid_to_str" >&5
9932 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
9933   echo $ac_n "(cached) $ac_c" 1>&6
9934 else
9935   ac_func_search_save_LIBS="$LIBS"
9936 ac_cv_search_uuid_to_str="no"
9937 cat > conftest.$ac_ext <<EOF
9938 #line 9939 "configure"
9939 #include "confdefs.h"
9940 /* Override any gcc2 internal prototype to avoid an error.  */
9941 /* We use char because int might match the return type of a gcc2
9942     builtin and then its argument prototype would still apply.  */
9943 char uuid_to_str();
9944
9945 int main() {
9946 uuid_to_str()
9947 ; return 0; }
9948 EOF
9949 if { (eval echo configure:9950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9950   rm -rf conftest*
9951   ac_cv_search_uuid_to_str="none required"
9952 else
9953   echo "configure: failed program was:" >&5
9954   cat conftest.$ac_ext >&5
9955 fi
9956 rm -f conftest*
9957 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
9958 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
9959 cat > conftest.$ac_ext <<EOF
9960 #line 9961 "configure"
9961 #include "confdefs.h"
9962 /* Override any gcc2 internal prototype to avoid an error.  */
9963 /* We use char because int might match the return type of a gcc2
9964     builtin and then its argument prototype would still apply.  */
9965 char uuid_to_str();
9966
9967 int main() {
9968 uuid_to_str()
9969 ; return 0; }
9970 EOF
9971 if { (eval echo configure:9972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9972   rm -rf conftest*
9973   ac_cv_search_uuid_to_str="-l$ac_lib"
9974 break
9975 else
9976   echo "configure: failed program was:" >&5
9977   cat conftest.$ac_ext >&5
9978 fi
9979 rm -f conftest*
9980 done
9981 LIBS="$ac_func_search_save_LIBS"
9982 fi
9983
9984 echo "$ac_t""$ac_cv_search_uuid_to_str" 1>&6
9985 if test "$ac_cv_search_uuid_to_str" != "no"; then
9986   test "$ac_cv_search_uuid_to_str" = "none required" || LIBS="$ac_cv_search_uuid_to_str $LIBS"
9987   have_uuid=yes
9988 else :
9989   :
9990 fi
9991         LIBS="$save_LIBS"
9992
9993         if test have_uuid = yes ; then
9994                 cat >> confdefs.h <<\EOF
9995 #define HAVE_UUID_TO_STR 1
9996 EOF
9997
9998
9999                 test "$ac_cv_search_uuid_to_str" = "none required" || \
10000                         SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
10001         fi
10002 fi
10003
10004 if test $have_uuid = no ; then
10005         echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
10006 echo "configure:10007: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
10007         save_LIBS="$LIBS"
10008         LIBS="$LIBS -lrpcrt4"
10009         cat > conftest.$ac_ext <<EOF
10010 #line 10011 "configure"
10011 #include "confdefs.h"
10012
10013                 char UuidCreate@4();
10014                 char UuidToStringA@8();
10015                 
10016 int main() {
10017
10018                 UuidCreate@4();
10019                 UuidToStringA@8();
10020                 
10021 ; return 0; }
10022 EOF
10023 if { (eval echo configure:10024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10024   rm -rf conftest*
10025   need_rpcrt=yes
10026 else
10027   echo "configure: failed program was:" >&5
10028   cat conftest.$ac_ext >&5
10029   rm -rf conftest*
10030   need_rpcrt=no
10031 fi
10032 rm -f conftest*
10033         if test $need_rpcrt = yes; then
10034                 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
10035         fi
10036         LIBS="$save_LIBS"
10037         echo "$ac_t""$need_rpcrt" 1>&6
10038 fi
10039
10040 ol_link_dnssrv=no
10041 echo $ac_n "checking for res_query""... $ac_c" 1>&6
10042 echo "configure:10043: checking for res_query" >&5
10043 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
10044   echo $ac_n "(cached) $ac_c" 1>&6
10045 else
10046   cat > conftest.$ac_ext <<EOF
10047 #line 10048 "configure"
10048 #include "confdefs.h"
10049 /* System header to define __stub macros and hopefully few prototypes,
10050     which can conflict with char res_query(); below.  */
10051 #include <assert.h>
10052 /* Override any gcc2 internal prototype to avoid an error.  */
10053 /* We use char because int might match the return type of a gcc2
10054     builtin and then its argument prototype would still apply.  */
10055 char res_query();
10056 char (*f)();
10057
10058 int main() {
10059
10060 /* The GNU C library defines this for functions which it implements
10061     to always fail with ENOSYS.  Some functions are actually named
10062     something starting with __ and the normal name is an alias.  */
10063 #if defined (__stub_res_query) || defined (__stub___res_query)
10064 choke me
10065 #else
10066 f = res_query;
10067 #endif
10068
10069 ; return 0; }
10070 EOF
10071 if { (eval echo configure:10072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10072   rm -rf conftest*
10073   eval "ac_cv_func_res_query=yes"
10074 else
10075   echo "configure: failed program was:" >&5
10076   cat conftest.$ac_ext >&5
10077   rm -rf conftest*
10078   eval "ac_cv_func_res_query=no"
10079 fi
10080 rm -f conftest*
10081 fi
10082
10083 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
10084   echo "$ac_t""yes" 1>&6
10085   :
10086 else
10087   echo "$ac_t""no" 1>&6
10088 fi
10089
10090 if test $ac_cv_func_res_query = no ; then 
10091         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
10092 echo "configure:10093: checking for __res_query" >&5
10093 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
10094   echo $ac_n "(cached) $ac_c" 1>&6
10095 else
10096   cat > conftest.$ac_ext <<EOF
10097 #line 10098 "configure"
10098 #include "confdefs.h"
10099 /* System header to define __stub macros and hopefully few prototypes,
10100     which can conflict with char __res_query(); below.  */
10101 #include <assert.h>
10102 /* Override any gcc2 internal prototype to avoid an error.  */
10103 /* We use char because int might match the return type of a gcc2
10104     builtin and then its argument prototype would still apply.  */
10105 char __res_query();
10106 char (*f)();
10107
10108 int main() {
10109
10110 /* The GNU C library defines this for functions which it implements
10111     to always fail with ENOSYS.  Some functions are actually named
10112     something starting with __ and the normal name is an alias.  */
10113 #if defined (__stub___res_query) || defined (__stub_____res_query)
10114 choke me
10115 #else
10116 f = __res_query;
10117 #endif
10118
10119 ; return 0; }
10120 EOF
10121 if { (eval echo configure:10122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10122   rm -rf conftest*
10123   eval "ac_cv_func___res_query=yes"
10124 else
10125   echo "configure: failed program was:" >&5
10126   cat conftest.$ac_ext >&5
10127   rm -rf conftest*
10128   eval "ac_cv_func___res_query=no"
10129 fi
10130 rm -f conftest*
10131 fi
10132
10133 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
10134   echo "$ac_t""yes" 1>&6
10135   :
10136 else
10137   echo "$ac_t""no" 1>&6
10138 fi
10139
10140         ac_cv_func_res_query=$ac_cv_func___res_query
10141 fi
10142
10143 if test $ac_cv_func_res_query = no ; then 
10144         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
10145 echo "configure:10146: checking for res_query in -lbind" >&5
10146 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
10147 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10148   echo $ac_n "(cached) $ac_c" 1>&6
10149 else
10150   ac_save_LIBS="$LIBS"
10151 LIBS="-lbind  $LIBS"
10152 cat > conftest.$ac_ext <<EOF
10153 #line 10154 "configure"
10154 #include "confdefs.h"
10155 /* Override any gcc2 internal prototype to avoid an error.  */
10156 /* We use char because int might match the return type of a gcc2
10157     builtin and then its argument prototype would still apply.  */
10158 char res_query();
10159
10160 int main() {
10161 res_query()
10162 ; return 0; }
10163 EOF
10164 if { (eval echo configure:10165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10165   rm -rf conftest*
10166   eval "ac_cv_lib_$ac_lib_var=yes"
10167 else
10168   echo "configure: failed program was:" >&5
10169   cat conftest.$ac_ext >&5
10170   rm -rf conftest*
10171   eval "ac_cv_lib_$ac_lib_var=no"
10172 fi
10173 rm -f conftest*
10174 LIBS="$ac_save_LIBS"
10175
10176 fi
10177 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10178   echo "$ac_t""yes" 1>&6
10179     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10180     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10181   cat >> confdefs.h <<EOF
10182 #define $ac_tr_lib 1
10183 EOF
10184
10185   LIBS="-lbind $LIBS"
10186
10187 else
10188   echo "$ac_t""no" 1>&6
10189 fi
10190
10191         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
10192 fi
10193
10194 if test $ac_cv_func_res_query = no ; then 
10195         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
10196 echo "configure:10197: checking for __res_query in -lbind" >&5
10197 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
10198 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10199   echo $ac_n "(cached) $ac_c" 1>&6
10200 else
10201   ac_save_LIBS="$LIBS"
10202 LIBS="-lbind  $LIBS"
10203 cat > conftest.$ac_ext <<EOF
10204 #line 10205 "configure"
10205 #include "confdefs.h"
10206 /* Override any gcc2 internal prototype to avoid an error.  */
10207 /* We use char because int might match the return type of a gcc2
10208     builtin and then its argument prototype would still apply.  */
10209 char __res_query();
10210
10211 int main() {
10212 __res_query()
10213 ; return 0; }
10214 EOF
10215 if { (eval echo configure:10216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10216   rm -rf conftest*
10217   eval "ac_cv_lib_$ac_lib_var=yes"
10218 else
10219   echo "configure: failed program was:" >&5
10220   cat conftest.$ac_ext >&5
10221   rm -rf conftest*
10222   eval "ac_cv_lib_$ac_lib_var=no"
10223 fi
10224 rm -f conftest*
10225 LIBS="$ac_save_LIBS"
10226
10227 fi
10228 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10229   echo "$ac_t""yes" 1>&6
10230     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10231     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10232   cat >> confdefs.h <<EOF
10233 #define $ac_tr_lib 1
10234 EOF
10235
10236   LIBS="-lbind $LIBS"
10237
10238 else
10239   echo "$ac_t""no" 1>&6
10240 fi
10241
10242         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
10243 fi
10244
10245 if test $ac_cv_func_res_query = no ; then 
10246         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
10247 echo "configure:10248: checking for res_query in -lresolv" >&5
10248 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
10249 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10250   echo $ac_n "(cached) $ac_c" 1>&6
10251 else
10252   ac_save_LIBS="$LIBS"
10253 LIBS="-lresolv  $LIBS"
10254 cat > conftest.$ac_ext <<EOF
10255 #line 10256 "configure"
10256 #include "confdefs.h"
10257 /* Override any gcc2 internal prototype to avoid an error.  */
10258 /* We use char because int might match the return type of a gcc2
10259     builtin and then its argument prototype would still apply.  */
10260 char res_query();
10261
10262 int main() {
10263 res_query()
10264 ; return 0; }
10265 EOF
10266 if { (eval echo configure:10267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10267   rm -rf conftest*
10268   eval "ac_cv_lib_$ac_lib_var=yes"
10269 else
10270   echo "configure: failed program was:" >&5
10271   cat conftest.$ac_ext >&5
10272   rm -rf conftest*
10273   eval "ac_cv_lib_$ac_lib_var=no"
10274 fi
10275 rm -f conftest*
10276 LIBS="$ac_save_LIBS"
10277
10278 fi
10279 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10280   echo "$ac_t""yes" 1>&6
10281     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10282     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10283   cat >> confdefs.h <<EOF
10284 #define $ac_tr_lib 1
10285 EOF
10286
10287   LIBS="-lresolv $LIBS"
10288
10289 else
10290   echo "$ac_t""no" 1>&6
10291 fi
10292
10293         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
10294 fi
10295
10296 if test $ac_cv_func_res_query = no ; then 
10297         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
10298 echo "configure:10299: checking for __res_query in -lresolv" >&5
10299 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
10300 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10301   echo $ac_n "(cached) $ac_c" 1>&6
10302 else
10303   ac_save_LIBS="$LIBS"
10304 LIBS="-lresolv  $LIBS"
10305 cat > conftest.$ac_ext <<EOF
10306 #line 10307 "configure"
10307 #include "confdefs.h"
10308 /* Override any gcc2 internal prototype to avoid an error.  */
10309 /* We use char because int might match the return type of a gcc2
10310     builtin and then its argument prototype would still apply.  */
10311 char __res_query();
10312
10313 int main() {
10314 __res_query()
10315 ; return 0; }
10316 EOF
10317 if { (eval echo configure:10318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10318   rm -rf conftest*
10319   eval "ac_cv_lib_$ac_lib_var=yes"
10320 else
10321   echo "configure: failed program was:" >&5
10322   cat conftest.$ac_ext >&5
10323   rm -rf conftest*
10324   eval "ac_cv_lib_$ac_lib_var=no"
10325 fi
10326 rm -f conftest*
10327 LIBS="$ac_save_LIBS"
10328
10329 fi
10330 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10331   echo "$ac_t""yes" 1>&6
10332     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
10333     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
10334   cat >> confdefs.h <<EOF
10335 #define $ac_tr_lib 1
10336 EOF
10337
10338   LIBS="-lresolv $LIBS"
10339
10340 else
10341   echo "$ac_t""no" 1>&6
10342 fi
10343
10344         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
10345 fi
10346
10347 if test "$ac_cv_func_res_query" = yes ; then
10348         cat >> confdefs.h <<\EOF
10349 #define HAVE_RES_QUERY 1
10350 EOF
10351
10352
10353         if test $ol_enable_dnssrv != no ; then
10354                 ol_link_dnssrv=yes
10355         fi
10356 fi
10357
10358 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
10359         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
10360 fi
10361
10362 for ac_func in getaddrinfo gai_strerror inet_ntop 
10363 do
10364 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10365 echo "configure:10366: checking for $ac_func" >&5
10366 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10367   echo $ac_n "(cached) $ac_c" 1>&6
10368 else
10369   cat > conftest.$ac_ext <<EOF
10370 #line 10371 "configure"
10371 #include "confdefs.h"
10372 /* System header to define __stub macros and hopefully few prototypes,
10373     which can conflict with char $ac_func(); below.  */
10374 #include <assert.h>
10375 /* Override any gcc2 internal prototype to avoid an error.  */
10376 /* We use char because int might match the return type of a gcc2
10377     builtin and then its argument prototype would still apply.  */
10378 char $ac_func();
10379 char (*f)();
10380
10381 int main() {
10382
10383 /* The GNU C library defines this for functions which it implements
10384     to always fail with ENOSYS.  Some functions are actually named
10385     something starting with __ and the normal name is an alias.  */
10386 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10387 choke me
10388 #else
10389 f = $ac_func;
10390 #endif
10391
10392 ; return 0; }
10393 EOF
10394 if { (eval echo configure:10395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10395   rm -rf conftest*
10396   eval "ac_cv_func_$ac_func=yes"
10397 else
10398   echo "configure: failed program was:" >&5
10399   cat conftest.$ac_ext >&5
10400   rm -rf conftest*
10401   eval "ac_cv_func_$ac_func=no"
10402 fi
10403 rm -f conftest*
10404 fi
10405
10406 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10407   echo "$ac_t""yes" 1>&6
10408     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10409   cat >> confdefs.h <<EOF
10410 #define $ac_tr_func 1
10411 EOF
10412  
10413 else
10414   echo "$ac_t""no" 1>&6
10415 fi
10416 done
10417
10418
10419 ol_link_ipv6=no
10420 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
10421         if test $ol_enable_ipv6 = yes ; then
10422                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
10423         fi
10424 elif test $ol_enable_ipv6 != no ; then
10425         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
10426 echo "configure:10427: checking INET6_ADDRSTRLEN" >&5
10427 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
10428   echo $ac_n "(cached) $ac_c" 1>&6
10429 else
10430   
10431                 cat > conftest.$ac_ext <<EOF
10432 #line 10433 "configure"
10433 #include "confdefs.h"
10434
10435 #                       include <netinet/in.h>
10436 #                       ifdef INET6_ADDRSTRLEN
10437                                 __has_inet6_addrstrlen__;
10438 #                       endif
10439                 
10440 EOF
10441 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10442   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
10443   rm -rf conftest*
10444   ol_cv_inet6_addrstrlen=yes
10445 else
10446   rm -rf conftest*
10447   ol_cv_inet6_addrstrlen=no
10448 fi
10449 rm -f conftest*
10450
10451 fi
10452
10453 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
10454
10455
10456         echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
10457 echo "configure:10458: checking struct sockaddr_storage" >&5
10458 if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
10459   echo $ac_n "(cached) $ac_c" 1>&6
10460 else
10461   
10462                 cat > conftest.$ac_ext <<EOF
10463 #line 10464 "configure"
10464 #include "confdefs.h"
10465
10466 #include <sys/types.h>
10467 #include <sys/socket.h>
10468
10469 int main() {
10470
10471                         struct sockaddr_storage ss;
10472
10473 ; return 0; }
10474 EOF
10475 if { (eval echo configure:10476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10476   rm -rf conftest*
10477   ol_cv_struct_sockaddr_storage=yes
10478 else
10479   echo "configure: failed program was:" >&5
10480   cat conftest.$ac_ext >&5
10481   rm -rf conftest*
10482   ol_cv_struct_sockaddr_storage=no
10483 fi
10484 rm -f conftest*
10485 fi
10486
10487 echo "$ac_t""$ol_cv_struct_sockaddr_storage" 1>&6
10488
10489         if test $ol_cv_inet6_addrstrlen = yes \
10490                 -a $ol_cv_struct_sockaddr_storage = yes ; then
10491                 ol_link_ipv6=yes
10492         elif test $ol_enable_ipv6 = yes \
10493                         -a $ol_cv_inet6_addrstrlen = no ; then
10494                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
10495         elif test $ol_enable_ipv6 = yes \
10496                         -a $ol_cv_struct_sockaddr_storage = no ; then
10497                 { echo "configure: error: IPv6 support requires struct sockaddr_storage" 1>&2; exit 1; }
10498         fi
10499 fi
10500
10501 if test $ol_enable_local != no ; then
10502         for ac_hdr in sys/un.h 
10503 do
10504 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10505 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10506 echo "configure:10507: checking for $ac_hdr" >&5
10507 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10508   echo $ac_n "(cached) $ac_c" 1>&6
10509 else
10510   cat > conftest.$ac_ext <<EOF
10511 #line 10512 "configure"
10512 #include "confdefs.h"
10513 #include <$ac_hdr>
10514 EOF
10515 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10516 { (eval echo configure:10517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10517 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10518 if test -z "$ac_err"; then
10519   rm -rf conftest*
10520   eval "ac_cv_header_$ac_safe=yes"
10521 else
10522   echo "$ac_err" >&5
10523   echo "configure: failed program was:" >&5
10524   cat conftest.$ac_ext >&5
10525   rm -rf conftest*
10526   eval "ac_cv_header_$ac_safe=no"
10527 fi
10528 rm -f conftest*
10529 fi
10530 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10531   echo "$ac_t""yes" 1>&6
10532     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10533   cat >> confdefs.h <<EOF
10534 #define $ac_tr_hdr 1
10535 EOF
10536  
10537 else
10538   echo "$ac_t""no" 1>&6
10539 fi
10540 done
10541
10542
10543         if test $ol_enable_local = auto ; then
10544                 ol_enable_local=$ac_cv_header_sys_un_h
10545         elif test $ac_cv_header_sys_un_h = no ; then
10546                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
10547         fi
10548 fi
10549
10550 ol_link_kbind=no
10551 ol_link_kpasswd=no
10552 ol_link_krb5=no
10553 ol_link_krb4=no
10554
10555 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
10556         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
10557         -o $ol_with_kerberos = k425 ; then
10558
10559         for ac_hdr in krb5.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_krb5_h = yes ; then
10601                                 for ac_hdr in heim_err.h
10602 do
10603 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10604 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10605 echo "configure:10606: checking for $ac_hdr" >&5
10606 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10607   echo $ac_n "(cached) $ac_c" 1>&6
10608 else
10609   cat > conftest.$ac_ext <<EOF
10610 #line 10611 "configure"
10611 #include "confdefs.h"
10612 #include <$ac_hdr>
10613 EOF
10614 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10615 { (eval echo configure:10616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10616 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10617 if test -z "$ac_err"; then
10618   rm -rf conftest*
10619   eval "ac_cv_header_$ac_safe=yes"
10620 else
10621   echo "$ac_err" >&5
10622   echo "configure: failed program was:" >&5
10623   cat conftest.$ac_ext >&5
10624   rm -rf conftest*
10625   eval "ac_cv_header_$ac_safe=no"
10626 fi
10627 rm -f conftest*
10628 fi
10629 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10630   echo "$ac_t""yes" 1>&6
10631     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10632   cat >> confdefs.h <<EOF
10633 #define $ac_tr_hdr 1
10634 EOF
10635  
10636 else
10637   echo "$ac_t""no" 1>&6
10638 fi
10639 done
10640
10641                 if test $ac_cv_header_heim_err_h = yes ; then
10642                         krb5_impl=heimdal
10643                 else
10644                         krb5_impl=mit
10645                 fi
10646
10647                 if test $krb5_impl = mit; then
10648                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
10649 echo "configure:10650: checking for main in -lk5crypto" >&5
10650 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
10651 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10652   echo $ac_n "(cached) $ac_c" 1>&6
10653 else
10654   ac_save_LIBS="$LIBS"
10655 LIBS="-lk5crypto  $LIBS"
10656 cat > conftest.$ac_ext <<EOF
10657 #line 10658 "configure"
10658 #include "confdefs.h"
10659
10660 int main() {
10661 main()
10662 ; return 0; }
10663 EOF
10664 if { (eval echo configure:10665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10665   rm -rf conftest*
10666   eval "ac_cv_lib_$ac_lib_var=yes"
10667 else
10668   echo "configure: failed program was:" >&5
10669   cat conftest.$ac_ext >&5
10670   rm -rf conftest*
10671   eval "ac_cv_lib_$ac_lib_var=no"
10672 fi
10673 rm -f conftest*
10674 LIBS="$ac_save_LIBS"
10675
10676 fi
10677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10678   echo "$ac_t""yes" 1>&6
10679   krb5crypto=k5crypto
10680 else
10681   echo "$ac_t""no" 1>&6
10682 krb5crypto=crypto
10683 fi
10684
10685
10686                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10687 echo "configure:10688: checking for main in -lkrb5" >&5
10688 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10689 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10690   echo $ac_n "(cached) $ac_c" 1>&6
10691 else
10692   ac_save_LIBS="$LIBS"
10693 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
10694 cat > conftest.$ac_ext <<EOF
10695 #line 10696 "configure"
10696 #include "confdefs.h"
10697
10698 int main() {
10699 main()
10700 ; return 0; }
10701 EOF
10702 if { (eval echo configure:10703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10703   rm -rf conftest*
10704   eval "ac_cv_lib_$ac_lib_var=yes"
10705 else
10706   echo "configure: failed program was:" >&5
10707   cat conftest.$ac_ext >&5
10708   rm -rf conftest*
10709   eval "ac_cv_lib_$ac_lib_var=no"
10710 fi
10711 rm -f conftest*
10712 LIBS="$ac_save_LIBS"
10713
10714 fi
10715 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10716   echo "$ac_t""yes" 1>&6
10717   have_krb5=yes
10718                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
10719 else
10720   echo "$ac_t""no" 1>&6
10721 have_krb5=no
10722 fi
10723
10724
10725                 elif test $krb5_impl = heimdal; then
10726                         echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
10727 echo "configure:10728: checking for main in -ldes" >&5
10728 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
10729 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10730   echo $ac_n "(cached) $ac_c" 1>&6
10731 else
10732   ac_save_LIBS="$LIBS"
10733 LIBS="-ldes  $LIBS"
10734 cat > conftest.$ac_ext <<EOF
10735 #line 10736 "configure"
10736 #include "confdefs.h"
10737
10738 int main() {
10739 main()
10740 ; return 0; }
10741 EOF
10742 if { (eval echo configure:10743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10743   rm -rf conftest*
10744   eval "ac_cv_lib_$ac_lib_var=yes"
10745 else
10746   echo "configure: failed program was:" >&5
10747   cat conftest.$ac_ext >&5
10748   rm -rf conftest*
10749   eval "ac_cv_lib_$ac_lib_var=no"
10750 fi
10751 rm -f conftest*
10752 LIBS="$ac_save_LIBS"
10753
10754 fi
10755 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10756   echo "$ac_t""yes" 1>&6
10757   krb5crypto=des
10758 else
10759   echo "$ac_t""no" 1>&6
10760 krb5crypto=crypto
10761 fi
10762
10763
10764                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
10765 echo "configure:10766: checking for main in -lkrb5" >&5
10766 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
10767 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10768   echo $ac_n "(cached) $ac_c" 1>&6
10769 else
10770   ac_save_LIBS="$LIBS"
10771 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10772 cat > conftest.$ac_ext <<EOF
10773 #line 10774 "configure"
10774 #include "confdefs.h"
10775
10776 int main() {
10777 main()
10778 ; return 0; }
10779 EOF
10780 if { (eval echo configure:10781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10781   rm -rf conftest*
10782   eval "ac_cv_lib_$ac_lib_var=yes"
10783 else
10784   echo "configure: failed program was:" >&5
10785   cat conftest.$ac_ext >&5
10786   rm -rf conftest*
10787   eval "ac_cv_lib_$ac_lib_var=no"
10788 fi
10789 rm -f conftest*
10790 LIBS="$ac_save_LIBS"
10791
10792 fi
10793 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10794   echo "$ac_t""yes" 1>&6
10795   have_krb5=yes
10796                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err"
10797 else
10798   echo "$ac_t""no" 1>&6
10799 have_krb5=no
10800 fi
10801
10802
10803                         cat >> confdefs.h <<\EOF
10804 #define HAVE_HEIMDAL_KERBEROS 1
10805 EOF
10806
10807
10808                 else
10809                         have_krb5=no
10810                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
10811                 fi
10812
10813                 if test $have_krb5 = yes ; then
10814                         ol_link_krb5=yes
10815
10816                         cat >> confdefs.h <<\EOF
10817 #define HAVE_KRB5 1
10818 EOF
10819
10820
10821                         if test $ol_enable_kpasswd != no ; then
10822                                 ol_link_kpasswd=yes;
10823                         fi
10824
10825                         if test $ol_with_kerberos = k5only ; then
10826                                 ol_with_kerberos=found
10827                         fi
10828
10829                 elif test $ol_with_kerberos != auto ; then
10830                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
10831                 fi
10832
10833         fi
10834 fi
10835
10836 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
10837         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
10838
10839         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
10840 do
10841 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10842 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10843 echo "configure:10844: checking for $ac_hdr" >&5
10844 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10845   echo $ac_n "(cached) $ac_c" 1>&6
10846 else
10847   cat > conftest.$ac_ext <<EOF
10848 #line 10849 "configure"
10849 #include "confdefs.h"
10850 #include <$ac_hdr>
10851 EOF
10852 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10853 { (eval echo configure:10854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10854 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10855 if test -z "$ac_err"; then
10856   rm -rf conftest*
10857   eval "ac_cv_header_$ac_safe=yes"
10858 else
10859   echo "$ac_err" >&5
10860   echo "configure: failed program was:" >&5
10861   cat conftest.$ac_ext >&5
10862   rm -rf conftest*
10863   eval "ac_cv_header_$ac_safe=no"
10864 fi
10865 rm -f conftest*
10866 fi
10867 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10868   echo "$ac_t""yes" 1>&6
10869     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10870   cat >> confdefs.h <<EOF
10871 #define $ac_tr_hdr 1
10872 EOF
10873  
10874 else
10875   echo "$ac_t""no" 1>&6
10876 fi
10877 done
10878
10879
10880         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
10881                 if test $krb5_impl = mit; then
10882                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10883 echo "configure:10884: checking for main in -lkrb4" >&5
10884 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
10885 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10886   echo $ac_n "(cached) $ac_c" 1>&6
10887 else
10888   ac_save_LIBS="$LIBS"
10889 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
10890 cat > conftest.$ac_ext <<EOF
10891 #line 10892 "configure"
10892 #include "confdefs.h"
10893
10894 int main() {
10895 main()
10896 ; return 0; }
10897 EOF
10898 if { (eval echo configure:10899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10899   rm -rf conftest*
10900   eval "ac_cv_lib_$ac_lib_var=yes"
10901 else
10902   echo "configure: failed program was:" >&5
10903   cat conftest.$ac_ext >&5
10904   rm -rf conftest*
10905   eval "ac_cv_lib_$ac_lib_var=no"
10906 fi
10907 rm -f conftest*
10908 LIBS="$ac_save_LIBS"
10909
10910 fi
10911 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10912   echo "$ac_t""yes" 1>&6
10913   have_k425=yes
10914                                 KRB4_LIBS="-lkrb4 -ldes425"
10915 else
10916   echo "$ac_t""no" 1>&6
10917 have_k425=no
10918 fi
10919
10920
10921                 elif test $krb5_impl = heimdal; then
10922                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
10923 echo "configure:10924: checking for main in -lkrb4" >&5
10924 ac_lib_var=`echo krb4'_'main | 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="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
10930 cat > conftest.$ac_ext <<EOF
10931 #line 10932 "configure"
10932 #include "confdefs.h"
10933
10934 int main() {
10935 main()
10936 ; return 0; }
10937 EOF
10938 if { (eval echo configure:10939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10939   rm -rf conftest*
10940   eval "ac_cv_lib_$ac_lib_var=yes"
10941 else
10942   echo "configure: failed program was:" >&5
10943   cat conftest.$ac_ext >&5
10944   rm -rf conftest*
10945   eval "ac_cv_lib_$ac_lib_var=no"
10946 fi
10947 rm -f conftest*
10948 LIBS="$ac_save_LIBS"
10949
10950 fi
10951 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10952   echo "$ac_t""yes" 1>&6
10953   have_k425=yes
10954                                 KRB4_LIBS="-lkrb4"
10955 else
10956   echo "$ac_t""no" 1>&6
10957 have_k425=no
10958 fi
10959
10960
10961                 else
10962                         have_425=no
10963                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
10964                 fi
10965
10966                 if test $have_k425 = yes ; then
10967                         ol_with_kerberos=found
10968                         ol_link_krb4=yes
10969
10970                         cat >> confdefs.h <<\EOF
10971 #define HAVE_KRB425 1
10972 EOF
10973
10974                         cat >> confdefs.h <<\EOF
10975 #define HAVE_KRB4 1
10976 EOF
10977
10978
10979                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
10980 echo "configure:10981: checking for des_debug in Kerberos libraries" >&5
10981 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
10982   echo $ac_n "(cached) $ac_c" 1>&6
10983 else
10984   
10985                                                                 save_LIBS="$LIBS"
10986                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
10987                                 cat > conftest.$ac_ext <<EOF
10988 #line 10989 "configure"
10989 #include "confdefs.h"
10990
10991 #include <kerberosIV/krb.h>
10992 #include <kerberosIV/des.h>
10993 extern int des_debug;
10994
10995 int main() {
10996
10997 des_debug = 1;
10998
10999 ; return 0; }
11000 EOF
11001 if { (eval echo configure:11002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11002   rm -rf conftest*
11003   ol_cv_var_des_debug=yes
11004 else
11005   echo "configure: failed program was:" >&5
11006   cat conftest.$ac_ext >&5
11007   rm -rf conftest*
11008   ol_cv_var_des_debug=no
11009 fi
11010 rm -f conftest*
11011                                                                 LIBS="$save_LIBS"
11012                         
11013 fi
11014
11015 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
11016
11017                         if test $ol_cv_var_des_debug = yes ; then
11018                                 cat >> confdefs.h <<\EOF
11019 #define HAVE_DES_DEBUG 1
11020 EOF
11021
11022                         fi
11023
11024                         LIBS="$save_LIBS"
11025                 fi
11026         fi
11027 fi
11028
11029 if test $ol_link_krb5 = yes ; then
11030         ol_with_kerberos=found
11031 fi
11032
11033 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
11034         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
11035
11036         for ac_hdr in krb.h des.h krb-archaeology.h 
11037 do
11038 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11039 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11040 echo "configure:11041: checking for $ac_hdr" >&5
11041 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11042   echo $ac_n "(cached) $ac_c" 1>&6
11043 else
11044   cat > conftest.$ac_ext <<EOF
11045 #line 11046 "configure"
11046 #include "confdefs.h"
11047 #include <$ac_hdr>
11048 EOF
11049 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11050 { (eval echo configure:11051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11051 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11052 if test -z "$ac_err"; then
11053   rm -rf conftest*
11054   eval "ac_cv_header_$ac_safe=yes"
11055 else
11056   echo "$ac_err" >&5
11057   echo "configure: failed program was:" >&5
11058   cat conftest.$ac_ext >&5
11059   rm -rf conftest*
11060   eval "ac_cv_header_$ac_safe=no"
11061 fi
11062 rm -f conftest*
11063 fi
11064 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11065   echo "$ac_t""yes" 1>&6
11066     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11067   cat >> confdefs.h <<EOF
11068 #define $ac_tr_hdr 1
11069 EOF
11070  
11071 else
11072   echo "$ac_t""no" 1>&6
11073 fi
11074 done
11075
11076
11077         if test $ac_cv_header_krb_h = yes ; then
11078                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
11079 echo "configure:11080: checking for main in -lkrb" >&5
11080 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
11081 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11082   echo $ac_n "(cached) $ac_c" 1>&6
11083 else
11084   ac_save_LIBS="$LIBS"
11085 LIBS="-lkrb -ldes $LIBS"
11086 cat > conftest.$ac_ext <<EOF
11087 #line 11088 "configure"
11088 #include "confdefs.h"
11089
11090 int main() {
11091 main()
11092 ; return 0; }
11093 EOF
11094 if { (eval echo configure:11095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11095   rm -rf conftest*
11096   eval "ac_cv_lib_$ac_lib_var=yes"
11097 else
11098   echo "configure: failed program was:" >&5
11099   cat conftest.$ac_ext >&5
11100   rm -rf conftest*
11101   eval "ac_cv_lib_$ac_lib_var=no"
11102 fi
11103 rm -f conftest*
11104 LIBS="$ac_save_LIBS"
11105
11106 fi
11107 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11108   echo "$ac_t""yes" 1>&6
11109   have_k4=yes
11110 else
11111   echo "$ac_t""no" 1>&6
11112 have_k4=no
11113 fi
11114
11115
11116                 if test $have_k4 = yes ; then
11117                         ol_with_kerberos=found
11118                         ol_link_krb4=yes
11119
11120                         cat >> confdefs.h <<\EOF
11121 #define HAVE_KRB4 1
11122 EOF
11123
11124
11125                         KRB4_LIBS="-lkrb -ldes"
11126
11127                         if test $ac_cv_header_krb_archaeology_h = yes ; then
11128                                 cat >> confdefs.h <<\EOF
11129 #define HAVE_KTH_KERBEROS 1
11130 EOF
11131
11132                         fi
11133                 fi
11134         fi
11135 fi
11136
11137 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
11138         ol_link_kpasswd=yes
11139 fi
11140
11141 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
11142         ol_link_kbind=yes
11143
11144 elif test $ol_enable_kbind = yes ; then
11145         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
11146 fi
11147
11148 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
11149         cat >> confdefs.h <<\EOF
11150 #define HAVE_KERBEROS 1
11151 EOF
11152
11153
11154 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
11155         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
11156 fi
11157
11158 ol_link_tls=no
11159 if test $ol_with_tls != no ; then
11160         for ac_hdr in openssl/ssl.h ssl.h
11161 do
11162 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11163 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11164 echo "configure:11165: checking for $ac_hdr" >&5
11165 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11166   echo $ac_n "(cached) $ac_c" 1>&6
11167 else
11168   cat > conftest.$ac_ext <<EOF
11169 #line 11170 "configure"
11170 #include "confdefs.h"
11171 #include <$ac_hdr>
11172 EOF
11173 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11174 { (eval echo configure:11175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11175 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11176 if test -z "$ac_err"; then
11177   rm -rf conftest*
11178   eval "ac_cv_header_$ac_safe=yes"
11179 else
11180   echo "$ac_err" >&5
11181   echo "configure: failed program was:" >&5
11182   cat conftest.$ac_ext >&5
11183   rm -rf conftest*
11184   eval "ac_cv_header_$ac_safe=no"
11185 fi
11186 rm -f conftest*
11187 fi
11188 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11189   echo "$ac_t""yes" 1>&6
11190     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11191   cat >> confdefs.h <<EOF
11192 #define $ac_tr_hdr 1
11193 EOF
11194  
11195 else
11196   echo "$ac_t""no" 1>&6
11197 fi
11198 done
11199
11200         
11201         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
11202                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
11203 echo "configure:11204: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
11204 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
11205 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11206   echo $ac_n "(cached) $ac_c" 1>&6
11207 else
11208   ac_save_LIBS="$LIBS"
11209 LIBS="-lssl -lcrypto $LIBS"
11210 cat > conftest.$ac_ext <<EOF
11211 #line 11212 "configure"
11212 #include "confdefs.h"
11213 /* Override any gcc2 internal prototype to avoid an error.  */
11214 /* We use char because int might match the return type of a gcc2
11215     builtin and then its argument prototype would still apply.  */
11216 char SSLeay_add_ssl_algorithms();
11217
11218 int main() {
11219 SSLeay_add_ssl_algorithms()
11220 ; return 0; }
11221 EOF
11222 if { (eval echo configure:11223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11223   rm -rf conftest*
11224   eval "ac_cv_lib_$ac_lib_var=yes"
11225 else
11226   echo "configure: failed program was:" >&5
11227   cat conftest.$ac_ext >&5
11228   rm -rf conftest*
11229   eval "ac_cv_lib_$ac_lib_var=no"
11230 fi
11231 rm -f conftest*
11232 LIBS="$ac_save_LIBS"
11233
11234 fi
11235 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11236   echo "$ac_t""yes" 1>&6
11237   have_ssleay=yes
11238                         need_rsaref=no
11239 else
11240   echo "$ac_t""no" 1>&6
11241 have_ssleay=no
11242 fi
11243
11244                         
11245                 if test $have_ssleay = no ; then
11246                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
11247 echo "configure:11248: checking for SSL_library_init in -lssl" >&5
11248 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
11249 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11250   echo $ac_n "(cached) $ac_c" 1>&6
11251 else
11252   ac_save_LIBS="$LIBS"
11253 LIBS="-lssl -lcrypto $LIBS"
11254 cat > conftest.$ac_ext <<EOF
11255 #line 11256 "configure"
11256 #include "confdefs.h"
11257 /* Override any gcc2 internal prototype to avoid an error.  */
11258 /* We use char because int might match the return type of a gcc2
11259     builtin and then its argument prototype would still apply.  */
11260 char SSL_library_init();
11261
11262 int main() {
11263 SSL_library_init()
11264 ; return 0; }
11265 EOF
11266 if { (eval echo configure:11267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11267   rm -rf conftest*
11268   eval "ac_cv_lib_$ac_lib_var=yes"
11269 else
11270   echo "configure: failed program was:" >&5
11271   cat conftest.$ac_ext >&5
11272   rm -rf conftest*
11273   eval "ac_cv_lib_$ac_lib_var=no"
11274 fi
11275 rm -f conftest*
11276 LIBS="$ac_save_LIBS"
11277
11278 fi
11279 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11280   echo "$ac_t""yes" 1>&6
11281   have_ssleay=yes
11282                                 need_rsaref=no
11283 else
11284   echo "$ac_t""no" 1>&6
11285 have_ssleay=no
11286 fi
11287
11288                 fi
11289
11290                 if test $have_ssleay = no ; then
11291                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
11292 echo "configure:11293: checking for ssl3_accept in -lssl" >&5
11293 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
11294 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11295   echo $ac_n "(cached) $ac_c" 1>&6
11296 else
11297   ac_save_LIBS="$LIBS"
11298 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
11299 cat > conftest.$ac_ext <<EOF
11300 #line 11301 "configure"
11301 #include "confdefs.h"
11302 /* Override any gcc2 internal prototype to avoid an error.  */
11303 /* We use char because int might match the return type of a gcc2
11304     builtin and then its argument prototype would still apply.  */
11305 char ssl3_accept();
11306
11307 int main() {
11308 ssl3_accept()
11309 ; return 0; }
11310 EOF
11311 if { (eval echo configure:11312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11312   rm -rf conftest*
11313   eval "ac_cv_lib_$ac_lib_var=yes"
11314 else
11315   echo "configure: failed program was:" >&5
11316   cat conftest.$ac_ext >&5
11317   rm -rf conftest*
11318   eval "ac_cv_lib_$ac_lib_var=no"
11319 fi
11320 rm -f conftest*
11321 LIBS="$ac_save_LIBS"
11322
11323 fi
11324 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11325   echo "$ac_t""yes" 1>&6
11326   have_ssleay=yes
11327                                 need_rsaref=yes
11328 else
11329   echo "$ac_t""no" 1>&6
11330 have_ssleay=no
11331 fi
11332
11333                 fi
11334
11335                 if test $have_ssleay = yes ; then
11336                         ol_with_tls=found
11337                         ol_link_tls=yes
11338
11339                         cat >> confdefs.h <<\EOF
11340 #define HAVE_SSLEAY 1
11341 EOF
11342
11343
11344                         if test $need_rsaref = yes; then
11345                                 cat >> confdefs.h <<\EOF
11346 #define HAVE_RSAREF 1
11347 EOF
11348
11349
11350                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
11351                         else
11352                                 TLS_LIBS="-lssl -lcrypto"
11353                         fi
11354                 fi
11355         fi
11356
11357 else
11358         echo "configure: warning: TLS data protection not supported!" 1>&2
11359 fi
11360
11361 if test $ol_link_tls = yes ; then
11362         cat >> confdefs.h <<\EOF
11363 #define HAVE_TLS 1
11364 EOF
11365
11366
11367 elif test $ol_with_tls = auto ; then
11368         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
11369         echo "configure: warning: TLS data protection not supported!" 1>&2
11370
11371 elif test $ol_with_tls != no ; then
11372         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
11373 fi
11374
11375 if test $ol_enable_lmpasswd != no; then
11376         if test $ol_link_tls != yes ; then
11377                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
11378         fi
11379
11380         cat >> confdefs.h <<\EOF
11381 #define SLAPD_LMHASH 1
11382 EOF
11383
11384 fi
11385
11386 for ac_func in \
11387         ctime_r                 \
11388         gethostbyname_r gethostbyaddr_r \
11389
11390 do
11391 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11392 echo "configure:11393: checking for $ac_func" >&5
11393 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11394   echo $ac_n "(cached) $ac_c" 1>&6
11395 else
11396   cat > conftest.$ac_ext <<EOF
11397 #line 11398 "configure"
11398 #include "confdefs.h"
11399 /* System header to define __stub macros and hopefully few prototypes,
11400     which can conflict with char $ac_func(); below.  */
11401 #include <assert.h>
11402 /* Override any gcc2 internal prototype to avoid an error.  */
11403 /* We use char because int might match the return type of a gcc2
11404     builtin and then its argument prototype would still apply.  */
11405 char $ac_func();
11406 char (*f)();
11407
11408 int main() {
11409
11410 /* The GNU C library defines this for functions which it implements
11411     to always fail with ENOSYS.  Some functions are actually named
11412     something starting with __ and the normal name is an alias.  */
11413 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11414 choke me
11415 #else
11416 f = $ac_func;
11417 #endif
11418
11419 ; return 0; }
11420 EOF
11421 if { (eval echo configure:11422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11422   rm -rf conftest*
11423   eval "ac_cv_func_$ac_func=yes"
11424 else
11425   echo "configure: failed program was:" >&5
11426   cat conftest.$ac_ext >&5
11427   rm -rf conftest*
11428   eval "ac_cv_func_$ac_func=no"
11429 fi
11430 rm -f conftest*
11431 fi
11432
11433 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11434   echo "$ac_t""yes" 1>&6
11435     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11436   cat >> confdefs.h <<EOF
11437 #define $ac_tr_func 1
11438 EOF
11439  
11440 else
11441   echo "$ac_t""no" 1>&6
11442 fi
11443 done
11444
11445
11446 if test "$ac_cv_func_ctime_r" = no ; then
11447         ol_cv_func_ctime_r_nargs=0
11448 else
11449         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
11450 echo "configure:11451: checking number of arguments of ctime_r" >&5
11451 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
11452   echo $ac_n "(cached) $ac_c" 1>&6
11453 else
11454   cat > conftest.$ac_ext <<EOF
11455 #line 11456 "configure"
11456 #include "confdefs.h"
11457 #include <time.h>
11458 int main() {
11459 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
11460 ; return 0; }
11461 EOF
11462 if { (eval echo configure:11463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11463   rm -rf conftest*
11464   ol_cv_func_ctime_r_nargs3=yes
11465 else
11466   echo "configure: failed program was:" >&5
11467   cat conftest.$ac_ext >&5
11468   rm -rf conftest*
11469   ol_cv_func_ctime_r_nargs3=no
11470 fi
11471 rm -f conftest*
11472
11473         cat > conftest.$ac_ext <<EOF
11474 #line 11475 "configure"
11475 #include "confdefs.h"
11476 #include <time.h>
11477 int main() {
11478 time_t ti; char *buffer; ctime_r(&ti,buffer);
11479 ; return 0; }
11480 EOF
11481 if { (eval echo configure:11482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11482   rm -rf conftest*
11483   ol_cv_func_ctime_r_nargs2=yes
11484 else
11485   echo "configure: failed program was:" >&5
11486   cat conftest.$ac_ext >&5
11487   rm -rf conftest*
11488   ol_cv_func_ctime_r_nargs2=no
11489 fi
11490 rm -f conftest*
11491
11492         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
11493                 $ol_cv_func_ctime_r_nargs2 = no ; then
11494
11495                 ol_cv_func_ctime_r_nargs=3
11496
11497         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
11498                 $ol_cv_func_ctime_r_nargs2 = yes ; then
11499
11500                 ol_cv_func_ctime_r_nargs=2
11501
11502         else
11503                 ol_cv_func_ctime_r_nargs=0
11504         fi
11505   
11506 fi
11507
11508 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
11509
11510   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
11511         cat >> confdefs.h <<EOF
11512 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
11513 EOF
11514
11515   fi
11516
11517 fi
11518
11519 if test "$ac_cv_func_gethostbyname_r" = yes ; then
11520         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
11521 echo "configure:11522: checking number of arguments of gethostbyname_r" >&5
11522 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
11523   echo $ac_n "(cached) $ac_c" 1>&6
11524 else
11525   cat > conftest.$ac_ext <<EOF
11526 #line 11527 "configure"
11527 #include "confdefs.h"
11528 #include <sys/types.h>
11529 #include <sys/socket.h>
11530 #include <netinet/in.h>
11531 #include <netdb.h>
11532 #define BUFSIZE (sizeof(struct hostent)+10)
11533 int main() {
11534 struct hostent hent; char buffer[BUFSIZE];
11535                 int bufsize=BUFSIZE;int h_errno;
11536                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
11537                         buffer, bufsize, &h_errno);
11538 ; return 0; }
11539 EOF
11540 if { (eval echo configure:11541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11541   rm -rf conftest*
11542   ol_cv_func_gethostbyname_r_nargs5=yes
11543 else
11544   echo "configure: failed program was:" >&5
11545   cat conftest.$ac_ext >&5
11546   rm -rf conftest*
11547   ol_cv_func_gethostbyname_r_nargs5=no
11548 fi
11549 rm -f conftest*
11550
11551         cat > conftest.$ac_ext <<EOF
11552 #line 11553 "configure"
11553 #include "confdefs.h"
11554 #include <sys/types.h>
11555 #include <sys/socket.h>
11556 #include <netinet/in.h>
11557 #include <netdb.h>
11558 #define BUFSIZE (sizeof(struct hostent)+10)
11559 int main() {
11560 struct hostent hent;struct hostent *rhent;
11561                 char buffer[BUFSIZE];
11562                 int bufsize=BUFSIZE;int h_errno;
11563                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
11564                         &rhent, &h_errno);
11565 ; return 0; }
11566 EOF
11567 if { (eval echo configure:11568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11568   rm -rf conftest*
11569   ol_cv_func_gethostbyname_r_nargs6=yes
11570 else
11571   echo "configure: failed program was:" >&5
11572   cat conftest.$ac_ext >&5
11573   rm -rf conftest*
11574   ol_cv_func_gethostbyname_r_nargs6=no
11575 fi
11576 rm -f conftest*
11577
11578         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
11579                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
11580
11581                 ol_cv_func_gethostbyname_r_nargs=5
11582
11583         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
11584                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
11585
11586                 ol_cv_func_gethostbyname_r_nargs=6
11587
11588         else
11589                 ol_cv_func_gethostbyname_r_nargs=0
11590         fi
11591   
11592 fi
11593
11594 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
11595   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
11596         cat >> confdefs.h <<EOF
11597 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
11598 EOF
11599
11600   fi
11601
11602 else
11603         ol_cv_func_gethostbyname_r_nargs=0
11604 fi
11605  
11606 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
11607         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
11608 echo "configure:11609: checking number of arguments of gethostbyaddr_r" >&5
11609 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
11610   echo $ac_n "(cached) $ac_c" 1>&6
11611 else
11612   cat > conftest.$ac_ext <<EOF
11613 #line 11614 "configure"
11614 #include "confdefs.h"
11615 #include <sys/types.h>
11616 #include <sys/socket.h>
11617 #include <netinet/in.h>
11618 #include <netdb.h>
11619 #define BUFSIZE (sizeof(struct hostent)+10)
11620 int main() {
11621 struct hostent hent; char buffer[BUFSIZE]; 
11622             struct in_addr add;
11623             size_t alen=sizeof(struct in_addr);
11624             int bufsize=BUFSIZE;int h_errno;
11625                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
11626                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
11627 ; return 0; }
11628 EOF
11629 if { (eval echo configure:11630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11630   rm -rf conftest*
11631   ol_cv_func_gethostbyaddr_r_nargs7=yes
11632 else
11633   echo "configure: failed program was:" >&5
11634   cat conftest.$ac_ext >&5
11635   rm -rf conftest*
11636   ol_cv_func_gethostbyaddr_r_nargs7=no
11637 fi
11638 rm -f conftest*
11639
11640         cat > conftest.$ac_ext <<EOF
11641 #line 11642 "configure"
11642 #include "confdefs.h"
11643 #include <sys/types.h>
11644 #include <sys/socket.h>
11645 #include <netinet/in.h>
11646 #include <netdb.h>
11647 #define BUFSIZE (sizeof(struct hostent)+10)
11648 int main() {
11649 struct hostent hent;
11650                 struct hostent *rhent; char buffer[BUFSIZE]; 
11651                 struct in_addr add;
11652                 size_t alen=sizeof(struct in_addr);
11653                 int bufsize=BUFSIZE;int h_errno;
11654                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
11655                         alen, AF_INET, &hent, buffer, bufsize, 
11656                         &rhent, &h_errno);
11657 ; return 0; }
11658 EOF
11659 if { (eval echo configure:11660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11660   rm -rf conftest*
11661   ol_cv_func_gethostbyaddr_r_nargs8=yes
11662 else
11663   echo "configure: failed program was:" >&5
11664   cat conftest.$ac_ext >&5
11665   rm -rf conftest*
11666   ol_cv_func_gethostbyaddr_r_nargs8=no
11667 fi
11668 rm -f conftest*
11669
11670         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
11671                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
11672
11673                 ol_cv_func_gethostbyaddr_r_nargs=7
11674
11675         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
11676                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
11677
11678                 ol_cv_func_gethostbyaddr_r_nargs=8
11679
11680         else
11681                 ol_cv_func_gethostbyaddr_r_nargs=0
11682         fi
11683   
11684 fi
11685
11686 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
11687   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
11688     cat >> confdefs.h <<EOF
11689 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
11690 EOF
11691
11692   fi
11693
11694 else
11695         ol_cv_func_gethostbyaddr_r_nargs=0
11696 fi
11697
11698 if test "$ac_cv_func_ctime_r" = yes \
11699         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
11700         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
11701         -a "$ac_cv_func_gethostbyname_r" = yes \
11702         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
11703         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
11704         -a "$ac_cv_func_gethostbyaddr_r" = yes \
11705         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
11706         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
11707         ; then
11708  
11709         cat >> confdefs.h <<\EOF
11710 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
11711 EOF
11712
11713 fi
11714
11715 ol_link_threads=no
11716
11717 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11718         -o $ol_with_threads = nt ; then
11719
11720         
11721         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
11722 echo "configure:11723: checking for _beginthread" >&5
11723 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
11724   echo $ac_n "(cached) $ac_c" 1>&6
11725 else
11726   cat > conftest.$ac_ext <<EOF
11727 #line 11728 "configure"
11728 #include "confdefs.h"
11729 /* System header to define __stub macros and hopefully few prototypes,
11730     which can conflict with char _beginthread(); below.  */
11731 #include <assert.h>
11732 /* Override any gcc2 internal prototype to avoid an error.  */
11733 /* We use char because int might match the return type of a gcc2
11734     builtin and then its argument prototype would still apply.  */
11735 char _beginthread();
11736 char (*f)();
11737
11738 int main() {
11739
11740 /* The GNU C library defines this for functions which it implements
11741     to always fail with ENOSYS.  Some functions are actually named
11742     something starting with __ and the normal name is an alias.  */
11743 #if defined (__stub__beginthread) || defined (__stub____beginthread)
11744 choke me
11745 #else
11746 f = _beginthread;
11747 #endif
11748
11749 ; return 0; }
11750 EOF
11751 if { (eval echo configure:11752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11752   rm -rf conftest*
11753   eval "ac_cv_func__beginthread=yes"
11754 else
11755   echo "configure: failed program was:" >&5
11756   cat conftest.$ac_ext >&5
11757   rm -rf conftest*
11758   eval "ac_cv_func__beginthread=no"
11759 fi
11760 rm -f conftest*
11761 fi
11762
11763 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
11764   echo "$ac_t""yes" 1>&6
11765   :
11766 else
11767   echo "$ac_t""no" 1>&6
11768 fi
11769
11770
11771         if test $ac_cv_func__beginthread = yes ; then
11772                 cat >> confdefs.h <<\EOF
11773 #define HAVE_NT_THREADS 1
11774 EOF
11775
11776                 ol_cv_nt_threads=yes
11777         fi
11778
11779
11780         if test "$ol_cv_nt_threads" = yes ; then
11781                 ol_link_threads=nt
11782                 ol_with_threads=found
11783                 ol_with_yielding_select=yes
11784
11785                 cat >> confdefs.h <<\EOF
11786 #define HAVE_NT_SERVICE_MANAGER 1
11787 EOF
11788
11789                 cat >> confdefs.h <<\EOF
11790 #define HAVE_NT_EVENT_LOG 1
11791 EOF
11792
11793         fi
11794
11795         if test $ol_with_threads = nt ; then
11796                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
11797         fi
11798 fi
11799
11800 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11801         -o $ol_with_threads = posix ; then
11802
11803         for ac_hdr in pthread.h
11804 do
11805 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11806 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11807 echo "configure:11808: checking for $ac_hdr" >&5
11808 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11809   echo $ac_n "(cached) $ac_c" 1>&6
11810 else
11811   cat > conftest.$ac_ext <<EOF
11812 #line 11813 "configure"
11813 #include "confdefs.h"
11814 #include <$ac_hdr>
11815 EOF
11816 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11817 { (eval echo configure:11818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11818 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11819 if test -z "$ac_err"; then
11820   rm -rf conftest*
11821   eval "ac_cv_header_$ac_safe=yes"
11822 else
11823   echo "$ac_err" >&5
11824   echo "configure: failed program was:" >&5
11825   cat conftest.$ac_ext >&5
11826   rm -rf conftest*
11827   eval "ac_cv_header_$ac_safe=no"
11828 fi
11829 rm -f conftest*
11830 fi
11831 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11832   echo "$ac_t""yes" 1>&6
11833     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11834   cat >> confdefs.h <<EOF
11835 #define $ac_tr_hdr 1
11836 EOF
11837  
11838 else
11839   echo "$ac_t""no" 1>&6
11840 fi
11841 done
11842
11843
11844         if test $ac_cv_header_pthread_h = yes ; then
11845                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
11846 echo "configure:11847: checking POSIX thread version" >&5
11847 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
11848   echo $ac_n "(cached) $ac_c" 1>&6
11849 else
11850   
11851         cat > conftest.$ac_ext <<EOF
11852 #line 11853 "configure"
11853 #include "confdefs.h"
11854
11855 #               include <pthread.h>
11856         
11857 int main() {
11858
11859                 int i = PTHREAD_CREATE_JOINABLE;
11860         
11861 ; return 0; }
11862 EOF
11863 if { (eval echo configure:11864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11864   rm -rf conftest*
11865   
11866         cat > conftest.$ac_ext <<EOF
11867 #line 11868 "configure"
11868 #include "confdefs.h"
11869 #include <pthread.h>
11870 EOF
11871 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11872   egrep "pthread_detach" >/dev/null 2>&1; then
11873   rm -rf conftest*
11874   ol_cv_pthread_version=10
11875 else
11876   rm -rf conftest*
11877   ol_cv_pthread_version=8
11878 fi
11879 rm -f conftest*
11880
11881 else
11882   echo "configure: failed program was:" >&5
11883   cat conftest.$ac_ext >&5
11884   rm -rf conftest*
11885   
11886         cat > conftest.$ac_ext <<EOF
11887 #line 11888 "configure"
11888 #include "confdefs.h"
11889
11890 #               include <pthread.h>
11891 #               ifdef PTHREAD_CREATE_UNDETACHED
11892                 draft7
11893 #               endif
11894         
11895 EOF
11896 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11897   egrep "draft7" >/dev/null 2>&1; then
11898   rm -rf conftest*
11899   ol_cv_pthread_version=7
11900 else
11901   rm -rf conftest*
11902   
11903         cat > conftest.$ac_ext <<EOF
11904 #line 11905 "configure"
11905 #include "confdefs.h"
11906 #include <pthread.h>
11907 EOF
11908 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11909   egrep "pthread_attr_init" >/dev/null 2>&1; then
11910   rm -rf conftest*
11911   ol_cv_pthread_version=6
11912 else
11913   rm -rf conftest*
11914   
11915         cat > conftest.$ac_ext <<EOF
11916 #line 11917 "configure"
11917 #include "confdefs.h"
11918
11919 #               include <pthread.h>
11920 #ifdef          PTHREAD_MUTEX_INITIALIZER
11921                 draft5
11922 #endif
11923         
11924 EOF
11925 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11926   egrep "draft5" >/dev/null 2>&1; then
11927   rm -rf conftest*
11928   ol_cv_pthread_version=5
11929 else
11930   rm -rf conftest*
11931   ol_cv_pthread_version=4
11932 fi
11933 rm -f conftest*
11934  
11935 fi
11936 rm -f conftest*
11937  
11938 fi
11939 rm -f conftest*
11940  
11941 fi
11942 rm -f conftest*
11943
11944 fi
11945
11946 echo "$ac_t""$ol_cv_pthread_version" 1>&6
11947
11948
11949                 if test $ol_cv_pthread_version != 0 ; then
11950                         cat >> confdefs.h <<EOF
11951 #define HAVE_PTHREADS $ol_cv_pthread_version
11952 EOF
11953
11954                 else
11955                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
11956                 fi
11957
11958                 # consider threads found
11959                 ol_with_threads=found
11960
11961                 
11962         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11963 echo "configure:11964: checking for LinuxThreads pthread.h" >&5
11964 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11965   echo $ac_n "(cached) $ac_c" 1>&6
11966 else
11967   cat > conftest.$ac_ext <<EOF
11968 #line 11969 "configure"
11969 #include "confdefs.h"
11970 #include <pthread.h>
11971 EOF
11972 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11973   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11974   rm -rf conftest*
11975   ol_cv_header_linux_threads=yes
11976 else
11977   rm -rf conftest*
11978   ol_cv_header_linux_threads=no
11979 fi
11980 rm -f conftest*
11981
11982                 
11983 fi
11984
11985 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11986         if test $ol_cv_header_linux_threads = yes; then
11987                 cat >> confdefs.h <<\EOF
11988 #define HAVE_LINUX_THREADS 1
11989 EOF
11990
11991         fi
11992
11993                 
11994         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
11995 echo "configure:11996: checking for GNU Pth pthread.h" >&5
11996 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
11997   echo $ac_n "(cached) $ac_c" 1>&6
11998 else
11999   cat > conftest.$ac_ext <<EOF
12000 #line 12001 "configure"
12001 #include "confdefs.h"
12002 #include <pthread.h>
12003 #ifdef _POSIX_THREAD_IS_GNU_PTH
12004         __gnu_pth__;
12005 #endif
12006
12007 EOF
12008 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12009   egrep "__gnu_pth__" >/dev/null 2>&1; then
12010   rm -rf conftest*
12011   ol_cv_header_gnu_pth_pthread_h=yes
12012 else
12013   rm -rf conftest*
12014   ol_cv_header_gnu_pth_pthread_h=no
12015 fi
12016 rm -f conftest*
12017
12018                 
12019 fi
12020
12021 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
12022
12023
12024                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
12025                         for ac_hdr in sched.h
12026 do
12027 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12028 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12029 echo "configure:12030: checking for $ac_hdr" >&5
12030 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12031   echo $ac_n "(cached) $ac_c" 1>&6
12032 else
12033   cat > conftest.$ac_ext <<EOF
12034 #line 12035 "configure"
12035 #include "confdefs.h"
12036 #include <$ac_hdr>
12037 EOF
12038 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12039 { (eval echo configure:12040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12040 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12041 if test -z "$ac_err"; then
12042   rm -rf conftest*
12043   eval "ac_cv_header_$ac_safe=yes"
12044 else
12045   echo "$ac_err" >&5
12046   echo "configure: failed program was:" >&5
12047   cat conftest.$ac_ext >&5
12048   rm -rf conftest*
12049   eval "ac_cv_header_$ac_safe=no"
12050 fi
12051 rm -f conftest*
12052 fi
12053 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12054   echo "$ac_t""yes" 1>&6
12055     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12056   cat >> confdefs.h <<EOF
12057 #define $ac_tr_hdr 1
12058 EOF
12059  
12060 else
12061   echo "$ac_t""no" 1>&6
12062 fi
12063 done
12064
12065                 fi
12066
12067                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
12068                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
12069 echo "configure:12070: checking for pthread_create in default libraries" >&5
12070 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
12071   echo $ac_n "(cached) $ac_c" 1>&6
12072 else
12073   
12074                 if test "$cross_compiling" = yes; then
12075   cat > conftest.$ac_ext <<EOF
12076 #line 12077 "configure"
12077 #include "confdefs.h"
12078 /* pthread test headers */
12079 #include <pthread.h>
12080 #if HAVE_PTHREADS < 7
12081 #include <errno.h>
12082 #endif
12083 #ifndef NULL
12084 #define NULL (void*)0
12085 #endif
12086
12087 static void *task(p)
12088         void *p;
12089 {
12090         return (void *) (p == NULL);
12091 }
12092
12093 int main() {
12094
12095         /* pthread test function */
12096 #ifndef PTHREAD_CREATE_DETACHED
12097 #define PTHREAD_CREATE_DETACHED 1
12098 #endif
12099         pthread_t t;
12100         int status;
12101         int detach = PTHREAD_CREATE_DETACHED;
12102
12103 #if HAVE_PTHREADS > 4
12104         /* Final pthreads */
12105         pthread_attr_t attr;
12106
12107         status = pthread_attr_init(&attr);
12108         if( status ) return status;
12109
12110 #if HAVE_PTHREADS < 7
12111         status = pthread_attr_setdetachstate(&attr, &detach);
12112         if( status < 0 ) status = errno;
12113 #else
12114         status = pthread_attr_setdetachstate(&attr, detach);
12115 #endif
12116         if( status ) return status;
12117         status = pthread_create( &t, &attr, task, NULL );
12118 #if HAVE_PTHREADS < 7
12119         if( status < 0 ) status = errno;
12120 #endif
12121         if( status ) return status;
12122 #else
12123         /* Draft 4 pthreads */
12124         status = pthread_create( &t, pthread_attr_default, task, NULL );
12125         if( status ) return errno;
12126
12127         /* give thread a chance to complete */
12128         /* it should remain joinable and hence detachable */
12129         sleep( 1 );
12130
12131         status = pthread_detach( &t );
12132         if( status ) return errno;
12133 #endif
12134
12135 #ifdef HAVE_LINUX_THREADS
12136         pthread_kill_other_threads_np();
12137 #endif
12138
12139         return 0;
12140
12141 ; return 0; }
12142 EOF
12143 if { (eval echo configure:12144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12144   rm -rf conftest*
12145   ol_cv_pthread_create=yes
12146 else
12147   echo "configure: failed program was:" >&5
12148   cat conftest.$ac_ext >&5
12149   rm -rf conftest*
12150   ol_cv_pthread_create=no
12151 fi
12152 rm -f conftest*
12153 else
12154   cat > conftest.$ac_ext <<EOF
12155 #line 12156 "configure"
12156 #include "confdefs.h"
12157 /* pthread test headers */
12158 #include <pthread.h>
12159 #if HAVE_PTHREADS < 7
12160 #include <errno.h>
12161 #endif
12162 #ifndef NULL
12163 #define NULL (void*)0
12164 #endif
12165
12166 static void *task(p)
12167         void *p;
12168 {
12169         return (void *) (p == NULL);
12170 }
12171
12172
12173 int main(argc, argv)
12174         int argc;
12175         char **argv;
12176 {
12177
12178         /* pthread test function */
12179 #ifndef PTHREAD_CREATE_DETACHED
12180 #define PTHREAD_CREATE_DETACHED 1
12181 #endif
12182         pthread_t t;
12183         int status;
12184         int detach = PTHREAD_CREATE_DETACHED;
12185
12186 #if HAVE_PTHREADS > 4
12187         /* Final pthreads */
12188         pthread_attr_t attr;
12189
12190         status = pthread_attr_init(&attr);
12191         if( status ) return status;
12192
12193 #if HAVE_PTHREADS < 7
12194         status = pthread_attr_setdetachstate(&attr, &detach);
12195         if( status < 0 ) status = errno;
12196 #else
12197         status = pthread_attr_setdetachstate(&attr, detach);
12198 #endif
12199         if( status ) return status;
12200         status = pthread_create( &t, &attr, task, NULL );
12201 #if HAVE_PTHREADS < 7
12202         if( status < 0 ) status = errno;
12203 #endif
12204         if( status ) return status;
12205 #else
12206         /* Draft 4 pthreads */
12207         status = pthread_create( &t, pthread_attr_default, task, NULL );
12208         if( status ) return errno;
12209
12210         /* give thread a chance to complete */
12211         /* it should remain joinable and hence detachable */
12212         sleep( 1 );
12213
12214         status = pthread_detach( &t );
12215         if( status ) return errno;
12216 #endif
12217
12218 #ifdef HAVE_LINUX_THREADS
12219         pthread_kill_other_threads_np();
12220 #endif
12221
12222         return 0;
12223
12224 }
12225
12226 EOF
12227 if { (eval echo configure:12228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12228 then
12229   ol_cv_pthread_create=yes
12230 else
12231   echo "configure: failed program was:" >&5
12232   cat conftest.$ac_ext >&5
12233   rm -fr conftest*
12234   ol_cv_pthread_create=no
12235 fi
12236 rm -fr conftest*
12237 fi
12238
12239 fi
12240
12241 echo "$ac_t""$ol_cv_pthread_create" 1>&6
12242
12243                 if test $ol_cv_pthread_create != no ; then
12244                         ol_link_threads=posix
12245                         ol_link_pthreads=""
12246                 fi
12247                 
12248                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
12249 if test "$ol_link_threads" = no ; then
12250         # try -kthread
12251         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
12252 echo "configure:12253: checking for pthread link with -kthread" >&5
12253 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
12254   echo $ac_n "(cached) $ac_c" 1>&6
12255 else
12256   
12257                 # save the flags
12258                 ol_LIBS="$LIBS"
12259                 LIBS="-kthread $LIBS"
12260
12261                 if test "$cross_compiling" = yes; then
12262   cat > conftest.$ac_ext <<EOF
12263 #line 12264 "configure"
12264 #include "confdefs.h"
12265 /* pthread test headers */
12266 #include <pthread.h>
12267 #if HAVE_PTHREADS < 7
12268 #include <errno.h>
12269 #endif
12270 #ifndef NULL
12271 #define NULL (void*)0
12272 #endif
12273
12274 static void *task(p)
12275         void *p;
12276 {
12277         return (void *) (p == NULL);
12278 }
12279
12280 int main() {
12281
12282         /* pthread test function */
12283 #ifndef PTHREAD_CREATE_DETACHED
12284 #define PTHREAD_CREATE_DETACHED 1
12285 #endif
12286         pthread_t t;
12287         int status;
12288         int detach = PTHREAD_CREATE_DETACHED;
12289
12290 #if HAVE_PTHREADS > 4
12291         /* Final pthreads */
12292         pthread_attr_t attr;
12293
12294         status = pthread_attr_init(&attr);
12295         if( status ) return status;
12296
12297 #if HAVE_PTHREADS < 7
12298         status = pthread_attr_setdetachstate(&attr, &detach);
12299         if( status < 0 ) status = errno;
12300 #else
12301         status = pthread_attr_setdetachstate(&attr, detach);
12302 #endif
12303         if( status ) return status;
12304         status = pthread_create( &t, &attr, task, NULL );
12305 #if HAVE_PTHREADS < 7
12306         if( status < 0 ) status = errno;
12307 #endif
12308         if( status ) return status;
12309 #else
12310         /* Draft 4 pthreads */
12311         status = pthread_create( &t, pthread_attr_default, task, NULL );
12312         if( status ) return errno;
12313
12314         /* give thread a chance to complete */
12315         /* it should remain joinable and hence detachable */
12316         sleep( 1 );
12317
12318         status = pthread_detach( &t );
12319         if( status ) return errno;
12320 #endif
12321
12322 #ifdef HAVE_LINUX_THREADS
12323         pthread_kill_other_threads_np();
12324 #endif
12325
12326         return 0;
12327
12328 ; return 0; }
12329 EOF
12330 if { (eval echo configure:12331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12331   rm -rf conftest*
12332   ol_cv_pthread_kthread=yes
12333 else
12334   echo "configure: failed program was:" >&5
12335   cat conftest.$ac_ext >&5
12336   rm -rf conftest*
12337   ol_cv_pthread_kthread=no
12338 fi
12339 rm -f conftest*
12340 else
12341   cat > conftest.$ac_ext <<EOF
12342 #line 12343 "configure"
12343 #include "confdefs.h"
12344 /* pthread test headers */
12345 #include <pthread.h>
12346 #if HAVE_PTHREADS < 7
12347 #include <errno.h>
12348 #endif
12349 #ifndef NULL
12350 #define NULL (void*)0
12351 #endif
12352
12353 static void *task(p)
12354         void *p;
12355 {
12356         return (void *) (p == NULL);
12357 }
12358
12359
12360 int main(argc, argv)
12361         int argc;
12362         char **argv;
12363 {
12364
12365         /* pthread test function */
12366 #ifndef PTHREAD_CREATE_DETACHED
12367 #define PTHREAD_CREATE_DETACHED 1
12368 #endif
12369         pthread_t t;
12370         int status;
12371         int detach = PTHREAD_CREATE_DETACHED;
12372
12373 #if HAVE_PTHREADS > 4
12374         /* Final pthreads */
12375         pthread_attr_t attr;
12376
12377         status = pthread_attr_init(&attr);
12378         if( status ) return status;
12379
12380 #if HAVE_PTHREADS < 7
12381         status = pthread_attr_setdetachstate(&attr, &detach);
12382         if( status < 0 ) status = errno;
12383 #else
12384         status = pthread_attr_setdetachstate(&attr, detach);
12385 #endif
12386         if( status ) return status;
12387         status = pthread_create( &t, &attr, task, NULL );
12388 #if HAVE_PTHREADS < 7
12389         if( status < 0 ) status = errno;
12390 #endif
12391         if( status ) return status;
12392 #else
12393         /* Draft 4 pthreads */
12394         status = pthread_create( &t, pthread_attr_default, task, NULL );
12395         if( status ) return errno;
12396
12397         /* give thread a chance to complete */
12398         /* it should remain joinable and hence detachable */
12399         sleep( 1 );
12400
12401         status = pthread_detach( &t );
12402         if( status ) return errno;
12403 #endif
12404
12405 #ifdef HAVE_LINUX_THREADS
12406         pthread_kill_other_threads_np();
12407 #endif
12408
12409         return 0;
12410
12411 }
12412
12413 EOF
12414 if { (eval echo configure:12415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12415 then
12416   ol_cv_pthread_kthread=yes
12417 else
12418   echo "configure: failed program was:" >&5
12419   cat conftest.$ac_ext >&5
12420   rm -fr conftest*
12421   ol_cv_pthread_kthread=no
12422 fi
12423 rm -fr conftest*
12424 fi
12425
12426
12427                 # restore the LIBS
12428                 LIBS="$ol_LIBS"
12429         
12430 fi
12431
12432 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
12433
12434         if test $ol_cv_pthread_kthread = yes ; then
12435                 ol_link_pthreads="-kthread"
12436                 ol_link_threads=posix
12437         fi
12438 fi
12439
12440                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
12441 if test "$ol_link_threads" = no ; then
12442         # try -pthread
12443         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
12444 echo "configure:12445: checking for pthread link with -pthread" >&5
12445 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
12446   echo $ac_n "(cached) $ac_c" 1>&6
12447 else
12448   
12449                 # save the flags
12450                 ol_LIBS="$LIBS"
12451                 LIBS="-pthread $LIBS"
12452
12453                 if test "$cross_compiling" = yes; then
12454   cat > conftest.$ac_ext <<EOF
12455 #line 12456 "configure"
12456 #include "confdefs.h"
12457 /* pthread test headers */
12458 #include <pthread.h>
12459 #if HAVE_PTHREADS < 7
12460 #include <errno.h>
12461 #endif
12462 #ifndef NULL
12463 #define NULL (void*)0
12464 #endif
12465
12466 static void *task(p)
12467         void *p;
12468 {
12469         return (void *) (p == NULL);
12470 }
12471
12472 int main() {
12473
12474         /* pthread test function */
12475 #ifndef PTHREAD_CREATE_DETACHED
12476 #define PTHREAD_CREATE_DETACHED 1
12477 #endif
12478         pthread_t t;
12479         int status;
12480         int detach = PTHREAD_CREATE_DETACHED;
12481
12482 #if HAVE_PTHREADS > 4
12483         /* Final pthreads */
12484         pthread_attr_t attr;
12485
12486         status = pthread_attr_init(&attr);
12487         if( status ) return status;
12488
12489 #if HAVE_PTHREADS < 7
12490         status = pthread_attr_setdetachstate(&attr, &detach);
12491         if( status < 0 ) status = errno;
12492 #else
12493         status = pthread_attr_setdetachstate(&attr, detach);
12494 #endif
12495         if( status ) return status;
12496         status = pthread_create( &t, &attr, task, NULL );
12497 #if HAVE_PTHREADS < 7
12498         if( status < 0 ) status = errno;
12499 #endif
12500         if( status ) return status;
12501 #else
12502         /* Draft 4 pthreads */
12503         status = pthread_create( &t, pthread_attr_default, task, NULL );
12504         if( status ) return errno;
12505
12506         /* give thread a chance to complete */
12507         /* it should remain joinable and hence detachable */
12508         sleep( 1 );
12509
12510         status = pthread_detach( &t );
12511         if( status ) return errno;
12512 #endif
12513
12514 #ifdef HAVE_LINUX_THREADS
12515         pthread_kill_other_threads_np();
12516 #endif
12517
12518         return 0;
12519
12520 ; return 0; }
12521 EOF
12522 if { (eval echo configure:12523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12523   rm -rf conftest*
12524   ol_cv_pthread_pthread=yes
12525 else
12526   echo "configure: failed program was:" >&5
12527   cat conftest.$ac_ext >&5
12528   rm -rf conftest*
12529   ol_cv_pthread_pthread=no
12530 fi
12531 rm -f conftest*
12532 else
12533   cat > conftest.$ac_ext <<EOF
12534 #line 12535 "configure"
12535 #include "confdefs.h"
12536 /* pthread test headers */
12537 #include <pthread.h>
12538 #if HAVE_PTHREADS < 7
12539 #include <errno.h>
12540 #endif
12541 #ifndef NULL
12542 #define NULL (void*)0
12543 #endif
12544
12545 static void *task(p)
12546         void *p;
12547 {
12548         return (void *) (p == NULL);
12549 }
12550
12551
12552 int main(argc, argv)
12553         int argc;
12554         char **argv;
12555 {
12556
12557         /* pthread test function */
12558 #ifndef PTHREAD_CREATE_DETACHED
12559 #define PTHREAD_CREATE_DETACHED 1
12560 #endif
12561         pthread_t t;
12562         int status;
12563         int detach = PTHREAD_CREATE_DETACHED;
12564
12565 #if HAVE_PTHREADS > 4
12566         /* Final pthreads */
12567         pthread_attr_t attr;
12568
12569         status = pthread_attr_init(&attr);
12570         if( status ) return status;
12571
12572 #if HAVE_PTHREADS < 7
12573         status = pthread_attr_setdetachstate(&attr, &detach);
12574         if( status < 0 ) status = errno;
12575 #else
12576         status = pthread_attr_setdetachstate(&attr, detach);
12577 #endif
12578         if( status ) return status;
12579         status = pthread_create( &t, &attr, task, NULL );
12580 #if HAVE_PTHREADS < 7
12581         if( status < 0 ) status = errno;
12582 #endif
12583         if( status ) return status;
12584 #else
12585         /* Draft 4 pthreads */
12586         status = pthread_create( &t, pthread_attr_default, task, NULL );
12587         if( status ) return errno;
12588
12589         /* give thread a chance to complete */
12590         /* it should remain joinable and hence detachable */
12591         sleep( 1 );
12592
12593         status = pthread_detach( &t );
12594         if( status ) return errno;
12595 #endif
12596
12597 #ifdef HAVE_LINUX_THREADS
12598         pthread_kill_other_threads_np();
12599 #endif
12600
12601         return 0;
12602
12603 }
12604
12605 EOF
12606 if { (eval echo configure:12607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12607 then
12608   ol_cv_pthread_pthread=yes
12609 else
12610   echo "configure: failed program was:" >&5
12611   cat conftest.$ac_ext >&5
12612   rm -fr conftest*
12613   ol_cv_pthread_pthread=no
12614 fi
12615 rm -fr conftest*
12616 fi
12617
12618
12619                 # restore the LIBS
12620                 LIBS="$ol_LIBS"
12621         
12622 fi
12623
12624 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
12625
12626         if test $ol_cv_pthread_pthread = yes ; then
12627                 ol_link_pthreads="-pthread"
12628                 ol_link_threads=posix
12629         fi
12630 fi
12631
12632                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
12633 if test "$ol_link_threads" = no ; then
12634         # try -pthreads
12635         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
12636 echo "configure:12637: checking for pthread link with -pthreads" >&5
12637 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
12638   echo $ac_n "(cached) $ac_c" 1>&6
12639 else
12640   
12641                 # save the flags
12642                 ol_LIBS="$LIBS"
12643                 LIBS="-pthreads $LIBS"
12644
12645                 if test "$cross_compiling" = yes; then
12646   cat > conftest.$ac_ext <<EOF
12647 #line 12648 "configure"
12648 #include "confdefs.h"
12649 /* pthread test headers */
12650 #include <pthread.h>
12651 #if HAVE_PTHREADS < 7
12652 #include <errno.h>
12653 #endif
12654 #ifndef NULL
12655 #define NULL (void*)0
12656 #endif
12657
12658 static void *task(p)
12659         void *p;
12660 {
12661         return (void *) (p == NULL);
12662 }
12663
12664 int main() {
12665
12666         /* pthread test function */
12667 #ifndef PTHREAD_CREATE_DETACHED
12668 #define PTHREAD_CREATE_DETACHED 1
12669 #endif
12670         pthread_t t;
12671         int status;
12672         int detach = PTHREAD_CREATE_DETACHED;
12673
12674 #if HAVE_PTHREADS > 4
12675         /* Final pthreads */
12676         pthread_attr_t attr;
12677
12678         status = pthread_attr_init(&attr);
12679         if( status ) return status;
12680
12681 #if HAVE_PTHREADS < 7
12682         status = pthread_attr_setdetachstate(&attr, &detach);
12683         if( status < 0 ) status = errno;
12684 #else
12685         status = pthread_attr_setdetachstate(&attr, detach);
12686 #endif
12687         if( status ) return status;
12688         status = pthread_create( &t, &attr, task, NULL );
12689 #if HAVE_PTHREADS < 7
12690         if( status < 0 ) status = errno;
12691 #endif
12692         if( status ) return status;
12693 #else
12694         /* Draft 4 pthreads */
12695         status = pthread_create( &t, pthread_attr_default, task, NULL );
12696         if( status ) return errno;
12697
12698         /* give thread a chance to complete */
12699         /* it should remain joinable and hence detachable */
12700         sleep( 1 );
12701
12702         status = pthread_detach( &t );
12703         if( status ) return errno;
12704 #endif
12705
12706 #ifdef HAVE_LINUX_THREADS
12707         pthread_kill_other_threads_np();
12708 #endif
12709
12710         return 0;
12711
12712 ; return 0; }
12713 EOF
12714 if { (eval echo configure:12715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12715   rm -rf conftest*
12716   ol_cv_pthread_pthreads=yes
12717 else
12718   echo "configure: failed program was:" >&5
12719   cat conftest.$ac_ext >&5
12720   rm -rf conftest*
12721   ol_cv_pthread_pthreads=no
12722 fi
12723 rm -f conftest*
12724 else
12725   cat > conftest.$ac_ext <<EOF
12726 #line 12727 "configure"
12727 #include "confdefs.h"
12728 /* pthread test headers */
12729 #include <pthread.h>
12730 #if HAVE_PTHREADS < 7
12731 #include <errno.h>
12732 #endif
12733 #ifndef NULL
12734 #define NULL (void*)0
12735 #endif
12736
12737 static void *task(p)
12738         void *p;
12739 {
12740         return (void *) (p == NULL);
12741 }
12742
12743
12744 int main(argc, argv)
12745         int argc;
12746         char **argv;
12747 {
12748
12749         /* pthread test function */
12750 #ifndef PTHREAD_CREATE_DETACHED
12751 #define PTHREAD_CREATE_DETACHED 1
12752 #endif
12753         pthread_t t;
12754         int status;
12755         int detach = PTHREAD_CREATE_DETACHED;
12756
12757 #if HAVE_PTHREADS > 4
12758         /* Final pthreads */
12759         pthread_attr_t attr;
12760
12761         status = pthread_attr_init(&attr);
12762         if( status ) return status;
12763
12764 #if HAVE_PTHREADS < 7
12765         status = pthread_attr_setdetachstate(&attr, &detach);
12766         if( status < 0 ) status = errno;
12767 #else
12768         status = pthread_attr_setdetachstate(&attr, detach);
12769 #endif
12770         if( status ) return status;
12771         status = pthread_create( &t, &attr, task, NULL );
12772 #if HAVE_PTHREADS < 7
12773         if( status < 0 ) status = errno;
12774 #endif
12775         if( status ) return status;
12776 #else
12777         /* Draft 4 pthreads */
12778         status = pthread_create( &t, pthread_attr_default, task, NULL );
12779         if( status ) return errno;
12780
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 errno;
12787 #endif
12788
12789 #ifdef HAVE_LINUX_THREADS
12790         pthread_kill_other_threads_np();
12791 #endif
12792
12793         return 0;
12794
12795 }
12796
12797 EOF
12798 if { (eval echo configure:12799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12799 then
12800   ol_cv_pthread_pthreads=yes
12801 else
12802   echo "configure: failed program was:" >&5
12803   cat conftest.$ac_ext >&5
12804   rm -fr conftest*
12805   ol_cv_pthread_pthreads=no
12806 fi
12807 rm -fr conftest*
12808 fi
12809
12810
12811                 # restore the LIBS
12812                 LIBS="$ol_LIBS"
12813         
12814 fi
12815
12816 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
12817
12818         if test $ol_cv_pthread_pthreads = yes ; then
12819                 ol_link_pthreads="-pthreads"
12820                 ol_link_threads=posix
12821         fi
12822 fi
12823
12824                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
12825 if test "$ol_link_threads" = no ; then
12826         # try -mthreads
12827         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
12828 echo "configure:12829: checking for pthread link with -mthreads" >&5
12829 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
12830   echo $ac_n "(cached) $ac_c" 1>&6
12831 else
12832   
12833                 # save the flags
12834                 ol_LIBS="$LIBS"
12835                 LIBS="-mthreads $LIBS"
12836
12837                 if test "$cross_compiling" = yes; then
12838   cat > conftest.$ac_ext <<EOF
12839 #line 12840 "configure"
12840 #include "confdefs.h"
12841 /* pthread test headers */
12842 #include <pthread.h>
12843 #if HAVE_PTHREADS < 7
12844 #include <errno.h>
12845 #endif
12846 #ifndef NULL
12847 #define NULL (void*)0
12848 #endif
12849
12850 static void *task(p)
12851         void *p;
12852 {
12853         return (void *) (p == NULL);
12854 }
12855
12856 int main() {
12857
12858         /* pthread test function */
12859 #ifndef PTHREAD_CREATE_DETACHED
12860 #define PTHREAD_CREATE_DETACHED 1
12861 #endif
12862         pthread_t t;
12863         int status;
12864         int detach = PTHREAD_CREATE_DETACHED;
12865
12866 #if HAVE_PTHREADS > 4
12867         /* Final pthreads */
12868         pthread_attr_t attr;
12869
12870         status = pthread_attr_init(&attr);
12871         if( status ) return status;
12872
12873 #if HAVE_PTHREADS < 7
12874         status = pthread_attr_setdetachstate(&attr, &detach);
12875         if( status < 0 ) status = errno;
12876 #else
12877         status = pthread_attr_setdetachstate(&attr, detach);
12878 #endif
12879         if( status ) return status;
12880         status = pthread_create( &t, &attr, task, NULL );
12881 #if HAVE_PTHREADS < 7
12882         if( status < 0 ) status = errno;
12883 #endif
12884         if( status ) return status;
12885 #else
12886         /* Draft 4 pthreads */
12887         status = pthread_create( &t, pthread_attr_default, task, NULL );
12888         if( status ) return errno;
12889
12890         /* give thread a chance to complete */
12891         /* it should remain joinable and hence detachable */
12892         sleep( 1 );
12893
12894         status = pthread_detach( &t );
12895         if( status ) return errno;
12896 #endif
12897
12898 #ifdef HAVE_LINUX_THREADS
12899         pthread_kill_other_threads_np();
12900 #endif
12901
12902         return 0;
12903
12904 ; return 0; }
12905 EOF
12906 if { (eval echo configure:12907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12907   rm -rf conftest*
12908   ol_cv_pthread_mthreads=yes
12909 else
12910   echo "configure: failed program was:" >&5
12911   cat conftest.$ac_ext >&5
12912   rm -rf conftest*
12913   ol_cv_pthread_mthreads=no
12914 fi
12915 rm -f conftest*
12916 else
12917   cat > conftest.$ac_ext <<EOF
12918 #line 12919 "configure"
12919 #include "confdefs.h"
12920 /* pthread test headers */
12921 #include <pthread.h>
12922 #if HAVE_PTHREADS < 7
12923 #include <errno.h>
12924 #endif
12925 #ifndef NULL
12926 #define NULL (void*)0
12927 #endif
12928
12929 static void *task(p)
12930         void *p;
12931 {
12932         return (void *) (p == NULL);
12933 }
12934
12935
12936 int main(argc, argv)
12937         int argc;
12938         char **argv;
12939 {
12940
12941         /* pthread test function */
12942 #ifndef PTHREAD_CREATE_DETACHED
12943 #define PTHREAD_CREATE_DETACHED 1
12944 #endif
12945         pthread_t t;
12946         int status;
12947         int detach = PTHREAD_CREATE_DETACHED;
12948
12949 #if HAVE_PTHREADS > 4
12950         /* Final pthreads */
12951         pthread_attr_t attr;
12952
12953         status = pthread_attr_init(&attr);
12954         if( status ) return status;
12955
12956 #if HAVE_PTHREADS < 7
12957         status = pthread_attr_setdetachstate(&attr, &detach);
12958         if( status < 0 ) status = errno;
12959 #else
12960         status = pthread_attr_setdetachstate(&attr, detach);
12961 #endif
12962         if( status ) return status;
12963         status = pthread_create( &t, &attr, task, NULL );
12964 #if HAVE_PTHREADS < 7
12965         if( status < 0 ) status = errno;
12966 #endif
12967         if( status ) return status;
12968 #else
12969         /* Draft 4 pthreads */
12970         status = pthread_create( &t, pthread_attr_default, task, NULL );
12971         if( status ) return errno;
12972
12973         /* give thread a chance to complete */
12974         /* it should remain joinable and hence detachable */
12975         sleep( 1 );
12976
12977         status = pthread_detach( &t );
12978         if( status ) return errno;
12979 #endif
12980
12981 #ifdef HAVE_LINUX_THREADS
12982         pthread_kill_other_threads_np();
12983 #endif
12984
12985         return 0;
12986
12987 }
12988
12989 EOF
12990 if { (eval echo configure:12991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12991 then
12992   ol_cv_pthread_mthreads=yes
12993 else
12994   echo "configure: failed program was:" >&5
12995   cat conftest.$ac_ext >&5
12996   rm -fr conftest*
12997   ol_cv_pthread_mthreads=no
12998 fi
12999 rm -fr conftest*
13000 fi
13001
13002
13003                 # restore the LIBS
13004                 LIBS="$ol_LIBS"
13005         
13006 fi
13007
13008 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
13009
13010         if test $ol_cv_pthread_mthreads = yes ; then
13011                 ol_link_pthreads="-mthreads"
13012                 ol_link_threads=posix
13013         fi
13014 fi
13015
13016                 # Pthread try link: -thread (ol_cv_pthread_thread)
13017 if test "$ol_link_threads" = no ; then
13018         # try -thread
13019         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
13020 echo "configure:13021: checking for pthread link with -thread" >&5
13021 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
13022   echo $ac_n "(cached) $ac_c" 1>&6
13023 else
13024   
13025                 # save the flags
13026                 ol_LIBS="$LIBS"
13027                 LIBS="-thread $LIBS"
13028
13029                 if test "$cross_compiling" = yes; then
13030   cat > conftest.$ac_ext <<EOF
13031 #line 13032 "configure"
13032 #include "confdefs.h"
13033 /* pthread test headers */
13034 #include <pthread.h>
13035 #if HAVE_PTHREADS < 7
13036 #include <errno.h>
13037 #endif
13038 #ifndef NULL
13039 #define NULL (void*)0
13040 #endif
13041
13042 static void *task(p)
13043         void *p;
13044 {
13045         return (void *) (p == NULL);
13046 }
13047
13048 int main() {
13049
13050         /* pthread test function */
13051 #ifndef PTHREAD_CREATE_DETACHED
13052 #define PTHREAD_CREATE_DETACHED 1
13053 #endif
13054         pthread_t t;
13055         int status;
13056         int detach = PTHREAD_CREATE_DETACHED;
13057
13058 #if HAVE_PTHREADS > 4
13059         /* Final pthreads */
13060         pthread_attr_t attr;
13061
13062         status = pthread_attr_init(&attr);
13063         if( status ) return status;
13064
13065 #if HAVE_PTHREADS < 7
13066         status = pthread_attr_setdetachstate(&attr, &detach);
13067         if( status < 0 ) status = errno;
13068 #else
13069         status = pthread_attr_setdetachstate(&attr, detach);
13070 #endif
13071         if( status ) return status;
13072         status = pthread_create( &t, &attr, task, NULL );
13073 #if HAVE_PTHREADS < 7
13074         if( status < 0 ) status = errno;
13075 #endif
13076         if( status ) return status;
13077 #else
13078         /* Draft 4 pthreads */
13079         status = pthread_create( &t, pthread_attr_default, task, NULL );
13080         if( status ) return errno;
13081
13082         /* give thread a chance to complete */
13083         /* it should remain joinable and hence detachable */
13084         sleep( 1 );
13085
13086         status = pthread_detach( &t );
13087         if( status ) return errno;
13088 #endif
13089
13090 #ifdef HAVE_LINUX_THREADS
13091         pthread_kill_other_threads_np();
13092 #endif
13093
13094         return 0;
13095
13096 ; return 0; }
13097 EOF
13098 if { (eval echo configure:13099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13099   rm -rf conftest*
13100   ol_cv_pthread_thread=yes
13101 else
13102   echo "configure: failed program was:" >&5
13103   cat conftest.$ac_ext >&5
13104   rm -rf conftest*
13105   ol_cv_pthread_thread=no
13106 fi
13107 rm -f conftest*
13108 else
13109   cat > conftest.$ac_ext <<EOF
13110 #line 13111 "configure"
13111 #include "confdefs.h"
13112 /* pthread test headers */
13113 #include <pthread.h>
13114 #if HAVE_PTHREADS < 7
13115 #include <errno.h>
13116 #endif
13117 #ifndef NULL
13118 #define NULL (void*)0
13119 #endif
13120
13121 static void *task(p)
13122         void *p;
13123 {
13124         return (void *) (p == NULL);
13125 }
13126
13127
13128 int main(argc, argv)
13129         int argc;
13130         char **argv;
13131 {
13132
13133         /* pthread test function */
13134 #ifndef PTHREAD_CREATE_DETACHED
13135 #define PTHREAD_CREATE_DETACHED 1
13136 #endif
13137         pthread_t t;
13138         int status;
13139         int detach = PTHREAD_CREATE_DETACHED;
13140
13141 #if HAVE_PTHREADS > 4
13142         /* Final pthreads */
13143         pthread_attr_t attr;
13144
13145         status = pthread_attr_init(&attr);
13146         if( status ) return status;
13147
13148 #if HAVE_PTHREADS < 7
13149         status = pthread_attr_setdetachstate(&attr, &detach);
13150         if( status < 0 ) status = errno;
13151 #else
13152         status = pthread_attr_setdetachstate(&attr, detach);
13153 #endif
13154         if( status ) return status;
13155         status = pthread_create( &t, &attr, task, NULL );
13156 #if HAVE_PTHREADS < 7
13157         if( status < 0 ) status = errno;
13158 #endif
13159         if( status ) return status;
13160 #else
13161         /* Draft 4 pthreads */
13162         status = pthread_create( &t, pthread_attr_default, task, NULL );
13163         if( status ) return errno;
13164
13165         /* give thread a chance to complete */
13166         /* it should remain joinable and hence detachable */
13167         sleep( 1 );
13168
13169         status = pthread_detach( &t );
13170         if( status ) return errno;
13171 #endif
13172
13173 #ifdef HAVE_LINUX_THREADS
13174         pthread_kill_other_threads_np();
13175 #endif
13176
13177         return 0;
13178
13179 }
13180
13181 EOF
13182 if { (eval echo configure:13183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13183 then
13184   ol_cv_pthread_thread=yes
13185 else
13186   echo "configure: failed program was:" >&5
13187   cat conftest.$ac_ext >&5
13188   rm -fr conftest*
13189   ol_cv_pthread_thread=no
13190 fi
13191 rm -fr conftest*
13192 fi
13193
13194
13195                 # restore the LIBS
13196                 LIBS="$ol_LIBS"
13197         
13198 fi
13199
13200 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
13201
13202         if test $ol_cv_pthread_thread = yes ; then
13203                 ol_link_pthreads="-thread"
13204                 ol_link_threads=posix
13205         fi
13206 fi
13207
13208
13209                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
13210 if test "$ol_link_threads" = no ; then
13211         # try -lpthread -lmach -lexc -lc_r
13212         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
13213 echo "configure:13214: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
13214 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
13215   echo $ac_n "(cached) $ac_c" 1>&6
13216 else
13217   
13218                 # save the flags
13219                 ol_LIBS="$LIBS"
13220                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
13221
13222                 if test "$cross_compiling" = yes; then
13223   cat > conftest.$ac_ext <<EOF
13224 #line 13225 "configure"
13225 #include "confdefs.h"
13226 /* pthread test headers */
13227 #include <pthread.h>
13228 #if HAVE_PTHREADS < 7
13229 #include <errno.h>
13230 #endif
13231 #ifndef NULL
13232 #define NULL (void*)0
13233 #endif
13234
13235 static void *task(p)
13236         void *p;
13237 {
13238         return (void *) (p == NULL);
13239 }
13240
13241 int main() {
13242
13243         /* pthread test function */
13244 #ifndef PTHREAD_CREATE_DETACHED
13245 #define PTHREAD_CREATE_DETACHED 1
13246 #endif
13247         pthread_t t;
13248         int status;
13249         int detach = PTHREAD_CREATE_DETACHED;
13250
13251 #if HAVE_PTHREADS > 4
13252         /* Final pthreads */
13253         pthread_attr_t attr;
13254
13255         status = pthread_attr_init(&attr);
13256         if( status ) return status;
13257
13258 #if HAVE_PTHREADS < 7
13259         status = pthread_attr_setdetachstate(&attr, &detach);
13260         if( status < 0 ) status = errno;
13261 #else
13262         status = pthread_attr_setdetachstate(&attr, detach);
13263 #endif
13264         if( status ) return status;
13265         status = pthread_create( &t, &attr, task, NULL );
13266 #if HAVE_PTHREADS < 7
13267         if( status < 0 ) status = errno;
13268 #endif
13269         if( status ) return status;
13270 #else
13271         /* Draft 4 pthreads */
13272         status = pthread_create( &t, pthread_attr_default, task, NULL );
13273         if( status ) return errno;
13274
13275         /* give thread a chance to complete */
13276         /* it should remain joinable and hence detachable */
13277         sleep( 1 );
13278
13279         status = pthread_detach( &t );
13280         if( status ) return errno;
13281 #endif
13282
13283 #ifdef HAVE_LINUX_THREADS
13284         pthread_kill_other_threads_np();
13285 #endif
13286
13287         return 0;
13288
13289 ; return 0; }
13290 EOF
13291 if { (eval echo configure:13292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13292   rm -rf conftest*
13293   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
13294 else
13295   echo "configure: failed program was:" >&5
13296   cat conftest.$ac_ext >&5
13297   rm -rf conftest*
13298   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
13299 fi
13300 rm -f conftest*
13301 else
13302   cat > conftest.$ac_ext <<EOF
13303 #line 13304 "configure"
13304 #include "confdefs.h"
13305 /* pthread test headers */
13306 #include <pthread.h>
13307 #if HAVE_PTHREADS < 7
13308 #include <errno.h>
13309 #endif
13310 #ifndef NULL
13311 #define NULL (void*)0
13312 #endif
13313
13314 static void *task(p)
13315         void *p;
13316 {
13317         return (void *) (p == NULL);
13318 }
13319
13320
13321 int main(argc, argv)
13322         int argc;
13323         char **argv;
13324 {
13325
13326         /* pthread test function */
13327 #ifndef PTHREAD_CREATE_DETACHED
13328 #define PTHREAD_CREATE_DETACHED 1
13329 #endif
13330         pthread_t t;
13331         int status;
13332         int detach = PTHREAD_CREATE_DETACHED;
13333
13334 #if HAVE_PTHREADS > 4
13335         /* Final pthreads */
13336         pthread_attr_t attr;
13337
13338         status = pthread_attr_init(&attr);
13339         if( status ) return status;
13340
13341 #if HAVE_PTHREADS < 7
13342         status = pthread_attr_setdetachstate(&attr, &detach);
13343         if( status < 0 ) status = errno;
13344 #else
13345         status = pthread_attr_setdetachstate(&attr, detach);
13346 #endif
13347         if( status ) return status;
13348         status = pthread_create( &t, &attr, task, NULL );
13349 #if HAVE_PTHREADS < 7
13350         if( status < 0 ) status = errno;
13351 #endif
13352         if( status ) return status;
13353 #else
13354         /* Draft 4 pthreads */
13355         status = pthread_create( &t, pthread_attr_default, task, NULL );
13356         if( status ) return errno;
13357
13358         /* give thread a chance to complete */
13359         /* it should remain joinable and hence detachable */
13360         sleep( 1 );
13361
13362         status = pthread_detach( &t );
13363         if( status ) return errno;
13364 #endif
13365
13366 #ifdef HAVE_LINUX_THREADS
13367         pthread_kill_other_threads_np();
13368 #endif
13369
13370         return 0;
13371
13372 }
13373
13374 EOF
13375 if { (eval echo configure:13376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13376 then
13377   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
13378 else
13379   echo "configure: failed program was:" >&5
13380   cat conftest.$ac_ext >&5
13381   rm -fr conftest*
13382   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
13383 fi
13384 rm -fr conftest*
13385 fi
13386
13387
13388                 # restore the LIBS
13389                 LIBS="$ol_LIBS"
13390         
13391 fi
13392
13393 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
13394
13395         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
13396                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
13397                 ol_link_threads=posix
13398         fi
13399 fi
13400
13401                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
13402 if test "$ol_link_threads" = no ; then
13403         # try -lpthread -lmach -lexc
13404         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
13405 echo "configure:13406: checking for pthread link with -lpthread -lmach -lexc" >&5
13406 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
13407   echo $ac_n "(cached) $ac_c" 1>&6
13408 else
13409   
13410                 # save the flags
13411                 ol_LIBS="$LIBS"
13412                 LIBS="-lpthread -lmach -lexc $LIBS"
13413
13414                 if test "$cross_compiling" = yes; then
13415   cat > conftest.$ac_ext <<EOF
13416 #line 13417 "configure"
13417 #include "confdefs.h"
13418 /* pthread test headers */
13419 #include <pthread.h>
13420 #if HAVE_PTHREADS < 7
13421 #include <errno.h>
13422 #endif
13423 #ifndef NULL
13424 #define NULL (void*)0
13425 #endif
13426
13427 static void *task(p)
13428         void *p;
13429 {
13430         return (void *) (p == NULL);
13431 }
13432
13433 int main() {
13434
13435         /* pthread test function */
13436 #ifndef PTHREAD_CREATE_DETACHED
13437 #define PTHREAD_CREATE_DETACHED 1
13438 #endif
13439         pthread_t t;
13440         int status;
13441         int detach = PTHREAD_CREATE_DETACHED;
13442
13443 #if HAVE_PTHREADS > 4
13444         /* Final pthreads */
13445         pthread_attr_t attr;
13446
13447         status = pthread_attr_init(&attr);
13448         if( status ) return status;
13449
13450 #if HAVE_PTHREADS < 7
13451         status = pthread_attr_setdetachstate(&attr, &detach);
13452         if( status < 0 ) status = errno;
13453 #else
13454         status = pthread_attr_setdetachstate(&attr, detach);
13455 #endif
13456         if( status ) return status;
13457         status = pthread_create( &t, &attr, task, NULL );
13458 #if HAVE_PTHREADS < 7
13459         if( status < 0 ) status = errno;
13460 #endif
13461         if( status ) return status;
13462 #else
13463         /* Draft 4 pthreads */
13464         status = pthread_create( &t, pthread_attr_default, task, NULL );
13465         if( status ) return errno;
13466
13467         /* give thread a chance to complete */
13468         /* it should remain joinable and hence detachable */
13469         sleep( 1 );
13470
13471         status = pthread_detach( &t );
13472         if( status ) return errno;
13473 #endif
13474
13475 #ifdef HAVE_LINUX_THREADS
13476         pthread_kill_other_threads_np();
13477 #endif
13478
13479         return 0;
13480
13481 ; return 0; }
13482 EOF
13483 if { (eval echo configure:13484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13484   rm -rf conftest*
13485   ol_cv_pthread_lpthread_lmach_lexc=yes
13486 else
13487   echo "configure: failed program was:" >&5
13488   cat conftest.$ac_ext >&5
13489   rm -rf conftest*
13490   ol_cv_pthread_lpthread_lmach_lexc=no
13491 fi
13492 rm -f conftest*
13493 else
13494   cat > conftest.$ac_ext <<EOF
13495 #line 13496 "configure"
13496 #include "confdefs.h"
13497 /* pthread test headers */
13498 #include <pthread.h>
13499 #if HAVE_PTHREADS < 7
13500 #include <errno.h>
13501 #endif
13502 #ifndef NULL
13503 #define NULL (void*)0
13504 #endif
13505
13506 static void *task(p)
13507         void *p;
13508 {
13509         return (void *) (p == NULL);
13510 }
13511
13512
13513 int main(argc, argv)
13514         int argc;
13515         char **argv;
13516 {
13517
13518         /* pthread test function */
13519 #ifndef PTHREAD_CREATE_DETACHED
13520 #define PTHREAD_CREATE_DETACHED 1
13521 #endif
13522         pthread_t t;
13523         int status;
13524         int detach = PTHREAD_CREATE_DETACHED;
13525
13526 #if HAVE_PTHREADS > 4
13527         /* Final pthreads */
13528         pthread_attr_t attr;
13529
13530         status = pthread_attr_init(&attr);
13531         if( status ) return status;
13532
13533 #if HAVE_PTHREADS < 7
13534         status = pthread_attr_setdetachstate(&attr, &detach);
13535         if( status < 0 ) status = errno;
13536 #else
13537         status = pthread_attr_setdetachstate(&attr, detach);
13538 #endif
13539         if( status ) return status;
13540         status = pthread_create( &t, &attr, task, NULL );
13541 #if HAVE_PTHREADS < 7
13542         if( status < 0 ) status = errno;
13543 #endif
13544         if( status ) return status;
13545 #else
13546         /* Draft 4 pthreads */
13547         status = pthread_create( &t, pthread_attr_default, task, NULL );
13548         if( status ) return errno;
13549
13550         /* give thread a chance to complete */
13551         /* it should remain joinable and hence detachable */
13552         sleep( 1 );
13553
13554         status = pthread_detach( &t );
13555         if( status ) return errno;
13556 #endif
13557
13558 #ifdef HAVE_LINUX_THREADS
13559         pthread_kill_other_threads_np();
13560 #endif
13561
13562         return 0;
13563
13564 }
13565
13566 EOF
13567 if { (eval echo configure:13568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13568 then
13569   ol_cv_pthread_lpthread_lmach_lexc=yes
13570 else
13571   echo "configure: failed program was:" >&5
13572   cat conftest.$ac_ext >&5
13573   rm -fr conftest*
13574   ol_cv_pthread_lpthread_lmach_lexc=no
13575 fi
13576 rm -fr conftest*
13577 fi
13578
13579
13580                 # restore the LIBS
13581                 LIBS="$ol_LIBS"
13582         
13583 fi
13584
13585 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
13586
13587         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
13588                 ol_link_pthreads="-lpthread -lmach -lexc"
13589                 ol_link_threads=posix
13590         fi
13591 fi
13592
13593
13594                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
13595 if test "$ol_link_threads" = no ; then
13596         # try -lpthread -Wl,-woff,85
13597         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
13598 echo "configure:13599: checking for pthread link with -lpthread -Wl,-woff,85" >&5
13599 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
13600   echo $ac_n "(cached) $ac_c" 1>&6
13601 else
13602   
13603                 # save the flags
13604                 ol_LIBS="$LIBS"
13605                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
13606
13607                 if test "$cross_compiling" = yes; then
13608   cat > conftest.$ac_ext <<EOF
13609 #line 13610 "configure"
13610 #include "confdefs.h"
13611 /* pthread test headers */
13612 #include <pthread.h>
13613 #if HAVE_PTHREADS < 7
13614 #include <errno.h>
13615 #endif
13616 #ifndef NULL
13617 #define NULL (void*)0
13618 #endif
13619
13620 static void *task(p)
13621         void *p;
13622 {
13623         return (void *) (p == NULL);
13624 }
13625
13626 int main() {
13627
13628         /* pthread test function */
13629 #ifndef PTHREAD_CREATE_DETACHED
13630 #define PTHREAD_CREATE_DETACHED 1
13631 #endif
13632         pthread_t t;
13633         int status;
13634         int detach = PTHREAD_CREATE_DETACHED;
13635
13636 #if HAVE_PTHREADS > 4
13637         /* Final pthreads */
13638         pthread_attr_t attr;
13639
13640         status = pthread_attr_init(&attr);
13641         if( status ) return status;
13642
13643 #if HAVE_PTHREADS < 7
13644         status = pthread_attr_setdetachstate(&attr, &detach);
13645         if( status < 0 ) status = errno;
13646 #else
13647         status = pthread_attr_setdetachstate(&attr, detach);
13648 #endif
13649         if( status ) return status;
13650         status = pthread_create( &t, &attr, task, NULL );
13651 #if HAVE_PTHREADS < 7
13652         if( status < 0 ) status = errno;
13653 #endif
13654         if( status ) return status;
13655 #else
13656         /* Draft 4 pthreads */
13657         status = pthread_create( &t, pthread_attr_default, task, NULL );
13658         if( status ) return errno;
13659
13660         /* give thread a chance to complete */
13661         /* it should remain joinable and hence detachable */
13662         sleep( 1 );
13663
13664         status = pthread_detach( &t );
13665         if( status ) return errno;
13666 #endif
13667
13668 #ifdef HAVE_LINUX_THREADS
13669         pthread_kill_other_threads_np();
13670 #endif
13671
13672         return 0;
13673
13674 ; return 0; }
13675 EOF
13676 if { (eval echo configure:13677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13677   rm -rf conftest*
13678   ol_cv_pthread_lib_lpthread_woff=yes
13679 else
13680   echo "configure: failed program was:" >&5
13681   cat conftest.$ac_ext >&5
13682   rm -rf conftest*
13683   ol_cv_pthread_lib_lpthread_woff=no
13684 fi
13685 rm -f conftest*
13686 else
13687   cat > conftest.$ac_ext <<EOF
13688 #line 13689 "configure"
13689 #include "confdefs.h"
13690 /* pthread test headers */
13691 #include <pthread.h>
13692 #if HAVE_PTHREADS < 7
13693 #include <errno.h>
13694 #endif
13695 #ifndef NULL
13696 #define NULL (void*)0
13697 #endif
13698
13699 static void *task(p)
13700         void *p;
13701 {
13702         return (void *) (p == NULL);
13703 }
13704
13705
13706 int main(argc, argv)
13707         int argc;
13708         char **argv;
13709 {
13710
13711         /* pthread test function */
13712 #ifndef PTHREAD_CREATE_DETACHED
13713 #define PTHREAD_CREATE_DETACHED 1
13714 #endif
13715         pthread_t t;
13716         int status;
13717         int detach = PTHREAD_CREATE_DETACHED;
13718
13719 #if HAVE_PTHREADS > 4
13720         /* Final pthreads */
13721         pthread_attr_t attr;
13722
13723         status = pthread_attr_init(&attr);
13724         if( status ) return status;
13725
13726 #if HAVE_PTHREADS < 7
13727         status = pthread_attr_setdetachstate(&attr, &detach);
13728         if( status < 0 ) status = errno;
13729 #else
13730         status = pthread_attr_setdetachstate(&attr, detach);
13731 #endif
13732         if( status ) return status;
13733         status = pthread_create( &t, &attr, task, NULL );
13734 #if HAVE_PTHREADS < 7
13735         if( status < 0 ) status = errno;
13736 #endif
13737         if( status ) return status;
13738 #else
13739         /* Draft 4 pthreads */
13740         status = pthread_create( &t, pthread_attr_default, task, NULL );
13741         if( status ) return errno;
13742
13743         /* give thread a chance to complete */
13744         /* it should remain joinable and hence detachable */
13745         sleep( 1 );
13746
13747         status = pthread_detach( &t );
13748         if( status ) return errno;
13749 #endif
13750
13751 #ifdef HAVE_LINUX_THREADS
13752         pthread_kill_other_threads_np();
13753 #endif
13754
13755         return 0;
13756
13757 }
13758
13759 EOF
13760 if { (eval echo configure:13761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13761 then
13762   ol_cv_pthread_lib_lpthread_woff=yes
13763 else
13764   echo "configure: failed program was:" >&5
13765   cat conftest.$ac_ext >&5
13766   rm -fr conftest*
13767   ol_cv_pthread_lib_lpthread_woff=no
13768 fi
13769 rm -fr conftest*
13770 fi
13771
13772
13773                 # restore the LIBS
13774                 LIBS="$ol_LIBS"
13775         
13776 fi
13777
13778 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
13779
13780         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
13781                 ol_link_pthreads="-lpthread -Wl,-woff,85"
13782                 ol_link_threads=posix
13783         fi
13784 fi
13785
13786
13787                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
13788 if test "$ol_link_threads" = no ; then
13789         # try -lpthread
13790         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
13791 echo "configure:13792: checking for pthread link with -lpthread" >&5
13792 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
13793   echo $ac_n "(cached) $ac_c" 1>&6
13794 else
13795   
13796                 # save the flags
13797                 ol_LIBS="$LIBS"
13798                 LIBS="-lpthread $LIBS"
13799
13800                 if test "$cross_compiling" = yes; then
13801   cat > conftest.$ac_ext <<EOF
13802 #line 13803 "configure"
13803 #include "confdefs.h"
13804 /* pthread test headers */
13805 #include <pthread.h>
13806 #if HAVE_PTHREADS < 7
13807 #include <errno.h>
13808 #endif
13809 #ifndef NULL
13810 #define NULL (void*)0
13811 #endif
13812
13813 static void *task(p)
13814         void *p;
13815 {
13816         return (void *) (p == NULL);
13817 }
13818
13819 int main() {
13820
13821         /* pthread test function */
13822 #ifndef PTHREAD_CREATE_DETACHED
13823 #define PTHREAD_CREATE_DETACHED 1
13824 #endif
13825         pthread_t t;
13826         int status;
13827         int detach = PTHREAD_CREATE_DETACHED;
13828
13829 #if HAVE_PTHREADS > 4
13830         /* Final pthreads */
13831         pthread_attr_t attr;
13832
13833         status = pthread_attr_init(&attr);
13834         if( status ) return status;
13835
13836 #if HAVE_PTHREADS < 7
13837         status = pthread_attr_setdetachstate(&attr, &detach);
13838         if( status < 0 ) status = errno;
13839 #else
13840         status = pthread_attr_setdetachstate(&attr, detach);
13841 #endif
13842         if( status ) return status;
13843         status = pthread_create( &t, &attr, task, NULL );
13844 #if HAVE_PTHREADS < 7
13845         if( status < 0 ) status = errno;
13846 #endif
13847         if( status ) return status;
13848 #else
13849         /* Draft 4 pthreads */
13850         status = pthread_create( &t, pthread_attr_default, task, NULL );
13851         if( status ) return errno;
13852
13853         /* give thread a chance to complete */
13854         /* it should remain joinable and hence detachable */
13855         sleep( 1 );
13856
13857         status = pthread_detach( &t );
13858         if( status ) return errno;
13859 #endif
13860
13861 #ifdef HAVE_LINUX_THREADS
13862         pthread_kill_other_threads_np();
13863 #endif
13864
13865         return 0;
13866
13867 ; return 0; }
13868 EOF
13869 if { (eval echo configure:13870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13870   rm -rf conftest*
13871   ol_cv_pthread_lpthread=yes
13872 else
13873   echo "configure: failed program was:" >&5
13874   cat conftest.$ac_ext >&5
13875   rm -rf conftest*
13876   ol_cv_pthread_lpthread=no
13877 fi
13878 rm -f conftest*
13879 else
13880   cat > conftest.$ac_ext <<EOF
13881 #line 13882 "configure"
13882 #include "confdefs.h"
13883 /* pthread test headers */
13884 #include <pthread.h>
13885 #if HAVE_PTHREADS < 7
13886 #include <errno.h>
13887 #endif
13888 #ifndef NULL
13889 #define NULL (void*)0
13890 #endif
13891
13892 static void *task(p)
13893         void *p;
13894 {
13895         return (void *) (p == NULL);
13896 }
13897
13898
13899 int main(argc, argv)
13900         int argc;
13901         char **argv;
13902 {
13903
13904         /* pthread test function */
13905 #ifndef PTHREAD_CREATE_DETACHED
13906 #define PTHREAD_CREATE_DETACHED 1
13907 #endif
13908         pthread_t t;
13909         int status;
13910         int detach = PTHREAD_CREATE_DETACHED;
13911
13912 #if HAVE_PTHREADS > 4
13913         /* Final pthreads */
13914         pthread_attr_t attr;
13915
13916         status = pthread_attr_init(&attr);
13917         if( status ) return status;
13918
13919 #if HAVE_PTHREADS < 7
13920         status = pthread_attr_setdetachstate(&attr, &detach);
13921         if( status < 0 ) status = errno;
13922 #else
13923         status = pthread_attr_setdetachstate(&attr, detach);
13924 #endif
13925         if( status ) return status;
13926         status = pthread_create( &t, &attr, task, NULL );
13927 #if HAVE_PTHREADS < 7
13928         if( status < 0 ) status = errno;
13929 #endif
13930         if( status ) return status;
13931 #else
13932         /* Draft 4 pthreads */
13933         status = pthread_create( &t, pthread_attr_default, task, NULL );
13934         if( status ) return errno;
13935
13936         /* give thread a chance to complete */
13937         /* it should remain joinable and hence detachable */
13938         sleep( 1 );
13939
13940         status = pthread_detach( &t );
13941         if( status ) return errno;
13942 #endif
13943
13944 #ifdef HAVE_LINUX_THREADS
13945         pthread_kill_other_threads_np();
13946 #endif
13947
13948         return 0;
13949
13950 }
13951
13952 EOF
13953 if { (eval echo configure:13954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13954 then
13955   ol_cv_pthread_lpthread=yes
13956 else
13957   echo "configure: failed program was:" >&5
13958   cat conftest.$ac_ext >&5
13959   rm -fr conftest*
13960   ol_cv_pthread_lpthread=no
13961 fi
13962 rm -fr conftest*
13963 fi
13964
13965
13966                 # restore the LIBS
13967                 LIBS="$ol_LIBS"
13968         
13969 fi
13970
13971 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
13972
13973         if test $ol_cv_pthread_lpthread = yes ; then
13974                 ol_link_pthreads="-lpthread"
13975                 ol_link_threads=posix
13976         fi
13977 fi
13978
13979                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
13980 if test "$ol_link_threads" = no ; then
13981         # try -lc_r
13982         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
13983 echo "configure:13984: checking for pthread link with -lc_r" >&5
13984 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
13985   echo $ac_n "(cached) $ac_c" 1>&6
13986 else
13987   
13988                 # save the flags
13989                 ol_LIBS="$LIBS"
13990                 LIBS="-lc_r $LIBS"
13991
13992                 if test "$cross_compiling" = yes; then
13993   cat > conftest.$ac_ext <<EOF
13994 #line 13995 "configure"
13995 #include "confdefs.h"
13996 /* pthread test headers */
13997 #include <pthread.h>
13998 #if HAVE_PTHREADS < 7
13999 #include <errno.h>
14000 #endif
14001 #ifndef NULL
14002 #define NULL (void*)0
14003 #endif
14004
14005 static void *task(p)
14006         void *p;
14007 {
14008         return (void *) (p == NULL);
14009 }
14010
14011 int main() {
14012
14013         /* pthread test function */
14014 #ifndef PTHREAD_CREATE_DETACHED
14015 #define PTHREAD_CREATE_DETACHED 1
14016 #endif
14017         pthread_t t;
14018         int status;
14019         int detach = PTHREAD_CREATE_DETACHED;
14020
14021 #if HAVE_PTHREADS > 4
14022         /* Final pthreads */
14023         pthread_attr_t attr;
14024
14025         status = pthread_attr_init(&attr);
14026         if( status ) return status;
14027
14028 #if HAVE_PTHREADS < 7
14029         status = pthread_attr_setdetachstate(&attr, &detach);
14030         if( status < 0 ) status = errno;
14031 #else
14032         status = pthread_attr_setdetachstate(&attr, detach);
14033 #endif
14034         if( status ) return status;
14035         status = pthread_create( &t, &attr, task, NULL );
14036 #if HAVE_PTHREADS < 7
14037         if( status < 0 ) status = errno;
14038 #endif
14039         if( status ) return status;
14040 #else
14041         /* Draft 4 pthreads */
14042         status = pthread_create( &t, pthread_attr_default, task, NULL );
14043         if( status ) return errno;
14044
14045         /* give thread a chance to complete */
14046         /* it should remain joinable and hence detachable */
14047         sleep( 1 );
14048
14049         status = pthread_detach( &t );
14050         if( status ) return errno;
14051 #endif
14052
14053 #ifdef HAVE_LINUX_THREADS
14054         pthread_kill_other_threads_np();
14055 #endif
14056
14057         return 0;
14058
14059 ; return 0; }
14060 EOF
14061 if { (eval echo configure:14062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14062   rm -rf conftest*
14063   ol_cv_pthread_lc_r=yes
14064 else
14065   echo "configure: failed program was:" >&5
14066   cat conftest.$ac_ext >&5
14067   rm -rf conftest*
14068   ol_cv_pthread_lc_r=no
14069 fi
14070 rm -f conftest*
14071 else
14072   cat > conftest.$ac_ext <<EOF
14073 #line 14074 "configure"
14074 #include "confdefs.h"
14075 /* pthread test headers */
14076 #include <pthread.h>
14077 #if HAVE_PTHREADS < 7
14078 #include <errno.h>
14079 #endif
14080 #ifndef NULL
14081 #define NULL (void*)0
14082 #endif
14083
14084 static void *task(p)
14085         void *p;
14086 {
14087         return (void *) (p == NULL);
14088 }
14089
14090
14091 int main(argc, argv)
14092         int argc;
14093         char **argv;
14094 {
14095
14096         /* pthread test function */
14097 #ifndef PTHREAD_CREATE_DETACHED
14098 #define PTHREAD_CREATE_DETACHED 1
14099 #endif
14100         pthread_t t;
14101         int status;
14102         int detach = PTHREAD_CREATE_DETACHED;
14103
14104 #if HAVE_PTHREADS > 4
14105         /* Final pthreads */
14106         pthread_attr_t attr;
14107
14108         status = pthread_attr_init(&attr);
14109         if( status ) return status;
14110
14111 #if HAVE_PTHREADS < 7
14112         status = pthread_attr_setdetachstate(&attr, &detach);
14113         if( status < 0 ) status = errno;
14114 #else
14115         status = pthread_attr_setdetachstate(&attr, detach);
14116 #endif
14117         if( status ) return status;
14118         status = pthread_create( &t, &attr, task, NULL );
14119 #if HAVE_PTHREADS < 7
14120         if( status < 0 ) status = errno;
14121 #endif
14122         if( status ) return status;
14123 #else
14124         /* Draft 4 pthreads */
14125         status = pthread_create( &t, pthread_attr_default, task, NULL );
14126         if( status ) return errno;
14127
14128         /* give thread a chance to complete */
14129         /* it should remain joinable and hence detachable */
14130         sleep( 1 );
14131
14132         status = pthread_detach( &t );
14133         if( status ) return errno;
14134 #endif
14135
14136 #ifdef HAVE_LINUX_THREADS
14137         pthread_kill_other_threads_np();
14138 #endif
14139
14140         return 0;
14141
14142 }
14143
14144 EOF
14145 if { (eval echo configure:14146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14146 then
14147   ol_cv_pthread_lc_r=yes
14148 else
14149   echo "configure: failed program was:" >&5
14150   cat conftest.$ac_ext >&5
14151   rm -fr conftest*
14152   ol_cv_pthread_lc_r=no
14153 fi
14154 rm -fr conftest*
14155 fi
14156
14157
14158                 # restore the LIBS
14159                 LIBS="$ol_LIBS"
14160         
14161 fi
14162
14163 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
14164
14165         if test $ol_cv_pthread_lc_r = yes ; then
14166                 ol_link_pthreads="-lc_r"
14167                 ol_link_threads=posix
14168         fi
14169 fi
14170
14171
14172                 # Pthread try link: -threads (ol_cv_pthread_threads)
14173 if test "$ol_link_threads" = no ; then
14174         # try -threads
14175         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
14176 echo "configure:14177: checking for pthread link with -threads" >&5
14177 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
14178   echo $ac_n "(cached) $ac_c" 1>&6
14179 else
14180   
14181                 # save the flags
14182                 ol_LIBS="$LIBS"
14183                 LIBS="-threads $LIBS"
14184
14185                 if test "$cross_compiling" = yes; then
14186   cat > conftest.$ac_ext <<EOF
14187 #line 14188 "configure"
14188 #include "confdefs.h"
14189 /* pthread test headers */
14190 #include <pthread.h>
14191 #if HAVE_PTHREADS < 7
14192 #include <errno.h>
14193 #endif
14194 #ifndef NULL
14195 #define NULL (void*)0
14196 #endif
14197
14198 static void *task(p)
14199         void *p;
14200 {
14201         return (void *) (p == NULL);
14202 }
14203
14204 int main() {
14205
14206         /* pthread test function */
14207 #ifndef PTHREAD_CREATE_DETACHED
14208 #define PTHREAD_CREATE_DETACHED 1
14209 #endif
14210         pthread_t t;
14211         int status;
14212         int detach = PTHREAD_CREATE_DETACHED;
14213
14214 #if HAVE_PTHREADS > 4
14215         /* Final pthreads */
14216         pthread_attr_t attr;
14217
14218         status = pthread_attr_init(&attr);
14219         if( status ) return status;
14220
14221 #if HAVE_PTHREADS < 7
14222         status = pthread_attr_setdetachstate(&attr, &detach);
14223         if( status < 0 ) status = errno;
14224 #else
14225         status = pthread_attr_setdetachstate(&attr, detach);
14226 #endif
14227         if( status ) return status;
14228         status = pthread_create( &t, &attr, task, NULL );
14229 #if HAVE_PTHREADS < 7
14230         if( status < 0 ) status = errno;
14231 #endif
14232         if( status ) return status;
14233 #else
14234         /* Draft 4 pthreads */
14235         status = pthread_create( &t, pthread_attr_default, task, NULL );
14236         if( status ) return errno;
14237
14238         /* give thread a chance to complete */
14239         /* it should remain joinable and hence detachable */
14240         sleep( 1 );
14241
14242         status = pthread_detach( &t );
14243         if( status ) return errno;
14244 #endif
14245
14246 #ifdef HAVE_LINUX_THREADS
14247         pthread_kill_other_threads_np();
14248 #endif
14249
14250         return 0;
14251
14252 ; return 0; }
14253 EOF
14254 if { (eval echo configure:14255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14255   rm -rf conftest*
14256   ol_cv_pthread_threads=yes
14257 else
14258   echo "configure: failed program was:" >&5
14259   cat conftest.$ac_ext >&5
14260   rm -rf conftest*
14261   ol_cv_pthread_threads=no
14262 fi
14263 rm -f conftest*
14264 else
14265   cat > conftest.$ac_ext <<EOF
14266 #line 14267 "configure"
14267 #include "confdefs.h"
14268 /* pthread test headers */
14269 #include <pthread.h>
14270 #if HAVE_PTHREADS < 7
14271 #include <errno.h>
14272 #endif
14273 #ifndef NULL
14274 #define NULL (void*)0
14275 #endif
14276
14277 static void *task(p)
14278         void *p;
14279 {
14280         return (void *) (p == NULL);
14281 }
14282
14283
14284 int main(argc, argv)
14285         int argc;
14286         char **argv;
14287 {
14288
14289         /* pthread test function */
14290 #ifndef PTHREAD_CREATE_DETACHED
14291 #define PTHREAD_CREATE_DETACHED 1
14292 #endif
14293         pthread_t t;
14294         int status;
14295         int detach = PTHREAD_CREATE_DETACHED;
14296
14297 #if HAVE_PTHREADS > 4
14298         /* Final pthreads */
14299         pthread_attr_t attr;
14300
14301         status = pthread_attr_init(&attr);
14302         if( status ) return status;
14303
14304 #if HAVE_PTHREADS < 7
14305         status = pthread_attr_setdetachstate(&attr, &detach);
14306         if( status < 0 ) status = errno;
14307 #else
14308         status = pthread_attr_setdetachstate(&attr, detach);
14309 #endif
14310         if( status ) return status;
14311         status = pthread_create( &t, &attr, task, NULL );
14312 #if HAVE_PTHREADS < 7
14313         if( status < 0 ) status = errno;
14314 #endif
14315         if( status ) return status;
14316 #else
14317         /* Draft 4 pthreads */
14318         status = pthread_create( &t, pthread_attr_default, task, NULL );
14319         if( status ) return errno;
14320
14321         /* give thread a chance to complete */
14322         /* it should remain joinable and hence detachable */
14323         sleep( 1 );
14324
14325         status = pthread_detach( &t );
14326         if( status ) return errno;
14327 #endif
14328
14329 #ifdef HAVE_LINUX_THREADS
14330         pthread_kill_other_threads_np();
14331 #endif
14332
14333         return 0;
14334
14335 }
14336
14337 EOF
14338 if { (eval echo configure:14339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14339 then
14340   ol_cv_pthread_threads=yes
14341 else
14342   echo "configure: failed program was:" >&5
14343   cat conftest.$ac_ext >&5
14344   rm -fr conftest*
14345   ol_cv_pthread_threads=no
14346 fi
14347 rm -fr conftest*
14348 fi
14349
14350
14351                 # restore the LIBS
14352                 LIBS="$ol_LIBS"
14353         
14354 fi
14355
14356 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
14357
14358         if test $ol_cv_pthread_threads = yes ; then
14359                 ol_link_pthreads="-threads"
14360                 ol_link_threads=posix
14361         fi
14362 fi
14363
14364
14365                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
14366 if test "$ol_link_threads" = no ; then
14367         # try -lpthreads -lmach -lexc -lc_r
14368         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
14369 echo "configure:14370: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
14370 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
14371   echo $ac_n "(cached) $ac_c" 1>&6
14372 else
14373   
14374                 # save the flags
14375                 ol_LIBS="$LIBS"
14376                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
14377
14378                 if test "$cross_compiling" = yes; then
14379   cat > conftest.$ac_ext <<EOF
14380 #line 14381 "configure"
14381 #include "confdefs.h"
14382 /* pthread test headers */
14383 #include <pthread.h>
14384 #if HAVE_PTHREADS < 7
14385 #include <errno.h>
14386 #endif
14387 #ifndef NULL
14388 #define NULL (void*)0
14389 #endif
14390
14391 static void *task(p)
14392         void *p;
14393 {
14394         return (void *) (p == NULL);
14395 }
14396
14397 int main() {
14398
14399         /* pthread test function */
14400 #ifndef PTHREAD_CREATE_DETACHED
14401 #define PTHREAD_CREATE_DETACHED 1
14402 #endif
14403         pthread_t t;
14404         int status;
14405         int detach = PTHREAD_CREATE_DETACHED;
14406
14407 #if HAVE_PTHREADS > 4
14408         /* Final pthreads */
14409         pthread_attr_t attr;
14410
14411         status = pthread_attr_init(&attr);
14412         if( status ) return status;
14413
14414 #if HAVE_PTHREADS < 7
14415         status = pthread_attr_setdetachstate(&attr, &detach);
14416         if( status < 0 ) status = errno;
14417 #else
14418         status = pthread_attr_setdetachstate(&attr, detach);
14419 #endif
14420         if( status ) return status;
14421         status = pthread_create( &t, &attr, task, NULL );
14422 #if HAVE_PTHREADS < 7
14423         if( status < 0 ) status = errno;
14424 #endif
14425         if( status ) return status;
14426 #else
14427         /* Draft 4 pthreads */
14428         status = pthread_create( &t, pthread_attr_default, task, NULL );
14429         if( status ) return errno;
14430
14431         /* give thread a chance to complete */
14432         /* it should remain joinable and hence detachable */
14433         sleep( 1 );
14434
14435         status = pthread_detach( &t );
14436         if( status ) return errno;
14437 #endif
14438
14439 #ifdef HAVE_LINUX_THREADS
14440         pthread_kill_other_threads_np();
14441 #endif
14442
14443         return 0;
14444
14445 ; return 0; }
14446 EOF
14447 if { (eval echo configure:14448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14448   rm -rf conftest*
14449   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14450 else
14451   echo "configure: failed program was:" >&5
14452   cat conftest.$ac_ext >&5
14453   rm -rf conftest*
14454   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14455 fi
14456 rm -f conftest*
14457 else
14458   cat > conftest.$ac_ext <<EOF
14459 #line 14460 "configure"
14460 #include "confdefs.h"
14461 /* pthread test headers */
14462 #include <pthread.h>
14463 #if HAVE_PTHREADS < 7
14464 #include <errno.h>
14465 #endif
14466 #ifndef NULL
14467 #define NULL (void*)0
14468 #endif
14469
14470 static void *task(p)
14471         void *p;
14472 {
14473         return (void *) (p == NULL);
14474 }
14475
14476
14477 int main(argc, argv)
14478         int argc;
14479         char **argv;
14480 {
14481
14482         /* pthread test function */
14483 #ifndef PTHREAD_CREATE_DETACHED
14484 #define PTHREAD_CREATE_DETACHED 1
14485 #endif
14486         pthread_t t;
14487         int status;
14488         int detach = PTHREAD_CREATE_DETACHED;
14489
14490 #if HAVE_PTHREADS > 4
14491         /* Final pthreads */
14492         pthread_attr_t attr;
14493
14494         status = pthread_attr_init(&attr);
14495         if( status ) return status;
14496
14497 #if HAVE_PTHREADS < 7
14498         status = pthread_attr_setdetachstate(&attr, &detach);
14499         if( status < 0 ) status = errno;
14500 #else
14501         status = pthread_attr_setdetachstate(&attr, detach);
14502 #endif
14503         if( status ) return status;
14504         status = pthread_create( &t, &attr, task, NULL );
14505 #if HAVE_PTHREADS < 7
14506         if( status < 0 ) status = errno;
14507 #endif
14508         if( status ) return status;
14509 #else
14510         /* Draft 4 pthreads */
14511         status = pthread_create( &t, pthread_attr_default, task, NULL );
14512         if( status ) return errno;
14513
14514         /* give thread a chance to complete */
14515         /* it should remain joinable and hence detachable */
14516         sleep( 1 );
14517
14518         status = pthread_detach( &t );
14519         if( status ) return errno;
14520 #endif
14521
14522 #ifdef HAVE_LINUX_THREADS
14523         pthread_kill_other_threads_np();
14524 #endif
14525
14526         return 0;
14527
14528 }
14529
14530 EOF
14531 if { (eval echo configure:14532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14532 then
14533   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
14534 else
14535   echo "configure: failed program was:" >&5
14536   cat conftest.$ac_ext >&5
14537   rm -fr conftest*
14538   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
14539 fi
14540 rm -fr conftest*
14541 fi
14542
14543
14544                 # restore the LIBS
14545                 LIBS="$ol_LIBS"
14546         
14547 fi
14548
14549 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
14550
14551         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
14552                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
14553                 ol_link_threads=posix
14554         fi
14555 fi
14556
14557                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
14558 if test "$ol_link_threads" = no ; then
14559         # try -lpthreads -lmach -lexc
14560         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
14561 echo "configure:14562: checking for pthread link with -lpthreads -lmach -lexc" >&5
14562 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
14563   echo $ac_n "(cached) $ac_c" 1>&6
14564 else
14565   
14566                 # save the flags
14567                 ol_LIBS="$LIBS"
14568                 LIBS="-lpthreads -lmach -lexc $LIBS"
14569
14570                 if test "$cross_compiling" = yes; then
14571   cat > conftest.$ac_ext <<EOF
14572 #line 14573 "configure"
14573 #include "confdefs.h"
14574 /* pthread test headers */
14575 #include <pthread.h>
14576 #if HAVE_PTHREADS < 7
14577 #include <errno.h>
14578 #endif
14579 #ifndef NULL
14580 #define NULL (void*)0
14581 #endif
14582
14583 static void *task(p)
14584         void *p;
14585 {
14586         return (void *) (p == NULL);
14587 }
14588
14589 int main() {
14590
14591         /* pthread test function */
14592 #ifndef PTHREAD_CREATE_DETACHED
14593 #define PTHREAD_CREATE_DETACHED 1
14594 #endif
14595         pthread_t t;
14596         int status;
14597         int detach = PTHREAD_CREATE_DETACHED;
14598
14599 #if HAVE_PTHREADS > 4
14600         /* Final pthreads */
14601         pthread_attr_t attr;
14602
14603         status = pthread_attr_init(&attr);
14604         if( status ) return status;
14605
14606 #if HAVE_PTHREADS < 7
14607         status = pthread_attr_setdetachstate(&attr, &detach);
14608         if( status < 0 ) status = errno;
14609 #else
14610         status = pthread_attr_setdetachstate(&attr, detach);
14611 #endif
14612         if( status ) return status;
14613         status = pthread_create( &t, &attr, task, NULL );
14614 #if HAVE_PTHREADS < 7
14615         if( status < 0 ) status = errno;
14616 #endif
14617         if( status ) return status;
14618 #else
14619         /* Draft 4 pthreads */
14620         status = pthread_create( &t, pthread_attr_default, task, NULL );
14621         if( status ) return errno;
14622
14623         /* give thread a chance to complete */
14624         /* it should remain joinable and hence detachable */
14625         sleep( 1 );
14626
14627         status = pthread_detach( &t );
14628         if( status ) return errno;
14629 #endif
14630
14631 #ifdef HAVE_LINUX_THREADS
14632         pthread_kill_other_threads_np();
14633 #endif
14634
14635         return 0;
14636
14637 ; return 0; }
14638 EOF
14639 if { (eval echo configure:14640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14640   rm -rf conftest*
14641   ol_cv_pthread_lpthreads_lmach_lexc=yes
14642 else
14643   echo "configure: failed program was:" >&5
14644   cat conftest.$ac_ext >&5
14645   rm -rf conftest*
14646   ol_cv_pthread_lpthreads_lmach_lexc=no
14647 fi
14648 rm -f conftest*
14649 else
14650   cat > conftest.$ac_ext <<EOF
14651 #line 14652 "configure"
14652 #include "confdefs.h"
14653 /* pthread test headers */
14654 #include <pthread.h>
14655 #if HAVE_PTHREADS < 7
14656 #include <errno.h>
14657 #endif
14658 #ifndef NULL
14659 #define NULL (void*)0
14660 #endif
14661
14662 static void *task(p)
14663         void *p;
14664 {
14665         return (void *) (p == NULL);
14666 }
14667
14668
14669 int main(argc, argv)
14670         int argc;
14671         char **argv;
14672 {
14673
14674         /* pthread test function */
14675 #ifndef PTHREAD_CREATE_DETACHED
14676 #define PTHREAD_CREATE_DETACHED 1
14677 #endif
14678         pthread_t t;
14679         int status;
14680         int detach = PTHREAD_CREATE_DETACHED;
14681
14682 #if HAVE_PTHREADS > 4
14683         /* Final pthreads */
14684         pthread_attr_t attr;
14685
14686         status = pthread_attr_init(&attr);
14687         if( status ) return status;
14688
14689 #if HAVE_PTHREADS < 7
14690         status = pthread_attr_setdetachstate(&attr, &detach);
14691         if( status < 0 ) status = errno;
14692 #else
14693         status = pthread_attr_setdetachstate(&attr, detach);
14694 #endif
14695         if( status ) return status;
14696         status = pthread_create( &t, &attr, task, NULL );
14697 #if HAVE_PTHREADS < 7
14698         if( status < 0 ) status = errno;
14699 #endif
14700         if( status ) return status;
14701 #else
14702         /* Draft 4 pthreads */
14703         status = pthread_create( &t, pthread_attr_default, task, NULL );
14704         if( status ) return errno;
14705
14706         /* give thread a chance to complete */
14707         /* it should remain joinable and hence detachable */
14708         sleep( 1 );
14709
14710         status = pthread_detach( &t );
14711         if( status ) return errno;
14712 #endif
14713
14714 #ifdef HAVE_LINUX_THREADS
14715         pthread_kill_other_threads_np();
14716 #endif
14717
14718         return 0;
14719
14720 }
14721
14722 EOF
14723 if { (eval echo configure:14724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14724 then
14725   ol_cv_pthread_lpthreads_lmach_lexc=yes
14726 else
14727   echo "configure: failed program was:" >&5
14728   cat conftest.$ac_ext >&5
14729   rm -fr conftest*
14730   ol_cv_pthread_lpthreads_lmach_lexc=no
14731 fi
14732 rm -fr conftest*
14733 fi
14734
14735
14736                 # restore the LIBS
14737                 LIBS="$ol_LIBS"
14738         
14739 fi
14740
14741 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
14742
14743         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
14744                 ol_link_pthreads="-lpthreads -lmach -lexc"
14745                 ol_link_threads=posix
14746         fi
14747 fi
14748
14749                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
14750 if test "$ol_link_threads" = no ; then
14751         # try -lpthreads -lexc
14752         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
14753 echo "configure:14754: checking for pthread link with -lpthreads -lexc" >&5
14754 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
14755   echo $ac_n "(cached) $ac_c" 1>&6
14756 else
14757   
14758                 # save the flags
14759                 ol_LIBS="$LIBS"
14760                 LIBS="-lpthreads -lexc $LIBS"
14761
14762                 if test "$cross_compiling" = yes; then
14763   cat > conftest.$ac_ext <<EOF
14764 #line 14765 "configure"
14765 #include "confdefs.h"
14766 /* pthread test headers */
14767 #include <pthread.h>
14768 #if HAVE_PTHREADS < 7
14769 #include <errno.h>
14770 #endif
14771 #ifndef NULL
14772 #define NULL (void*)0
14773 #endif
14774
14775 static void *task(p)
14776         void *p;
14777 {
14778         return (void *) (p == NULL);
14779 }
14780
14781 int main() {
14782
14783         /* pthread test function */
14784 #ifndef PTHREAD_CREATE_DETACHED
14785 #define PTHREAD_CREATE_DETACHED 1
14786 #endif
14787         pthread_t t;
14788         int status;
14789         int detach = PTHREAD_CREATE_DETACHED;
14790
14791 #if HAVE_PTHREADS > 4
14792         /* Final pthreads */
14793         pthread_attr_t attr;
14794
14795         status = pthread_attr_init(&attr);
14796         if( status ) return status;
14797
14798 #if HAVE_PTHREADS < 7
14799         status = pthread_attr_setdetachstate(&attr, &detach);
14800         if( status < 0 ) status = errno;
14801 #else
14802         status = pthread_attr_setdetachstate(&attr, detach);
14803 #endif
14804         if( status ) return status;
14805         status = pthread_create( &t, &attr, task, NULL );
14806 #if HAVE_PTHREADS < 7
14807         if( status < 0 ) status = errno;
14808 #endif
14809         if( status ) return status;
14810 #else
14811         /* Draft 4 pthreads */
14812         status = pthread_create( &t, pthread_attr_default, task, NULL );
14813         if( status ) return errno;
14814
14815         /* give thread a chance to complete */
14816         /* it should remain joinable and hence detachable */
14817         sleep( 1 );
14818
14819         status = pthread_detach( &t );
14820         if( status ) return errno;
14821 #endif
14822
14823 #ifdef HAVE_LINUX_THREADS
14824         pthread_kill_other_threads_np();
14825 #endif
14826
14827         return 0;
14828
14829 ; return 0; }
14830 EOF
14831 if { (eval echo configure:14832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14832   rm -rf conftest*
14833   ol_cv_pthread_lpthreads_lexc=yes
14834 else
14835   echo "configure: failed program was:" >&5
14836   cat conftest.$ac_ext >&5
14837   rm -rf conftest*
14838   ol_cv_pthread_lpthreads_lexc=no
14839 fi
14840 rm -f conftest*
14841 else
14842   cat > conftest.$ac_ext <<EOF
14843 #line 14844 "configure"
14844 #include "confdefs.h"
14845 /* pthread test headers */
14846 #include <pthread.h>
14847 #if HAVE_PTHREADS < 7
14848 #include <errno.h>
14849 #endif
14850 #ifndef NULL
14851 #define NULL (void*)0
14852 #endif
14853
14854 static void *task(p)
14855         void *p;
14856 {
14857         return (void *) (p == NULL);
14858 }
14859
14860
14861 int main(argc, argv)
14862         int argc;
14863         char **argv;
14864 {
14865
14866         /* pthread test function */
14867 #ifndef PTHREAD_CREATE_DETACHED
14868 #define PTHREAD_CREATE_DETACHED 1
14869 #endif
14870         pthread_t t;
14871         int status;
14872         int detach = PTHREAD_CREATE_DETACHED;
14873
14874 #if HAVE_PTHREADS > 4
14875         /* Final pthreads */
14876         pthread_attr_t attr;
14877
14878         status = pthread_attr_init(&attr);
14879         if( status ) return status;
14880
14881 #if HAVE_PTHREADS < 7
14882         status = pthread_attr_setdetachstate(&attr, &detach);
14883         if( status < 0 ) status = errno;
14884 #else
14885         status = pthread_attr_setdetachstate(&attr, detach);
14886 #endif
14887         if( status ) return status;
14888         status = pthread_create( &t, &attr, task, NULL );
14889 #if HAVE_PTHREADS < 7
14890         if( status < 0 ) status = errno;
14891 #endif
14892         if( status ) return status;
14893 #else
14894         /* Draft 4 pthreads */
14895         status = pthread_create( &t, pthread_attr_default, task, NULL );
14896         if( status ) return errno;
14897
14898         /* give thread a chance to complete */
14899         /* it should remain joinable and hence detachable */
14900         sleep( 1 );
14901
14902         status = pthread_detach( &t );
14903         if( status ) return errno;
14904 #endif
14905
14906 #ifdef HAVE_LINUX_THREADS
14907         pthread_kill_other_threads_np();
14908 #endif
14909
14910         return 0;
14911
14912 }
14913
14914 EOF
14915 if { (eval echo configure:14916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14916 then
14917   ol_cv_pthread_lpthreads_lexc=yes
14918 else
14919   echo "configure: failed program was:" >&5
14920   cat conftest.$ac_ext >&5
14921   rm -fr conftest*
14922   ol_cv_pthread_lpthreads_lexc=no
14923 fi
14924 rm -fr conftest*
14925 fi
14926
14927
14928                 # restore the LIBS
14929                 LIBS="$ol_LIBS"
14930         
14931 fi
14932
14933 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
14934
14935         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
14936                 ol_link_pthreads="-lpthreads -lexc"
14937                 ol_link_threads=posix
14938         fi
14939 fi
14940
14941
14942                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
14943 if test "$ol_link_threads" = no ; then
14944         # try -lpthreads
14945         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
14946 echo "configure:14947: checking for pthread link with -lpthreads" >&5
14947 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
14948   echo $ac_n "(cached) $ac_c" 1>&6
14949 else
14950   
14951                 # save the flags
14952                 ol_LIBS="$LIBS"
14953                 LIBS="-lpthreads $LIBS"
14954
14955                 if test "$cross_compiling" = yes; then
14956   cat > conftest.$ac_ext <<EOF
14957 #line 14958 "configure"
14958 #include "confdefs.h"
14959 /* pthread test headers */
14960 #include <pthread.h>
14961 #if HAVE_PTHREADS < 7
14962 #include <errno.h>
14963 #endif
14964 #ifndef NULL
14965 #define NULL (void*)0
14966 #endif
14967
14968 static void *task(p)
14969         void *p;
14970 {
14971         return (void *) (p == NULL);
14972 }
14973
14974 int main() {
14975
14976         /* pthread test function */
14977 #ifndef PTHREAD_CREATE_DETACHED
14978 #define PTHREAD_CREATE_DETACHED 1
14979 #endif
14980         pthread_t t;
14981         int status;
14982         int detach = PTHREAD_CREATE_DETACHED;
14983
14984 #if HAVE_PTHREADS > 4
14985         /* Final pthreads */
14986         pthread_attr_t attr;
14987
14988         status = pthread_attr_init(&attr);
14989         if( status ) return status;
14990
14991 #if HAVE_PTHREADS < 7
14992         status = pthread_attr_setdetachstate(&attr, &detach);
14993         if( status < 0 ) status = errno;
14994 #else
14995         status = pthread_attr_setdetachstate(&attr, detach);
14996 #endif
14997         if( status ) return status;
14998         status = pthread_create( &t, &attr, task, NULL );
14999 #if HAVE_PTHREADS < 7
15000         if( status < 0 ) status = errno;
15001 #endif
15002         if( status ) return status;
15003 #else
15004         /* Draft 4 pthreads */
15005         status = pthread_create( &t, pthread_attr_default, task, NULL );
15006         if( status ) return errno;
15007
15008         /* give thread a chance to complete */
15009         /* it should remain joinable and hence detachable */
15010         sleep( 1 );
15011
15012         status = pthread_detach( &t );
15013         if( status ) return errno;
15014 #endif
15015
15016 #ifdef HAVE_LINUX_THREADS
15017         pthread_kill_other_threads_np();
15018 #endif
15019
15020         return 0;
15021
15022 ; return 0; }
15023 EOF
15024 if { (eval echo configure:15025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15025   rm -rf conftest*
15026   ol_cv_pthread_lib_lpthreads=yes
15027 else
15028   echo "configure: failed program was:" >&5
15029   cat conftest.$ac_ext >&5
15030   rm -rf conftest*
15031   ol_cv_pthread_lib_lpthreads=no
15032 fi
15033 rm -f conftest*
15034 else
15035   cat > conftest.$ac_ext <<EOF
15036 #line 15037 "configure"
15037 #include "confdefs.h"
15038 /* pthread test headers */
15039 #include <pthread.h>
15040 #if HAVE_PTHREADS < 7
15041 #include <errno.h>
15042 #endif
15043 #ifndef NULL
15044 #define NULL (void*)0
15045 #endif
15046
15047 static void *task(p)
15048         void *p;
15049 {
15050         return (void *) (p == NULL);
15051 }
15052
15053
15054 int main(argc, argv)
15055         int argc;
15056         char **argv;
15057 {
15058
15059         /* pthread test function */
15060 #ifndef PTHREAD_CREATE_DETACHED
15061 #define PTHREAD_CREATE_DETACHED 1
15062 #endif
15063         pthread_t t;
15064         int status;
15065         int detach = PTHREAD_CREATE_DETACHED;
15066
15067 #if HAVE_PTHREADS > 4
15068         /* Final pthreads */
15069         pthread_attr_t attr;
15070
15071         status = pthread_attr_init(&attr);
15072         if( status ) return status;
15073
15074 #if HAVE_PTHREADS < 7
15075         status = pthread_attr_setdetachstate(&attr, &detach);
15076         if( status < 0 ) status = errno;
15077 #else
15078         status = pthread_attr_setdetachstate(&attr, detach);
15079 #endif
15080         if( status ) return status;
15081         status = pthread_create( &t, &attr, task, NULL );
15082 #if HAVE_PTHREADS < 7
15083         if( status < 0 ) status = errno;
15084 #endif
15085         if( status ) return status;
15086 #else
15087         /* Draft 4 pthreads */
15088         status = pthread_create( &t, pthread_attr_default, task, NULL );
15089         if( status ) return errno;
15090
15091         /* give thread a chance to complete */
15092         /* it should remain joinable and hence detachable */
15093         sleep( 1 );
15094
15095         status = pthread_detach( &t );
15096         if( status ) return errno;
15097 #endif
15098
15099 #ifdef HAVE_LINUX_THREADS
15100         pthread_kill_other_threads_np();
15101 #endif
15102
15103         return 0;
15104
15105 }
15106
15107 EOF
15108 if { (eval echo configure:15109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15109 then
15110   ol_cv_pthread_lib_lpthreads=yes
15111 else
15112   echo "configure: failed program was:" >&5
15113   cat conftest.$ac_ext >&5
15114   rm -fr conftest*
15115   ol_cv_pthread_lib_lpthreads=no
15116 fi
15117 rm -fr conftest*
15118 fi
15119
15120
15121                 # restore the LIBS
15122                 LIBS="$ol_LIBS"
15123         
15124 fi
15125
15126 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
15127
15128         if test $ol_cv_pthread_lib_lpthreads = yes ; then
15129                 ol_link_pthreads="-lpthreads"
15130                 ol_link_threads=posix
15131         fi
15132 fi
15133
15134
15135                 if test $ol_link_threads != no ; then
15136                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
15137
15138                                                 save_CPPFLAGS="$CPPFLAGS"
15139                         save_LIBS="$LIBS"
15140                         LIBS="$LTHREAD_LIBS $LIBS"
15141
15142                                                                                                 for ac_func in sched_yield pthread_yield thr_yield
15143 do
15144 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15145 echo "configure:15146: checking for $ac_func" >&5
15146 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15147   echo $ac_n "(cached) $ac_c" 1>&6
15148 else
15149   cat > conftest.$ac_ext <<EOF
15150 #line 15151 "configure"
15151 #include "confdefs.h"
15152 /* System header to define __stub macros and hopefully few prototypes,
15153     which can conflict with char $ac_func(); below.  */
15154 #include <assert.h>
15155 /* Override any gcc2 internal prototype to avoid an error.  */
15156 /* We use char because int might match the return type of a gcc2
15157     builtin and then its argument prototype would still apply.  */
15158 char $ac_func();
15159 char (*f)();
15160
15161 int main() {
15162
15163 /* The GNU C library defines this for functions which it implements
15164     to always fail with ENOSYS.  Some functions are actually named
15165     something starting with __ and the normal name is an alias.  */
15166 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15167 choke me
15168 #else
15169 f = $ac_func;
15170 #endif
15171
15172 ; return 0; }
15173 EOF
15174 if { (eval echo configure:15175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15175   rm -rf conftest*
15176   eval "ac_cv_func_$ac_func=yes"
15177 else
15178   echo "configure: failed program was:" >&5
15179   cat conftest.$ac_ext >&5
15180   rm -rf conftest*
15181   eval "ac_cv_func_$ac_func=no"
15182 fi
15183 rm -f conftest*
15184 fi
15185
15186 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15187   echo "$ac_t""yes" 1>&6
15188     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15189   cat >> confdefs.h <<EOF
15190 #define $ac_tr_func 1
15191 EOF
15192  
15193 else
15194   echo "$ac_t""no" 1>&6
15195 fi
15196 done
15197
15198
15199                         if test $ac_cv_func_sched_yield = no -a \
15200                                 $ac_cv_func_pthread_yield = no -a \
15201                                 $ac_cv_func_thr_yield = no ; then
15202                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
15203 echo "configure:15204: checking for sched_yield in -lrt" >&5
15204 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
15205 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15206   echo $ac_n "(cached) $ac_c" 1>&6
15207 else
15208   ac_save_LIBS="$LIBS"
15209 LIBS="-lrt  $LIBS"
15210 cat > conftest.$ac_ext <<EOF
15211 #line 15212 "configure"
15212 #include "confdefs.h"
15213 /* Override any gcc2 internal prototype to avoid an error.  */
15214 /* We use char because int might match the return type of a gcc2
15215     builtin and then its argument prototype would still apply.  */
15216 char sched_yield();
15217
15218 int main() {
15219 sched_yield()
15220 ; return 0; }
15221 EOF
15222 if { (eval echo configure:15223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15223   rm -rf conftest*
15224   eval "ac_cv_lib_$ac_lib_var=yes"
15225 else
15226   echo "configure: failed program was:" >&5
15227   cat conftest.$ac_ext >&5
15228   rm -rf conftest*
15229   eval "ac_cv_lib_$ac_lib_var=no"
15230 fi
15231 rm -f conftest*
15232 LIBS="$ac_save_LIBS"
15233
15234 fi
15235 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15236   echo "$ac_t""yes" 1>&6
15237   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
15238                                         cat >> confdefs.h <<\EOF
15239 #define HAVE_SCHED_YIELD 1
15240 EOF
15241
15242                                         ac_cv_func_sched_yield=yes
15243 else
15244   echo "$ac_t""no" 1>&6
15245 ac_cv_func_sched_yield=no
15246 fi
15247
15248                         fi
15249                         if test $ac_cv_func_sched_yield = no -a \
15250                                 $ac_cv_func_pthread_yield = no -a \
15251                                 "$ac_cv_func_thr_yield" = no ; then
15252                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
15253                         fi
15254
15255                                                 for ac_func in pthread_kill pthread_rwlock_destroy
15256 do
15257 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15258 echo "configure:15259: checking for $ac_func" >&5
15259 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15260   echo $ac_n "(cached) $ac_c" 1>&6
15261 else
15262   cat > conftest.$ac_ext <<EOF
15263 #line 15264 "configure"
15264 #include "confdefs.h"
15265 /* System header to define __stub macros and hopefully few prototypes,
15266     which can conflict with char $ac_func(); below.  */
15267 #include <assert.h>
15268 /* Override any gcc2 internal prototype to avoid an error.  */
15269 /* We use char because int might match the return type of a gcc2
15270     builtin and then its argument prototype would still apply.  */
15271 char $ac_func();
15272 char (*f)();
15273
15274 int main() {
15275
15276 /* The GNU C library defines this for functions which it implements
15277     to always fail with ENOSYS.  Some functions are actually named
15278     something starting with __ and the normal name is an alias.  */
15279 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15280 choke me
15281 #else
15282 f = $ac_func;
15283 #endif
15284
15285 ; return 0; }
15286 EOF
15287 if { (eval echo configure:15288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15288   rm -rf conftest*
15289   eval "ac_cv_func_$ac_func=yes"
15290 else
15291   echo "configure: failed program was:" >&5
15292   cat conftest.$ac_ext >&5
15293   rm -rf conftest*
15294   eval "ac_cv_func_$ac_func=no"
15295 fi
15296 rm -f conftest*
15297 fi
15298
15299 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15300   echo "$ac_t""yes" 1>&6
15301     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15302   cat >> confdefs.h <<EOF
15303 #define $ac_tr_func 1
15304 EOF
15305  
15306 else
15307   echo "$ac_t""no" 1>&6
15308 fi
15309 done
15310
15311
15312                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
15313 echo "configure:15314: checking for pthread_detach with <pthread.h>" >&5
15314 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
15315   echo $ac_n "(cached) $ac_c" 1>&6
15316 else
15317   
15318                                                                 cat > conftest.$ac_ext <<EOF
15319 #line 15320 "configure"
15320 #include "confdefs.h"
15321
15322 #include <pthread.h>
15323 #ifndef NULL
15324 #define NULL (void*)0
15325 #endif
15326
15327 int main() {
15328 pthread_detach(NULL);
15329 ; return 0; }
15330 EOF
15331 if { (eval echo configure:15332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15332   rm -rf conftest*
15333   ol_cv_func_pthread_detach=yes
15334 else
15335   echo "configure: failed program was:" >&5
15336   cat conftest.$ac_ext >&5
15337   rm -rf conftest*
15338   ol_cv_func_pthread_detach=no
15339 fi
15340 rm -f conftest*
15341                         
15342 fi
15343
15344 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
15345
15346                         if test $ol_cv_func_pthread_detach = no ; then
15347                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
15348                         fi
15349
15350                         cat >> confdefs.h <<\EOF
15351 #define HAVE_PTHREAD_DETACH 1
15352 EOF
15353
15354
15355                                                 for ac_func in \
15356                                 pthread_setconcurrency \
15357                                 pthread_getconcurrency \
15358                                 thr_setconcurrency \
15359                                 thr_getconcurrency \
15360                         
15361 do
15362 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15363 echo "configure:15364: checking for $ac_func" >&5
15364 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15365   echo $ac_n "(cached) $ac_c" 1>&6
15366 else
15367   cat > conftest.$ac_ext <<EOF
15368 #line 15369 "configure"
15369 #include "confdefs.h"
15370 /* System header to define __stub macros and hopefully few prototypes,
15371     which can conflict with char $ac_func(); below.  */
15372 #include <assert.h>
15373 /* Override any gcc2 internal prototype to avoid an error.  */
15374 /* We use char because int might match the return type of a gcc2
15375     builtin and then its argument prototype would still apply.  */
15376 char $ac_func();
15377 char (*f)();
15378
15379 int main() {
15380
15381 /* The GNU C library defines this for functions which it implements
15382     to always fail with ENOSYS.  Some functions are actually named
15383     something starting with __ and the normal name is an alias.  */
15384 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15385 choke me
15386 #else
15387 f = $ac_func;
15388 #endif
15389
15390 ; return 0; }
15391 EOF
15392 if { (eval echo configure:15393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15393   rm -rf conftest*
15394   eval "ac_cv_func_$ac_func=yes"
15395 else
15396   echo "configure: failed program was:" >&5
15397   cat conftest.$ac_ext >&5
15398   rm -rf conftest*
15399   eval "ac_cv_func_$ac_func=no"
15400 fi
15401 rm -f conftest*
15402 fi
15403
15404 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15405   echo "$ac_t""yes" 1>&6
15406     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15407   cat >> confdefs.h <<EOF
15408 #define $ac_tr_func 1
15409 EOF
15410  
15411 else
15412   echo "$ac_t""no" 1>&6
15413 fi
15414 done
15415
15416
15417                         
15418         for ac_func in pthread_kill_other_threads_np
15419 do
15420 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15421 echo "configure:15422: checking for $ac_func" >&5
15422 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15423   echo $ac_n "(cached) $ac_c" 1>&6
15424 else
15425   cat > conftest.$ac_ext <<EOF
15426 #line 15427 "configure"
15427 #include "confdefs.h"
15428 /* System header to define __stub macros and hopefully few prototypes,
15429     which can conflict with char $ac_func(); below.  */
15430 #include <assert.h>
15431 /* Override any gcc2 internal prototype to avoid an error.  */
15432 /* We use char because int might match the return type of a gcc2
15433     builtin and then its argument prototype would still apply.  */
15434 char $ac_func();
15435 char (*f)();
15436
15437 int main() {
15438
15439 /* The GNU C library defines this for functions which it implements
15440     to always fail with ENOSYS.  Some functions are actually named
15441     something starting with __ and the normal name is an alias.  */
15442 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15443 choke me
15444 #else
15445 f = $ac_func;
15446 #endif
15447
15448 ; return 0; }
15449 EOF
15450 if { (eval echo configure:15451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15451   rm -rf conftest*
15452   eval "ac_cv_func_$ac_func=yes"
15453 else
15454   echo "configure: failed program was:" >&5
15455   cat conftest.$ac_ext >&5
15456   rm -rf conftest*
15457   eval "ac_cv_func_$ac_func=no"
15458 fi
15459 rm -f conftest*
15460 fi
15461
15462 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15463   echo "$ac_t""yes" 1>&6
15464     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15465   cat >> confdefs.h <<EOF
15466 #define $ac_tr_func 1
15467 EOF
15468  
15469 else
15470   echo "$ac_t""no" 1>&6
15471 fi
15472 done
15473
15474         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
15475 echo "configure:15476: checking for LinuxThreads implementation" >&5
15476 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
15477   echo $ac_n "(cached) $ac_c" 1>&6
15478 else
15479   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
15480 fi
15481
15482 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
15483
15484                         
15485         
15486         
15487         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
15488 echo "configure:15489: checking for LinuxThreads consistency" >&5
15489 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
15490   echo $ac_n "(cached) $ac_c" 1>&6
15491 else
15492   
15493                 if test $ol_cv_header_linux_threads = yes -a \
15494                         $ol_cv_sys_linux_threads = yes; then
15495                         ol_cv_linux_threads=yes
15496                 elif test $ol_cv_header_linux_threads = no -a \
15497                         $ol_cv_sys_linux_threads = no; then
15498                         ol_cv_linux_threads=no
15499                 else
15500                         ol_cv_linux_threads=error
15501                 fi
15502         
15503 fi
15504
15505 echo "$ac_t""$ol_cv_linux_threads" 1>&6
15506
15507
15508                         if test $ol_cv_linux_threads = error; then
15509                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
15510                         fi
15511
15512                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
15513 echo "configure:15514: checking if pthread_create() works" >&5
15514 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
15515   echo $ac_n "(cached) $ac_c" 1>&6
15516 else
15517   
15518                         if test "$cross_compiling" = yes; then
15519                                 ol_cv_pthread_create_works=yes
15520 else
15521   cat > conftest.$ac_ext <<EOF
15522 #line 15523 "configure"
15523 #include "confdefs.h"
15524 /* pthread test headers */
15525 #include <pthread.h>
15526 #if HAVE_PTHREADS < 7
15527 #include <errno.h>
15528 #endif
15529 #ifndef NULL
15530 #define NULL (void*)0
15531 #endif
15532
15533 static void *task(p)
15534         void *p;
15535 {
15536         return (void *) (p == NULL);
15537 }
15538
15539
15540 int main(argc, argv)
15541         int argc;
15542         char **argv;
15543 {
15544
15545         /* pthread test function */
15546 #ifndef PTHREAD_CREATE_DETACHED
15547 #define PTHREAD_CREATE_DETACHED 1
15548 #endif
15549         pthread_t t;
15550         int status;
15551         int detach = PTHREAD_CREATE_DETACHED;
15552
15553 #if HAVE_PTHREADS > 4
15554         /* Final pthreads */
15555         pthread_attr_t attr;
15556
15557         status = pthread_attr_init(&attr);
15558         if( status ) return status;
15559
15560 #if HAVE_PTHREADS < 7
15561         status = pthread_attr_setdetachstate(&attr, &detach);
15562         if( status < 0 ) status = errno;
15563 #else
15564         status = pthread_attr_setdetachstate(&attr, detach);
15565 #endif
15566         if( status ) return status;
15567         status = pthread_create( &t, &attr, task, NULL );
15568 #if HAVE_PTHREADS < 7
15569         if( status < 0 ) status = errno;
15570 #endif
15571         if( status ) return status;
15572 #else
15573         /* Draft 4 pthreads */
15574         status = pthread_create( &t, pthread_attr_default, task, NULL );
15575         if( status ) return errno;
15576
15577         /* give thread a chance to complete */
15578         /* it should remain joinable and hence detachable */
15579         sleep( 1 );
15580
15581         status = pthread_detach( &t );
15582         if( status ) return errno;
15583 #endif
15584
15585 #ifdef HAVE_LINUX_THREADS
15586         pthread_kill_other_threads_np();
15587 #endif
15588
15589         return 0;
15590
15591 }
15592
15593 EOF
15594 if { (eval echo configure:15595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15595 then
15596   ol_cv_pthread_create_works=yes
15597 else
15598   echo "configure: failed program was:" >&5
15599   cat conftest.$ac_ext >&5
15600   rm -fr conftest*
15601   ol_cv_pthread_create_works=no
15602 fi
15603 rm -fr conftest*
15604 fi
15605
15606 fi
15607
15608 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
15609
15610                         if test $ol_cv_pthread_create_works = no ; then
15611                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
15612                         fi
15613
15614                                                 if test $ol_with_yielding_select = auto ; then
15615                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
15616 echo "configure:15617: checking if select yields when using pthreads" >&5
15617 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
15618   echo $ac_n "(cached) $ac_c" 1>&6
15619 else
15620   
15621                                 if test "$cross_compiling" = yes; then
15622   ol_cv_pthread_select_yields=cross
15623 else
15624   cat > conftest.$ac_ext <<EOF
15625 #line 15626 "configure"
15626 #include "confdefs.h"
15627
15628 #include <sys/types.h>
15629 #include <sys/time.h>
15630 #include <unistd.h>
15631 #include <pthread.h>
15632 #ifndef NULL
15633 #define NULL (void*) 0
15634 #endif
15635
15636 static int fildes[2];
15637
15638 static void *task(p)
15639         void *p;
15640 {
15641         int i;
15642         struct timeval tv;
15643
15644         fd_set rfds;
15645
15646         tv.tv_sec=10;
15647         tv.tv_usec=0;
15648
15649         FD_ZERO(&rfds);
15650         FD_SET(fildes[0], &rfds);
15651
15652         /* we're not interested in any fds */
15653         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
15654
15655         if(i < 0) {
15656                 perror("select");
15657                 exit(10);
15658         }
15659
15660         exit(0); /* if we exit here, the select blocked the whole process */
15661 }
15662
15663 int main(argc, argv)
15664         int argc;
15665         char **argv;
15666 {
15667         pthread_t t;
15668
15669         /* create a pipe to select */
15670         if(pipe(&fildes[0])) {
15671                 perror("select");
15672                 exit(1);
15673         }
15674
15675 #ifdef HAVE_PTHREAD_SETCONCURRENCY
15676         (void) pthread_setconcurrency(2);
15677 #else
15678 #ifdef HAVE_THR_SETCONCURRENCY
15679         /* Set Solaris LWP concurrency to 2 */
15680         thr_setconcurrency(2);
15681 #endif
15682 #endif
15683
15684 #if HAVE_PTHREADS < 6
15685         pthread_create(&t, pthread_attr_default, task, NULL);
15686 #else
15687         pthread_create(&t, NULL, task, NULL);
15688 #endif
15689
15690         /* make sure task runs first */
15691 #if HAVE_THR_YIELD
15692         thr_yield();
15693 #elif defined( HAVE_SCHED_YIELD )
15694         sched_yield();
15695 #elif defined( HAVE_PTHREAD_YIELD )
15696         pthread_yield();
15697 #endif
15698
15699         exit(2);
15700 }
15701 EOF
15702 if { (eval echo configure:15703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15703 then
15704   ol_cv_pthread_select_yields=no
15705 else
15706   echo "configure: failed program was:" >&5
15707   cat conftest.$ac_ext >&5
15708   rm -fr conftest*
15709   ol_cv_pthread_select_yields=yes
15710 fi
15711 rm -fr conftest*
15712 fi
15713
15714 fi
15715
15716 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
15717
15718                                 if test $ol_cv_pthread_select_yields = cross ; then
15719                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
15720                                 fi
15721
15722                                 if test $ol_cv_pthread_select_yields = yes ; then
15723                                         ol_with_yielding_select=yes
15724                                 fi
15725                         fi
15726
15727                                                 CPPFLAGS="$save_CPPFLAGS"
15728                         LIBS="$save_LIBS"
15729                 else
15730                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
15731                 fi
15732         fi
15733
15734         if test $ol_with_threads = posix ; then
15735                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
15736         fi
15737 fi
15738
15739 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15740         -o $ol_with_threads = mach ; then
15741
15742                 for ac_hdr in mach/cthreads.h cthreads.h
15743 do
15744 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15745 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15746 echo "configure:15747: checking for $ac_hdr" >&5
15747 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15748   echo $ac_n "(cached) $ac_c" 1>&6
15749 else
15750   cat > conftest.$ac_ext <<EOF
15751 #line 15752 "configure"
15752 #include "confdefs.h"
15753 #include <$ac_hdr>
15754 EOF
15755 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15756 { (eval echo configure:15757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15757 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15758 if test -z "$ac_err"; then
15759   rm -rf conftest*
15760   eval "ac_cv_header_$ac_safe=yes"
15761 else
15762   echo "$ac_err" >&5
15763   echo "configure: failed program was:" >&5
15764   cat conftest.$ac_ext >&5
15765   rm -rf conftest*
15766   eval "ac_cv_header_$ac_safe=no"
15767 fi
15768 rm -f conftest*
15769 fi
15770 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15771   echo "$ac_t""yes" 1>&6
15772     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15773   cat >> confdefs.h <<EOF
15774 #define $ac_tr_hdr 1
15775 EOF
15776  
15777 else
15778   echo "$ac_t""no" 1>&6
15779 fi
15780 done
15781
15782         if test $ac_cv_header_mach_cthreads_h = yes ; then
15783                 ol_with_threads=found
15784
15785                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15786 echo "configure:15787: checking for cthread_fork" >&5
15787 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15788   echo $ac_n "(cached) $ac_c" 1>&6
15789 else
15790   cat > conftest.$ac_ext <<EOF
15791 #line 15792 "configure"
15792 #include "confdefs.h"
15793 /* System header to define __stub macros and hopefully few prototypes,
15794     which can conflict with char cthread_fork(); below.  */
15795 #include <assert.h>
15796 /* Override any gcc2 internal prototype to avoid an error.  */
15797 /* We use char because int might match the return type of a gcc2
15798     builtin and then its argument prototype would still apply.  */
15799 char cthread_fork();
15800 char (*f)();
15801
15802 int main() {
15803
15804 /* The GNU C library defines this for functions which it implements
15805     to always fail with ENOSYS.  Some functions are actually named
15806     something starting with __ and the normal name is an alias.  */
15807 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15808 choke me
15809 #else
15810 f = cthread_fork;
15811 #endif
15812
15813 ; return 0; }
15814 EOF
15815 if { (eval echo configure:15816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15816   rm -rf conftest*
15817   eval "ac_cv_func_cthread_fork=yes"
15818 else
15819   echo "configure: failed program was:" >&5
15820   cat conftest.$ac_ext >&5
15821   rm -rf conftest*
15822   eval "ac_cv_func_cthread_fork=no"
15823 fi
15824 rm -f conftest*
15825 fi
15826
15827 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15828   echo "$ac_t""yes" 1>&6
15829   ol_link_threads=yes
15830 else
15831   echo "$ac_t""no" 1>&6
15832 fi
15833
15834
15835                 if test $ol_link_threads = no ; then
15836                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
15837 echo "configure:15838: checking for cthread_fork with -all_load" >&5
15838 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
15839   echo $ac_n "(cached) $ac_c" 1>&6
15840 else
15841   
15842                                                                 save_LIBS="$LIBS"
15843                                 LIBS="-all_load $LIBS"
15844                                 cat > conftest.$ac_ext <<EOF
15845 #line 15846 "configure"
15846 #include "confdefs.h"
15847 #include <mach/cthreads.h>
15848 int main() {
15849
15850                                         cthread_fork((void *)0, (void *)0);
15851                                         
15852 ; return 0; }
15853 EOF
15854 if { (eval echo configure:15855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15855   rm -rf conftest*
15856   ol_cv_cthread_all_load=yes
15857 else
15858   echo "configure: failed program was:" >&5
15859   cat conftest.$ac_ext >&5
15860   rm -rf conftest*
15861   ol_cv_cthread_all_load=no
15862 fi
15863 rm -f conftest*
15864                                                                 LIBS="$save_LIBS"
15865                         
15866 fi
15867
15868 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
15869
15870                         if test $ol_cv_cthread_all_load = yes ; then
15871                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
15872                                 ol_link_threads=mach
15873                                 ol_with_threads=found
15874                         fi
15875                 fi
15876
15877         elif test $ac_cv_header_cthreads_h = yes ; then
15878                                 
15879                 ol_with_threads=found
15880  
15881                                 save_LIBS="$LIBS"
15882                 LIBS="$LIBS -lthreads"
15883                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
15884 echo "configure:15885: checking for cthread_fork" >&5
15885 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
15886   echo $ac_n "(cached) $ac_c" 1>&6
15887 else
15888   cat > conftest.$ac_ext <<EOF
15889 #line 15890 "configure"
15890 #include "confdefs.h"
15891 /* System header to define __stub macros and hopefully few prototypes,
15892     which can conflict with char cthread_fork(); below.  */
15893 #include <assert.h>
15894 /* Override any gcc2 internal prototype to avoid an error.  */
15895 /* We use char because int might match the return type of a gcc2
15896     builtin and then its argument prototype would still apply.  */
15897 char cthread_fork();
15898 char (*f)();
15899
15900 int main() {
15901
15902 /* The GNU C library defines this for functions which it implements
15903     to always fail with ENOSYS.  Some functions are actually named
15904     something starting with __ and the normal name is an alias.  */
15905 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
15906 choke me
15907 #else
15908 f = cthread_fork;
15909 #endif
15910
15911 ; return 0; }
15912 EOF
15913 if { (eval echo configure:15914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15914   rm -rf conftest*
15915   eval "ac_cv_func_cthread_fork=yes"
15916 else
15917   echo "configure: failed program was:" >&5
15918   cat conftest.$ac_ext >&5
15919   rm -rf conftest*
15920   eval "ac_cv_func_cthread_fork=no"
15921 fi
15922 rm -f conftest*
15923 fi
15924
15925 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
15926   echo "$ac_t""yes" 1>&6
15927   ol_link_threads=yes
15928 else
15929   echo "$ac_t""no" 1>&6
15930 fi
15931
15932                 LIBS="$save_LIBS"
15933
15934                 if test $ol_link_threads = yes ; then
15935                         LTHREAD_LIBS="-lthreads"
15936                         ol_link_threads=mach
15937                         ol_with_threads=found
15938                 else
15939                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15940                 fi
15941
15942         elif test $ol_with_threads = mach ; then
15943                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
15944         fi
15945
15946         if test $ol_link_threads = mach ; then
15947                 cat >> confdefs.h <<\EOF
15948 #define HAVE_MACH_CTHREADS 1
15949 EOF
15950
15951         elif test $ol_with_threads = found ; then
15952                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
15953         fi
15954 fi
15955
15956 if test $ol_with_threads = auto -o $ol_with_threads = yes \
15957         -o $ol_with_threads = pth ; then
15958
15959         for ac_hdr in pth.h
15960 do
15961 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15962 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15963 echo "configure:15964: checking for $ac_hdr" >&5
15964 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15965   echo $ac_n "(cached) $ac_c" 1>&6
15966 else
15967   cat > conftest.$ac_ext <<EOF
15968 #line 15969 "configure"
15969 #include "confdefs.h"
15970 #include <$ac_hdr>
15971 EOF
15972 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15973 { (eval echo configure:15974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15974 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15975 if test -z "$ac_err"; then
15976   rm -rf conftest*
15977   eval "ac_cv_header_$ac_safe=yes"
15978 else
15979   echo "$ac_err" >&5
15980   echo "configure: failed program was:" >&5
15981   cat conftest.$ac_ext >&5
15982   rm -rf conftest*
15983   eval "ac_cv_header_$ac_safe=no"
15984 fi
15985 rm -f conftest*
15986 fi
15987 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15988   echo "$ac_t""yes" 1>&6
15989     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15990   cat >> confdefs.h <<EOF
15991 #define $ac_tr_hdr 1
15992 EOF
15993  
15994 else
15995   echo "$ac_t""no" 1>&6
15996 fi
15997 done
15998
15999
16000         if test $ac_cv_header_pth_h = yes ; then
16001                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
16002 echo "configure:16003: checking for pth_version in -lpth" >&5
16003 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
16004 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16005   echo $ac_n "(cached) $ac_c" 1>&6
16006 else
16007   ac_save_LIBS="$LIBS"
16008 LIBS="-lpth  $LIBS"
16009 cat > conftest.$ac_ext <<EOF
16010 #line 16011 "configure"
16011 #include "confdefs.h"
16012 /* Override any gcc2 internal prototype to avoid an error.  */
16013 /* We use char because int might match the return type of a gcc2
16014     builtin and then its argument prototype would still apply.  */
16015 char pth_version();
16016
16017 int main() {
16018 pth_version()
16019 ; return 0; }
16020 EOF
16021 if { (eval echo configure:16022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16022   rm -rf conftest*
16023   eval "ac_cv_lib_$ac_lib_var=yes"
16024 else
16025   echo "configure: failed program was:" >&5
16026   cat conftest.$ac_ext >&5
16027   rm -rf conftest*
16028   eval "ac_cv_lib_$ac_lib_var=no"
16029 fi
16030 rm -f conftest*
16031 LIBS="$ac_save_LIBS"
16032
16033 fi
16034 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16035   echo "$ac_t""yes" 1>&6
16036   have_pth=yes
16037 else
16038   echo "$ac_t""no" 1>&6
16039 have_pth=no
16040 fi
16041
16042
16043                 if test $have_pth = yes ; then
16044                         cat >> confdefs.h <<\EOF
16045 #define HAVE_GNU_PTH 1
16046 EOF
16047
16048                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
16049                         ol_link_threads=pth
16050                         ol_with_threads=found
16051
16052                         if test $ol_with_yielding_select = auto ; then
16053                                 ol_with_yielding_select=yes
16054                         fi
16055                 fi
16056         fi
16057 fi
16058
16059 if test $ol_with_threads = auto -o $ol_with_threads = yes \
16060         -o $ol_with_threads = lwp ; then
16061
16062                 for ac_hdr in thread.h synch.h
16063 do
16064 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16065 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16066 echo "configure:16067: checking for $ac_hdr" >&5
16067 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16068   echo $ac_n "(cached) $ac_c" 1>&6
16069 else
16070   cat > conftest.$ac_ext <<EOF
16071 #line 16072 "configure"
16072 #include "confdefs.h"
16073 #include <$ac_hdr>
16074 EOF
16075 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16076 { (eval echo configure:16077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16077 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16078 if test -z "$ac_err"; then
16079   rm -rf conftest*
16080   eval "ac_cv_header_$ac_safe=yes"
16081 else
16082   echo "$ac_err" >&5
16083   echo "configure: failed program was:" >&5
16084   cat conftest.$ac_ext >&5
16085   rm -rf conftest*
16086   eval "ac_cv_header_$ac_safe=no"
16087 fi
16088 rm -f conftest*
16089 fi
16090 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16091   echo "$ac_t""yes" 1>&6
16092     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16093   cat >> confdefs.h <<EOF
16094 #define $ac_tr_hdr 1
16095 EOF
16096  
16097 else
16098   echo "$ac_t""no" 1>&6
16099 fi
16100 done
16101
16102         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
16103                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
16104 echo "configure:16105: checking for thr_create in -lthread" >&5
16105 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
16106 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16107   echo $ac_n "(cached) $ac_c" 1>&6
16108 else
16109   ac_save_LIBS="$LIBS"
16110 LIBS="-lthread  $LIBS"
16111 cat > conftest.$ac_ext <<EOF
16112 #line 16113 "configure"
16113 #include "confdefs.h"
16114 /* Override any gcc2 internal prototype to avoid an error.  */
16115 /* We use char because int might match the return type of a gcc2
16116     builtin and then its argument prototype would still apply.  */
16117 char thr_create();
16118
16119 int main() {
16120 thr_create()
16121 ; return 0; }
16122 EOF
16123 if { (eval echo configure:16124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16124   rm -rf conftest*
16125   eval "ac_cv_lib_$ac_lib_var=yes"
16126 else
16127   echo "configure: failed program was:" >&5
16128   cat conftest.$ac_ext >&5
16129   rm -rf conftest*
16130   eval "ac_cv_lib_$ac_lib_var=no"
16131 fi
16132 rm -f conftest*
16133 LIBS="$ac_save_LIBS"
16134
16135 fi
16136 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16137   echo "$ac_t""yes" 1>&6
16138   have_thr=yes
16139 else
16140   echo "$ac_t""no" 1>&6
16141 have_thr=no
16142 fi
16143
16144
16145                 if test $have_thr = yes ; then
16146                         cat >> confdefs.h <<\EOF
16147 #define HAVE_THR 1
16148 EOF
16149
16150                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
16151                         ol_link_threads=thr
16152
16153                         if test $ol_with_yielding_select = auto ; then
16154                                 ol_with_yielding_select=yes
16155                         fi
16156
16157                                                 for ac_func in \
16158                                 thr_setconcurrency \
16159                                 thr_getconcurrency \
16160                         
16161 do
16162 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16163 echo "configure:16164: checking for $ac_func" >&5
16164 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16165   echo $ac_n "(cached) $ac_c" 1>&6
16166 else
16167   cat > conftest.$ac_ext <<EOF
16168 #line 16169 "configure"
16169 #include "confdefs.h"
16170 /* System header to define __stub macros and hopefully few prototypes,
16171     which can conflict with char $ac_func(); below.  */
16172 #include <assert.h>
16173 /* Override any gcc2 internal prototype to avoid an error.  */
16174 /* We use char because int might match the return type of a gcc2
16175     builtin and then its argument prototype would still apply.  */
16176 char $ac_func();
16177 char (*f)();
16178
16179 int main() {
16180
16181 /* The GNU C library defines this for functions which it implements
16182     to always fail with ENOSYS.  Some functions are actually named
16183     something starting with __ and the normal name is an alias.  */
16184 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16185 choke me
16186 #else
16187 f = $ac_func;
16188 #endif
16189
16190 ; return 0; }
16191 EOF
16192 if { (eval echo configure:16193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16193   rm -rf conftest*
16194   eval "ac_cv_func_$ac_func=yes"
16195 else
16196   echo "configure: failed program was:" >&5
16197   cat conftest.$ac_ext >&5
16198   rm -rf conftest*
16199   eval "ac_cv_func_$ac_func=no"
16200 fi
16201 rm -f conftest*
16202 fi
16203
16204 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16205   echo "$ac_t""yes" 1>&6
16206     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16207   cat >> confdefs.h <<EOF
16208 #define $ac_tr_func 1
16209 EOF
16210  
16211 else
16212   echo "$ac_t""no" 1>&6
16213 fi
16214 done
16215
16216                 fi
16217         fi
16218
16219                 for ac_hdr in lwp/lwp.h
16220 do
16221 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16222 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16223 echo "configure:16224: checking for $ac_hdr" >&5
16224 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16225   echo $ac_n "(cached) $ac_c" 1>&6
16226 else
16227   cat > conftest.$ac_ext <<EOF
16228 #line 16229 "configure"
16229 #include "confdefs.h"
16230 #include <$ac_hdr>
16231 EOF
16232 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16233 { (eval echo configure:16234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16234 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16235 if test -z "$ac_err"; then
16236   rm -rf conftest*
16237   eval "ac_cv_header_$ac_safe=yes"
16238 else
16239   echo "$ac_err" >&5
16240   echo "configure: failed program was:" >&5
16241   cat conftest.$ac_ext >&5
16242   rm -rf conftest*
16243   eval "ac_cv_header_$ac_safe=no"
16244 fi
16245 rm -f conftest*
16246 fi
16247 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16248   echo "$ac_t""yes" 1>&6
16249     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16250   cat >> confdefs.h <<EOF
16251 #define $ac_tr_hdr 1
16252 EOF
16253  
16254 else
16255   echo "$ac_t""no" 1>&6
16256 fi
16257 done
16258
16259         if test $ac_cv_header_lwp_lwp_h = yes ; then
16260                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
16261 echo "configure:16262: checking for lwp_create in -llwp" >&5
16262 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
16263 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16264   echo $ac_n "(cached) $ac_c" 1>&6
16265 else
16266   ac_save_LIBS="$LIBS"
16267 LIBS="-llwp  $LIBS"
16268 cat > conftest.$ac_ext <<EOF
16269 #line 16270 "configure"
16270 #include "confdefs.h"
16271 /* Override any gcc2 internal prototype to avoid an error.  */
16272 /* We use char because int might match the return type of a gcc2
16273     builtin and then its argument prototype would still apply.  */
16274 char lwp_create();
16275
16276 int main() {
16277 lwp_create()
16278 ; return 0; }
16279 EOF
16280 if { (eval echo configure:16281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16281   rm -rf conftest*
16282   eval "ac_cv_lib_$ac_lib_var=yes"
16283 else
16284   echo "configure: failed program was:" >&5
16285   cat conftest.$ac_ext >&5
16286   rm -rf conftest*
16287   eval "ac_cv_lib_$ac_lib_var=no"
16288 fi
16289 rm -f conftest*
16290 LIBS="$ac_save_LIBS"
16291
16292 fi
16293 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16294   echo "$ac_t""yes" 1>&6
16295   have_lwp=yes
16296 else
16297   echo "$ac_t""no" 1>&6
16298 have_lwp=no
16299 fi
16300
16301
16302                 if test $have_lwp = yes ; then
16303                         cat >> confdefs.h <<\EOF
16304 #define HAVE_LWP 1
16305 EOF
16306
16307                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
16308                         ol_link_threads=lwp
16309
16310                         if test $ol_with_yielding_select = auto ; then
16311                                 ol_with_yielding_select=no
16312                         fi
16313                 fi
16314         fi
16315 fi
16316
16317 if test $ol_with_yielding_select = yes ; then
16318         cat >> confdefs.h <<\EOF
16319 #define HAVE_YIELDING_SELECT 1
16320 EOF
16321
16322 fi
16323
16324 if test $ol_with_threads = manual ; then
16325                 ol_link_threads=yes
16326
16327         echo "configure: warning: thread defines and link options must be set manually" 1>&2
16328
16329         for ac_hdr in pthread.h sched.h
16330 do
16331 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16332 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16333 echo "configure:16334: checking for $ac_hdr" >&5
16334 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16335   echo $ac_n "(cached) $ac_c" 1>&6
16336 else
16337   cat > conftest.$ac_ext <<EOF
16338 #line 16339 "configure"
16339 #include "confdefs.h"
16340 #include <$ac_hdr>
16341 EOF
16342 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16343 { (eval echo configure:16344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16344 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16345 if test -z "$ac_err"; then
16346   rm -rf conftest*
16347   eval "ac_cv_header_$ac_safe=yes"
16348 else
16349   echo "$ac_err" >&5
16350   echo "configure: failed program was:" >&5
16351   cat conftest.$ac_ext >&5
16352   rm -rf conftest*
16353   eval "ac_cv_header_$ac_safe=no"
16354 fi
16355 rm -f conftest*
16356 fi
16357 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16358   echo "$ac_t""yes" 1>&6
16359     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16360   cat >> confdefs.h <<EOF
16361 #define $ac_tr_hdr 1
16362 EOF
16363  
16364 else
16365   echo "$ac_t""no" 1>&6
16366 fi
16367 done
16368
16369         for ac_func in sched_yield pthread_yield
16370 do
16371 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16372 echo "configure:16373: checking for $ac_func" >&5
16373 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16374   echo $ac_n "(cached) $ac_c" 1>&6
16375 else
16376   cat > conftest.$ac_ext <<EOF
16377 #line 16378 "configure"
16378 #include "confdefs.h"
16379 /* System header to define __stub macros and hopefully few prototypes,
16380     which can conflict with char $ac_func(); below.  */
16381 #include <assert.h>
16382 /* Override any gcc2 internal prototype to avoid an error.  */
16383 /* We use char because int might match the return type of a gcc2
16384     builtin and then its argument prototype would still apply.  */
16385 char $ac_func();
16386 char (*f)();
16387
16388 int main() {
16389
16390 /* The GNU C library defines this for functions which it implements
16391     to always fail with ENOSYS.  Some functions are actually named
16392     something starting with __ and the normal name is an alias.  */
16393 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16394 choke me
16395 #else
16396 f = $ac_func;
16397 #endif
16398
16399 ; return 0; }
16400 EOF
16401 if { (eval echo configure:16402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16402   rm -rf conftest*
16403   eval "ac_cv_func_$ac_func=yes"
16404 else
16405   echo "configure: failed program was:" >&5
16406   cat conftest.$ac_ext >&5
16407   rm -rf conftest*
16408   eval "ac_cv_func_$ac_func=no"
16409 fi
16410 rm -f conftest*
16411 fi
16412
16413 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16414   echo "$ac_t""yes" 1>&6
16415     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16416   cat >> confdefs.h <<EOF
16417 #define $ac_tr_func 1
16418 EOF
16419  
16420 else
16421   echo "$ac_t""no" 1>&6
16422 fi
16423 done
16424
16425         
16426         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
16427 echo "configure:16428: checking for LinuxThreads pthread.h" >&5
16428 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
16429   echo $ac_n "(cached) $ac_c" 1>&6
16430 else
16431   cat > conftest.$ac_ext <<EOF
16432 #line 16433 "configure"
16433 #include "confdefs.h"
16434 #include <pthread.h>
16435 EOF
16436 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16437   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
16438   rm -rf conftest*
16439   ol_cv_header_linux_threads=yes
16440 else
16441   rm -rf conftest*
16442   ol_cv_header_linux_threads=no
16443 fi
16444 rm -f conftest*
16445
16446                 
16447 fi
16448
16449 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
16450         if test $ol_cv_header_linux_threads = yes; then
16451                 cat >> confdefs.h <<\EOF
16452 #define HAVE_LINUX_THREADS 1
16453 EOF
16454
16455         fi
16456
16457
16458         for ac_hdr in mach/cthreads.h
16459 do
16460 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16461 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16462 echo "configure:16463: checking for $ac_hdr" >&5
16463 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16464   echo $ac_n "(cached) $ac_c" 1>&6
16465 else
16466   cat > conftest.$ac_ext <<EOF
16467 #line 16468 "configure"
16468 #include "confdefs.h"
16469 #include <$ac_hdr>
16470 EOF
16471 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16472 { (eval echo configure:16473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16473 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16474 if test -z "$ac_err"; then
16475   rm -rf conftest*
16476   eval "ac_cv_header_$ac_safe=yes"
16477 else
16478   echo "$ac_err" >&5
16479   echo "configure: failed program was:" >&5
16480   cat conftest.$ac_ext >&5
16481   rm -rf conftest*
16482   eval "ac_cv_header_$ac_safe=no"
16483 fi
16484 rm -f conftest*
16485 fi
16486 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16487   echo "$ac_t""yes" 1>&6
16488     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16489   cat >> confdefs.h <<EOF
16490 #define $ac_tr_hdr 1
16491 EOF
16492  
16493 else
16494   echo "$ac_t""no" 1>&6
16495 fi
16496 done
16497
16498         for ac_hdr in lwp/lwp.h
16499 do
16500 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16501 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16502 echo "configure:16503: checking for $ac_hdr" >&5
16503 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16504   echo $ac_n "(cached) $ac_c" 1>&6
16505 else
16506   cat > conftest.$ac_ext <<EOF
16507 #line 16508 "configure"
16508 #include "confdefs.h"
16509 #include <$ac_hdr>
16510 EOF
16511 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16512 { (eval echo configure:16513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16513 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16514 if test -z "$ac_err"; then
16515   rm -rf conftest*
16516   eval "ac_cv_header_$ac_safe=yes"
16517 else
16518   echo "$ac_err" >&5
16519   echo "configure: failed program was:" >&5
16520   cat conftest.$ac_ext >&5
16521   rm -rf conftest*
16522   eval "ac_cv_header_$ac_safe=no"
16523 fi
16524 rm -f conftest*
16525 fi
16526 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16527   echo "$ac_t""yes" 1>&6
16528     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16529   cat >> confdefs.h <<EOF
16530 #define $ac_tr_hdr 1
16531 EOF
16532  
16533 else
16534   echo "$ac_t""no" 1>&6
16535 fi
16536 done
16537
16538         for ac_hdr in thread.h synch.h
16539 do
16540 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16541 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16542 echo "configure:16543: checking for $ac_hdr" >&5
16543 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16544   echo $ac_n "(cached) $ac_c" 1>&6
16545 else
16546   cat > conftest.$ac_ext <<EOF
16547 #line 16548 "configure"
16548 #include "confdefs.h"
16549 #include <$ac_hdr>
16550 EOF
16551 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16552 { (eval echo configure:16553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16553 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16554 if test -z "$ac_err"; then
16555   rm -rf conftest*
16556   eval "ac_cv_header_$ac_safe=yes"
16557 else
16558   echo "$ac_err" >&5
16559   echo "configure: failed program was:" >&5
16560   cat conftest.$ac_ext >&5
16561   rm -rf conftest*
16562   eval "ac_cv_header_$ac_safe=no"
16563 fi
16564 rm -f conftest*
16565 fi
16566 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16567   echo "$ac_t""yes" 1>&6
16568     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16569   cat >> confdefs.h <<EOF
16570 #define $ac_tr_hdr 1
16571 EOF
16572  
16573 else
16574   echo "$ac_t""no" 1>&6
16575 fi
16576 done
16577
16578 fi
16579
16580 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
16581                         cat >> confdefs.h <<\EOF
16582 #define REENTRANT 1
16583 EOF
16584
16585         cat >> confdefs.h <<\EOF
16586 #define _REENTRANT 1
16587 EOF
16588
16589         cat >> confdefs.h <<\EOF
16590 #define THREAD_SAFE 1
16591 EOF
16592
16593         cat >> confdefs.h <<\EOF
16594 #define _THREAD_SAFE 1
16595 EOF
16596
16597         cat >> confdefs.h <<\EOF
16598 #define THREADSAFE 1
16599 EOF
16600
16601         cat >> confdefs.h <<\EOF
16602 #define _THREADSAFE 1
16603 EOF
16604
16605         cat >> confdefs.h <<\EOF
16606 #define _SGI_MP_SOURCE 1
16607 EOF
16608
16609
16610                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
16611 echo "configure:16612: checking for thread specific errno" >&5
16612 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
16613   echo $ac_n "(cached) $ac_c" 1>&6
16614 else
16615   
16616                 cat > conftest.$ac_ext <<EOF
16617 #line 16618 "configure"
16618 #include "confdefs.h"
16619 #include <errno.h>
16620 int main() {
16621 errno = 0;
16622 ; return 0; }
16623 EOF
16624 if { (eval echo configure:16625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16625   rm -rf conftest*
16626   ol_cv_errno_thread_specific=yes
16627 else
16628   echo "configure: failed program was:" >&5
16629   cat conftest.$ac_ext >&5
16630   rm -rf conftest*
16631   ol_cv_errno_thread_specific=no
16632 fi
16633 rm -f conftest*
16634         
16635 fi
16636
16637 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
16638
16639                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
16640 echo "configure:16641: checking for thread specific h_errno" >&5
16641 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
16642   echo $ac_n "(cached) $ac_c" 1>&6
16643 else
16644   
16645                 cat > conftest.$ac_ext <<EOF
16646 #line 16647 "configure"
16647 #include "confdefs.h"
16648 #include <netdb.h>
16649 int main() {
16650 h_errno = 0;
16651 ; return 0; }
16652 EOF
16653 if { (eval echo configure:16654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16654   rm -rf conftest*
16655   ol_cv_h_errno_thread_specific=yes
16656 else
16657   echo "configure: failed program was:" >&5
16658   cat conftest.$ac_ext >&5
16659   rm -rf conftest*
16660   ol_cv_h_errno_thread_specific=no
16661 fi
16662 rm -f conftest*
16663         
16664 fi
16665
16666 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
16667
16668         if test $ol_cv_errno_thread_specific != yes \
16669                 -o $ol_cv_h_errno_thread_specific != yes ; then
16670                 LIBS="$LTHREAD_LIBS $LIBS"
16671                 LTHREAD_LIBS=""
16672         fi
16673
16674 fi  
16675
16676 if test $ol_link_threads = no ; then
16677         if test $ol_with_threads = yes ; then
16678                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
16679         fi
16680
16681         if test $ol_with_threads = auto ; then
16682                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
16683                 ol_with_threads=no
16684         fi
16685
16686         cat >> confdefs.h <<\EOF
16687 #define NO_THREADS 1
16688 EOF
16689
16690         LTHREAD_LIBS=""
16691 fi
16692
16693 if test $ol_link_threads != no ; then
16694         cat >> confdefs.h <<\EOF
16695 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
16696 EOF
16697
16698 fi
16699
16700 ol_link_ldbm=no 
16701
16702 if test $ol_with_ldbm_api = auto \
16703         -o $ol_with_ldbm_api = berkeley \
16704         -o $ol_with_ldbm_api = bcompat ; then
16705
16706         if test $ol_with_ldbm_api = bcompat; then \
16707                 for ac_hdr in db_185.h db.h
16708 do
16709 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
16710 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
16711 echo "configure:16712: checking for $ac_hdr" >&5
16712 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
16713   echo $ac_n "(cached) $ac_c" 1>&6
16714 else
16715   cat > conftest.$ac_ext <<EOF
16716 #line 16717 "configure"
16717 #include "confdefs.h"
16718 #include <$ac_hdr>
16719 EOF
16720 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
16721 { (eval echo configure:16722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16722 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
16723 if test -z "$ac_err"; then
16724   rm -rf conftest*
16725   eval "ac_cv_header_$ac_safe=yes"
16726 else
16727   echo "$ac_err" >&5
16728   echo "configure: failed program was:" >&5
16729   cat conftest.$ac_ext >&5
16730   rm -rf conftest*
16731   eval "ac_cv_header_$ac_safe=no"
16732 fi
16733 rm -f conftest*
16734 fi
16735 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
16736   echo "$ac_t""yes" 1>&6
16737     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
16738   cat >> confdefs.h <<EOF
16739 #define $ac_tr_hdr 1
16740 EOF
16741  
16742 else
16743   echo "$ac_t""no" 1>&6
16744 fi
16745 done
16746
16747 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
16748         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
16749 echo "configure:16750: checking if Berkeley DB header compatibility" >&5
16750 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
16751   echo $ac_n "(cached) $ac_c" 1>&6
16752 else
16753   
16754                 cat > conftest.$ac_ext <<EOF
16755 #line 16756 "configure"
16756 #include "confdefs.h"
16757
16758 #if HAVE_DB_185_H
16759 #       include <db_185.h>
16760 #else
16761 #       include <db.h>
16762 #endif
16763
16764  /* this check could be improved */
16765 #ifndef DB_VERSION_MAJOR
16766 #       define DB_VERSION_MAJOR 1
16767 #endif
16768
16769 #if DB_VERSION_MAJOR == 1 
16770         __db_version_1
16771 #endif
16772
16773 EOF
16774 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16775   egrep "__db_version_1" >/dev/null 2>&1; then
16776   rm -rf conftest*
16777   ol_cv_header_db1=yes
16778 else
16779   rm -rf conftest*
16780   ol_cv_header_db1=no
16781 fi
16782 rm -f conftest*
16783
16784 fi
16785
16786 echo "$ac_t""$ol_cv_header_db1" 1>&6
16787
16788         if test $ol_cv_header_db1 = yes ; then
16789                 ol_cv_lib_db=no
16790 if test $ol_cv_lib_db = no ; then
16791         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
16792 echo "configure:16793: checking for Berkeley DB link (default)" >&5
16793 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
16794   echo $ac_n "(cached) $ac_c" 1>&6
16795 else
16796   
16797         ol_DB_LIB=
16798         ol_LIBS=$LIBS
16799         LIBS="$ol_DB_LIB $LIBS"
16800
16801         cat > conftest.$ac_ext <<EOF
16802 #line 16803 "configure"
16803 #include "confdefs.h"
16804
16805 #ifdef HAVE_DB_185_H
16806 # include <db_185.h>
16807 #else
16808 # include <db.h>
16809 #endif
16810
16811 #ifndef DB_VERSION_MAJOR
16812 # define DB_VERSION_MAJOR 1
16813 #endif
16814
16815 #ifndef NULL
16816 #define NULL ((void*)0)
16817 #endif
16818
16819 int main() {
16820
16821 #if DB_VERSION_MAJOR > 1
16822         {
16823                 char *version;
16824                 int major, minor, patch;
16825
16826                 version = db_version( &major, &minor, &patch );
16827
16828                 if( major != DB_VERSION_MAJOR ||
16829                         minor < DB_VERSION_MINOR )
16830                 {
16831                         printf("Berkeley DB version mismatch\n"
16832                                 "\texpected: %s\n\tgot: %s\n",
16833                                 DB_VERSION_STRING, version);
16834                         return 1;
16835                 }
16836         }
16837 #endif
16838
16839 #if DB_VERSION_MAJOR > 2
16840         db_env_create( NULL, 0 );
16841 #elif DB_VERSION_MAJOR > 1
16842         db_appexit( NULL );
16843 #else
16844         (void) dbopen( NULL, 0, 0, 0, NULL);
16845 #endif
16846
16847 ; return 0; }
16848 EOF
16849 if { (eval echo configure:16850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16850   rm -rf conftest*
16851   ol_cv_db_none=yes
16852 else
16853   echo "configure: failed program was:" >&5
16854   cat conftest.$ac_ext >&5
16855   rm -rf conftest*
16856   ol_cv_db_none=no
16857 fi
16858 rm -f conftest*
16859
16860         LIBS="$ol_LIBS"
16861
16862 fi
16863
16864 echo "$ac_t""$ol_cv_db_none" 1>&6
16865
16866         if test $ol_cv_db_none = yes ; then
16867                 ol_cv_lib_db=yes
16868         fi
16869 fi
16870
16871 if test $ol_cv_lib_db = no ; then
16872         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
16873 echo "configure:16874: checking for Berkeley DB link (-ldb4)" >&5
16874 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
16875   echo $ac_n "(cached) $ac_c" 1>&6
16876 else
16877   
16878         ol_DB_LIB=-ldb4
16879         ol_LIBS=$LIBS
16880         LIBS="$ol_DB_LIB $LIBS"
16881
16882         cat > conftest.$ac_ext <<EOF
16883 #line 16884 "configure"
16884 #include "confdefs.h"
16885
16886 #ifdef HAVE_DB_185_H
16887 # include <db_185.h>
16888 #else
16889 # include <db.h>
16890 #endif
16891
16892 #ifndef DB_VERSION_MAJOR
16893 # define DB_VERSION_MAJOR 1
16894 #endif
16895
16896 #ifndef NULL
16897 #define NULL ((void*)0)
16898 #endif
16899
16900 int main() {
16901
16902 #if DB_VERSION_MAJOR > 1
16903         {
16904                 char *version;
16905                 int major, minor, patch;
16906
16907                 version = db_version( &major, &minor, &patch );
16908
16909                 if( major != DB_VERSION_MAJOR ||
16910                         minor < DB_VERSION_MINOR )
16911                 {
16912                         printf("Berkeley DB version mismatch\n"
16913                                 "\texpected: %s\n\tgot: %s\n",
16914                                 DB_VERSION_STRING, version);
16915                         return 1;
16916                 }
16917         }
16918 #endif
16919
16920 #if DB_VERSION_MAJOR > 2
16921         db_env_create( NULL, 0 );
16922 #elif DB_VERSION_MAJOR > 1
16923         db_appexit( NULL );
16924 #else
16925         (void) dbopen( NULL, 0, 0, 0, NULL);
16926 #endif
16927
16928 ; return 0; }
16929 EOF
16930 if { (eval echo configure:16931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16931   rm -rf conftest*
16932   ol_cv_db_db4=yes
16933 else
16934   echo "configure: failed program was:" >&5
16935   cat conftest.$ac_ext >&5
16936   rm -rf conftest*
16937   ol_cv_db_db4=no
16938 fi
16939 rm -f conftest*
16940
16941         LIBS="$ol_LIBS"
16942
16943 fi
16944
16945 echo "$ac_t""$ol_cv_db_db4" 1>&6
16946
16947         if test $ol_cv_db_db4 = yes ; then
16948                 ol_cv_lib_db=-ldb4
16949         fi
16950 fi
16951
16952 if test $ol_cv_lib_db = no ; then
16953         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
16954 echo "configure:16955: checking for Berkeley DB link (-ldb-4)" >&5
16955 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
16956   echo $ac_n "(cached) $ac_c" 1>&6
16957 else
16958   
16959         ol_DB_LIB=-ldb-4
16960         ol_LIBS=$LIBS
16961         LIBS="$ol_DB_LIB $LIBS"
16962
16963         cat > conftest.$ac_ext <<EOF
16964 #line 16965 "configure"
16965 #include "confdefs.h"
16966
16967 #ifdef HAVE_DB_185_H
16968 # include <db_185.h>
16969 #else
16970 # include <db.h>
16971 #endif
16972
16973 #ifndef DB_VERSION_MAJOR
16974 # define DB_VERSION_MAJOR 1
16975 #endif
16976
16977 #ifndef NULL
16978 #define NULL ((void*)0)
16979 #endif
16980
16981 int main() {
16982
16983 #if DB_VERSION_MAJOR > 1
16984         {
16985                 char *version;
16986                 int major, minor, patch;
16987
16988                 version = db_version( &major, &minor, &patch );
16989
16990                 if( major != DB_VERSION_MAJOR ||
16991                         minor < DB_VERSION_MINOR )
16992                 {
16993                         printf("Berkeley DB version mismatch\n"
16994                                 "\texpected: %s\n\tgot: %s\n",
16995                                 DB_VERSION_STRING, version);
16996                         return 1;
16997                 }
16998         }
16999 #endif
17000
17001 #if DB_VERSION_MAJOR > 2
17002         db_env_create( NULL, 0 );
17003 #elif DB_VERSION_MAJOR > 1
17004         db_appexit( NULL );
17005 #else
17006         (void) dbopen( NULL, 0, 0, 0, NULL);
17007 #endif
17008
17009 ; return 0; }
17010 EOF
17011 if { (eval echo configure:17012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17012   rm -rf conftest*
17013   ol_cv_db_db_4=yes
17014 else
17015   echo "configure: failed program was:" >&5
17016   cat conftest.$ac_ext >&5
17017   rm -rf conftest*
17018   ol_cv_db_db_4=no
17019 fi
17020 rm -f conftest*
17021
17022         LIBS="$ol_LIBS"
17023
17024 fi
17025
17026 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17027
17028         if test $ol_cv_db_db_4 = yes ; then
17029                 ol_cv_lib_db=-ldb-4
17030         fi
17031 fi
17032
17033 if test $ol_cv_lib_db = no ; then
17034         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17035 echo "configure:17036: checking for Berkeley DB link (-ldb)" >&5
17036 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17037   echo $ac_n "(cached) $ac_c" 1>&6
17038 else
17039   
17040         ol_DB_LIB=-ldb
17041         ol_LIBS=$LIBS
17042         LIBS="$ol_DB_LIB $LIBS"
17043
17044         cat > conftest.$ac_ext <<EOF
17045 #line 17046 "configure"
17046 #include "confdefs.h"
17047
17048 #ifdef HAVE_DB_185_H
17049 # include <db_185.h>
17050 #else
17051 # include <db.h>
17052 #endif
17053
17054 #ifndef DB_VERSION_MAJOR
17055 # define DB_VERSION_MAJOR 1
17056 #endif
17057
17058 #ifndef NULL
17059 #define NULL ((void*)0)
17060 #endif
17061
17062 int main() {
17063
17064 #if DB_VERSION_MAJOR > 1
17065         {
17066                 char *version;
17067                 int major, minor, patch;
17068
17069                 version = db_version( &major, &minor, &patch );
17070
17071                 if( major != DB_VERSION_MAJOR ||
17072                         minor < DB_VERSION_MINOR )
17073                 {
17074                         printf("Berkeley DB version mismatch\n"
17075                                 "\texpected: %s\n\tgot: %s\n",
17076                                 DB_VERSION_STRING, version);
17077                         return 1;
17078                 }
17079         }
17080 #endif
17081
17082 #if DB_VERSION_MAJOR > 2
17083         db_env_create( NULL, 0 );
17084 #elif DB_VERSION_MAJOR > 1
17085         db_appexit( NULL );
17086 #else
17087         (void) dbopen( NULL, 0, 0, 0, NULL);
17088 #endif
17089
17090 ; return 0; }
17091 EOF
17092 if { (eval echo configure:17093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17093   rm -rf conftest*
17094   ol_cv_db_db=yes
17095 else
17096   echo "configure: failed program was:" >&5
17097   cat conftest.$ac_ext >&5
17098   rm -rf conftest*
17099   ol_cv_db_db=no
17100 fi
17101 rm -f conftest*
17102
17103         LIBS="$ol_LIBS"
17104
17105 fi
17106
17107 echo "$ac_t""$ol_cv_db_db" 1>&6
17108
17109         if test $ol_cv_db_db = yes ; then
17110                 ol_cv_lib_db=-ldb
17111         fi
17112 fi
17113
17114 if test $ol_cv_lib_db = no ; then
17115         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17116 echo "configure:17117: checking for Berkeley DB link (-ldb3)" >&5
17117 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17118   echo $ac_n "(cached) $ac_c" 1>&6
17119 else
17120   
17121         ol_DB_LIB=-ldb3
17122         ol_LIBS=$LIBS
17123         LIBS="$ol_DB_LIB $LIBS"
17124
17125         cat > conftest.$ac_ext <<EOF
17126 #line 17127 "configure"
17127 #include "confdefs.h"
17128
17129 #ifdef HAVE_DB_185_H
17130 # include <db_185.h>
17131 #else
17132 # include <db.h>
17133 #endif
17134
17135 #ifndef DB_VERSION_MAJOR
17136 # define DB_VERSION_MAJOR 1
17137 #endif
17138
17139 #ifndef NULL
17140 #define NULL ((void*)0)
17141 #endif
17142
17143 int main() {
17144
17145 #if DB_VERSION_MAJOR > 1
17146         {
17147                 char *version;
17148                 int major, minor, patch;
17149
17150                 version = db_version( &major, &minor, &patch );
17151
17152                 if( major != DB_VERSION_MAJOR ||
17153                         minor < DB_VERSION_MINOR )
17154                 {
17155                         printf("Berkeley DB version mismatch\n"
17156                                 "\texpected: %s\n\tgot: %s\n",
17157                                 DB_VERSION_STRING, version);
17158                         return 1;
17159                 }
17160         }
17161 #endif
17162
17163 #if DB_VERSION_MAJOR > 2
17164         db_env_create( NULL, 0 );
17165 #elif DB_VERSION_MAJOR > 1
17166         db_appexit( NULL );
17167 #else
17168         (void) dbopen( NULL, 0, 0, 0, NULL);
17169 #endif
17170
17171 ; return 0; }
17172 EOF
17173 if { (eval echo configure:17174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17174   rm -rf conftest*
17175   ol_cv_db_db3=yes
17176 else
17177   echo "configure: failed program was:" >&5
17178   cat conftest.$ac_ext >&5
17179   rm -rf conftest*
17180   ol_cv_db_db3=no
17181 fi
17182 rm -f conftest*
17183
17184         LIBS="$ol_LIBS"
17185
17186 fi
17187
17188 echo "$ac_t""$ol_cv_db_db3" 1>&6
17189
17190         if test $ol_cv_db_db3 = yes ; then
17191                 ol_cv_lib_db=-ldb3
17192         fi
17193 fi
17194
17195 if test $ol_cv_lib_db = no ; then
17196         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
17197 echo "configure:17198: checking for Berkeley DB link (-ldb-3)" >&5
17198 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
17199   echo $ac_n "(cached) $ac_c" 1>&6
17200 else
17201   
17202         ol_DB_LIB=-ldb-3
17203         ol_LIBS=$LIBS
17204         LIBS="$ol_DB_LIB $LIBS"
17205
17206         cat > conftest.$ac_ext <<EOF
17207 #line 17208 "configure"
17208 #include "confdefs.h"
17209
17210 #ifdef HAVE_DB_185_H
17211 # include <db_185.h>
17212 #else
17213 # include <db.h>
17214 #endif
17215
17216 #ifndef DB_VERSION_MAJOR
17217 # define DB_VERSION_MAJOR 1
17218 #endif
17219
17220 #ifndef NULL
17221 #define NULL ((void*)0)
17222 #endif
17223
17224 int main() {
17225
17226 #if DB_VERSION_MAJOR > 1
17227         {
17228                 char *version;
17229                 int major, minor, patch;
17230
17231                 version = db_version( &major, &minor, &patch );
17232
17233                 if( major != DB_VERSION_MAJOR ||
17234                         minor < DB_VERSION_MINOR )
17235                 {
17236                         printf("Berkeley DB version mismatch\n"
17237                                 "\texpected: %s\n\tgot: %s\n",
17238                                 DB_VERSION_STRING, version);
17239                         return 1;
17240                 }
17241         }
17242 #endif
17243
17244 #if DB_VERSION_MAJOR > 2
17245         db_env_create( NULL, 0 );
17246 #elif DB_VERSION_MAJOR > 1
17247         db_appexit( NULL );
17248 #else
17249         (void) dbopen( NULL, 0, 0, 0, NULL);
17250 #endif
17251
17252 ; return 0; }
17253 EOF
17254 if { (eval echo configure:17255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17255   rm -rf conftest*
17256   ol_cv_db_db_3=yes
17257 else
17258   echo "configure: failed program was:" >&5
17259   cat conftest.$ac_ext >&5
17260   rm -rf conftest*
17261   ol_cv_db_db_3=no
17262 fi
17263 rm -f conftest*
17264
17265         LIBS="$ol_LIBS"
17266
17267 fi
17268
17269 echo "$ac_t""$ol_cv_db_db_3" 1>&6
17270
17271         if test $ol_cv_db_db_3 = yes ; then
17272                 ol_cv_lib_db=-ldb-3
17273         fi
17274 fi
17275
17276 if test $ol_cv_lib_db = no ; then
17277         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
17278 echo "configure:17279: checking for Berkeley DB link (-ldb2)" >&5
17279 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
17280   echo $ac_n "(cached) $ac_c" 1>&6
17281 else
17282   
17283         ol_DB_LIB=-ldb2
17284         ol_LIBS=$LIBS
17285         LIBS="$ol_DB_LIB $LIBS"
17286
17287         cat > conftest.$ac_ext <<EOF
17288 #line 17289 "configure"
17289 #include "confdefs.h"
17290
17291 #ifdef HAVE_DB_185_H
17292 # include <db_185.h>
17293 #else
17294 # include <db.h>
17295 #endif
17296
17297 #ifndef DB_VERSION_MAJOR
17298 # define DB_VERSION_MAJOR 1
17299 #endif
17300
17301 #ifndef NULL
17302 #define NULL ((void*)0)
17303 #endif
17304
17305 int main() {
17306
17307 #if DB_VERSION_MAJOR > 1
17308         {
17309                 char *version;
17310                 int major, minor, patch;
17311
17312                 version = db_version( &major, &minor, &patch );
17313
17314                 if( major != DB_VERSION_MAJOR ||
17315                         minor < DB_VERSION_MINOR )
17316                 {
17317                         printf("Berkeley DB version mismatch\n"
17318                                 "\texpected: %s\n\tgot: %s\n",
17319                                 DB_VERSION_STRING, version);
17320                         return 1;
17321                 }
17322         }
17323 #endif
17324
17325 #if DB_VERSION_MAJOR > 2
17326         db_env_create( NULL, 0 );
17327 #elif DB_VERSION_MAJOR > 1
17328         db_appexit( NULL );
17329 #else
17330         (void) dbopen( NULL, 0, 0, 0, NULL);
17331 #endif
17332
17333 ; return 0; }
17334 EOF
17335 if { (eval echo configure:17336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17336   rm -rf conftest*
17337   ol_cv_db_db2=yes
17338 else
17339   echo "configure: failed program was:" >&5
17340   cat conftest.$ac_ext >&5
17341   rm -rf conftest*
17342   ol_cv_db_db2=no
17343 fi
17344 rm -f conftest*
17345
17346         LIBS="$ol_LIBS"
17347
17348 fi
17349
17350 echo "$ac_t""$ol_cv_db_db2" 1>&6
17351
17352         if test $ol_cv_db_db2 = yes ; then
17353                 ol_cv_lib_db=-ldb2
17354         fi
17355 fi
17356
17357 if test $ol_cv_lib_db = no ; then
17358         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
17359 echo "configure:17360: checking for Berkeley DB link (-ldb-2)" >&5
17360 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
17361   echo $ac_n "(cached) $ac_c" 1>&6
17362 else
17363   
17364         ol_DB_LIB=-ldb-2
17365         ol_LIBS=$LIBS
17366         LIBS="$ol_DB_LIB $LIBS"
17367
17368         cat > conftest.$ac_ext <<EOF
17369 #line 17370 "configure"
17370 #include "confdefs.h"
17371
17372 #ifdef HAVE_DB_185_H
17373 # include <db_185.h>
17374 #else
17375 # include <db.h>
17376 #endif
17377
17378 #ifndef DB_VERSION_MAJOR
17379 # define DB_VERSION_MAJOR 1
17380 #endif
17381
17382 #ifndef NULL
17383 #define NULL ((void*)0)
17384 #endif
17385
17386 int main() {
17387
17388 #if DB_VERSION_MAJOR > 1
17389         {
17390                 char *version;
17391                 int major, minor, patch;
17392
17393                 version = db_version( &major, &minor, &patch );
17394
17395                 if( major != DB_VERSION_MAJOR ||
17396                         minor < DB_VERSION_MINOR )
17397                 {
17398                         printf("Berkeley DB version mismatch\n"
17399                                 "\texpected: %s\n\tgot: %s\n",
17400                                 DB_VERSION_STRING, version);
17401                         return 1;
17402                 }
17403         }
17404 #endif
17405
17406 #if DB_VERSION_MAJOR > 2
17407         db_env_create( NULL, 0 );
17408 #elif DB_VERSION_MAJOR > 1
17409         db_appexit( NULL );
17410 #else
17411         (void) dbopen( NULL, 0, 0, 0, NULL);
17412 #endif
17413
17414 ; return 0; }
17415 EOF
17416 if { (eval echo configure:17417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17417   rm -rf conftest*
17418   ol_cv_db_db_2=yes
17419 else
17420   echo "configure: failed program was:" >&5
17421   cat conftest.$ac_ext >&5
17422   rm -rf conftest*
17423   ol_cv_db_db_2=no
17424 fi
17425 rm -f conftest*
17426
17427         LIBS="$ol_LIBS"
17428
17429 fi
17430
17431 echo "$ac_t""$ol_cv_db_db_2" 1>&6
17432
17433         if test $ol_cv_db_db_2 = yes ; then
17434                 ol_cv_lib_db=-ldb-2
17435         fi
17436 fi
17437
17438 if test $ol_cv_lib_db = no ; then
17439         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
17440 echo "configure:17441: checking for Berkeley DB link (-ldb1)" >&5
17441 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
17442   echo $ac_n "(cached) $ac_c" 1>&6
17443 else
17444   
17445         ol_DB_LIB=-ldb1
17446         ol_LIBS=$LIBS
17447         LIBS="$ol_DB_LIB $LIBS"
17448
17449         cat > conftest.$ac_ext <<EOF
17450 #line 17451 "configure"
17451 #include "confdefs.h"
17452
17453 #ifdef HAVE_DB_185_H
17454 # include <db_185.h>
17455 #else
17456 # include <db.h>
17457 #endif
17458
17459 #ifndef DB_VERSION_MAJOR
17460 # define DB_VERSION_MAJOR 1
17461 #endif
17462
17463 #ifndef NULL
17464 #define NULL ((void*)0)
17465 #endif
17466
17467 int main() {
17468
17469 #if DB_VERSION_MAJOR > 1
17470         {
17471                 char *version;
17472                 int major, minor, patch;
17473
17474                 version = db_version( &major, &minor, &patch );
17475
17476                 if( major != DB_VERSION_MAJOR ||
17477                         minor < DB_VERSION_MINOR )
17478                 {
17479                         printf("Berkeley DB version mismatch\n"
17480                                 "\texpected: %s\n\tgot: %s\n",
17481                                 DB_VERSION_STRING, version);
17482                         return 1;
17483                 }
17484         }
17485 #endif
17486
17487 #if DB_VERSION_MAJOR > 2
17488         db_env_create( NULL, 0 );
17489 #elif DB_VERSION_MAJOR > 1
17490         db_appexit( NULL );
17491 #else
17492         (void) dbopen( NULL, 0, 0, 0, NULL);
17493 #endif
17494
17495 ; return 0; }
17496 EOF
17497 if { (eval echo configure:17498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17498   rm -rf conftest*
17499   ol_cv_db_db1=yes
17500 else
17501   echo "configure: failed program was:" >&5
17502   cat conftest.$ac_ext >&5
17503   rm -rf conftest*
17504   ol_cv_db_db1=no
17505 fi
17506 rm -f conftest*
17507
17508         LIBS="$ol_LIBS"
17509
17510 fi
17511
17512 echo "$ac_t""$ol_cv_db_db1" 1>&6
17513
17514         if test $ol_cv_db_db1 = yes ; then
17515                 ol_cv_lib_db=-ldb1
17516         fi
17517 fi
17518
17519 if test $ol_cv_lib_db = no ; then
17520         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
17521 echo "configure:17522: checking for Berkeley DB link (-ldb-1)" >&5
17522 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
17523   echo $ac_n "(cached) $ac_c" 1>&6
17524 else
17525   
17526         ol_DB_LIB=-ldb-1
17527         ol_LIBS=$LIBS
17528         LIBS="$ol_DB_LIB $LIBS"
17529
17530         cat > conftest.$ac_ext <<EOF
17531 #line 17532 "configure"
17532 #include "confdefs.h"
17533
17534 #ifdef HAVE_DB_185_H
17535 # include <db_185.h>
17536 #else
17537 # include <db.h>
17538 #endif
17539
17540 #ifndef DB_VERSION_MAJOR
17541 # define DB_VERSION_MAJOR 1
17542 #endif
17543
17544 #ifndef NULL
17545 #define NULL ((void*)0)
17546 #endif
17547
17548 int main() {
17549
17550 #if DB_VERSION_MAJOR > 1
17551         {
17552                 char *version;
17553                 int major, minor, patch;
17554
17555                 version = db_version( &major, &minor, &patch );
17556
17557                 if( major != DB_VERSION_MAJOR ||
17558                         minor < DB_VERSION_MINOR )
17559                 {
17560                         printf("Berkeley DB version mismatch\n"
17561                                 "\texpected: %s\n\tgot: %s\n",
17562                                 DB_VERSION_STRING, version);
17563                         return 1;
17564                 }
17565         }
17566 #endif
17567
17568 #if DB_VERSION_MAJOR > 2
17569         db_env_create( NULL, 0 );
17570 #elif DB_VERSION_MAJOR > 1
17571         db_appexit( NULL );
17572 #else
17573         (void) dbopen( NULL, 0, 0, 0, NULL);
17574 #endif
17575
17576 ; return 0; }
17577 EOF
17578 if { (eval echo configure:17579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17579   rm -rf conftest*
17580   ol_cv_db_db_1=yes
17581 else
17582   echo "configure: failed program was:" >&5
17583   cat conftest.$ac_ext >&5
17584   rm -rf conftest*
17585   ol_cv_db_db_1=no
17586 fi
17587 rm -f conftest*
17588
17589         LIBS="$ol_LIBS"
17590
17591 fi
17592
17593 echo "$ac_t""$ol_cv_db_db_1" 1>&6
17594
17595         if test $ol_cv_db_db_1 = yes ; then
17596                 ol_cv_lib_db=-ldb-1
17597         fi
17598 fi
17599
17600
17601                 if test "$ol_cv_lib_db" != no ; then
17602                         ol_cv_berkeley_db=yes
17603                 fi
17604         fi
17605 fi
17606
17607         else
17608                 ol_cv_berkeley_db=no
17609 for ac_hdr in db.h
17610 do
17611 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
17612 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
17613 echo "configure:17614: checking for $ac_hdr" >&5
17614 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
17615   echo $ac_n "(cached) $ac_c" 1>&6
17616 else
17617   cat > conftest.$ac_ext <<EOF
17618 #line 17619 "configure"
17619 #include "confdefs.h"
17620 #include <$ac_hdr>
17621 EOF
17622 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
17623 { (eval echo configure:17624: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
17624 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17625 if test -z "$ac_err"; then
17626   rm -rf conftest*
17627   eval "ac_cv_header_$ac_safe=yes"
17628 else
17629   echo "$ac_err" >&5
17630   echo "configure: failed program was:" >&5
17631   cat conftest.$ac_ext >&5
17632   rm -rf conftest*
17633   eval "ac_cv_header_$ac_safe=no"
17634 fi
17635 rm -f conftest*
17636 fi
17637 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
17638   echo "$ac_t""yes" 1>&6
17639     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
17640   cat >> confdefs.h <<EOF
17641 #define $ac_tr_hdr 1
17642 EOF
17643  
17644 else
17645   echo "$ac_t""no" 1>&6
17646 fi
17647 done
17648
17649 if test $ac_cv_header_db_h = yes; then
17650         ol_cv_lib_db=no
17651 if test $ol_cv_lib_db = no ; then
17652         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
17653 echo "configure:17654: checking for Berkeley DB link (default)" >&5
17654 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
17655   echo $ac_n "(cached) $ac_c" 1>&6
17656 else
17657   
17658         ol_DB_LIB=
17659         ol_LIBS=$LIBS
17660         LIBS="$ol_DB_LIB $LIBS"
17661
17662         cat > conftest.$ac_ext <<EOF
17663 #line 17664 "configure"
17664 #include "confdefs.h"
17665
17666 #ifdef HAVE_DB_185_H
17667 # include <db_185.h>
17668 #else
17669 # include <db.h>
17670 #endif
17671
17672 #ifndef DB_VERSION_MAJOR
17673 # define DB_VERSION_MAJOR 1
17674 #endif
17675
17676 #ifndef NULL
17677 #define NULL ((void*)0)
17678 #endif
17679
17680 int main() {
17681
17682 #if DB_VERSION_MAJOR > 1
17683         {
17684                 char *version;
17685                 int major, minor, patch;
17686
17687                 version = db_version( &major, &minor, &patch );
17688
17689                 if( major != DB_VERSION_MAJOR ||
17690                         minor < DB_VERSION_MINOR )
17691                 {
17692                         printf("Berkeley DB version mismatch\n"
17693                                 "\texpected: %s\n\tgot: %s\n",
17694                                 DB_VERSION_STRING, version);
17695                         return 1;
17696                 }
17697         }
17698 #endif
17699
17700 #if DB_VERSION_MAJOR > 2
17701         db_env_create( NULL, 0 );
17702 #elif DB_VERSION_MAJOR > 1
17703         db_appexit( NULL );
17704 #else
17705         (void) dbopen( NULL, 0, 0, 0, NULL);
17706 #endif
17707
17708 ; return 0; }
17709 EOF
17710 if { (eval echo configure:17711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17711   rm -rf conftest*
17712   ol_cv_db_none=yes
17713 else
17714   echo "configure: failed program was:" >&5
17715   cat conftest.$ac_ext >&5
17716   rm -rf conftest*
17717   ol_cv_db_none=no
17718 fi
17719 rm -f conftest*
17720
17721         LIBS="$ol_LIBS"
17722
17723 fi
17724
17725 echo "$ac_t""$ol_cv_db_none" 1>&6
17726
17727         if test $ol_cv_db_none = yes ; then
17728                 ol_cv_lib_db=yes
17729         fi
17730 fi
17731
17732 if test $ol_cv_lib_db = no ; then
17733         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
17734 echo "configure:17735: checking for Berkeley DB link (-ldb4)" >&5
17735 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
17736   echo $ac_n "(cached) $ac_c" 1>&6
17737 else
17738   
17739         ol_DB_LIB=-ldb4
17740         ol_LIBS=$LIBS
17741         LIBS="$ol_DB_LIB $LIBS"
17742
17743         cat > conftest.$ac_ext <<EOF
17744 #line 17745 "configure"
17745 #include "confdefs.h"
17746
17747 #ifdef HAVE_DB_185_H
17748 # include <db_185.h>
17749 #else
17750 # include <db.h>
17751 #endif
17752
17753 #ifndef DB_VERSION_MAJOR
17754 # define DB_VERSION_MAJOR 1
17755 #endif
17756
17757 #ifndef NULL
17758 #define NULL ((void*)0)
17759 #endif
17760
17761 int main() {
17762
17763 #if DB_VERSION_MAJOR > 1
17764         {
17765                 char *version;
17766                 int major, minor, patch;
17767
17768                 version = db_version( &major, &minor, &patch );
17769
17770                 if( major != DB_VERSION_MAJOR ||
17771                         minor < DB_VERSION_MINOR )
17772                 {
17773                         printf("Berkeley DB version mismatch\n"
17774                                 "\texpected: %s\n\tgot: %s\n",
17775                                 DB_VERSION_STRING, version);
17776                         return 1;
17777                 }
17778         }
17779 #endif
17780
17781 #if DB_VERSION_MAJOR > 2
17782         db_env_create( NULL, 0 );
17783 #elif DB_VERSION_MAJOR > 1
17784         db_appexit( NULL );
17785 #else
17786         (void) dbopen( NULL, 0, 0, 0, NULL);
17787 #endif
17788
17789 ; return 0; }
17790 EOF
17791 if { (eval echo configure:17792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17792   rm -rf conftest*
17793   ol_cv_db_db4=yes
17794 else
17795   echo "configure: failed program was:" >&5
17796   cat conftest.$ac_ext >&5
17797   rm -rf conftest*
17798   ol_cv_db_db4=no
17799 fi
17800 rm -f conftest*
17801
17802         LIBS="$ol_LIBS"
17803
17804 fi
17805
17806 echo "$ac_t""$ol_cv_db_db4" 1>&6
17807
17808         if test $ol_cv_db_db4 = yes ; then
17809                 ol_cv_lib_db=-ldb4
17810         fi
17811 fi
17812
17813 if test $ol_cv_lib_db = no ; then
17814         echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
17815 echo "configure:17816: checking for Berkeley DB link (-ldb-4)" >&5
17816 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
17817   echo $ac_n "(cached) $ac_c" 1>&6
17818 else
17819   
17820         ol_DB_LIB=-ldb-4
17821         ol_LIBS=$LIBS
17822         LIBS="$ol_DB_LIB $LIBS"
17823
17824         cat > conftest.$ac_ext <<EOF
17825 #line 17826 "configure"
17826 #include "confdefs.h"
17827
17828 #ifdef HAVE_DB_185_H
17829 # include <db_185.h>
17830 #else
17831 # include <db.h>
17832 #endif
17833
17834 #ifndef DB_VERSION_MAJOR
17835 # define DB_VERSION_MAJOR 1
17836 #endif
17837
17838 #ifndef NULL
17839 #define NULL ((void*)0)
17840 #endif
17841
17842 int main() {
17843
17844 #if DB_VERSION_MAJOR > 1
17845         {
17846                 char *version;
17847                 int major, minor, patch;
17848
17849                 version = db_version( &major, &minor, &patch );
17850
17851                 if( major != DB_VERSION_MAJOR ||
17852                         minor < DB_VERSION_MINOR )
17853                 {
17854                         printf("Berkeley DB version mismatch\n"
17855                                 "\texpected: %s\n\tgot: %s\n",
17856                                 DB_VERSION_STRING, version);
17857                         return 1;
17858                 }
17859         }
17860 #endif
17861
17862 #if DB_VERSION_MAJOR > 2
17863         db_env_create( NULL, 0 );
17864 #elif DB_VERSION_MAJOR > 1
17865         db_appexit( NULL );
17866 #else
17867         (void) dbopen( NULL, 0, 0, 0, NULL);
17868 #endif
17869
17870 ; return 0; }
17871 EOF
17872 if { (eval echo configure:17873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17873   rm -rf conftest*
17874   ol_cv_db_db_4=yes
17875 else
17876   echo "configure: failed program was:" >&5
17877   cat conftest.$ac_ext >&5
17878   rm -rf conftest*
17879   ol_cv_db_db_4=no
17880 fi
17881 rm -f conftest*
17882
17883         LIBS="$ol_LIBS"
17884
17885 fi
17886
17887 echo "$ac_t""$ol_cv_db_db_4" 1>&6
17888
17889         if test $ol_cv_db_db_4 = yes ; then
17890                 ol_cv_lib_db=-ldb-4
17891         fi
17892 fi
17893
17894 if test $ol_cv_lib_db = no ; then
17895         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
17896 echo "configure:17897: checking for Berkeley DB link (-ldb)" >&5
17897 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
17898   echo $ac_n "(cached) $ac_c" 1>&6
17899 else
17900   
17901         ol_DB_LIB=-ldb
17902         ol_LIBS=$LIBS
17903         LIBS="$ol_DB_LIB $LIBS"
17904
17905         cat > conftest.$ac_ext <<EOF
17906 #line 17907 "configure"
17907 #include "confdefs.h"
17908
17909 #ifdef HAVE_DB_185_H
17910 # include <db_185.h>
17911 #else
17912 # include <db.h>
17913 #endif
17914
17915 #ifndef DB_VERSION_MAJOR
17916 # define DB_VERSION_MAJOR 1
17917 #endif
17918
17919 #ifndef NULL
17920 #define NULL ((void*)0)
17921 #endif
17922
17923 int main() {
17924
17925 #if DB_VERSION_MAJOR > 1
17926         {
17927                 char *version;
17928                 int major, minor, patch;
17929
17930                 version = db_version( &major, &minor, &patch );
17931
17932                 if( major != DB_VERSION_MAJOR ||
17933                         minor < DB_VERSION_MINOR )
17934                 {
17935                         printf("Berkeley DB version mismatch\n"
17936                                 "\texpected: %s\n\tgot: %s\n",
17937                                 DB_VERSION_STRING, version);
17938                         return 1;
17939                 }
17940         }
17941 #endif
17942
17943 #if DB_VERSION_MAJOR > 2
17944         db_env_create( NULL, 0 );
17945 #elif DB_VERSION_MAJOR > 1
17946         db_appexit( NULL );
17947 #else
17948         (void) dbopen( NULL, 0, 0, 0, NULL);
17949 #endif
17950
17951 ; return 0; }
17952 EOF
17953 if { (eval echo configure:17954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17954   rm -rf conftest*
17955   ol_cv_db_db=yes
17956 else
17957   echo "configure: failed program was:" >&5
17958   cat conftest.$ac_ext >&5
17959   rm -rf conftest*
17960   ol_cv_db_db=no
17961 fi
17962 rm -f conftest*
17963
17964         LIBS="$ol_LIBS"
17965
17966 fi
17967
17968 echo "$ac_t""$ol_cv_db_db" 1>&6
17969
17970         if test $ol_cv_db_db = yes ; then
17971                 ol_cv_lib_db=-ldb
17972         fi
17973 fi
17974
17975 if test $ol_cv_lib_db = no ; then
17976         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
17977 echo "configure:17978: checking for Berkeley DB link (-ldb3)" >&5
17978 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
17979   echo $ac_n "(cached) $ac_c" 1>&6
17980 else
17981   
17982         ol_DB_LIB=-ldb3
17983         ol_LIBS=$LIBS
17984         LIBS="$ol_DB_LIB $LIBS"
17985
17986         cat > conftest.$ac_ext <<EOF
17987 #line 17988 "configure"
17988 #include "confdefs.h"
17989
17990 #ifdef HAVE_DB_185_H
17991 # include <db_185.h>
17992 #else
17993 # include <db.h>
17994 #endif
17995
17996 #ifndef DB_VERSION_MAJOR
17997 # define DB_VERSION_MAJOR 1
17998 #endif
17999
18000 #ifndef NULL
18001 #define NULL ((void*)0)
18002 #endif
18003
18004 int main() {
18005
18006 #if DB_VERSION_MAJOR > 1
18007         {
18008                 char *version;
18009                 int major, minor, patch;
18010
18011                 version = db_version( &major, &minor, &patch );
18012
18013                 if( major != DB_VERSION_MAJOR ||
18014                         minor < DB_VERSION_MINOR )
18015                 {
18016                         printf("Berkeley DB version mismatch\n"
18017                                 "\texpected: %s\n\tgot: %s\n",
18018                                 DB_VERSION_STRING, version);
18019                         return 1;
18020                 }
18021         }
18022 #endif
18023
18024 #if DB_VERSION_MAJOR > 2
18025         db_env_create( NULL, 0 );
18026 #elif DB_VERSION_MAJOR > 1
18027         db_appexit( NULL );
18028 #else
18029         (void) dbopen( NULL, 0, 0, 0, NULL);
18030 #endif
18031
18032 ; return 0; }
18033 EOF
18034 if { (eval echo configure:18035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18035   rm -rf conftest*
18036   ol_cv_db_db3=yes
18037 else
18038   echo "configure: failed program was:" >&5
18039   cat conftest.$ac_ext >&5
18040   rm -rf conftest*
18041   ol_cv_db_db3=no
18042 fi
18043 rm -f conftest*
18044
18045         LIBS="$ol_LIBS"
18046
18047 fi
18048
18049 echo "$ac_t""$ol_cv_db_db3" 1>&6
18050
18051         if test $ol_cv_db_db3 = yes ; then
18052                 ol_cv_lib_db=-ldb3
18053         fi
18054 fi
18055
18056 if test $ol_cv_lib_db = no ; then
18057         echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
18058 echo "configure:18059: checking for Berkeley DB link (-ldb-3)" >&5
18059 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
18060   echo $ac_n "(cached) $ac_c" 1>&6
18061 else
18062   
18063         ol_DB_LIB=-ldb-3
18064         ol_LIBS=$LIBS
18065         LIBS="$ol_DB_LIB $LIBS"
18066
18067         cat > conftest.$ac_ext <<EOF
18068 #line 18069 "configure"
18069 #include "confdefs.h"
18070
18071 #ifdef HAVE_DB_185_H
18072 # include <db_185.h>
18073 #else
18074 # include <db.h>
18075 #endif
18076
18077 #ifndef DB_VERSION_MAJOR
18078 # define DB_VERSION_MAJOR 1
18079 #endif
18080
18081 #ifndef NULL
18082 #define NULL ((void*)0)
18083 #endif
18084
18085 int main() {
18086
18087 #if DB_VERSION_MAJOR > 1
18088         {
18089                 char *version;
18090                 int major, minor, patch;
18091
18092                 version = db_version( &major, &minor, &patch );
18093
18094                 if( major != DB_VERSION_MAJOR ||
18095                         minor < DB_VERSION_MINOR )
18096                 {
18097                         printf("Berkeley DB version mismatch\n"
18098                                 "\texpected: %s\n\tgot: %s\n",
18099                                 DB_VERSION_STRING, version);
18100                         return 1;
18101                 }
18102         }
18103 #endif
18104
18105 #if DB_VERSION_MAJOR > 2
18106         db_env_create( NULL, 0 );
18107 #elif DB_VERSION_MAJOR > 1
18108         db_appexit( NULL );
18109 #else
18110         (void) dbopen( NULL, 0, 0, 0, NULL);
18111 #endif
18112
18113 ; return 0; }
18114 EOF
18115 if { (eval echo configure:18116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18116   rm -rf conftest*
18117   ol_cv_db_db_3=yes
18118 else
18119   echo "configure: failed program was:" >&5
18120   cat conftest.$ac_ext >&5
18121   rm -rf conftest*
18122   ol_cv_db_db_3=no
18123 fi
18124 rm -f conftest*
18125
18126         LIBS="$ol_LIBS"
18127
18128 fi
18129
18130 echo "$ac_t""$ol_cv_db_db_3" 1>&6
18131
18132         if test $ol_cv_db_db_3 = yes ; then
18133                 ol_cv_lib_db=-ldb-3
18134         fi
18135 fi
18136
18137 if test $ol_cv_lib_db = no ; then
18138         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
18139 echo "configure:18140: checking for Berkeley DB link (-ldb2)" >&5
18140 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
18141   echo $ac_n "(cached) $ac_c" 1>&6
18142 else
18143   
18144         ol_DB_LIB=-ldb2
18145         ol_LIBS=$LIBS
18146         LIBS="$ol_DB_LIB $LIBS"
18147
18148         cat > conftest.$ac_ext <<EOF
18149 #line 18150 "configure"
18150 #include "confdefs.h"
18151
18152 #ifdef HAVE_DB_185_H
18153 # include <db_185.h>
18154 #else
18155 # include <db.h>
18156 #endif
18157
18158 #ifndef DB_VERSION_MAJOR
18159 # define DB_VERSION_MAJOR 1
18160 #endif
18161
18162 #ifndef NULL
18163 #define NULL ((void*)0)
18164 #endif
18165
18166 int main() {
18167
18168 #if DB_VERSION_MAJOR > 1
18169         {
18170                 char *version;
18171                 int major, minor, patch;
18172
18173                 version = db_version( &major, &minor, &patch );
18174
18175                 if( major != DB_VERSION_MAJOR ||
18176                         minor < DB_VERSION_MINOR )
18177                 {
18178                         printf("Berkeley DB version mismatch\n"
18179                                 "\texpected: %s\n\tgot: %s\n",
18180                                 DB_VERSION_STRING, version);
18181                         return 1;
18182                 }
18183         }
18184 #endif
18185
18186 #if DB_VERSION_MAJOR > 2
18187         db_env_create( NULL, 0 );
18188 #elif DB_VERSION_MAJOR > 1
18189         db_appexit( NULL );
18190 #else
18191         (void) dbopen( NULL, 0, 0, 0, NULL);
18192 #endif
18193
18194 ; return 0; }
18195 EOF
18196 if { (eval echo configure:18197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18197   rm -rf conftest*
18198   ol_cv_db_db2=yes
18199 else
18200   echo "configure: failed program was:" >&5
18201   cat conftest.$ac_ext >&5
18202   rm -rf conftest*
18203   ol_cv_db_db2=no
18204 fi
18205 rm -f conftest*
18206
18207         LIBS="$ol_LIBS"
18208
18209 fi
18210
18211 echo "$ac_t""$ol_cv_db_db2" 1>&6
18212
18213         if test $ol_cv_db_db2 = yes ; then
18214                 ol_cv_lib_db=-ldb2
18215         fi
18216 fi
18217
18218 if test $ol_cv_lib_db = no ; then
18219         echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
18220 echo "configure:18221: checking for Berkeley DB link (-ldb-2)" >&5
18221 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
18222   echo $ac_n "(cached) $ac_c" 1>&6
18223 else
18224   
18225         ol_DB_LIB=-ldb-2
18226         ol_LIBS=$LIBS
18227         LIBS="$ol_DB_LIB $LIBS"
18228
18229         cat > conftest.$ac_ext <<EOF
18230 #line 18231 "configure"
18231 #include "confdefs.h"
18232
18233 #ifdef HAVE_DB_185_H
18234 # include <db_185.h>
18235 #else
18236 # include <db.h>
18237 #endif
18238
18239 #ifndef DB_VERSION_MAJOR
18240 # define DB_VERSION_MAJOR 1
18241 #endif
18242
18243 #ifndef NULL
18244 #define NULL ((void*)0)
18245 #endif
18246
18247 int main() {
18248
18249 #if DB_VERSION_MAJOR > 1
18250         {
18251                 char *version;
18252                 int major, minor, patch;
18253
18254                 version = db_version( &major, &minor, &patch );
18255
18256                 if( major != DB_VERSION_MAJOR ||
18257                         minor < DB_VERSION_MINOR )
18258                 {
18259                         printf("Berkeley DB version mismatch\n"
18260                                 "\texpected: %s\n\tgot: %s\n",
18261                                 DB_VERSION_STRING, version);
18262                         return 1;
18263                 }
18264         }
18265 #endif
18266
18267 #if DB_VERSION_MAJOR > 2
18268         db_env_create( NULL, 0 );
18269 #elif DB_VERSION_MAJOR > 1
18270         db_appexit( NULL );
18271 #else
18272         (void) dbopen( NULL, 0, 0, 0, NULL);
18273 #endif
18274
18275 ; return 0; }
18276 EOF
18277 if { (eval echo configure:18278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18278   rm -rf conftest*
18279   ol_cv_db_db_2=yes
18280 else
18281   echo "configure: failed program was:" >&5
18282   cat conftest.$ac_ext >&5
18283   rm -rf conftest*
18284   ol_cv_db_db_2=no
18285 fi
18286 rm -f conftest*
18287
18288         LIBS="$ol_LIBS"
18289
18290 fi
18291
18292 echo "$ac_t""$ol_cv_db_db_2" 1>&6
18293
18294         if test $ol_cv_db_db_2 = yes ; then
18295                 ol_cv_lib_db=-ldb-2
18296         fi
18297 fi
18298
18299 if test $ol_cv_lib_db = no ; then
18300         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
18301 echo "configure:18302: checking for Berkeley DB link (-ldb1)" >&5
18302 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
18303   echo $ac_n "(cached) $ac_c" 1>&6
18304 else
18305   
18306         ol_DB_LIB=-ldb1
18307         ol_LIBS=$LIBS
18308         LIBS="$ol_DB_LIB $LIBS"
18309
18310         cat > conftest.$ac_ext <<EOF
18311 #line 18312 "configure"
18312 #include "confdefs.h"
18313
18314 #ifdef HAVE_DB_185_H
18315 # include <db_185.h>
18316 #else
18317 # include <db.h>
18318 #endif
18319
18320 #ifndef DB_VERSION_MAJOR
18321 # define DB_VERSION_MAJOR 1
18322 #endif
18323
18324 #ifndef NULL
18325 #define NULL ((void*)0)
18326 #endif
18327
18328 int main() {
18329
18330 #if DB_VERSION_MAJOR > 1
18331         {
18332                 char *version;
18333                 int major, minor, patch;
18334
18335                 version = db_version( &major, &minor, &patch );
18336
18337                 if( major != DB_VERSION_MAJOR ||
18338                         minor < DB_VERSION_MINOR )
18339                 {
18340                         printf("Berkeley DB version mismatch\n"
18341                                 "\texpected: %s\n\tgot: %s\n",
18342                                 DB_VERSION_STRING, version);
18343                         return 1;
18344                 }
18345         }
18346 #endif
18347
18348 #if DB_VERSION_MAJOR > 2
18349         db_env_create( NULL, 0 );
18350 #elif DB_VERSION_MAJOR > 1
18351         db_appexit( NULL );
18352 #else
18353         (void) dbopen( NULL, 0, 0, 0, NULL);
18354 #endif
18355
18356 ; return 0; }
18357 EOF
18358 if { (eval echo configure:18359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18359   rm -rf conftest*
18360   ol_cv_db_db1=yes
18361 else
18362   echo "configure: failed program was:" >&5
18363   cat conftest.$ac_ext >&5
18364   rm -rf conftest*
18365   ol_cv_db_db1=no
18366 fi
18367 rm -f conftest*
18368
18369         LIBS="$ol_LIBS"
18370
18371 fi
18372
18373 echo "$ac_t""$ol_cv_db_db1" 1>&6
18374
18375         if test $ol_cv_db_db1 = yes ; then
18376                 ol_cv_lib_db=-ldb1
18377         fi
18378 fi
18379
18380 if test $ol_cv_lib_db = no ; then
18381         echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
18382 echo "configure:18383: checking for Berkeley DB link (-ldb-1)" >&5
18383 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
18384   echo $ac_n "(cached) $ac_c" 1>&6
18385 else
18386   
18387         ol_DB_LIB=-ldb-1
18388         ol_LIBS=$LIBS
18389         LIBS="$ol_DB_LIB $LIBS"
18390
18391         cat > conftest.$ac_ext <<EOF
18392 #line 18393 "configure"
18393 #include "confdefs.h"
18394
18395 #ifdef HAVE_DB_185_H
18396 # include <db_185.h>
18397 #else
18398 # include <db.h>
18399 #endif
18400
18401 #ifndef DB_VERSION_MAJOR
18402 # define DB_VERSION_MAJOR 1
18403 #endif
18404
18405 #ifndef NULL
18406 #define NULL ((void*)0)
18407 #endif
18408
18409 int main() {
18410
18411 #if DB_VERSION_MAJOR > 1
18412         {
18413                 char *version;
18414                 int major, minor, patch;
18415
18416                 version = db_version( &major, &minor, &patch );
18417
18418                 if( major != DB_VERSION_MAJOR ||
18419                         minor < DB_VERSION_MINOR )
18420                 {
18421                         printf("Berkeley DB version mismatch\n"
18422                                 "\texpected: %s\n\tgot: %s\n",
18423                                 DB_VERSION_STRING, version);
18424                         return 1;
18425                 }
18426         }
18427 #endif
18428
18429 #if DB_VERSION_MAJOR > 2
18430         db_env_create( NULL, 0 );
18431 #elif DB_VERSION_MAJOR > 1
18432         db_appexit( NULL );
18433 #else
18434         (void) dbopen( NULL, 0, 0, 0, NULL);
18435 #endif
18436
18437 ; return 0; }
18438 EOF
18439 if { (eval echo configure:18440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18440   rm -rf conftest*
18441   ol_cv_db_db_1=yes
18442 else
18443   echo "configure: failed program was:" >&5
18444   cat conftest.$ac_ext >&5
18445   rm -rf conftest*
18446   ol_cv_db_db_1=no
18447 fi
18448 rm -f conftest*
18449
18450         LIBS="$ol_LIBS"
18451
18452 fi
18453
18454 echo "$ac_t""$ol_cv_db_db_1" 1>&6
18455
18456         if test $ol_cv_db_db_1 = yes ; then
18457                 ol_cv_lib_db=-ldb-1
18458         fi
18459 fi
18460
18461
18462         if test "$ol_cv_lib_db" != no ; then
18463                 ol_cv_berkeley_db=yes
18464                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
18465 echo "configure:18466: checking for Berkeley DB thread support" >&5
18466 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
18467   echo $ac_n "(cached) $ac_c" 1>&6
18468 else
18469   
18470         ol_LIBS="$LIBS"
18471         if test $ol_cv_lib_db != yes ; then
18472                 LIBS="$ol_cv_lib_db"
18473         fi
18474
18475         if test "$cross_compiling" = yes; then
18476   ol_cv_berkeley_db_thread=cross
18477 else
18478   cat > conftest.$ac_ext <<EOF
18479 #line 18480 "configure"
18480 #include "confdefs.h"
18481
18482 #ifdef HAVE_DB_185_H
18483         choke me;
18484 #else
18485 #include <db.h>
18486 #endif
18487 #ifndef NULL
18488 #define NULL ((void *)0)
18489 #endif
18490 main()
18491 {
18492         int rc;
18493         u_int32_t flags = DB_CREATE |
18494 #ifdef DB_PRIVATE
18495                 DB_PRIVATE |
18496 #endif
18497                 DB_THREAD;
18498
18499 #if DB_VERSION_MAJOR > 2
18500         DB_ENV *env = NULL;
18501
18502         rc = db_env_create( &env, 0 );
18503
18504         flags |= DB_INIT_MPOOL;
18505 #ifdef DB_MPOOL_PRIVATE
18506         flags |= DB_MPOOL_PRIVATE;
18507 #endif
18508
18509         if( rc ) {
18510                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
18511                 return rc;
18512         }
18513
18514 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
18515         rc = env->open( env, NULL, flags, 0 );
18516 #else
18517         rc = env->open( env, NULL, NULL, flags, 0 );
18518 #endif
18519
18520         if ( rc == 0 ) {
18521                 rc = env->close( env, 0 );
18522         }
18523
18524         if( rc ) {
18525                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
18526                 return rc;
18527         }
18528
18529 #else
18530         DB_ENV env;
18531         memset( &env, '\0', sizeof(env) );
18532
18533         rc = db_appinit( NULL, NULL, &env, flags );
18534
18535         if( rc == 0 ) {
18536                 db_appexit( &env );
18537         }
18538
18539         unlink("__db_mpool.share");
18540         unlink("__db_lock.share");
18541 #endif
18542
18543         return rc;
18544 }
18545 EOF
18546 if { (eval echo configure:18547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
18547 then
18548   ol_cv_berkeley_db_thread=yes
18549 else
18550   echo "configure: failed program was:" >&5
18551   cat conftest.$ac_ext >&5
18552   rm -fr conftest*
18553   ol_cv_berkeley_db_thread=no
18554 fi
18555 rm -fr conftest*
18556 fi
18557
18558
18559         LIBS="$ol_LIBS"
18560
18561 fi
18562
18563 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
18564
18565         if test $ol_cv_berkeley_db_thread != no ; then
18566                 cat >> confdefs.h <<\EOF
18567 #define HAVE_BERKELEY_DB_THREAD 1
18568 EOF
18569
18570         fi
18571
18572         fi
18573 fi
18574
18575         fi
18576
18577         if test $ol_cv_berkeley_db != no ; then
18578                 cat >> confdefs.h <<\EOF
18579 #define HAVE_BERKELEY_DB 1
18580 EOF
18581
18582
18583                 ol_link_ldbm=berkeley
18584                 ol_with_ldbm_api=berkeley
18585
18586                 if test $ol_with_ldbm_type = hash ; then
18587                         cat >> confdefs.h <<\EOF
18588 #define LDBM_USE_DBHASH 1
18589 EOF
18590
18591                 else
18592                         cat >> confdefs.h <<\EOF
18593 #define LDBM_USE_DBBTREE 1
18594 EOF
18595
18596                 fi
18597
18598                                                 if test $ol_cv_lib_db != yes ; then
18599                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
18600                 fi
18601         fi
18602 fi
18603
18604 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
18605         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
18606 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
18607         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
18608 echo "configure:18609: checking Berkeley DB version for BDB backend" >&5
18609 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
18610   echo $ac_n "(cached) $ac_c" 1>&6
18611 else
18612   
18613         cat > conftest.$ac_ext <<EOF
18614 #line 18615 "configure"
18615 #include "confdefs.h"
18616
18617 #include <db.h>
18618
18619  /* this check could be improved */
18620 #ifndef DB_VERSION_MAJOR
18621 #       define DB_VERSION_MAJOR 1
18622 #endif
18623
18624 /* require 4.0 or later */
18625 #if DB_VERSION_MAJOR >= 4 
18626         __db_version_compat
18627 #endif
18628         
18629 EOF
18630 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18631   egrep "__db_version_compat" >/dev/null 2>&1; then
18632   rm -rf conftest*
18633   ol_cv_bdb_compat=yes
18634 else
18635   rm -rf conftest*
18636   ol_cv_bdb_compat=no
18637 fi
18638 rm -f conftest*
18639
18640 fi
18641
18642 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
18643
18644
18645         if test $ol_cv_bdb_compat = yes ; then
18646                 ol_enable_bdb=yes
18647         elif test $ol_enable_bdb = yes ; then
18648                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
18649         else
18650                 ol_enable_bdb=no
18651         fi
18652 fi
18653
18654 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
18655         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
18656         ol_with_ldbm_api=none
18657 fi
18658
18659 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
18660         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
18661 echo "configure:18662: checking for MDBM library" >&5
18662 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
18663   echo $ac_n "(cached) $ac_c" 1>&6
18664 else
18665         ol_LIBS="$LIBS"
18666         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
18667 echo "configure:18668: checking for mdbm_set_chain" >&5
18668 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
18669   echo $ac_n "(cached) $ac_c" 1>&6
18670 else
18671   cat > conftest.$ac_ext <<EOF
18672 #line 18673 "configure"
18673 #include "confdefs.h"
18674 /* System header to define __stub macros and hopefully few prototypes,
18675     which can conflict with char mdbm_set_chain(); below.  */
18676 #include <assert.h>
18677 /* Override any gcc2 internal prototype to avoid an error.  */
18678 /* We use char because int might match the return type of a gcc2
18679     builtin and then its argument prototype would still apply.  */
18680 char mdbm_set_chain();
18681 char (*f)();
18682
18683 int main() {
18684
18685 /* The GNU C library defines this for functions which it implements
18686     to always fail with ENOSYS.  Some functions are actually named
18687     something starting with __ and the normal name is an alias.  */
18688 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
18689 choke me
18690 #else
18691 f = mdbm_set_chain;
18692 #endif
18693
18694 ; return 0; }
18695 EOF
18696 if { (eval echo configure:18697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18697   rm -rf conftest*
18698   eval "ac_cv_func_mdbm_set_chain=yes"
18699 else
18700   echo "configure: failed program was:" >&5
18701   cat conftest.$ac_ext >&5
18702   rm -rf conftest*
18703   eval "ac_cv_func_mdbm_set_chain=no"
18704 fi
18705 rm -f conftest*
18706 fi
18707
18708 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
18709   echo "$ac_t""yes" 1>&6
18710   ol_cv_lib_mdbm=yes
18711 else
18712   echo "$ac_t""no" 1>&6
18713
18714                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
18715 echo "configure:18716: checking for mdbm_set_chain in -lmdbm" >&5
18716 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
18717 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18718   echo $ac_n "(cached) $ac_c" 1>&6
18719 else
18720   ac_save_LIBS="$LIBS"
18721 LIBS="-lmdbm  $LIBS"
18722 cat > conftest.$ac_ext <<EOF
18723 #line 18724 "configure"
18724 #include "confdefs.h"
18725 /* Override any gcc2 internal prototype to avoid an error.  */
18726 /* We use char because int might match the return type of a gcc2
18727     builtin and then its argument prototype would still apply.  */
18728 char mdbm_set_chain();
18729
18730 int main() {
18731 mdbm_set_chain()
18732 ; return 0; }
18733 EOF
18734 if { (eval echo configure:18735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18735   rm -rf conftest*
18736   eval "ac_cv_lib_$ac_lib_var=yes"
18737 else
18738   echo "configure: failed program was:" >&5
18739   cat conftest.$ac_ext >&5
18740   rm -rf conftest*
18741   eval "ac_cv_lib_$ac_lib_var=no"
18742 fi
18743 rm -f conftest*
18744 LIBS="$ac_save_LIBS"
18745
18746 fi
18747 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
18748   echo "$ac_t""yes" 1>&6
18749   ol_cv_lib_mdbm=-lmdbm
18750 else
18751   echo "$ac_t""no" 1>&6
18752 ol_cv_lib_mdbm=no
18753 fi
18754
18755         
18756 fi
18757
18758         LIBS="$ol_LIBS"
18759
18760 fi
18761
18762 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
18763
18764
18765  for ac_hdr in mdbm.h
18766 do
18767 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18768 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18769 echo "configure:18770: checking for $ac_hdr" >&5
18770 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18771   echo $ac_n "(cached) $ac_c" 1>&6
18772 else
18773   cat > conftest.$ac_ext <<EOF
18774 #line 18775 "configure"
18775 #include "confdefs.h"
18776 #include <$ac_hdr>
18777 EOF
18778 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18779 { (eval echo configure:18780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18780 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18781 if test -z "$ac_err"; then
18782   rm -rf conftest*
18783   eval "ac_cv_header_$ac_safe=yes"
18784 else
18785   echo "$ac_err" >&5
18786   echo "configure: failed program was:" >&5
18787   cat conftest.$ac_ext >&5
18788   rm -rf conftest*
18789   eval "ac_cv_header_$ac_safe=no"
18790 fi
18791 rm -f conftest*
18792 fi
18793 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18794   echo "$ac_t""yes" 1>&6
18795     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18796   cat >> confdefs.h <<EOF
18797 #define $ac_tr_hdr 1
18798 EOF
18799  
18800 else
18801   echo "$ac_t""no" 1>&6
18802 fi
18803 done
18804
18805  echo $ac_n "checking for db""... $ac_c" 1>&6
18806 echo "configure:18807: checking for db" >&5
18807 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
18808   echo $ac_n "(cached) $ac_c" 1>&6
18809 else
18810   
18811         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
18812                 ol_cv_mdbm=no
18813         else
18814                 ol_cv_mdbm=yes
18815         fi
18816
18817 fi
18818
18819 echo "$ac_t""$ol_cv_mdbm" 1>&6
18820  if test $ol_cv_mdbm = yes ; then
18821         cat >> confdefs.h <<\EOF
18822 #define HAVE_MDBM 1
18823 EOF
18824
18825  fi
18826
18827
18828         if test $ol_cv_mdbm = yes ; then
18829                 ol_link_ldbm=mdbm
18830                 ol_with_ldbm_api=mdbm
18831                 if test $ol_cv_lib_mdbm != yes ; then
18832                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
18833                 fi
18834         fi
18835 fi
18836
18837 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
18838         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
18839 echo "configure:18840: checking for GDBM library" >&5
18840 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
18841   echo $ac_n "(cached) $ac_c" 1>&6
18842 else
18843         ol_LIBS="$LIBS"
18844         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
18845 echo "configure:18846: checking for gdbm_open" >&5
18846 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
18847   echo $ac_n "(cached) $ac_c" 1>&6
18848 else
18849   cat > conftest.$ac_ext <<EOF
18850 #line 18851 "configure"
18851 #include "confdefs.h"
18852 /* System header to define __stub macros and hopefully few prototypes,
18853     which can conflict with char gdbm_open(); below.  */
18854 #include <assert.h>
18855 /* Override any gcc2 internal prototype to avoid an error.  */
18856 /* We use char because int might match the return type of a gcc2
18857     builtin and then its argument prototype would still apply.  */
18858 char gdbm_open();
18859 char (*f)();
18860
18861 int main() {
18862
18863 /* The GNU C library defines this for functions which it implements
18864     to always fail with ENOSYS.  Some functions are actually named
18865     something starting with __ and the normal name is an alias.  */
18866 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
18867 choke me
18868 #else
18869 f = gdbm_open;
18870 #endif
18871
18872 ; return 0; }
18873 EOF
18874 if { (eval echo configure:18875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18875   rm -rf conftest*
18876   eval "ac_cv_func_gdbm_open=yes"
18877 else
18878   echo "configure: failed program was:" >&5
18879   cat conftest.$ac_ext >&5
18880   rm -rf conftest*
18881   eval "ac_cv_func_gdbm_open=no"
18882 fi
18883 rm -f conftest*
18884 fi
18885
18886 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
18887   echo "$ac_t""yes" 1>&6
18888   ol_cv_lib_gdbm=yes
18889 else
18890   echo "$ac_t""no" 1>&6
18891
18892                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
18893 echo "configure:18894: checking for gdbm_open in -lgdbm" >&5
18894 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
18895 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
18896   echo $ac_n "(cached) $ac_c" 1>&6
18897 else
18898   ac_save_LIBS="$LIBS"
18899 LIBS="-lgdbm  $LIBS"
18900 cat > conftest.$ac_ext <<EOF
18901 #line 18902 "configure"
18902 #include "confdefs.h"
18903 /* Override any gcc2 internal prototype to avoid an error.  */
18904 /* We use char because int might match the return type of a gcc2
18905     builtin and then its argument prototype would still apply.  */
18906 char gdbm_open();
18907
18908 int main() {
18909 gdbm_open()
18910 ; return 0; }
18911 EOF
18912 if { (eval echo configure:18913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
18913   rm -rf conftest*
18914   eval "ac_cv_lib_$ac_lib_var=yes"
18915 else
18916   echo "configure: failed program was:" >&5
18917   cat conftest.$ac_ext >&5
18918   rm -rf conftest*
18919   eval "ac_cv_lib_$ac_lib_var=no"
18920 fi
18921 rm -f conftest*
18922 LIBS="$ac_save_LIBS"
18923
18924 fi
18925 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
18926   echo "$ac_t""yes" 1>&6
18927   ol_cv_lib_gdbm=-lgdbm
18928 else
18929   echo "$ac_t""no" 1>&6
18930 ol_cv_lib_gdbm=no
18931 fi
18932
18933         
18934 fi
18935
18936         LIBS="$ol_LIBS"
18937
18938 fi
18939
18940 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
18941
18942
18943  for ac_hdr in gdbm.h
18944 do
18945 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
18946 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
18947 echo "configure:18948: checking for $ac_hdr" >&5
18948 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
18949   echo $ac_n "(cached) $ac_c" 1>&6
18950 else
18951   cat > conftest.$ac_ext <<EOF
18952 #line 18953 "configure"
18953 #include "confdefs.h"
18954 #include <$ac_hdr>
18955 EOF
18956 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
18957 { (eval echo configure:18958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
18958 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
18959 if test -z "$ac_err"; then
18960   rm -rf conftest*
18961   eval "ac_cv_header_$ac_safe=yes"
18962 else
18963   echo "$ac_err" >&5
18964   echo "configure: failed program was:" >&5
18965   cat conftest.$ac_ext >&5
18966   rm -rf conftest*
18967   eval "ac_cv_header_$ac_safe=no"
18968 fi
18969 rm -f conftest*
18970 fi
18971 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
18972   echo "$ac_t""yes" 1>&6
18973     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
18974   cat >> confdefs.h <<EOF
18975 #define $ac_tr_hdr 1
18976 EOF
18977  
18978 else
18979   echo "$ac_t""no" 1>&6
18980 fi
18981 done
18982
18983  echo $ac_n "checking for db""... $ac_c" 1>&6
18984 echo "configure:18985: checking for db" >&5
18985 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
18986   echo $ac_n "(cached) $ac_c" 1>&6
18987 else
18988   
18989         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
18990                 ol_cv_gdbm=no
18991         else
18992                 ol_cv_gdbm=yes
18993         fi
18994
18995 fi
18996
18997 echo "$ac_t""$ol_cv_gdbm" 1>&6
18998  if test $ol_cv_gdbm = yes ; then
18999         cat >> confdefs.h <<\EOF
19000 #define HAVE_GDBM 1
19001 EOF
19002
19003  fi
19004
19005
19006         if test $ol_cv_gdbm = yes ; then
19007                 ol_link_ldbm=gdbm
19008                 ol_with_ldbm_api=gdbm
19009
19010                 if test $ol_cv_lib_gdbm != yes ; then
19011                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
19012                 fi
19013         fi
19014 fi
19015
19016 if test $ol_with_ldbm_api = ndbm ; then
19017         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
19018 echo "configure:19019: checking for NDBM library" >&5
19019 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
19020   echo $ac_n "(cached) $ac_c" 1>&6
19021 else
19022         ol_LIBS="$LIBS"
19023         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
19024 echo "configure:19025: checking for dbm_open" >&5
19025 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
19026   echo $ac_n "(cached) $ac_c" 1>&6
19027 else
19028   cat > conftest.$ac_ext <<EOF
19029 #line 19030 "configure"
19030 #include "confdefs.h"
19031 /* System header to define __stub macros and hopefully few prototypes,
19032     which can conflict with char dbm_open(); below.  */
19033 #include <assert.h>
19034 /* Override any gcc2 internal prototype to avoid an error.  */
19035 /* We use char because int might match the return type of a gcc2
19036     builtin and then its argument prototype would still apply.  */
19037 char dbm_open();
19038 char (*f)();
19039
19040 int main() {
19041
19042 /* The GNU C library defines this for functions which it implements
19043     to always fail with ENOSYS.  Some functions are actually named
19044     something starting with __ and the normal name is an alias.  */
19045 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
19046 choke me
19047 #else
19048 f = dbm_open;
19049 #endif
19050
19051 ; return 0; }
19052 EOF
19053 if { (eval echo configure:19054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19054   rm -rf conftest*
19055   eval "ac_cv_func_dbm_open=yes"
19056 else
19057   echo "configure: failed program was:" >&5
19058   cat conftest.$ac_ext >&5
19059   rm -rf conftest*
19060   eval "ac_cv_func_dbm_open=no"
19061 fi
19062 rm -f conftest*
19063 fi
19064
19065 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
19066   echo "$ac_t""yes" 1>&6
19067   ol_cv_lib_ndbm=yes
19068 else
19069   echo "$ac_t""no" 1>&6
19070
19071                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
19072 echo "configure:19073: checking for dbm_open in -lndbm" >&5
19073 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19074 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19075   echo $ac_n "(cached) $ac_c" 1>&6
19076 else
19077   ac_save_LIBS="$LIBS"
19078 LIBS="-lndbm  $LIBS"
19079 cat > conftest.$ac_ext <<EOF
19080 #line 19081 "configure"
19081 #include "confdefs.h"
19082 /* Override any gcc2 internal prototype to avoid an error.  */
19083 /* We use char because int might match the return type of a gcc2
19084     builtin and then its argument prototype would still apply.  */
19085 char dbm_open();
19086
19087 int main() {
19088 dbm_open()
19089 ; return 0; }
19090 EOF
19091 if { (eval echo configure:19092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19092   rm -rf conftest*
19093   eval "ac_cv_lib_$ac_lib_var=yes"
19094 else
19095   echo "configure: failed program was:" >&5
19096   cat conftest.$ac_ext >&5
19097   rm -rf conftest*
19098   eval "ac_cv_lib_$ac_lib_var=no"
19099 fi
19100 rm -f conftest*
19101 LIBS="$ac_save_LIBS"
19102
19103 fi
19104 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19105   echo "$ac_t""yes" 1>&6
19106   ol_cv_lib_ndbm=-lndbm
19107 else
19108   echo "$ac_t""no" 1>&6
19109
19110                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
19111 echo "configure:19112: checking for dbm_open in -ldbm" >&5
19112 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
19113 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19114   echo $ac_n "(cached) $ac_c" 1>&6
19115 else
19116   ac_save_LIBS="$LIBS"
19117 LIBS="-ldbm  $LIBS"
19118 cat > conftest.$ac_ext <<EOF
19119 #line 19120 "configure"
19120 #include "confdefs.h"
19121 /* Override any gcc2 internal prototype to avoid an error.  */
19122 /* We use char because int might match the return type of a gcc2
19123     builtin and then its argument prototype would still apply.  */
19124 char dbm_open();
19125
19126 int main() {
19127 dbm_open()
19128 ; return 0; }
19129 EOF
19130 if { (eval echo configure:19131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19131   rm -rf conftest*
19132   eval "ac_cv_lib_$ac_lib_var=yes"
19133 else
19134   echo "configure: failed program was:" >&5
19135   cat conftest.$ac_ext >&5
19136   rm -rf conftest*
19137   eval "ac_cv_lib_$ac_lib_var=no"
19138 fi
19139 rm -f conftest*
19140 LIBS="$ac_save_LIBS"
19141
19142 fi
19143 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19144   echo "$ac_t""yes" 1>&6
19145   ol_cv_lib_ndbm=-ldbm
19146 else
19147   echo "$ac_t""no" 1>&6
19148 ol_cv_lib_ndbm=no
19149 fi
19150                 
19151 fi
19152
19153         
19154 fi
19155
19156         LIBS="$ol_LIBS"
19157
19158 fi
19159
19160 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
19161
19162
19163  for ac_hdr in ndbm.h
19164 do
19165 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19166 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19167 echo "configure:19168: checking for $ac_hdr" >&5
19168 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19169   echo $ac_n "(cached) $ac_c" 1>&6
19170 else
19171   cat > conftest.$ac_ext <<EOF
19172 #line 19173 "configure"
19173 #include "confdefs.h"
19174 #include <$ac_hdr>
19175 EOF
19176 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19177 { (eval echo configure:19178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19178 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19179 if test -z "$ac_err"; then
19180   rm -rf conftest*
19181   eval "ac_cv_header_$ac_safe=yes"
19182 else
19183   echo "$ac_err" >&5
19184   echo "configure: failed program was:" >&5
19185   cat conftest.$ac_ext >&5
19186   rm -rf conftest*
19187   eval "ac_cv_header_$ac_safe=no"
19188 fi
19189 rm -f conftest*
19190 fi
19191 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19192   echo "$ac_t""yes" 1>&6
19193     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19194   cat >> confdefs.h <<EOF
19195 #define $ac_tr_hdr 1
19196 EOF
19197  
19198 else
19199   echo "$ac_t""no" 1>&6
19200 fi
19201 done
19202
19203  echo $ac_n "checking for db""... $ac_c" 1>&6
19204 echo "configure:19205: checking for db" >&5
19205 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
19206   echo $ac_n "(cached) $ac_c" 1>&6
19207 else
19208   
19209         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
19210                 ol_cv_ndbm=no
19211         else
19212                 ol_cv_ndbm=yes
19213         fi
19214
19215 fi
19216
19217 echo "$ac_t""$ol_cv_ndbm" 1>&6
19218  if test $ol_cv_ndbm = yes ; then
19219         cat >> confdefs.h <<\EOF
19220 #define HAVE_NDBM 1
19221 EOF
19222
19223  fi
19224
19225
19226         if test $ol_cv_ndbm = yes ; then
19227                 ol_link_ldbm=ndbm
19228                 ol_with_ldbm_api=ndbm
19229
19230                 if test $ol_cv_lib_ndbm != yes ; then
19231                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
19232                 fi
19233         fi
19234 fi
19235
19236 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
19237         echo "configure: warning: could not find suitable LDBM backend" 1>&2
19238         if test $ol_enable_ldbm = yes ; then
19239                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
19240         fi
19241
19242         echo "configure: warning: disabling LDBM" 1>&2
19243         ol_enable_ldbm=no
19244 fi
19245
19246 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
19247         BUILD_LIBS_DYNAMIC=shared
19248         cat >> confdefs.h <<\EOF
19249 #define LDAP_LIBS_DYNAMIC 1
19250 EOF
19251
19252 else
19253         BUILD_LIBS_DYNAMIC=static
19254 fi
19255
19256 if test $ol_enable_wrappers != no ; then
19257         for ac_hdr in tcpd.h
19258 do
19259 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19260 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19261 echo "configure:19262: checking for $ac_hdr" >&5
19262 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19263   echo $ac_n "(cached) $ac_c" 1>&6
19264 else
19265   cat > conftest.$ac_ext <<EOF
19266 #line 19267 "configure"
19267 #include "confdefs.h"
19268 #include <$ac_hdr>
19269 EOF
19270 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19271 { (eval echo configure:19272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19272 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19273 if test -z "$ac_err"; then
19274   rm -rf conftest*
19275   eval "ac_cv_header_$ac_safe=yes"
19276 else
19277   echo "$ac_err" >&5
19278   echo "configure: failed program was:" >&5
19279   cat conftest.$ac_ext >&5
19280   rm -rf conftest*
19281   eval "ac_cv_header_$ac_safe=no"
19282 fi
19283 rm -f conftest*
19284 fi
19285 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19286   echo "$ac_t""yes" 1>&6
19287     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19288   cat >> confdefs.h <<EOF
19289 #define $ac_tr_hdr 1
19290 EOF
19291  
19292                 echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
19293 echo "configure:19294: checking for TCP wrappers library" >&5
19294                 save_LIBS="$LIBS"
19295                 LIBS="$LIBS -lwrap"
19296                 cat > conftest.$ac_ext <<EOF
19297 #line 19298 "configure"
19298 #include "confdefs.h"
19299
19300 #include <tcpd.h>
19301 int allow_severity = 0;
19302 int deny_severity  = 0;
19303
19304 struct request_info *req;
19305                 
19306 int main() {
19307
19308 hosts_access(req)
19309                 
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   echo "$ac_t""-lwrap" 1>&6
19315                 have_wrappers=yes
19316                 LIBS="$save_LIBS"
19317 else
19318   echo "configure: failed program was:" >&5
19319   cat conftest.$ac_ext >&5
19320   rm -rf conftest*
19321   
19322                                 LIBS="$LIBS -lnsl"
19323                 cat > conftest.$ac_ext <<EOF
19324 #line 19325 "configure"
19325 #include "confdefs.h"
19326
19327 #include <tcpd.h>
19328 int allow_severity = 0;
19329 int deny_severity  = 0;
19330
19331 struct request_info *req;
19332                 
19333 int main() {
19334
19335 hosts_access(req)
19336                 
19337 ; return 0; }
19338 EOF
19339 if { (eval echo configure:19340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19340   rm -rf conftest*
19341   echo "$ac_t""-lwrap -lnsl" 1>&6
19342                 have_wrappers=yes
19343                 LIBS="$save_LIBS -lnsl"
19344 else
19345   echo "configure: failed program was:" >&5
19346   cat conftest.$ac_ext >&5
19347   rm -rf conftest*
19348   
19349                 echo "$ac_t""no" 1>&6
19350                 have_wrappers=no
19351                 LIBS=$save_LIBS
19352 fi
19353 rm -f conftest*
19354 fi
19355 rm -f conftest*
19356 else
19357   echo "$ac_t""no" 1>&6
19358 have_wrappers=no
19359 fi
19360 done
19361
19362
19363         if test $have_wrappers = yes ; then
19364                 cat >> confdefs.h <<\EOF
19365 #define HAVE_TCPD 1
19366 EOF
19367
19368                 WRAP_LIBS="-lwrap"
19369         elif test $ol_enable_wrappers = yes ; then
19370                 { echo "configure: error: could not find TCP wrappers, select apppropriate options ore disable" 1>&2; exit 1; }
19371         else
19372                 echo "configure: warning: could not find TCP wrappers, support disabled" 1>&2
19373                 WRAP_LIBS=""
19374         fi
19375 fi
19376
19377 if test $ol_enable_syslog != no ; then
19378         echo $ac_n "checking for openlog""... $ac_c" 1>&6
19379 echo "configure:19380: checking for openlog" >&5
19380 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
19381   echo $ac_n "(cached) $ac_c" 1>&6
19382 else
19383   cat > conftest.$ac_ext <<EOF
19384 #line 19385 "configure"
19385 #include "confdefs.h"
19386 /* System header to define __stub macros and hopefully few prototypes,
19387     which can conflict with char openlog(); below.  */
19388 #include <assert.h>
19389 /* Override any gcc2 internal prototype to avoid an error.  */
19390 /* We use char because int might match the return type of a gcc2
19391     builtin and then its argument prototype would still apply.  */
19392 char openlog();
19393 char (*f)();
19394
19395 int main() {
19396
19397 /* The GNU C library defines this for functions which it implements
19398     to always fail with ENOSYS.  Some functions are actually named
19399     something starting with __ and the normal name is an alias.  */
19400 #if defined (__stub_openlog) || defined (__stub___openlog)
19401 choke me
19402 #else
19403 f = openlog;
19404 #endif
19405
19406 ; return 0; }
19407 EOF
19408 if { (eval echo configure:19409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19409   rm -rf conftest*
19410   eval "ac_cv_func_openlog=yes"
19411 else
19412   echo "configure: failed program was:" >&5
19413   cat conftest.$ac_ext >&5
19414   rm -rf conftest*
19415   eval "ac_cv_func_openlog=no"
19416 fi
19417 rm -f conftest*
19418 fi
19419
19420 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
19421   echo "$ac_t""yes" 1>&6
19422   :
19423 else
19424   echo "$ac_t""no" 1>&6
19425 fi
19426
19427         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
19428                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
19429         fi
19430         ol_enable_syslog=$ac_cv_func_openlog
19431 fi
19432
19433
19434 ol_link_sql=no
19435 if test $ol_enable_sql != no ; then
19436         for ac_hdr in sql.h sqlext.h
19437 do
19438 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19439 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19440 echo "configure:19441: checking for $ac_hdr" >&5
19441 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19442   echo $ac_n "(cached) $ac_c" 1>&6
19443 else
19444   cat > conftest.$ac_ext <<EOF
19445 #line 19446 "configure"
19446 #include "confdefs.h"
19447 #include <$ac_hdr>
19448 EOF
19449 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19450 { (eval echo configure:19451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19451 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19452 if test -z "$ac_err"; then
19453   rm -rf conftest*
19454   eval "ac_cv_header_$ac_safe=yes"
19455 else
19456   echo "$ac_err" >&5
19457   echo "configure: failed program was:" >&5
19458   cat conftest.$ac_ext >&5
19459   rm -rf conftest*
19460   eval "ac_cv_header_$ac_safe=no"
19461 fi
19462 rm -f conftest*
19463 fi
19464 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19465   echo "$ac_t""yes" 1>&6
19466     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19467   cat >> confdefs.h <<EOF
19468 #define $ac_tr_hdr 1
19469 EOF
19470  
19471 else
19472   echo "$ac_t""no" 1>&6
19473 { echo "configure: error: could not locate SQL headers" 1>&2; exit 1; }
19474         
19475 fi
19476 done
19477
19478
19479         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
19480 echo "configure:19481: checking for SQLDriverConnect in -liodbc" >&5
19481 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
19482 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19483   echo $ac_n "(cached) $ac_c" 1>&6
19484 else
19485   ac_save_LIBS="$LIBS"
19486 LIBS="-liodbc  $LIBS"
19487 cat > conftest.$ac_ext <<EOF
19488 #line 19489 "configure"
19489 #include "confdefs.h"
19490 /* Override any gcc2 internal prototype to avoid an error.  */
19491 /* We use char because int might match the return type of a gcc2
19492     builtin and then its argument prototype would still apply.  */
19493 char SQLDriverConnect();
19494
19495 int main() {
19496 SQLDriverConnect()
19497 ; return 0; }
19498 EOF
19499 if { (eval echo configure:19500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19500   rm -rf conftest*
19501   eval "ac_cv_lib_$ac_lib_var=yes"
19502 else
19503   echo "configure: failed program was:" >&5
19504   cat conftest.$ac_ext >&5
19505   rm -rf conftest*
19506   eval "ac_cv_lib_$ac_lib_var=no"
19507 fi
19508 rm -f conftest*
19509 LIBS="$ac_save_LIBS"
19510
19511 fi
19512 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19513   echo "$ac_t""yes" 1>&6
19514   have_iodbc=yes
19515 else
19516   echo "$ac_t""no" 1>&6
19517 have_iodbc=no
19518 fi
19519
19520         if test $have_iodbc = yes ; then
19521                 ol_link_sql="-liodbc"
19522         else
19523                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
19524 echo "configure:19525: checking for SQLDriverConnect in -lodbc" >&5
19525 ac_lib_var=`echo odbc'_'SQLDriverConnect | 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="-lodbc  $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 SQLDriverConnect();
19538
19539 int main() {
19540 SQLDriverConnect()
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_odbc=yes
19559 else
19560   echo "$ac_t""no" 1>&6
19561 have_odbc=no
19562 fi
19563
19564                 if test $have_odbc = yes ; then
19565                         ol_link_sql="-lodbc"
19566                 fi
19567         fi
19568
19569         if test $ol_link_sql != no ; then
19570                 SLAPD_SQL_LIBS="$ol_link_sql"
19571
19572         elif test $ol_enable_sql != auto ; then
19573                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
19574         fi
19575 fi
19576
19577 ol_link_termcap=no
19578 for ac_hdr in termcap.h ncurses.h
19579 do
19580 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19581 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19582 echo "configure:19583: checking for $ac_hdr" >&5
19583 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19584   echo $ac_n "(cached) $ac_c" 1>&6
19585 else
19586   cat > conftest.$ac_ext <<EOF
19587 #line 19588 "configure"
19588 #include "confdefs.h"
19589 #include <$ac_hdr>
19590 EOF
19591 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19592 { (eval echo configure:19593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19593 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19594 if test -z "$ac_err"; then
19595   rm -rf conftest*
19596   eval "ac_cv_header_$ac_safe=yes"
19597 else
19598   echo "$ac_err" >&5
19599   echo "configure: failed program was:" >&5
19600   cat conftest.$ac_ext >&5
19601   rm -rf conftest*
19602   eval "ac_cv_header_$ac_safe=no"
19603 fi
19604 rm -f conftest*
19605 fi
19606 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19607   echo "$ac_t""yes" 1>&6
19608     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19609   cat >> confdefs.h <<EOF
19610 #define $ac_tr_hdr 1
19611 EOF
19612  
19613 else
19614   echo "$ac_t""no" 1>&6
19615 fi
19616 done
19617
19618
19619 if test $ol_link_termcap = no ; then
19620         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
19621 echo "configure:19622: checking for tputs in -ltermcap" >&5
19622 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
19623 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19624   echo $ac_n "(cached) $ac_c" 1>&6
19625 else
19626   ac_save_LIBS="$LIBS"
19627 LIBS="-ltermcap  $LIBS"
19628 cat > conftest.$ac_ext <<EOF
19629 #line 19630 "configure"
19630 #include "confdefs.h"
19631 /* Override any gcc2 internal prototype to avoid an error.  */
19632 /* We use char because int might match the return type of a gcc2
19633     builtin and then its argument prototype would still apply.  */
19634 char tputs();
19635
19636 int main() {
19637 tputs()
19638 ; return 0; }
19639 EOF
19640 if { (eval echo configure:19641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19641   rm -rf conftest*
19642   eval "ac_cv_lib_$ac_lib_var=yes"
19643 else
19644   echo "configure: failed program was:" >&5
19645   cat conftest.$ac_ext >&5
19646   rm -rf conftest*
19647   eval "ac_cv_lib_$ac_lib_var=no"
19648 fi
19649 rm -f conftest*
19650 LIBS="$ac_save_LIBS"
19651
19652 fi
19653 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19654   echo "$ac_t""yes" 1>&6
19655   have_termcap=yes
19656 else
19657   echo "$ac_t""no" 1>&6
19658 have_termcap=no
19659 fi
19660
19661         if test $have_termcap = yes ; then
19662                 cat >> confdefs.h <<\EOF
19663 #define HAVE_TERMCAP 1
19664 EOF
19665
19666                 ol_link_termcap=yes
19667                 TERMCAP_LIBS=-ltermcap
19668         fi
19669 fi
19670
19671 if test $ol_link_termcap = no ; then
19672         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
19673 echo "configure:19674: checking for initscr in -lncurses" >&5
19674 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
19675 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19676   echo $ac_n "(cached) $ac_c" 1>&6
19677 else
19678   ac_save_LIBS="$LIBS"
19679 LIBS="-lncurses  $LIBS"
19680 cat > conftest.$ac_ext <<EOF
19681 #line 19682 "configure"
19682 #include "confdefs.h"
19683 /* Override any gcc2 internal prototype to avoid an error.  */
19684 /* We use char because int might match the return type of a gcc2
19685     builtin and then its argument prototype would still apply.  */
19686 char initscr();
19687
19688 int main() {
19689 initscr()
19690 ; return 0; }
19691 EOF
19692 if { (eval echo configure:19693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19693   rm -rf conftest*
19694   eval "ac_cv_lib_$ac_lib_var=yes"
19695 else
19696   echo "configure: failed program was:" >&5
19697   cat conftest.$ac_ext >&5
19698   rm -rf conftest*
19699   eval "ac_cv_lib_$ac_lib_var=no"
19700 fi
19701 rm -f conftest*
19702 LIBS="$ac_save_LIBS"
19703
19704 fi
19705 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19706   echo "$ac_t""yes" 1>&6
19707   have_ncurses=yes
19708 else
19709   echo "$ac_t""no" 1>&6
19710 have_ncurses=no
19711 fi
19712
19713         if test $have_ncurses = yes ; then
19714                 cat >> confdefs.h <<\EOF
19715 #define HAVE_NCURSES 1
19716 EOF
19717
19718                 ol_link_termcap=yes
19719                 TERMCAP_LIBS=-lncurses
19720         fi
19721 fi
19722
19723 if test $ol_link_termcap = no ; then
19724         cat >> confdefs.h <<\EOF
19725 #define NO_TERMCAP 1
19726 EOF
19727
19728         TERMCAP_LIBS=
19729 fi
19730
19731 ol_link_sasl=no
19732 ol_link_spasswd=no
19733 if test $ol_with_cyrus_sasl != no ; then
19734         for ac_hdr in sasl/sasl.h sasl.h
19735 do
19736 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
19737 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
19738 echo "configure:19739: checking for $ac_hdr" >&5
19739 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
19740   echo $ac_n "(cached) $ac_c" 1>&6
19741 else
19742   cat > conftest.$ac_ext <<EOF
19743 #line 19744 "configure"
19744 #include "confdefs.h"
19745 #include <$ac_hdr>
19746 EOF
19747 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19748 { (eval echo configure:19749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
19749 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
19750 if test -z "$ac_err"; then
19751   rm -rf conftest*
19752   eval "ac_cv_header_$ac_safe=yes"
19753 else
19754   echo "$ac_err" >&5
19755   echo "configure: failed program was:" >&5
19756   cat conftest.$ac_ext >&5
19757   rm -rf conftest*
19758   eval "ac_cv_header_$ac_safe=no"
19759 fi
19760 rm -f conftest*
19761 fi
19762 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
19763   echo "$ac_t""yes" 1>&6
19764     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
19765   cat >> confdefs.h <<EOF
19766 #define $ac_tr_hdr 1
19767 EOF
19768  
19769 else
19770   echo "$ac_t""no" 1>&6
19771 fi
19772 done
19773
19774
19775         if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
19776                 echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
19777 echo "configure:19778: checking for sasl_client_init in -lsasl2" >&5
19778 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
19779 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19780   echo $ac_n "(cached) $ac_c" 1>&6
19781 else
19782   ac_save_LIBS="$LIBS"
19783 LIBS="-lsasl2  $LIBS"
19784 cat > conftest.$ac_ext <<EOF
19785 #line 19786 "configure"
19786 #include "confdefs.h"
19787 /* Override any gcc2 internal prototype to avoid an error.  */
19788 /* We use char because int might match the return type of a gcc2
19789     builtin and then its argument prototype would still apply.  */
19790 char sasl_client_init();
19791
19792 int main() {
19793 sasl_client_init()
19794 ; return 0; }
19795 EOF
19796 if { (eval echo configure:19797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19797   rm -rf conftest*
19798   eval "ac_cv_lib_$ac_lib_var=yes"
19799 else
19800   echo "configure: failed program was:" >&5
19801   cat conftest.$ac_ext >&5
19802   rm -rf conftest*
19803   eval "ac_cv_lib_$ac_lib_var=no"
19804 fi
19805 rm -f conftest*
19806 LIBS="$ac_save_LIBS"
19807
19808 fi
19809 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19810   echo "$ac_t""yes" 1>&6
19811   ol_link_sasl="-lsasl2"
19812 else
19813   echo "$ac_t""no" 1>&6
19814 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
19815 echo "configure:19816: checking for sasl_client_init in -lsasl" >&5
19816 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
19817 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
19818   echo $ac_n "(cached) $ac_c" 1>&6
19819 else
19820   ac_save_LIBS="$LIBS"
19821 LIBS="-lsasl  $LIBS"
19822 cat > conftest.$ac_ext <<EOF
19823 #line 19824 "configure"
19824 #include "confdefs.h"
19825 /* Override any gcc2 internal prototype to avoid an error.  */
19826 /* We use char because int might match the return type of a gcc2
19827     builtin and then its argument prototype would still apply.  */
19828 char sasl_client_init();
19829
19830 int main() {
19831 sasl_client_init()
19832 ; return 0; }
19833 EOF
19834 if { (eval echo configure:19835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19835   rm -rf conftest*
19836   eval "ac_cv_lib_$ac_lib_var=yes"
19837 else
19838   echo "configure: failed program was:" >&5
19839   cat conftest.$ac_ext >&5
19840   rm -rf conftest*
19841   eval "ac_cv_lib_$ac_lib_var=no"
19842 fi
19843 rm -f conftest*
19844 LIBS="$ac_save_LIBS"
19845
19846 fi
19847 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
19848   echo "$ac_t""yes" 1>&6
19849   ol_link_sasl="-lsasl"
19850 else
19851   echo "$ac_t""no" 1>&6
19852 fi
19853
19854 fi
19855
19856         fi
19857
19858         if test $ol_link_sasl = no ; then
19859                 if test $ol_with_cyrus_sasl != auto ; then
19860                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
19861                 else
19862                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
19863                         echo "configure: warning: SASL authentication not supported!" 1>&2
19864                         if test $ol_link_tls = no ; then
19865                                 echo "configure: warning: Strong authentication not supported!" 1>&2
19866                         fi
19867                 fi
19868         else
19869                 echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
19870 echo "configure:19871: checking Cyrus SASL library version" >&5
19871 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
19872   echo $ac_n "(cached) $ac_c" 1>&6
19873 else
19874   
19875         cat > conftest.$ac_ext <<EOF
19876 #line 19877 "configure"
19877 #include "confdefs.h"
19878
19879 #ifdef HAVE_SASL_SASL_H
19880 #include <sasl/sasl.h>
19881 #else
19882 #include <sasl.h>
19883 #endif
19884
19885 /* require 2.1.3 or later */
19886 #if SASL_VERSION_MAJOR == 1  && SASL_VERSION_MINOR >= 5
19887         char *__sasl_compat = "1.5.x okay";
19888 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR > 1
19889         __sasl_compat "2.2+ or better okay (we guess)";
19890 #elif SASL_VERSION_MAJOR == 2  && SASL_VERSION_MINOR == 1 \
19891         && SASL_VERSION_STEP >=3
19892         __sasl_compat = "2.1.3+ or better okay";
19893 #endif
19894         
19895 EOF
19896 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
19897   egrep "__sasl_compat" >/dev/null 2>&1; then
19898   rm -rf conftest*
19899   ol_cv_sasl_compat=yes
19900 else
19901   rm -rf conftest*
19902   ol_cv_sasl_compat=no
19903 fi
19904 rm -f conftest*
19905
19906 fi
19907
19908 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
19909
19910                 if test $ol_cv_sasl_compat = no ; then
19911                         ol_link_sasl=no
19912                         { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
19913                 fi
19914
19915                 cat >> confdefs.h <<\EOF
19916 #define HAVE_CYRUS_SASL 1
19917 EOF
19918
19919                 SASL_LIBS="$ol_link_sasl"
19920                 if test $ol_enable_spasswd != no ; then
19921                         ol_link_spasswd=yes
19922                 fi
19923
19924                 ac_save_LIBS="$LIBS"
19925                 LIBS="$LIBS $ol_link_sasl"
19926                 echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
19927 echo "configure:19928: checking for sasl_version" >&5
19928 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
19929   echo $ac_n "(cached) $ac_c" 1>&6
19930 else
19931   cat > conftest.$ac_ext <<EOF
19932 #line 19933 "configure"
19933 #include "confdefs.h"
19934 /* System header to define __stub macros and hopefully few prototypes,
19935     which can conflict with char sasl_version(); below.  */
19936 #include <assert.h>
19937 /* Override any gcc2 internal prototype to avoid an error.  */
19938 /* We use char because int might match the return type of a gcc2
19939     builtin and then its argument prototype would still apply.  */
19940 char sasl_version();
19941 char (*f)();
19942
19943 int main() {
19944
19945 /* The GNU C library defines this for functions which it implements
19946     to always fail with ENOSYS.  Some functions are actually named
19947     something starting with __ and the normal name is an alias.  */
19948 #if defined (__stub_sasl_version) || defined (__stub___sasl_version)
19949 choke me
19950 #else
19951 f = sasl_version;
19952 #endif
19953
19954 ; return 0; }
19955 EOF
19956 if { (eval echo configure:19957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
19957   rm -rf conftest*
19958   eval "ac_cv_func_sasl_version=yes"
19959 else
19960   echo "configure: failed program was:" >&5
19961   cat conftest.$ac_ext >&5
19962   rm -rf conftest*
19963   eval "ac_cv_func_sasl_version=no"
19964 fi
19965 rm -f conftest*
19966 fi
19967
19968 if eval "test \"`echo '$ac_cv_func_'sasl_version`\" = yes"; then
19969   echo "$ac_t""yes" 1>&6
19970   cat >> confdefs.h <<\EOF
19971 #define HAVE_SASL_VERSION 1
19972 EOF
19973
19974 else
19975   echo "$ac_t""no" 1>&6
19976 fi
19977
19978                 LIBS="$ac_save_LIBS"
19979         fi
19980
19981 else
19982         echo "configure: warning: SASL authentication not supported!" 1>&2
19983         if test $ol_link_tls = no ; then
19984                 echo "configure: warning: Strong authentication not supported!" 1>&2
19985         fi
19986 fi
19987
19988 if test $cross_compiling != yes -a "$ac_cv_mingw32" != yes ; then
19989         dev=no
19990         if test -r /dev/urandom ; then
19991                 dev="/dev/urandom";
19992         elif test -r /idev/urandom ; then
19993                 dev="/idev/urandom";
19994         elif test -r /dev/srandom ; then
19995                 dev="/dev/srandom";
19996         elif test -r /dev/random ; then
19997                 dev="/dev/random";
19998         elif test -r /idev/random ; then
19999                 dev="/idev/random";
20000         fi
20001
20002         if test $dev != no ; then
20003                 cat >> confdefs.h <<EOF
20004 #define URANDOM_DEVICE "$dev"
20005 EOF
20006
20007         fi
20008 fi
20009
20010 ol_link_fetch=no
20011 if test $ol_with_fetch != no ; then
20012         ol_LIBS=$LIBS
20013 LIBS="-lfetch -lcom_err $LIBS"
20014 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
20015 echo "configure:20016: checking fetch(3) library" >&5
20016 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
20017   echo $ac_n "(cached) $ac_c" 1>&6
20018 else
20019   
20020         cat > conftest.$ac_ext <<EOF
20021 #line 20022 "configure"
20022 #include "confdefs.h"
20023
20024 #include <sys/param.h>
20025 #include <stdio.h>
20026 #include <fetch.h>
20027 int main() {
20028 struct url *u = fetchParseURL("file:///"); 
20029 ; return 0; }
20030 EOF
20031 if { (eval echo configure:20032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20032   rm -rf conftest*
20033   ol_cv_lib_fetch=yes
20034 else
20035   echo "configure: failed program was:" >&5
20036   cat conftest.$ac_ext >&5
20037   rm -rf conftest*
20038   ol_cv_lib_fetch=no
20039 fi
20040 rm -f conftest*
20041 fi
20042
20043 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
20044 LIBS=$ol_LIBS
20045 if test $ol_cv_lib_fetch != no ; then
20046         ol_link_fetch="-lfetch -lcom_err"
20047         cat >> confdefs.h <<\EOF
20048 #define HAVE_FETCH 1
20049 EOF
20050
20051 fi
20052
20053
20054         if test $ol_cv_lib_fetch != no ; then
20055                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
20056                 ol_link_fetch=freebsd
20057
20058         elif test $ol_with_fetch != auto ; then
20059                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
20060         fi 
20061 fi
20062
20063 ol_link_readline=no
20064 if test $ol_with_readline != no ; then
20065         for ac_hdr in readline/readline.h readline/history.h
20066 do
20067 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20068 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20069 echo "configure:20070: checking for $ac_hdr" >&5
20070 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20071   echo $ac_n "(cached) $ac_c" 1>&6
20072 else
20073   cat > conftest.$ac_ext <<EOF
20074 #line 20075 "configure"
20075 #include "confdefs.h"
20076 #include <$ac_hdr>
20077 EOF
20078 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20079 { (eval echo configure:20080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20080 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20081 if test -z "$ac_err"; then
20082   rm -rf conftest*
20083   eval "ac_cv_header_$ac_safe=yes"
20084 else
20085   echo "$ac_err" >&5
20086   echo "configure: failed program was:" >&5
20087   cat conftest.$ac_ext >&5
20088   rm -rf conftest*
20089   eval "ac_cv_header_$ac_safe=no"
20090 fi
20091 rm -f conftest*
20092 fi
20093 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20094   echo "$ac_t""yes" 1>&6
20095     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20096   cat >> confdefs.h <<EOF
20097 #define $ac_tr_hdr 1
20098 EOF
20099  
20100 else
20101   echo "$ac_t""no" 1>&6
20102 fi
20103 done
20104
20105
20106         if test $ac_cv_header_readline_readline_h = yes ; then
20107                 save_LIBS="$LIBS"
20108                 LIBS="$TERMCAP_LIBS $LIBS"
20109                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
20110 echo "configure:20111: checking for readline in -lreadline" >&5
20111 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
20112 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20113   echo $ac_n "(cached) $ac_c" 1>&6
20114 else
20115   ac_save_LIBS="$LIBS"
20116 LIBS="-lreadline  $LIBS"
20117 cat > conftest.$ac_ext <<EOF
20118 #line 20119 "configure"
20119 #include "confdefs.h"
20120 /* Override any gcc2 internal prototype to avoid an error.  */
20121 /* We use char because int might match the return type of a gcc2
20122     builtin and then its argument prototype would still apply.  */
20123 char readline();
20124
20125 int main() {
20126 readline()
20127 ; return 0; }
20128 EOF
20129 if { (eval echo configure:20130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20130   rm -rf conftest*
20131   eval "ac_cv_lib_$ac_lib_var=yes"
20132 else
20133   echo "configure: failed program was:" >&5
20134   cat conftest.$ac_ext >&5
20135   rm -rf conftest*
20136   eval "ac_cv_lib_$ac_lib_var=no"
20137 fi
20138 rm -f conftest*
20139 LIBS="$ac_save_LIBS"
20140
20141 fi
20142 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20143   echo "$ac_t""yes" 1>&6
20144   have_readline=yes
20145 else
20146   echo "$ac_t""no" 1>&6
20147 have_readline=no
20148 fi
20149
20150                 LIBS="$save_LIBS"
20151                         
20152                 if test $have_readline = yes ; then
20153                         ol_with_readline=found
20154                         ol_link_readline=yes
20155
20156                         READLINE_LIBS="-lreadline"
20157                 fi
20158         fi
20159 fi
20160
20161 if test $ol_link_readline = yes ; then
20162         cat >> confdefs.h <<\EOF
20163 #define HAVE_READLINE 1
20164 EOF
20165
20166 fi
20167
20168
20169 if test $ol_enable_crypt != no ; then
20170         save_LIBS="$LIBS"
20171         LIBS="$TLS_LIBS $LIBS"
20172
20173         echo $ac_n "checking for crypt""... $ac_c" 1>&6
20174 echo "configure:20175: checking for crypt" >&5
20175 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
20176   echo $ac_n "(cached) $ac_c" 1>&6
20177 else
20178   cat > conftest.$ac_ext <<EOF
20179 #line 20180 "configure"
20180 #include "confdefs.h"
20181 /* System header to define __stub macros and hopefully few prototypes,
20182     which can conflict with char crypt(); below.  */
20183 #include <assert.h>
20184 /* Override any gcc2 internal prototype to avoid an error.  */
20185 /* We use char because int might match the return type of a gcc2
20186     builtin and then its argument prototype would still apply.  */
20187 char crypt();
20188 char (*f)();
20189
20190 int main() {
20191
20192 /* The GNU C library defines this for functions which it implements
20193     to always fail with ENOSYS.  Some functions are actually named
20194     something starting with __ and the normal name is an alias.  */
20195 #if defined (__stub_crypt) || defined (__stub___crypt)
20196 choke me
20197 #else
20198 f = crypt;
20199 #endif
20200
20201 ; return 0; }
20202 EOF
20203 if { (eval echo configure:20204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20204   rm -rf conftest*
20205   eval "ac_cv_func_crypt=yes"
20206 else
20207   echo "configure: failed program was:" >&5
20208   cat conftest.$ac_ext >&5
20209   rm -rf conftest*
20210   eval "ac_cv_func_crypt=no"
20211 fi
20212 rm -f conftest*
20213 fi
20214
20215 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
20216   echo "$ac_t""yes" 1>&6
20217   have_crypt=yes
20218 else
20219   echo "$ac_t""no" 1>&6
20220
20221                 LIBS="$save_LIBS"
20222                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
20223 echo "configure:20224: checking for crypt in -lcrypt" >&5
20224 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
20225 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20226   echo $ac_n "(cached) $ac_c" 1>&6
20227 else
20228   ac_save_LIBS="$LIBS"
20229 LIBS="-lcrypt  $LIBS"
20230 cat > conftest.$ac_ext <<EOF
20231 #line 20232 "configure"
20232 #include "confdefs.h"
20233 /* Override any gcc2 internal prototype to avoid an error.  */
20234 /* We use char because int might match the return type of a gcc2
20235     builtin and then its argument prototype would still apply.  */
20236 char crypt();
20237
20238 int main() {
20239 crypt()
20240 ; return 0; }
20241 EOF
20242 if { (eval echo configure:20243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20243   rm -rf conftest*
20244   eval "ac_cv_lib_$ac_lib_var=yes"
20245 else
20246   echo "configure: failed program was:" >&5
20247   cat conftest.$ac_ext >&5
20248   rm -rf conftest*
20249   eval "ac_cv_lib_$ac_lib_var=no"
20250 fi
20251 rm -f conftest*
20252 LIBS="$ac_save_LIBS"
20253
20254 fi
20255 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20256   echo "$ac_t""yes" 1>&6
20257   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
20258                         have_crypt=yes
20259 else
20260   echo "$ac_t""no" 1>&6
20261 have_crypt=no
20262 fi
20263
20264 fi
20265
20266
20267         LIBS="$save_LIBS"
20268
20269         if test $have_crypt = yes ; then
20270                 cat >> confdefs.h <<\EOF
20271 #define HAVE_CRYPT 1
20272 EOF
20273
20274         else
20275                 echo "configure: warning: could not find crypt" 1>&2
20276                 if test $ol_enable_crypt = yes ; then
20277                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
20278                 fi
20279
20280                 echo "configure: warning: disabling crypt support" 1>&2
20281                 ol_enable_crypt=no
20282         fi
20283 fi
20284
20285 if test $ol_enable_proctitle != no ; then
20286         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
20287 echo "configure:20288: checking for setproctitle" >&5
20288 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
20289   echo $ac_n "(cached) $ac_c" 1>&6
20290 else
20291   cat > conftest.$ac_ext <<EOF
20292 #line 20293 "configure"
20293 #include "confdefs.h"
20294 /* System header to define __stub macros and hopefully few prototypes,
20295     which can conflict with char setproctitle(); below.  */
20296 #include <assert.h>
20297 /* Override any gcc2 internal prototype to avoid an error.  */
20298 /* We use char because int might match the return type of a gcc2
20299     builtin and then its argument prototype would still apply.  */
20300 char setproctitle();
20301 char (*f)();
20302
20303 int main() {
20304
20305 /* The GNU C library defines this for functions which it implements
20306     to always fail with ENOSYS.  Some functions are actually named
20307     something starting with __ and the normal name is an alias.  */
20308 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
20309 choke me
20310 #else
20311 f = setproctitle;
20312 #endif
20313
20314 ; return 0; }
20315 EOF
20316 if { (eval echo configure:20317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20317   rm -rf conftest*
20318   eval "ac_cv_func_setproctitle=yes"
20319 else
20320   echo "configure: failed program was:" >&5
20321   cat conftest.$ac_ext >&5
20322   rm -rf conftest*
20323   eval "ac_cv_func_setproctitle=no"
20324 fi
20325 rm -f conftest*
20326 fi
20327
20328 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
20329   echo "$ac_t""yes" 1>&6
20330   have_setproctitle=yes
20331 else
20332   echo "$ac_t""no" 1>&6
20333
20334                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
20335 echo "configure:20336: checking for setproctitle in -lutil" >&5
20336 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
20337 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20338   echo $ac_n "(cached) $ac_c" 1>&6
20339 else
20340   ac_save_LIBS="$LIBS"
20341 LIBS="-lutil  $LIBS"
20342 cat > conftest.$ac_ext <<EOF
20343 #line 20344 "configure"
20344 #include "confdefs.h"
20345 /* Override any gcc2 internal prototype to avoid an error.  */
20346 /* We use char because int might match the return type of a gcc2
20347     builtin and then its argument prototype would still apply.  */
20348 char setproctitle();
20349
20350 int main() {
20351 setproctitle()
20352 ; return 0; }
20353 EOF
20354 if { (eval echo configure:20355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20355   rm -rf conftest*
20356   eval "ac_cv_lib_$ac_lib_var=yes"
20357 else
20358   echo "configure: failed program was:" >&5
20359   cat conftest.$ac_ext >&5
20360   rm -rf conftest*
20361   eval "ac_cv_lib_$ac_lib_var=no"
20362 fi
20363 rm -f conftest*
20364 LIBS="$ac_save_LIBS"
20365
20366 fi
20367 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20368   echo "$ac_t""yes" 1>&6
20369   have_setproctitle=yes
20370                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
20371 else
20372   echo "$ac_t""no" 1>&6
20373 have_setproctitle=no
20374                         LIBOBJS="$LIBOBJS setproctitle.o"
20375                         LIBSRCS="$LIBSRCS setproctitle.c"
20376 fi
20377
20378 fi
20379
20380
20381         if test $have_setproctitle = yes ; then
20382                 cat >> confdefs.h <<\EOF
20383 #define HAVE_SETPROCTITLE 1
20384 EOF
20385
20386         fi
20387 fi
20388
20389 if test $ol_enable_slp != no ; then
20390         for ac_hdr in slp.h 
20391 do
20392 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
20393 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
20394 echo "configure:20395: checking for $ac_hdr" >&5
20395 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
20396   echo $ac_n "(cached) $ac_c" 1>&6
20397 else
20398   cat > conftest.$ac_ext <<EOF
20399 #line 20400 "configure"
20400 #include "confdefs.h"
20401 #include <$ac_hdr>
20402 EOF
20403 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20404 { (eval echo configure:20405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20405 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20406 if test -z "$ac_err"; then
20407   rm -rf conftest*
20408   eval "ac_cv_header_$ac_safe=yes"
20409 else
20410   echo "$ac_err" >&5
20411   echo "configure: failed program was:" >&5
20412   cat conftest.$ac_ext >&5
20413   rm -rf conftest*
20414   eval "ac_cv_header_$ac_safe=no"
20415 fi
20416 rm -f conftest*
20417 fi
20418 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
20419   echo "$ac_t""yes" 1>&6
20420     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
20421   cat >> confdefs.h <<EOF
20422 #define $ac_tr_hdr 1
20423 EOF
20424  
20425 else
20426   echo "$ac_t""no" 1>&6
20427 fi
20428 done
20429
20430
20431         if test $ac_cv_header_slp_h = yes ; then
20432                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
20433 echo "configure:20434: checking for SLPOpen in -lslp" >&5
20434 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
20435 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
20436   echo $ac_n "(cached) $ac_c" 1>&6
20437 else
20438   ac_save_LIBS="$LIBS"
20439 LIBS="-lslp  $LIBS"
20440 cat > conftest.$ac_ext <<EOF
20441 #line 20442 "configure"
20442 #include "confdefs.h"
20443 /* Override any gcc2 internal prototype to avoid an error.  */
20444 /* We use char because int might match the return type of a gcc2
20445     builtin and then its argument prototype would still apply.  */
20446 char SLPOpen();
20447
20448 int main() {
20449 SLPOpen()
20450 ; return 0; }
20451 EOF
20452 if { (eval echo configure:20453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
20453   rm -rf conftest*
20454   eval "ac_cv_lib_$ac_lib_var=yes"
20455 else
20456   echo "configure: failed program was:" >&5
20457   cat conftest.$ac_ext >&5
20458   rm -rf conftest*
20459   eval "ac_cv_lib_$ac_lib_var=no"
20460 fi
20461 rm -f conftest*
20462 LIBS="$ac_save_LIBS"
20463
20464 fi
20465 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
20466   echo "$ac_t""yes" 1>&6
20467   have_slp=yes
20468 else
20469   echo "$ac_t""no" 1>&6
20470 have_slp=no
20471 fi
20472
20473                 if test $have_slp = yes ; then
20474                         cat >> confdefs.h <<\EOF
20475 #define HAVE_SLP 1
20476 EOF
20477
20478                         SLAPD_SLP_LIBS=-lslp
20479                 fi
20480
20481         elif test $ol_enable_slp = yes ; then
20482                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
20483         fi
20484 fi
20485
20486 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
20487 echo "configure:20488: checking for ANSI C header files" >&5
20488 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
20489   echo $ac_n "(cached) $ac_c" 1>&6
20490 else
20491   cat > conftest.$ac_ext <<EOF
20492 #line 20493 "configure"
20493 #include "confdefs.h"
20494 #include <stdlib.h>
20495 #include <stdarg.h>
20496 #include <string.h>
20497 #include <float.h>
20498 EOF
20499 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
20500 { (eval echo configure:20501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20501 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
20502 if test -z "$ac_err"; then
20503   rm -rf conftest*
20504   ac_cv_header_stdc=yes
20505 else
20506   echo "$ac_err" >&5
20507   echo "configure: failed program was:" >&5
20508   cat conftest.$ac_ext >&5
20509   rm -rf conftest*
20510   ac_cv_header_stdc=no
20511 fi
20512 rm -f conftest*
20513
20514 if test $ac_cv_header_stdc = yes; then
20515   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
20516 cat > conftest.$ac_ext <<EOF
20517 #line 20518 "configure"
20518 #include "confdefs.h"
20519 #include <string.h>
20520 EOF
20521 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20522   egrep "memchr" >/dev/null 2>&1; then
20523   :
20524 else
20525   rm -rf conftest*
20526   ac_cv_header_stdc=no
20527 fi
20528 rm -f conftest*
20529
20530 fi
20531
20532 if test $ac_cv_header_stdc = yes; then
20533   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
20534 cat > conftest.$ac_ext <<EOF
20535 #line 20536 "configure"
20536 #include "confdefs.h"
20537 #include <stdlib.h>
20538 EOF
20539 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20540   egrep "free" >/dev/null 2>&1; then
20541   :
20542 else
20543   rm -rf conftest*
20544   ac_cv_header_stdc=no
20545 fi
20546 rm -f conftest*
20547
20548 fi
20549
20550 if test $ac_cv_header_stdc = yes; then
20551   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
20552 if test "$cross_compiling" = yes; then
20553   :
20554 else
20555   cat > conftest.$ac_ext <<EOF
20556 #line 20557 "configure"
20557 #include "confdefs.h"
20558 #include <ctype.h>
20559 #if ((' ' & 0x0FF) == 0x020)
20560 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
20561 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
20562 #else
20563 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
20564  || ('j' <= (c) && (c) <= 'r') \
20565  || ('s' <= (c) && (c) <= 'z'))
20566 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
20567 #endif
20568 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
20569 int main () { int i; for (i = 0; i < 256; i++)
20570 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
20571 exit (0); }
20572
20573 EOF
20574 if { (eval echo configure:20575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
20575 then
20576   :
20577 else
20578   echo "configure: failed program was:" >&5
20579   cat conftest.$ac_ext >&5
20580   rm -fr conftest*
20581   ac_cv_header_stdc=no
20582 fi
20583 rm -fr conftest*
20584 fi
20585
20586 fi
20587 fi
20588
20589 echo "$ac_t""$ac_cv_header_stdc" 1>&6
20590 if test $ac_cv_header_stdc = yes; then
20591   cat >> confdefs.h <<\EOF
20592 #define STDC_HEADERS 1
20593 EOF
20594
20595 fi
20596
20597 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
20598 echo "configure:20599: checking for mode_t" >&5
20599 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
20600   echo $ac_n "(cached) $ac_c" 1>&6
20601 else
20602   cat > conftest.$ac_ext <<EOF
20603 #line 20604 "configure"
20604 #include "confdefs.h"
20605 #include <sys/types.h>
20606 #if STDC_HEADERS
20607 #include <stdlib.h>
20608 #include <stddef.h>
20609 #endif
20610
20611 EOF
20612 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20613   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20614   rm -rf conftest*
20615   eval "ac_cv_type_mode_t=yes"
20616 else
20617   rm -rf conftest*
20618   eval "ac_cv_type_mode_t=no"
20619 fi
20620 rm -f conftest*
20621
20622 fi
20623 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
20624   echo "$ac_t""yes" 1>&6
20625 else
20626   echo "$ac_t""no" 1>&6
20627   cat >> confdefs.h <<EOF
20628 #define mode_t int
20629 EOF
20630
20631 fi
20632
20633 echo $ac_n "checking for off_t""... $ac_c" 1>&6
20634 echo "configure:20635: checking for off_t" >&5
20635 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
20636   echo $ac_n "(cached) $ac_c" 1>&6
20637 else
20638   cat > conftest.$ac_ext <<EOF
20639 #line 20640 "configure"
20640 #include "confdefs.h"
20641 #include <sys/types.h>
20642 #if STDC_HEADERS
20643 #include <stdlib.h>
20644 #include <stddef.h>
20645 #endif
20646
20647 EOF
20648 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20649   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20650   rm -rf conftest*
20651   eval "ac_cv_type_off_t=yes"
20652 else
20653   rm -rf conftest*
20654   eval "ac_cv_type_off_t=no"
20655 fi
20656 rm -f conftest*
20657
20658 fi
20659 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
20660   echo "$ac_t""yes" 1>&6
20661 else
20662   echo "$ac_t""no" 1>&6
20663   cat >> confdefs.h <<EOF
20664 #define off_t long
20665 EOF
20666
20667 fi
20668
20669 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
20670 echo "configure:20671: checking for pid_t" >&5
20671 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
20672   echo $ac_n "(cached) $ac_c" 1>&6
20673 else
20674   cat > conftest.$ac_ext <<EOF
20675 #line 20676 "configure"
20676 #include "confdefs.h"
20677 #include <sys/types.h>
20678 #if STDC_HEADERS
20679 #include <stdlib.h>
20680 #include <stddef.h>
20681 #endif
20682
20683 EOF
20684 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20685   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20686   rm -rf conftest*
20687   eval "ac_cv_type_pid_t=yes"
20688 else
20689   rm -rf conftest*
20690   eval "ac_cv_type_pid_t=no"
20691 fi
20692 rm -f conftest*
20693
20694 fi
20695 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
20696   echo "$ac_t""yes" 1>&6
20697 else
20698   echo "$ac_t""no" 1>&6
20699   cat >> confdefs.h <<EOF
20700 #define pid_t int
20701 EOF
20702
20703 fi
20704
20705 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
20706 echo "configure:20707: checking for ptrdiff_t" >&5
20707 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
20708   echo $ac_n "(cached) $ac_c" 1>&6
20709 else
20710   cat > conftest.$ac_ext <<EOF
20711 #line 20712 "configure"
20712 #include "confdefs.h"
20713 #include <stddef.h>
20714 int main() {
20715 ptrdiff_t p
20716 ; return 0; }
20717 EOF
20718 if { (eval echo configure:20719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20719   rm -rf conftest*
20720   am_cv_type_ptrdiff_t=yes
20721 else
20722   echo "configure: failed program was:" >&5
20723   cat conftest.$ac_ext >&5
20724   rm -rf conftest*
20725   am_cv_type_ptrdiff_t=no
20726 fi
20727 rm -f conftest*
20728 fi
20729
20730 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
20731    if test $am_cv_type_ptrdiff_t = yes; then
20732      cat >> confdefs.h <<\EOF
20733 #define HAVE_PTRDIFF_T 1
20734 EOF
20735
20736    fi
20737
20738 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
20739 echo "configure:20740: checking return type of signal handlers" >&5
20740 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
20741   echo $ac_n "(cached) $ac_c" 1>&6
20742 else
20743   cat > conftest.$ac_ext <<EOF
20744 #line 20745 "configure"
20745 #include "confdefs.h"
20746 #include <sys/types.h>
20747 #include <signal.h>
20748 #ifdef signal
20749 #undef signal
20750 #endif
20751 #ifdef __cplusplus
20752 extern "C" void (*signal (int, void (*)(int)))(int);
20753 #else
20754 void (*signal ()) ();
20755 #endif
20756
20757 int main() {
20758 int i;
20759 ; return 0; }
20760 EOF
20761 if { (eval echo configure:20762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20762   rm -rf conftest*
20763   ac_cv_type_signal=void
20764 else
20765   echo "configure: failed program was:" >&5
20766   cat conftest.$ac_ext >&5
20767   rm -rf conftest*
20768   ac_cv_type_signal=int
20769 fi
20770 rm -f conftest*
20771 fi
20772
20773 echo "$ac_t""$ac_cv_type_signal" 1>&6
20774 cat >> confdefs.h <<EOF
20775 #define RETSIGTYPE $ac_cv_type_signal
20776 EOF
20777
20778
20779 echo $ac_n "checking for size_t""... $ac_c" 1>&6
20780 echo "configure:20781: checking for size_t" >&5
20781 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
20782   echo $ac_n "(cached) $ac_c" 1>&6
20783 else
20784   cat > conftest.$ac_ext <<EOF
20785 #line 20786 "configure"
20786 #include "confdefs.h"
20787 #include <sys/types.h>
20788 #if STDC_HEADERS
20789 #include <stdlib.h>
20790 #include <stddef.h>
20791 #endif
20792
20793 EOF
20794 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20795   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20796   rm -rf conftest*
20797   eval "ac_cv_type_size_t=yes"
20798 else
20799   rm -rf conftest*
20800   eval "ac_cv_type_size_t=no"
20801 fi
20802 rm -f conftest*
20803
20804 fi
20805 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
20806   echo "$ac_t""yes" 1>&6
20807 else
20808   echo "$ac_t""no" 1>&6
20809   cat >> confdefs.h <<EOF
20810 #define size_t unsigned
20811 EOF
20812
20813 fi
20814
20815
20816 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
20817 echo "configure:20818: checking for ssize_t" >&5
20818 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
20819   echo $ac_n "(cached) $ac_c" 1>&6
20820 else
20821   cat > conftest.$ac_ext <<EOF
20822 #line 20823 "configure"
20823 #include "confdefs.h"
20824 #include <sys/types.h>
20825 #if STDC_HEADERS
20826 #include <stdlib.h>
20827 #include <stddef.h>
20828 #endif
20829
20830 EOF
20831 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20832   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20833   rm -rf conftest*
20834   eval "ac_cv_type_ssize_t=yes"
20835 else
20836   rm -rf conftest*
20837   eval "ac_cv_type_ssize_t=no"
20838 fi
20839 rm -f conftest*
20840
20841 fi
20842 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
20843   echo "$ac_t""yes" 1>&6
20844 else
20845   echo "$ac_t""no" 1>&6
20846   cat >> confdefs.h <<EOF
20847 #define ssize_t signed int
20848 EOF
20849
20850 fi
20851
20852 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
20853 echo "configure:20854: checking for caddr_t" >&5
20854 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
20855   echo $ac_n "(cached) $ac_c" 1>&6
20856 else
20857   cat > conftest.$ac_ext <<EOF
20858 #line 20859 "configure"
20859 #include "confdefs.h"
20860 #include <sys/types.h>
20861 #if STDC_HEADERS
20862 #include <stdlib.h>
20863 #include <stddef.h>
20864 #endif
20865
20866 EOF
20867 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
20868   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
20869   rm -rf conftest*
20870   eval "ac_cv_type_caddr_t=yes"
20871 else
20872   rm -rf conftest*
20873   eval "ac_cv_type_caddr_t=no"
20874 fi
20875 rm -f conftest*
20876
20877 fi
20878 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
20879   echo "$ac_t""yes" 1>&6
20880 else
20881   echo "$ac_t""no" 1>&6
20882   cat >> confdefs.h <<EOF
20883 #define caddr_t char *
20884 EOF
20885
20886 fi
20887
20888
20889 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
20890 echo "configure:20891: checking for socklen_t" >&5
20891 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
20892   echo $ac_n "(cached) $ac_c" 1>&6
20893 else
20894   cat > conftest.$ac_ext <<EOF
20895 #line 20896 "configure"
20896 #include "confdefs.h"
20897
20898 #ifdef HAVE_SYS_TYPES_H
20899 #include <sys/types.h>
20900 #endif
20901 #ifdef HAVE_SYS_SOCKET_H
20902 #include <sys/socket.h>
20903 #endif
20904
20905 int main() {
20906 socklen_t len;
20907 ; return 0; }
20908 EOF
20909 if { (eval echo configure:20910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20910   rm -rf conftest*
20911   ol_cv_type_socklen_t=yes
20912 else
20913   echo "configure: failed program was:" >&5
20914   cat conftest.$ac_ext >&5
20915   rm -rf conftest*
20916   ol_cv_type_socklen_t=no
20917 fi
20918 rm -f conftest*
20919 fi
20920
20921 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
20922   if test $ol_cv_type_socklen_t = no; then
20923     cat >> confdefs.h <<\EOF
20924 #define socklen_t int
20925 EOF
20926
20927   fi
20928  
20929 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
20930 echo "configure:20931: checking for member st_blksize in aggregate type struct stat" >&5
20931 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
20932   echo $ac_n "(cached) $ac_c" 1>&6
20933 else
20934   cat > conftest.$ac_ext <<EOF
20935 #line 20936 "configure"
20936 #include "confdefs.h"
20937 #include <sys/types.h>
20938 #include <sys/stat.h>
20939 int main() {
20940 struct stat foo; foo.st_blksize;
20941 ; return 0; }
20942 EOF
20943 if { (eval echo configure:20944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20944   rm -rf conftest*
20945   ac_cv_c_struct_member_st_blksize=yes
20946 else
20947   echo "configure: failed program was:" >&5
20948   cat conftest.$ac_ext >&5
20949   rm -rf conftest*
20950   ac_cv_c_struct_member_st_blksize=no
20951 fi
20952 rm -f conftest*
20953 fi
20954
20955 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
20956 st_blksize="$ac_cv_c_struct_member_st_blksize"
20957 if test $ac_cv_c_struct_member_st_blksize = yes; then
20958   cat >> confdefs.h <<\EOF
20959 #define HAVE_ST_BLKSIZE 1
20960 EOF
20961
20962 fi
20963
20964 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
20965 echo "configure:20966: checking whether time.h and sys/time.h may both be included" >&5
20966 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
20967   echo $ac_n "(cached) $ac_c" 1>&6
20968 else
20969   cat > conftest.$ac_ext <<EOF
20970 #line 20971 "configure"
20971 #include "confdefs.h"
20972 #include <sys/types.h>
20973 #include <sys/time.h>
20974 #include <time.h>
20975 int main() {
20976 struct tm *tp;
20977 ; return 0; }
20978 EOF
20979 if { (eval echo configure:20980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
20980   rm -rf conftest*
20981   ac_cv_header_time=yes
20982 else
20983   echo "configure: failed program was:" >&5
20984   cat conftest.$ac_ext >&5
20985   rm -rf conftest*
20986   ac_cv_header_time=no
20987 fi
20988 rm -f conftest*
20989 fi
20990
20991 echo "$ac_t""$ac_cv_header_time" 1>&6
20992 if test $ac_cv_header_time = yes; then
20993   cat >> confdefs.h <<\EOF
20994 #define TIME_WITH_SYS_TIME 1
20995 EOF
20996
20997 fi
20998
20999 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
21000 echo "configure:21001: checking whether struct tm is in sys/time.h or time.h" >&5
21001 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
21002   echo $ac_n "(cached) $ac_c" 1>&6
21003 else
21004   cat > conftest.$ac_ext <<EOF
21005 #line 21006 "configure"
21006 #include "confdefs.h"
21007 #include <sys/types.h>
21008 #include <time.h>
21009 int main() {
21010 struct tm *tp; tp->tm_sec;
21011 ; return 0; }
21012 EOF
21013 if { (eval echo configure:21014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21014   rm -rf conftest*
21015   ac_cv_struct_tm=time.h
21016 else
21017   echo "configure: failed program was:" >&5
21018   cat conftest.$ac_ext >&5
21019   rm -rf conftest*
21020   ac_cv_struct_tm=sys/time.h
21021 fi
21022 rm -f conftest*
21023 fi
21024
21025 echo "$ac_t""$ac_cv_struct_tm" 1>&6
21026 if test $ac_cv_struct_tm = sys/time.h; then
21027   cat >> confdefs.h <<\EOF
21028 #define TM_IN_SYS_TIME 1
21029 EOF
21030
21031 fi
21032
21033 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
21034 echo "configure:21035: checking for uid_t in sys/types.h" >&5
21035 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
21036   echo $ac_n "(cached) $ac_c" 1>&6
21037 else
21038   cat > conftest.$ac_ext <<EOF
21039 #line 21040 "configure"
21040 #include "confdefs.h"
21041 #include <sys/types.h>
21042 EOF
21043 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
21044   egrep "uid_t" >/dev/null 2>&1; then
21045   rm -rf conftest*
21046   ac_cv_type_uid_t=yes
21047 else
21048   rm -rf conftest*
21049   ac_cv_type_uid_t=no
21050 fi
21051 rm -f conftest*
21052
21053 fi
21054
21055 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
21056 if test $ac_cv_type_uid_t = no; then
21057   cat >> confdefs.h <<\EOF
21058 #define uid_t int
21059 EOF
21060
21061   cat >> confdefs.h <<\EOF
21062 #define gid_t int
21063 EOF
21064
21065 fi
21066
21067 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
21068 echo "configure:21069: checking for sig_atomic_t" >&5
21069 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
21070   echo $ac_n "(cached) $ac_c" 1>&6
21071 else
21072   cat > conftest.$ac_ext <<EOF
21073 #line 21074 "configure"
21074 #include "confdefs.h"
21075 #include <signal.h>
21076 int main() {
21077 sig_atomic_t atomic;
21078 ; return 0; }
21079 EOF
21080 if { (eval echo configure:21081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21081   rm -rf conftest*
21082   ol_cv_type_sig_atomic_t=yes
21083 else
21084   echo "configure: failed program was:" >&5
21085   cat conftest.$ac_ext >&5
21086   rm -rf conftest*
21087   ol_cv_type_sig_atomic_t=no
21088 fi
21089 rm -f conftest*
21090 fi
21091
21092 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
21093   if test $ol_cv_type_sig_atomic_t = no; then
21094     cat >> confdefs.h <<\EOF
21095 #define sig_atomic_t int
21096 EOF
21097
21098   fi
21099  
21100
21101
21102 # test for pw_gecos in struct passwd
21103 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
21104 echo "configure:21105: checking struct passwd for pw_gecos" >&5
21105 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
21106   echo $ac_n "(cached) $ac_c" 1>&6
21107 else
21108   
21109         cat > conftest.$ac_ext <<EOF
21110 #line 21111 "configure"
21111 #include "confdefs.h"
21112 #include <pwd.h>
21113 int main() {
21114
21115         struct passwd pwd;
21116         pwd.pw_gecos = pwd.pw_name;
21117
21118 ; return 0; }
21119 EOF
21120 if { (eval echo configure:21121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21121   rm -rf conftest*
21122   ol_cv_struct_passwd_pw_gecos=yes
21123 else
21124   echo "configure: failed program was:" >&5
21125   cat conftest.$ac_ext >&5
21126   rm -rf conftest*
21127   ol_cv_struct_passwd_pw_gecos=no
21128 fi
21129 rm -f conftest*
21130 fi
21131
21132 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
21133 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
21134         cat >> confdefs.h <<\EOF
21135 #define HAVE_PW_GECOS 1
21136 EOF
21137
21138 fi
21139
21140 # test for pw_passwd in struct passwd
21141 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
21142 echo "configure:21143: checking struct passwd for pw_passwd" >&5
21143 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
21144   echo $ac_n "(cached) $ac_c" 1>&6
21145 else
21146   
21147         cat > conftest.$ac_ext <<EOF
21148 #line 21149 "configure"
21149 #include "confdefs.h"
21150 #include <pwd.h>
21151 int main() {
21152
21153         struct passwd pwd;
21154         pwd.pw_passwd = pwd.pw_name;
21155
21156 ; return 0; }
21157 EOF
21158 if { (eval echo configure:21159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21159   rm -rf conftest*
21160   ol_cv_struct_passwd_pw_passwd=yes
21161 else
21162   echo "configure: failed program was:" >&5
21163   cat conftest.$ac_ext >&5
21164   rm -rf conftest*
21165   ol_cv_struct_passwd_pw_passwd=no
21166 fi
21167 rm -f conftest*
21168 fi
21169
21170 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
21171 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
21172         cat >> confdefs.h <<\EOF
21173 #define HAVE_PW_PASSWD 1
21174 EOF
21175
21176 fi
21177
21178
21179 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
21180 echo "configure:21181: checking if toupper() requires islower()" >&5
21181 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
21182   echo $ac_n "(cached) $ac_c" 1>&6
21183 else
21184   
21185         if test "$cross_compiling" = yes; then
21186   ol_cv_c_upper_lower=safe
21187 else
21188   cat > conftest.$ac_ext <<EOF
21189 #line 21190 "configure"
21190 #include "confdefs.h"
21191
21192 #include <ctype.h>
21193 main()
21194 {
21195         if ('C' == toupper('C'))
21196                 exit(0);
21197         else
21198                 exit(1);
21199 }
21200 EOF
21201 if { (eval echo configure:21202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21202 then
21203   ol_cv_c_upper_lower=no
21204 else
21205   echo "configure: failed program was:" >&5
21206   cat conftest.$ac_ext >&5
21207   rm -fr conftest*
21208   ol_cv_c_upper_lower=yes
21209 fi
21210 rm -fr conftest*
21211 fi
21212
21213 fi
21214
21215 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
21216 if test $ol_cv_c_upper_lower != no ; then
21217         cat >> confdefs.h <<\EOF
21218 #define C_UPPER_LOWER 1
21219 EOF
21220
21221 fi
21222
21223 echo $ac_n "checking for working const""... $ac_c" 1>&6
21224 echo "configure:21225: checking for working const" >&5
21225 if eval "test \"\${ac_cv_c_const+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
21232 int main() {
21233
21234 /* Ultrix mips cc rejects this.  */
21235 typedef int charset[2]; const charset x;
21236 /* SunOS 4.1.1 cc rejects this.  */
21237 char const *const *ccp;
21238 char **p;
21239 /* NEC SVR4.0.2 mips cc rejects this.  */
21240 struct point {int x, y;};
21241 static struct point const zero = {0,0};
21242 /* AIX XL C 1.02.0.0 rejects this.
21243    It does not let you subtract one const X* pointer from another in an arm
21244    of an if-expression whose if-part is not a constant expression */
21245 const char *g = "string";
21246 ccp = &g + (g ? g-g : 0);
21247 /* HPUX 7.0 cc rejects these. */
21248 ++ccp;
21249 p = (char**) ccp;
21250 ccp = (char const *const *) p;
21251 { /* SCO 3.2v4 cc rejects this.  */
21252   char *t;
21253   char const *s = 0 ? (char *) 0 : (char const *) 0;
21254
21255   *t++ = 0;
21256 }
21257 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
21258   int x[] = {25, 17};
21259   const int *foo = &x[0];
21260   ++foo;
21261 }
21262 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
21263   typedef const int *iptr;
21264   iptr p = 0;
21265   ++p;
21266 }
21267 { /* AIX XL C 1.02.0.0 rejects this saying
21268      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
21269   struct s { int j; const int *ap[3]; };
21270   struct s *b; b->j = 5;
21271 }
21272 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
21273   const int foo = 10;
21274 }
21275
21276 ; return 0; }
21277 EOF
21278 if { (eval echo configure:21279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21279   rm -rf conftest*
21280   ac_cv_c_const=yes
21281 else
21282   echo "configure: failed program was:" >&5
21283   cat conftest.$ac_ext >&5
21284   rm -rf conftest*
21285   ac_cv_c_const=no
21286 fi
21287 rm -f conftest*
21288 fi
21289
21290 echo "$ac_t""$ac_cv_c_const" 1>&6
21291 if test $ac_cv_c_const = no; then
21292   cat >> confdefs.h <<\EOF
21293 #define const 
21294 EOF
21295
21296 fi
21297
21298 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
21299 echo "configure:21300: checking if compiler understands volatile" >&5
21300 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
21301   echo $ac_n "(cached) $ac_c" 1>&6
21302 else
21303   cat > conftest.$ac_ext <<EOF
21304 #line 21305 "configure"
21305 #include "confdefs.h"
21306 int x, y, z;
21307 int main() {
21308 volatile int a; int * volatile b = x ? &y : &z;
21309       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
21310       *b = 0;
21311 ; return 0; }
21312 EOF
21313 if { (eval echo configure:21314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21314   rm -rf conftest*
21315   ol_cv_c_volatile=yes
21316 else
21317   echo "configure: failed program was:" >&5
21318   cat conftest.$ac_ext >&5
21319   rm -rf conftest*
21320   ol_cv_c_volatile=no
21321 fi
21322 rm -f conftest*
21323 fi
21324
21325 echo "$ac_t""$ol_cv_c_volatile" 1>&6
21326   if test $ol_cv_c_volatile = yes; then
21327     : 
21328   else
21329     cat >> confdefs.h <<\EOF
21330 #define volatile 
21331 EOF
21332
21333   fi
21334  
21335
21336 if test $cross_compiling = yes ; then
21337         cat >> confdefs.h <<\EOF
21338 #define CROSS_COMPILING 1
21339 EOF
21340
21341 else
21342         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
21343 echo "configure:21344: checking whether byte ordering is bigendian" >&5
21344 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
21345   echo $ac_n "(cached) $ac_c" 1>&6
21346 else
21347   ac_cv_c_bigendian=unknown
21348 # See if sys/param.h defines the BYTE_ORDER macro.
21349 cat > conftest.$ac_ext <<EOF
21350 #line 21351 "configure"
21351 #include "confdefs.h"
21352 #include <sys/types.h>
21353 #include <sys/param.h>
21354 int main() {
21355
21356 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
21357  bogus endian macros
21358 #endif
21359 ; return 0; }
21360 EOF
21361 if { (eval echo configure:21362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21362   rm -rf conftest*
21363   # It does; now see whether it defined to BIG_ENDIAN or not.
21364 cat > conftest.$ac_ext <<EOF
21365 #line 21366 "configure"
21366 #include "confdefs.h"
21367 #include <sys/types.h>
21368 #include <sys/param.h>
21369 int main() {
21370
21371 #if BYTE_ORDER != BIG_ENDIAN
21372  not big endian
21373 #endif
21374 ; return 0; }
21375 EOF
21376 if { (eval echo configure:21377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21377   rm -rf conftest*
21378   ac_cv_c_bigendian=yes
21379 else
21380   echo "configure: failed program was:" >&5
21381   cat conftest.$ac_ext >&5
21382   rm -rf conftest*
21383   ac_cv_c_bigendian=no
21384 fi
21385 rm -f conftest*
21386 else
21387   echo "configure: failed program was:" >&5
21388   cat conftest.$ac_ext >&5
21389 fi
21390 rm -f conftest*
21391 if test $ac_cv_c_bigendian = unknown; then
21392 if test "$cross_compiling" = yes; then
21393     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
21394 else
21395   cat > conftest.$ac_ext <<EOF
21396 #line 21397 "configure"
21397 #include "confdefs.h"
21398 main () {
21399   /* Are we little or big endian?  From Harbison&Steele.  */
21400   union
21401   {
21402     long l;
21403     char c[sizeof (long)];
21404   } u;
21405   u.l = 1;
21406   exit (u.c[sizeof (long) - 1] == 1);
21407 }
21408 EOF
21409 if { (eval echo configure:21410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21410 then
21411   ac_cv_c_bigendian=no
21412 else
21413   echo "configure: failed program was:" >&5
21414   cat conftest.$ac_ext >&5
21415   rm -fr conftest*
21416   ac_cv_c_bigendian=yes
21417 fi
21418 rm -fr conftest*
21419 fi
21420
21421 fi
21422 fi
21423
21424 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
21425 if test $ac_cv_c_bigendian = yes; then
21426   cat >> confdefs.h <<\EOF
21427 #define WORDS_BIGENDIAN 1
21428 EOF
21429
21430 fi
21431
21432 fi
21433
21434 echo $ac_n "checking size of short""... $ac_c" 1>&6
21435 echo "configure:21436: checking size of short" >&5 
21436 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
21437   echo $ac_n "(cached) $ac_c" 1>&6
21438 else
21439   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21440   cat > conftest.$ac_ext <<EOF
21441 #line 21442 "configure"
21442 #include "confdefs.h"
21443 #include "confdefs.h" 
21444 #include <sys/types.h> 
21445  
21446
21447 int main() {
21448 switch (0) case 0: case (sizeof (short) == $ac_size):;
21449 ; return 0; }
21450 EOF
21451 if { (eval echo configure:21452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21452   rm -rf conftest*
21453   ac_cv_sizeof_short=$ac_size
21454 else
21455   echo "configure: failed program was:" >&5
21456   cat conftest.$ac_ext >&5
21457 fi
21458 rm -f conftest* 
21459   if test x$ac_cv_sizeof_short != x ; then break; fi 
21460 done 
21461
21462 fi
21463  
21464 if test x$ac_cv_sizeof_short = x ; then 
21465   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
21466 fi 
21467 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
21468 cat >> confdefs.h <<EOF
21469 #define SIZEOF_SHORT $ac_cv_sizeof_short
21470 EOF
21471  
21472  
21473 echo $ac_n "checking size of int""... $ac_c" 1>&6
21474 echo "configure:21475: checking size of int" >&5 
21475 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
21476   echo $ac_n "(cached) $ac_c" 1>&6
21477 else
21478   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21479   cat > conftest.$ac_ext <<EOF
21480 #line 21481 "configure"
21481 #include "confdefs.h"
21482 #include "confdefs.h" 
21483 #include <sys/types.h> 
21484  
21485
21486 int main() {
21487 switch (0) case 0: case (sizeof (int) == $ac_size):;
21488 ; return 0; }
21489 EOF
21490 if { (eval echo configure:21491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21491   rm -rf conftest*
21492   ac_cv_sizeof_int=$ac_size
21493 else
21494   echo "configure: failed program was:" >&5
21495   cat conftest.$ac_ext >&5
21496 fi
21497 rm -f conftest* 
21498   if test x$ac_cv_sizeof_int != x ; then break; fi 
21499 done 
21500
21501 fi
21502  
21503 if test x$ac_cv_sizeof_int = x ; then 
21504   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
21505 fi 
21506 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
21507 cat >> confdefs.h <<EOF
21508 #define SIZEOF_INT $ac_cv_sizeof_int
21509 EOF
21510  
21511  
21512 echo $ac_n "checking size of long""... $ac_c" 1>&6
21513 echo "configure:21514: checking size of long" >&5 
21514 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
21515   echo $ac_n "(cached) $ac_c" 1>&6
21516 else
21517   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
21518   cat > conftest.$ac_ext <<EOF
21519 #line 21520 "configure"
21520 #include "confdefs.h"
21521 #include "confdefs.h" 
21522 #include <sys/types.h> 
21523  
21524
21525 int main() {
21526 switch (0) case 0: case (sizeof (long) == $ac_size):;
21527 ; return 0; }
21528 EOF
21529 if { (eval echo configure:21530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
21530   rm -rf conftest*
21531   ac_cv_sizeof_long=$ac_size
21532 else
21533   echo "configure: failed program was:" >&5
21534   cat conftest.$ac_ext >&5
21535 fi
21536 rm -f conftest* 
21537   if test x$ac_cv_sizeof_long != x ; then break; fi 
21538 done 
21539
21540 fi
21541  
21542 if test x$ac_cv_sizeof_long = x ; then 
21543   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
21544 fi 
21545 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
21546 cat >> confdefs.h <<EOF
21547 #define SIZEOF_LONG $ac_cv_sizeof_long
21548 EOF
21549  
21550
21551
21552 if test "$ac_cv_sizeof_int" -lt 4 ; then
21553         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
21554
21555         cat >> confdefs.h <<\EOF
21556 #define LBER_INT_T long
21557 EOF
21558
21559 else
21560         cat >> confdefs.h <<\EOF
21561 #define LBER_INT_T int
21562 EOF
21563
21564 fi
21565
21566 cat >> confdefs.h <<\EOF
21567 #define LBER_LEN_T long
21568 EOF
21569
21570 cat >> confdefs.h <<\EOF
21571 #define LBER_SOCKET_T int
21572 EOF
21573
21574 cat >> confdefs.h <<\EOF
21575 #define LBER_TAG_T long
21576 EOF
21577
21578
21579 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
21580 echo "configure:21581: checking for 8-bit clean memcmp" >&5
21581 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
21582   echo $ac_n "(cached) $ac_c" 1>&6
21583 else
21584   if test "$cross_compiling" = yes; then
21585   ac_cv_func_memcmp_clean=no
21586 else
21587   cat > conftest.$ac_ext <<EOF
21588 #line 21589 "configure"
21589 #include "confdefs.h"
21590
21591 main()
21592 {
21593   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
21594   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
21595 }
21596
21597 EOF
21598 if { (eval echo configure:21599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
21599 then
21600   ac_cv_func_memcmp_clean=yes
21601 else
21602   echo "configure: failed program was:" >&5
21603   cat conftest.$ac_ext >&5
21604   rm -fr conftest*
21605   ac_cv_func_memcmp_clean=no
21606 fi
21607 rm -fr conftest*
21608 fi
21609
21610 fi
21611
21612 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
21613 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
21614
21615 echo $ac_n "checking for strftime""... $ac_c" 1>&6
21616 echo "configure:21617: checking for strftime" >&5
21617 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
21618   echo $ac_n "(cached) $ac_c" 1>&6
21619 else
21620   cat > conftest.$ac_ext <<EOF
21621 #line 21622 "configure"
21622 #include "confdefs.h"
21623 /* System header to define __stub macros and hopefully few prototypes,
21624     which can conflict with char strftime(); below.  */
21625 #include <assert.h>
21626 /* Override any gcc2 internal prototype to avoid an error.  */
21627 /* We use char because int might match the return type of a gcc2
21628     builtin and then its argument prototype would still apply.  */
21629 char strftime();
21630 char (*f)();
21631
21632 int main() {
21633
21634 /* The GNU C library defines this for functions which it implements
21635     to always fail with ENOSYS.  Some functions are actually named
21636     something starting with __ and the normal name is an alias.  */
21637 #if defined (__stub_strftime) || defined (__stub___strftime)
21638 choke me
21639 #else
21640 f = strftime;
21641 #endif
21642
21643 ; return 0; }
21644 EOF
21645 if { (eval echo configure:21646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21646   rm -rf conftest*
21647   eval "ac_cv_func_strftime=yes"
21648 else
21649   echo "configure: failed program was:" >&5
21650   cat conftest.$ac_ext >&5
21651   rm -rf conftest*
21652   eval "ac_cv_func_strftime=no"
21653 fi
21654 rm -f conftest*
21655 fi
21656
21657 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
21658   echo "$ac_t""yes" 1>&6
21659   cat >> confdefs.h <<\EOF
21660 #define HAVE_STRFTIME 1
21661 EOF
21662
21663 else
21664   echo "$ac_t""no" 1>&6
21665 # strftime is in -lintl on SCO UNIX.
21666 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
21667 echo "configure:21668: checking for strftime in -lintl" >&5
21668 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
21669 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
21670   echo $ac_n "(cached) $ac_c" 1>&6
21671 else
21672   ac_save_LIBS="$LIBS"
21673 LIBS="-lintl  $LIBS"
21674 cat > conftest.$ac_ext <<EOF
21675 #line 21676 "configure"
21676 #include "confdefs.h"
21677 /* Override any gcc2 internal prototype to avoid an error.  */
21678 /* We use char because int might match the return type of a gcc2
21679     builtin and then its argument prototype would still apply.  */
21680 char strftime();
21681
21682 int main() {
21683 strftime()
21684 ; return 0; }
21685 EOF
21686 if { (eval echo configure:21687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21687   rm -rf conftest*
21688   eval "ac_cv_lib_$ac_lib_var=yes"
21689 else
21690   echo "configure: failed program was:" >&5
21691   cat conftest.$ac_ext >&5
21692   rm -rf conftest*
21693   eval "ac_cv_lib_$ac_lib_var=no"
21694 fi
21695 rm -f conftest*
21696 LIBS="$ac_save_LIBS"
21697
21698 fi
21699 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
21700   echo "$ac_t""yes" 1>&6
21701   cat >> confdefs.h <<\EOF
21702 #define HAVE_STRFTIME 1
21703 EOF
21704
21705 LIBS="-lintl $LIBS"
21706 else
21707   echo "$ac_t""no" 1>&6
21708 fi
21709
21710 fi
21711
21712
21713 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
21714 echo "configure:21715: checking for inet_aton()" >&5
21715 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
21716   echo $ac_n "(cached) $ac_c" 1>&6
21717 else
21718   cat > conftest.$ac_ext <<EOF
21719 #line 21720 "configure"
21720 #include "confdefs.h"
21721
21722 #ifdef HAVE_SYS_TYPES_H
21723 #       include <sys/types.h>
21724 #endif
21725 #ifdef HAVE_SYS_SOCKET_H
21726 #       include <sys/socket.h>
21727 #       ifdef HAVE_SYS_SELECT_H
21728 #               include <sys/select.h>
21729 #       endif
21730 #       include <netinet/in.h>
21731 #       ifdef HAVE_ARPA_INET_H
21732 #               include <arpa/inet.h>
21733 #       endif
21734 #endif
21735
21736 int main() {
21737 struct in_addr in;
21738 int rc = inet_aton( "255.255.255.255", &in );
21739 ; return 0; }
21740 EOF
21741 if { (eval echo configure:21742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21742   rm -rf conftest*
21743   ol_cv_func_inet_aton=yes
21744 else
21745   echo "configure: failed program was:" >&5
21746   cat conftest.$ac_ext >&5
21747   rm -rf conftest*
21748   ol_cv_func_inet_aton=no
21749 fi
21750 rm -f conftest*
21751 fi
21752
21753 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
21754   if test $ol_cv_func_inet_aton != no; then
21755     cat >> confdefs.h <<\EOF
21756 #define HAVE_INET_ATON 1
21757 EOF
21758
21759   fi
21760  
21761
21762 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
21763 echo "configure:21764: checking for _spawnlp" >&5
21764 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
21765   echo $ac_n "(cached) $ac_c" 1>&6
21766 else
21767   cat > conftest.$ac_ext <<EOF
21768 #line 21769 "configure"
21769 #include "confdefs.h"
21770 /* System header to define __stub macros and hopefully few prototypes,
21771     which can conflict with char _spawnlp(); below.  */
21772 #include <assert.h>
21773 /* Override any gcc2 internal prototype to avoid an error.  */
21774 /* We use char because int might match the return type of a gcc2
21775     builtin and then its argument prototype would still apply.  */
21776 char _spawnlp();
21777 char (*f)();
21778
21779 int main() {
21780
21781 /* The GNU C library defines this for functions which it implements
21782     to always fail with ENOSYS.  Some functions are actually named
21783     something starting with __ and the normal name is an alias.  */
21784 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
21785 choke me
21786 #else
21787 f = _spawnlp;
21788 #endif
21789
21790 ; return 0; }
21791 EOF
21792 if { (eval echo configure:21793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21793   rm -rf conftest*
21794   eval "ac_cv_func__spawnlp=yes"
21795 else
21796   echo "configure: failed program was:" >&5
21797   cat conftest.$ac_ext >&5
21798   rm -rf conftest*
21799   eval "ac_cv_func__spawnlp=no"
21800 fi
21801 rm -f conftest*
21802 fi
21803
21804 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
21805   echo "$ac_t""yes" 1>&6
21806   cat >> confdefs.h <<\EOF
21807 #define HAVE_SPAWNLP 1
21808 EOF
21809
21810 else
21811   echo "$ac_t""no" 1>&6
21812 fi
21813
21814
21815 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
21816 echo "configure:21817: checking for _snprintf" >&5
21817 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
21818   echo $ac_n "(cached) $ac_c" 1>&6
21819 else
21820   cat > conftest.$ac_ext <<EOF
21821 #line 21822 "configure"
21822 #include "confdefs.h"
21823 /* System header to define __stub macros and hopefully few prototypes,
21824     which can conflict with char _snprintf(); below.  */
21825 #include <assert.h>
21826 /* Override any gcc2 internal prototype to avoid an error.  */
21827 /* We use char because int might match the return type of a gcc2
21828     builtin and then its argument prototype would still apply.  */
21829 char _snprintf();
21830 char (*f)();
21831
21832 int main() {
21833
21834 /* The GNU C library defines this for functions which it implements
21835     to always fail with ENOSYS.  Some functions are actually named
21836     something starting with __ and the normal name is an alias.  */
21837 #if defined (__stub__snprintf) || defined (__stub____snprintf)
21838 choke me
21839 #else
21840 f = _snprintf;
21841 #endif
21842
21843 ; return 0; }
21844 EOF
21845 if { (eval echo configure:21846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21846   rm -rf conftest*
21847   eval "ac_cv_func__snprintf=yes"
21848 else
21849   echo "configure: failed program was:" >&5
21850   cat conftest.$ac_ext >&5
21851   rm -rf conftest*
21852   eval "ac_cv_func__snprintf=no"
21853 fi
21854 rm -f conftest*
21855 fi
21856
21857 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
21858   echo "$ac_t""yes" 1>&6
21859   ac_cv_func_snprintf=yes
21860         cat >> confdefs.h <<\EOF
21861 #define snprintf _snprintf
21862 EOF
21863
21864
21865 else
21866   echo "$ac_t""no" 1>&6
21867 fi
21868
21869
21870 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
21871 echo "configure:21872: checking for _vsnprintf" >&5
21872 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
21873   echo $ac_n "(cached) $ac_c" 1>&6
21874 else
21875   cat > conftest.$ac_ext <<EOF
21876 #line 21877 "configure"
21877 #include "confdefs.h"
21878 /* System header to define __stub macros and hopefully few prototypes,
21879     which can conflict with char _vsnprintf(); below.  */
21880 #include <assert.h>
21881 /* Override any gcc2 internal prototype to avoid an error.  */
21882 /* We use char because int might match the return type of a gcc2
21883     builtin and then its argument prototype would still apply.  */
21884 char _vsnprintf();
21885 char (*f)();
21886
21887 int main() {
21888
21889 /* The GNU C library defines this for functions which it implements
21890     to always fail with ENOSYS.  Some functions are actually named
21891     something starting with __ and the normal name is an alias.  */
21892 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
21893 choke me
21894 #else
21895 f = _vsnprintf;
21896 #endif
21897
21898 ; return 0; }
21899 EOF
21900 if { (eval echo configure:21901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21901   rm -rf conftest*
21902   eval "ac_cv_func__vsnprintf=yes"
21903 else
21904   echo "configure: failed program was:" >&5
21905   cat conftest.$ac_ext >&5
21906   rm -rf conftest*
21907   eval "ac_cv_func__vsnprintf=no"
21908 fi
21909 rm -f conftest*
21910 fi
21911
21912 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
21913   echo "$ac_t""yes" 1>&6
21914   ac_cv_func_vsnprintf=yes
21915         cat >> confdefs.h <<\EOF
21916 #define vsnprintf _vsnprintf
21917 EOF
21918
21919
21920 else
21921   echo "$ac_t""no" 1>&6
21922 fi
21923
21924
21925 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
21926 echo "configure:21927: checking for vprintf" >&5
21927 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
21928   echo $ac_n "(cached) $ac_c" 1>&6
21929 else
21930   cat > conftest.$ac_ext <<EOF
21931 #line 21932 "configure"
21932 #include "confdefs.h"
21933 /* System header to define __stub macros and hopefully few prototypes,
21934     which can conflict with char vprintf(); below.  */
21935 #include <assert.h>
21936 /* Override any gcc2 internal prototype to avoid an error.  */
21937 /* We use char because int might match the return type of a gcc2
21938     builtin and then its argument prototype would still apply.  */
21939 char vprintf();
21940 char (*f)();
21941
21942 int main() {
21943
21944 /* The GNU C library defines this for functions which it implements
21945     to always fail with ENOSYS.  Some functions are actually named
21946     something starting with __ and the normal name is an alias.  */
21947 #if defined (__stub_vprintf) || defined (__stub___vprintf)
21948 choke me
21949 #else
21950 f = vprintf;
21951 #endif
21952
21953 ; return 0; }
21954 EOF
21955 if { (eval echo configure:21956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
21956   rm -rf conftest*
21957   eval "ac_cv_func_vprintf=yes"
21958 else
21959   echo "configure: failed program was:" >&5
21960   cat conftest.$ac_ext >&5
21961   rm -rf conftest*
21962   eval "ac_cv_func_vprintf=no"
21963 fi
21964 rm -f conftest*
21965 fi
21966
21967 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
21968   echo "$ac_t""yes" 1>&6
21969   cat >> confdefs.h <<\EOF
21970 #define HAVE_VPRINTF 1
21971 EOF
21972
21973 else
21974   echo "$ac_t""no" 1>&6
21975 fi
21976
21977 if test "$ac_cv_func_vprintf" != yes; then
21978 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
21979 echo "configure:21980: checking for _doprnt" >&5
21980 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
21981   echo $ac_n "(cached) $ac_c" 1>&6
21982 else
21983   cat > conftest.$ac_ext <<EOF
21984 #line 21985 "configure"
21985 #include "confdefs.h"
21986 /* System header to define __stub macros and hopefully few prototypes,
21987     which can conflict with char _doprnt(); below.  */
21988 #include <assert.h>
21989 /* Override any gcc2 internal prototype to avoid an error.  */
21990 /* We use char because int might match the return type of a gcc2
21991     builtin and then its argument prototype would still apply.  */
21992 char _doprnt();
21993 char (*f)();
21994
21995 int main() {
21996
21997 /* The GNU C library defines this for functions which it implements
21998     to always fail with ENOSYS.  Some functions are actually named
21999     something starting with __ and the normal name is an alias.  */
22000 #if defined (__stub__doprnt) || defined (__stub____doprnt)
22001 choke me
22002 #else
22003 f = _doprnt;
22004 #endif
22005
22006 ; return 0; }
22007 EOF
22008 if { (eval echo configure:22009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22009   rm -rf conftest*
22010   eval "ac_cv_func__doprnt=yes"
22011 else
22012   echo "configure: failed program was:" >&5
22013   cat conftest.$ac_ext >&5
22014   rm -rf conftest*
22015   eval "ac_cv_func__doprnt=no"
22016 fi
22017 rm -f conftest*
22018 fi
22019
22020 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
22021   echo "$ac_t""yes" 1>&6
22022   cat >> confdefs.h <<\EOF
22023 #define HAVE_DOPRNT 1
22024 EOF
22025
22026 else
22027   echo "$ac_t""no" 1>&6
22028 fi
22029
22030 fi
22031
22032
22033 if test $ac_cv_func_vprintf = yes ; then
22034                 for ac_func in snprintf vsnprintf
22035 do
22036 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22037 echo "configure:22038: checking for $ac_func" >&5
22038 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22039   echo $ac_n "(cached) $ac_c" 1>&6
22040 else
22041   cat > conftest.$ac_ext <<EOF
22042 #line 22043 "configure"
22043 #include "confdefs.h"
22044 /* System header to define __stub macros and hopefully few prototypes,
22045     which can conflict with char $ac_func(); below.  */
22046 #include <assert.h>
22047 /* Override any gcc2 internal prototype to avoid an error.  */
22048 /* We use char because int might match the return type of a gcc2
22049     builtin and then its argument prototype would still apply.  */
22050 char $ac_func();
22051 char (*f)();
22052
22053 int main() {
22054
22055 /* The GNU C library defines this for functions which it implements
22056     to always fail with ENOSYS.  Some functions are actually named
22057     something starting with __ and the normal name is an alias.  */
22058 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22059 choke me
22060 #else
22061 f = $ac_func;
22062 #endif
22063
22064 ; return 0; }
22065 EOF
22066 if { (eval echo configure:22067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22067   rm -rf conftest*
22068   eval "ac_cv_func_$ac_func=yes"
22069 else
22070   echo "configure: failed program was:" >&5
22071   cat conftest.$ac_ext >&5
22072   rm -rf conftest*
22073   eval "ac_cv_func_$ac_func=no"
22074 fi
22075 rm -f conftest*
22076 fi
22077
22078 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22079   echo "$ac_t""yes" 1>&6
22080     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22081   cat >> confdefs.h <<EOF
22082 #define $ac_tr_func 1
22083 EOF
22084  
22085 else
22086   echo "$ac_t""no" 1>&6
22087 fi
22088 done
22089
22090 fi
22091
22092 for ac_func in \
22093         bcopy                   \
22094         closesocket             \
22095         chroot                  \
22096         endgrent                \
22097         endpwent                \
22098         fcntl                   \
22099         flock                   \
22100         fstat                   \
22101         getdtablesize   \
22102         getgrgid                \
22103         gethostname             \
22104         getpass                 \
22105         getpassphrase   \
22106         getpwuid                \
22107         getpwnam                \
22108         getspnam                \
22109         gettimeofday    \
22110         initgroups              \
22111         lockf                   \
22112         memcpy                  \
22113         memmove                 \
22114         mkstemp                 \
22115         mktemp                  \
22116         pipe                    \
22117         read                    \
22118         recv                    \
22119         recvfrom                \
22120         setpwfile               \
22121         setgid                  \
22122         setegid                 \
22123         setsid                  \
22124         setuid                  \
22125         seteuid                 \
22126         sigaction               \
22127         signal                  \
22128         sigset                  \
22129         strdup                  \
22130         strerror                \
22131         strpbrk                 \
22132         strrchr                 \
22133         strsep                  \
22134         strstr                  \
22135         strtol                  \
22136         strtoul                 \
22137         strspn                  \
22138         sysconf                 \
22139         usleep                  \
22140         waitpid                 \
22141         wait4                   \
22142         write                   \
22143         send                    \
22144         sendto                  \
22145
22146 do
22147 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22148 echo "configure:22149: checking for $ac_func" >&5
22149 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22150   echo $ac_n "(cached) $ac_c" 1>&6
22151 else
22152   cat > conftest.$ac_ext <<EOF
22153 #line 22154 "configure"
22154 #include "confdefs.h"
22155 /* System header to define __stub macros and hopefully few prototypes,
22156     which can conflict with char $ac_func(); below.  */
22157 #include <assert.h>
22158 /* Override any gcc2 internal prototype to avoid an error.  */
22159 /* We use char because int might match the return type of a gcc2
22160     builtin and then its argument prototype would still apply.  */
22161 char $ac_func();
22162 char (*f)();
22163
22164 int main() {
22165
22166 /* The GNU C library defines this for functions which it implements
22167     to always fail with ENOSYS.  Some functions are actually named
22168     something starting with __ and the normal name is an alias.  */
22169 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22170 choke me
22171 #else
22172 f = $ac_func;
22173 #endif
22174
22175 ; return 0; }
22176 EOF
22177 if { (eval echo configure:22178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22178   rm -rf conftest*
22179   eval "ac_cv_func_$ac_func=yes"
22180 else
22181   echo "configure: failed program was:" >&5
22182   cat conftest.$ac_ext >&5
22183   rm -rf conftest*
22184   eval "ac_cv_func_$ac_func=no"
22185 fi
22186 rm -f conftest*
22187 fi
22188
22189 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22190   echo "$ac_t""yes" 1>&6
22191     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22192   cat >> confdefs.h <<EOF
22193 #define $ac_tr_func 1
22194 EOF
22195  
22196 else
22197   echo "$ac_t""no" 1>&6
22198 fi
22199 done
22200
22201
22202 for ac_func in getopt
22203 do
22204 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
22205 echo "configure:22206: checking for $ac_func" >&5
22206 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
22207   echo $ac_n "(cached) $ac_c" 1>&6
22208 else
22209   cat > conftest.$ac_ext <<EOF
22210 #line 22211 "configure"
22211 #include "confdefs.h"
22212 /* System header to define __stub macros and hopefully few prototypes,
22213     which can conflict with char $ac_func(); below.  */
22214 #include <assert.h>
22215 /* Override any gcc2 internal prototype to avoid an error.  */
22216 /* We use char because int might match the return type of a gcc2
22217     builtin and then its argument prototype would still apply.  */
22218 char $ac_func();
22219 char (*f)();
22220
22221 int main() {
22222
22223 /* The GNU C library defines this for functions which it implements
22224     to always fail with ENOSYS.  Some functions are actually named
22225     something starting with __ and the normal name is an alias.  */
22226 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
22227 choke me
22228 #else
22229 f = $ac_func;
22230 #endif
22231
22232 ; return 0; }
22233 EOF
22234 if { (eval echo configure:22235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22235   rm -rf conftest*
22236   eval "ac_cv_func_$ac_func=yes"
22237 else
22238   echo "configure: failed program was:" >&5
22239   cat conftest.$ac_ext >&5
22240   rm -rf conftest*
22241   eval "ac_cv_func_$ac_func=no"
22242 fi
22243 rm -f conftest*
22244 fi
22245
22246 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
22247   echo "$ac_t""yes" 1>&6
22248     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
22249   cat >> confdefs.h <<EOF
22250 #define $ac_tr_func 1
22251 EOF
22252  
22253 else
22254   echo "$ac_t""no" 1>&6
22255 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
22256 fi
22257 done
22258
22259
22260
22261 if test "$ac_cv_func_getopt" != yes; then
22262         LIBSRCS="$LIBSRCS getopt.c"
22263 fi
22264 if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
22265         if test "$ac_cv_func_snprintf" != yes; then
22266                 cat >> confdefs.h <<\EOF
22267 #define snprintf ber_pvt_snprintf
22268 EOF
22269
22270         fi
22271         if test "$ac_cv_func_vsnprintf" != yes; then
22272                 cat >> confdefs.h <<\EOF
22273 #define vsnprintf ber_pvt_vsnprintf
22274 EOF
22275
22276         fi
22277 fi
22278
22279 # Check Configuration
22280 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
22281 echo "configure:22282: checking declaration of sys_errlist" >&5
22282 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
22283   echo $ac_n "(cached) $ac_c" 1>&6
22284 else
22285   
22286         cat > conftest.$ac_ext <<EOF
22287 #line 22288 "configure"
22288 #include "confdefs.h"
22289
22290 #include <stdio.h>
22291 #include <sys/types.h>
22292 #include <errno.h>
22293 #ifdef WINNT
22294 #include <stdlib.h>
22295 #endif 
22296 int main() {
22297 char *c = (char *) *sys_errlist
22298 ; return 0; }
22299 EOF
22300 if { (eval echo configure:22301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
22301   rm -rf conftest*
22302   ol_cv_dcl_sys_errlist=yes
22303         ol_cv_have_sys_errlist=yes
22304 else
22305   echo "configure: failed program was:" >&5
22306   cat conftest.$ac_ext >&5
22307   rm -rf conftest*
22308   ol_cv_dcl_sys_errlist=no
22309 fi
22310 rm -f conftest*
22311 fi
22312
22313 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
22314 #
22315 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
22316 if test $ol_cv_dcl_sys_errlist = no ; then
22317         cat >> confdefs.h <<\EOF
22318 #define DECL_SYS_ERRLIST 1
22319 EOF
22320
22321
22322         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
22323 echo "configure:22324: checking existence of sys_errlist" >&5
22324 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
22325   echo $ac_n "(cached) $ac_c" 1>&6
22326 else
22327   
22328                 cat > conftest.$ac_ext <<EOF
22329 #line 22330 "configure"
22330 #include "confdefs.h"
22331 #include <errno.h>
22332 int main() {
22333 char *c = (char *) *sys_errlist
22334 ; return 0; }
22335 EOF
22336 if { (eval echo configure:22337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
22337   rm -rf conftest*
22338   ol_cv_have_sys_errlist=yes
22339 else
22340   echo "configure: failed program was:" >&5
22341   cat conftest.$ac_ext >&5
22342   rm -rf conftest*
22343   ol_cv_have_sys_errlist=no
22344 fi
22345 rm -f conftest*
22346 fi
22347
22348 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
22349 fi
22350 if test $ol_cv_have_sys_errlist = yes ; then
22351         cat >> confdefs.h <<\EOF
22352 #define HAVE_SYS_ERRLIST 1
22353 EOF
22354
22355 fi
22356
22357
22358
22359 if test "$ol_enable_debug" != no ; then
22360         cat >> confdefs.h <<\EOF
22361 #define LDAP_DEBUG 1
22362 EOF
22363
22364 fi
22365 if test "$ol_enable_syslog" = yes ; then
22366         cat >> confdefs.h <<\EOF
22367 #define LDAP_SYSLOG 1
22368 EOF
22369
22370 fi
22371 if test "$ol_enable_cache" = no ; then
22372         cat >> confdefs.h <<\EOF
22373 #define LDAP_NOCACHE 1
22374 EOF
22375
22376 fi
22377 if test "$ol_link_kbind" != no ; then
22378         cat >> confdefs.h <<\EOF
22379 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
22380 EOF
22381
22382 fi
22383 if test "$ol_enable_proctitle" != no ; then
22384         cat >> confdefs.h <<\EOF
22385 #define LDAP_PROCTITLE 1
22386 EOF
22387
22388 fi
22389 if test "$ol_enable_referrals" != no ; then
22390         cat >> confdefs.h <<\EOF
22391 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
22392 EOF
22393
22394 fi
22395 if test "$ol_enable_local" != no; then
22396         cat >> confdefs.h <<\EOF
22397 #define LDAP_PF_LOCAL 1
22398 EOF
22399
22400 fi
22401 if test "$ol_link_ipv6" != no; then
22402         cat >> confdefs.h <<\EOF
22403 #define LDAP_PF_INET6 1
22404 EOF
22405
22406 fi
22407 if test "$ol_enable_cleartext" != no ; then
22408         cat >> confdefs.h <<\EOF
22409 #define SLAPD_CLEARTEXT 1
22410 EOF
22411
22412 fi
22413 if test "$ol_enable_crypt" != no ; then
22414         cat >> confdefs.h <<\EOF
22415 #define SLAPD_CRYPT 1
22416 EOF
22417
22418 fi
22419 if test "$ol_link_kpasswd" != no ; then
22420         cat >> confdefs.h <<\EOF
22421 #define SLAPD_KPASSWD 1
22422 EOF
22423
22424 fi
22425 if test "$ol_link_spasswd" != no ; then
22426         cat >> confdefs.h <<\EOF
22427 #define SLAPD_SPASSWD 1
22428 EOF
22429
22430 fi
22431 if test "$ol_enable_multimaster" != no ; then
22432         cat >> confdefs.h <<\EOF
22433 #define SLAPD_MULTIMASTER 1
22434 EOF
22435
22436 fi
22437 if test "$ol_enable_phonetic" != no ; then
22438         cat >> confdefs.h <<\EOF
22439 #define SLAPD_PHONETIC 1
22440 EOF
22441
22442 fi
22443 if test "$ol_enable_rlookups" != no ; then
22444         cat >> confdefs.h <<\EOF
22445 #define SLAPD_RLOOKUPS 1
22446 EOF
22447
22448 fi
22449 if test "$ol_enable_aci" != no ; then
22450         cat >> confdefs.h <<\EOF
22451 #define SLAPD_ACI_ENABLED 1
22452 EOF
22453
22454 fi
22455
22456 if test "$ol_link_modules" != no ; then
22457         cat >> confdefs.h <<\EOF
22458 #define SLAPD_MODULES 1
22459 EOF
22460
22461         BUILD_SLAPD=yes
22462         SLAPD_MODULES_LDFLAGS="-dlopen self"
22463 fi
22464
22465 if test "$ol_enable_bdb" != no ; then
22466         cat >> confdefs.h <<\EOF
22467 #define SLAPD_BDB 1
22468 EOF
22469
22470         BUILD_SLAPD=yes
22471         BUILD_BDB=yes
22472         if test "$ol_with_bdb_module" != static ; then
22473                 cat >> confdefs.h <<\EOF
22474 #define SLAPD_BDB_DYNAMIC 1
22475 EOF
22476
22477                 BUILD_BDB=mod
22478                 BUILD_BDB_DYNAMIC=shared
22479                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
22480         else
22481                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
22482         fi
22483 fi
22484
22485 if test "$ol_link_dnssrv" != no ; then
22486         cat >> confdefs.h <<\EOF
22487 #define SLAPD_DNSSRV 1
22488 EOF
22489
22490         BUILD_SLAPD=yes
22491         BUILD_DNSSRV=yes
22492         if test "$ol_with_dnssrv_module" != static ; then
22493                 cat >> confdefs.h <<\EOF
22494 #define SLAPD_DNSSRV_DYNAMIC 1
22495 EOF
22496
22497                 BUILD_DNSSRV=mod
22498                 BUILD_DNSSRV_DYNAMIC=shared
22499                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
22500         else
22501                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
22502         fi
22503 fi
22504
22505 if test "$ol_enable_ldap" != no ; then
22506         cat >> confdefs.h <<\EOF
22507 #define SLAPD_LDAP 1
22508 EOF
22509
22510         BUILD_SLAPD=yes
22511         BUILD_LDAP=yes
22512         if test "$ol_with_ldap_module" != static ; then
22513                 cat >> confdefs.h <<\EOF
22514 #define SLAPD_LDAP_DYNAMIC 1
22515 EOF
22516
22517                 BUILD_LDAP=mod
22518                 BUILD_LDAP_DYNAMIC=shared
22519                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
22520         else
22521                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
22522         fi
22523 fi
22524
22525 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
22526         cat >> confdefs.h <<\EOF
22527 #define SLAPD_LDBM 1
22528 EOF
22529
22530         BUILD_SLAPD=yes
22531         BUILD_LDBM=yes
22532         if test "$ol_with_ldbm_module" != static ; then
22533                 cat >> confdefs.h <<\EOF
22534 #define SLAPD_LDBM_DYNAMIC 1
22535 EOF
22536
22537                 BUILD_LDBM=mod
22538                 BUILD_LDBM_DYNAMIC=shared
22539                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
22540         else
22541                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
22542         fi
22543 fi
22544
22545 if test "$ol_enable_meta" != no ; then
22546         if test "$ol_enable_ldap" = no ; then
22547                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
22548         fi
22549         if test "$ol_enable_rewrite" = no ; then
22550                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
22551         fi
22552         cat >> confdefs.h <<\EOF
22553 #define SLAPD_META 1
22554 EOF
22555
22556         BUILD_SLAPD=yes
22557         BUILD_META=yes
22558         BUILD_LDAP=yes
22559         BUILD_REWRITE=yes
22560         if test "$ol_with_meta_module" != static ; then
22561                 cat >> confdefs.h <<\EOF
22562 #define SLAPD_META_DYNAMIC 1
22563 EOF
22564
22565                 BUILD_META=mod
22566                 BUILD_META_DYNAMIC=shared
22567                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
22568         else
22569                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
22570         fi
22571 fi
22572
22573 if test "$ol_enable_monitor" != no ; then
22574         cat >> confdefs.h <<\EOF
22575 #define SLAPD_MONITOR 1
22576 EOF
22577
22578         BUILD_SLAPD=yes
22579         BUILD_MONITOR=yes
22580         if test "$ol_with_monitor_module" != static ; then
22581                 cat >> confdefs.h <<\EOF
22582 #define SLAPD_MONITOR_DYNAMIC 1
22583 EOF
22584
22585                 BUILD_MONITOR=mod
22586                 BUILD_MONITOR_DYNAMIC=shared
22587                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
22588         else
22589                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
22590         fi
22591 fi
22592
22593 if test "$ol_enable_null" != no ; then
22594         cat >> confdefs.h <<\EOF
22595 #define SLAPD_NULL 1
22596 EOF
22597
22598         BUILD_SLAPD=yes
22599         BUILD_NULL=yes
22600         if test "$ol_with_null_module" != static ; then
22601                 cat >> confdefs.h <<\EOF
22602 #define SLAPD_NULL_DYNAMIC 1
22603 EOF
22604
22605                 BUILD_NULL=mod
22606                 BUILD_NULL_DYNAMIC=shared
22607                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
22608         else
22609                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
22610         fi
22611 fi
22612
22613 if test "$ol_enable_passwd" != no ; then
22614         cat >> confdefs.h <<\EOF
22615 #define SLAPD_PASSWD 1
22616 EOF
22617
22618         BUILD_SLAPD=yes
22619         BUILD_PASSWD=yes
22620         if test "$ol_with_passwd_module" != static ; then
22621                 cat >> confdefs.h <<\EOF
22622 #define SLAPD_PASSWD_DYNAMIC 1
22623 EOF
22624
22625                 BUILD_PASSWD=mod
22626                 BUILD_PASSWD_DYNAMIC=shared
22627                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
22628         else
22629                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
22630         fi
22631 fi
22632
22633 if test "$ol_link_perl" != no ; then
22634         cat >> confdefs.h <<\EOF
22635 #define SLAPD_PERL 1
22636 EOF
22637
22638         BUILD_SLAPD=yes
22639         BUILD_PERL=yes
22640         if test "$ol_with_perl_module" != static ; then
22641                 cat >> confdefs.h <<\EOF
22642 #define SLAPD_PERL_DYNAMIC 1
22643 EOF
22644
22645                 BUILD_PERL=mod
22646                 BUILD_PERL_DYNAMIC=shared
22647                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
22648         else
22649                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
22650         fi
22651 fi
22652
22653 if test "$ol_enable_shell" != no ; then
22654         if test "$ol_link_thread" != no ; then
22655                 echo "configure: warning: Use of --without-threads is recommended with back-shell" 1>&2
22656         fi
22657         cat >> confdefs.h <<\EOF
22658 #define SLAPD_SHELL 1
22659 EOF
22660
22661         BUILD_SLAPD=yes
22662         BUILD_SHELL=yes
22663         if test "$ol_with_shell_module" != static ; then
22664                 cat >> confdefs.h <<\EOF
22665 #define SLAPD_SHELL_DYNAMIC 1
22666 EOF
22667
22668                 BUILD_SHELL=mod
22669                 BUILD_SHELL_DYNAMIC=shared
22670                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
22671         else
22672                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
22673         fi
22674 fi
22675
22676 if test "$ol_link_sql" != no ; then
22677         cat >> confdefs.h <<\EOF
22678 #define SLAPD_SQL 1
22679 EOF
22680
22681         BUILD_SLAPD=yes
22682         BUILD_SQL=yes
22683         if test "$ol_with_sql_module" != static; then
22684                 cat >> confdefs.h <<\EOF
22685 #define SLAPD_SQL_DYNAMIC 1
22686 EOF
22687
22688                 BUILD_SQL=mod
22689                 BUILD_SQL_DYNAMIC=shared
22690                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
22691         else
22692                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
22693         fi
22694 fi
22695
22696 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
22697         $BUILD_SLAPD = yes ; then
22698         BUILD_SLURPD=yes
22699 fi
22700
22701 if test "$ol_enable_rewrite" != no ; then
22702         cat >> confdefs.h <<\EOF
22703 #define ENABLE_REWRITE 1
22704 EOF
22705
22706         BUILD_REWRITE=yes
22707 fi
22708
22709
22710
22711 if test "$ac_cv_mingw32" = yes ; then
22712         PLAT=NT
22713         SLAPD_MODULES_LDFLAGS=
22714 else
22715         PLAT=UNIX
22716 fi
22717
22718 if test -z "$SLAPD_STATIC_BACKENDS"; then
22719         SLAPD_NO_STATIC='#'
22720 else
22721         SLAPD_NO_STATIC=
22722 fi
22723
22724
22725
22726
22727
22728
22729   
22730   
22731   
22732   
22733   
22734   
22735   
22736   
22737   
22738   
22739   
22740   
22741   
22742   
22743   
22744   
22745   
22746   
22747   
22748   
22749   
22750   
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788 # Check whether --with-xxinstall or --without-xxinstall was given.
22789 if test "${with_xxinstall+set}" = set; then
22790   withval="$with_xxinstall"
22791   :
22792 fi
22793
22794
22795
22796 trap '' 1 2 15
22797
22798 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
22799
22800 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22801 # Let make expand exec_prefix.
22802 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22803
22804 # Any assignment to VPATH causes Sun make to only execute
22805 # the first set of double-colon rules, so remove it if not needed.
22806 # If there is a colon in the path, we need to keep it.
22807 if test "x$srcdir" = x.; then
22808   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
22809 fi
22810
22811 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
22812
22813 DEFS=-DHAVE_CONFIG_H
22814
22815 # Without the "./", some shells look in PATH for config.status.
22816 : ${CONFIG_STATUS=./config.status}
22817
22818 echo creating $CONFIG_STATUS
22819 rm -f $CONFIG_STATUS
22820 cat > $CONFIG_STATUS <<EOF
22821 #! /bin/sh
22822 # Generated automatically by configure.
22823 # Run this file to recreate the current configuration.
22824 # This directory was configured as follows,
22825 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
22826 #
22827 # $0 $ac_configure_args
22828 #
22829 # Compiler output produced by configure, useful for debugging
22830 # configure, is in ./config.log if it exists.
22831
22832 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
22833 for ac_option
22834 do
22835   case "\$ac_option" in
22836   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
22837     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
22838     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
22839   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
22840     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
22841     exit 0 ;;
22842   -help | --help | --hel | --he | --h)
22843     echo "\$ac_cs_usage"; exit 0 ;;
22844   *) echo "\$ac_cs_usage"; exit 1 ;;
22845   esac
22846 done
22847
22848 ac_given_srcdir=$srcdir
22849 ac_given_INSTALL="$INSTALL"
22850
22851 trap 'rm -fr `echo "\
22852 Makefile:build/top.mk:Makefile.in:build/dir.mk \
22853 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
22854 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
22855 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
22856 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
22857 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
22858 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
22859 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
22860 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
22861 include/Makefile:build/top.mk:include/Makefile.in \
22862 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
22863 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
22864 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
22865 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
22866 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
22867 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
22868 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
22869 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
22870 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
22871 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
22872 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
22873 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
22874 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
22875 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
22876 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
22877 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
22878 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
22879 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
22880 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
22881 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
22882 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
22883 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
22884 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
22885 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
22886 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
22887 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
22888 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
22889 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
22890  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
22891 EOF
22892 cat >> $CONFIG_STATUS <<EOF
22893
22894 # Protect against being on the right side of a sed subst in config.status.
22895 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
22896  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
22897 $ac_vpsub
22898 $extrasub
22899 s%@SHELL@%$SHELL%g
22900 s%@CFLAGS@%$CFLAGS%g
22901 s%@CPPFLAGS@%$CPPFLAGS%g
22902 s%@CXXFLAGS@%$CXXFLAGS%g
22903 s%@FFLAGS@%$FFLAGS%g
22904 s%@DEFS@%$DEFS%g
22905 s%@LDFLAGS@%$LDFLAGS%g
22906 s%@LIBS@%$LIBS%g
22907 s%@exec_prefix@%$exec_prefix%g
22908 s%@prefix@%$prefix%g
22909 s%@program_transform_name@%$program_transform_name%g
22910 s%@bindir@%$bindir%g
22911 s%@sbindir@%$sbindir%g
22912 s%@libexecdir@%$libexecdir%g
22913 s%@datadir@%$datadir%g
22914 s%@sysconfdir@%$sysconfdir%g
22915 s%@sharedstatedir@%$sharedstatedir%g
22916 s%@localstatedir@%$localstatedir%g
22917 s%@libdir@%$libdir%g
22918 s%@includedir@%$includedir%g
22919 s%@oldincludedir@%$oldincludedir%g
22920 s%@infodir@%$infodir%g
22921 s%@mandir@%$mandir%g
22922 s%@host@%$host%g
22923 s%@host_alias@%$host_alias%g
22924 s%@host_cpu@%$host_cpu%g
22925 s%@host_vendor@%$host_vendor%g
22926 s%@host_os@%$host_os%g
22927 s%@target@%$target%g
22928 s%@target_alias@%$target_alias%g
22929 s%@target_cpu@%$target_cpu%g
22930 s%@target_vendor@%$target_vendor%g
22931 s%@target_os@%$target_os%g
22932 s%@build@%$build%g
22933 s%@build_alias@%$build_alias%g
22934 s%@build_cpu@%$build_cpu%g
22935 s%@build_vendor@%$build_vendor%g
22936 s%@build_os@%$build_os%g
22937 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
22938 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
22939 s%@INSTALL_DATA@%$INSTALL_DATA%g
22940 s%@PACKAGE@%$PACKAGE%g
22941 s%@VERSION@%$VERSION%g
22942 s%@ACLOCAL@%$ACLOCAL%g
22943 s%@AUTOCONF@%$AUTOCONF%g
22944 s%@AUTOMAKE@%$AUTOMAKE%g
22945 s%@AUTOHEADER@%$AUTOHEADER%g
22946 s%@MAKEINFO@%$MAKEINFO%g
22947 s%@install_sh@%$install_sh%g
22948 s%@AMTAR@%$AMTAR%g
22949 s%@AWK@%$AWK%g
22950 s%@AMTARFLAGS@%$AMTARFLAGS%g
22951 s%@SET_MAKE@%$SET_MAKE%g
22952 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
22953 s%@OPENLDAP_RELEASE_DATE@%$OPENLDAP_RELEASE_DATE%g
22954 s%@top_builddir@%$top_builddir%g
22955 s%@ldap_subdir@%$ldap_subdir%g
22956 s%@CC@%$CC%g
22957 s%@AR@%$AR%g
22958 s%@LN_S@%$LN_S%g
22959 s%@OBJEXT@%$OBJEXT%g
22960 s%@EXEEXT@%$EXEEXT%g
22961 s%@ECHO@%$ECHO%g
22962 s%@RANLIB@%$RANLIB%g
22963 s%@STRIP@%$STRIP%g
22964 s%@DLLTOOL@%$DLLTOOL%g
22965 s%@AS@%$AS%g
22966 s%@OBJDUMP@%$OBJDUMP%g
22967 s%@CPP@%$CPP%g
22968 s%@LIBTOOL@%$LIBTOOL%g
22969 s%@LN_H@%$LN_H%g
22970 s%@SENDMAIL@%$SENDMAIL%g
22971 s%@EDITOR@%$EDITOR%g
22972 s%@PERLBIN@%$PERLBIN%g
22973 s%@OL_MKDEP@%$OL_MKDEP%g
22974 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
22975 s%@LIBOBJS@%$LIBOBJS%g
22976 s%@LIBSRCS@%$LIBSRCS%g
22977 s%@PLAT@%$PLAT%g
22978 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
22979 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
22980 s%@BUILD_BDB@%$BUILD_BDB%g
22981 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
22982 s%@BUILD_LDAP@%$BUILD_LDAP%g
22983 s%@BUILD_LDBM@%$BUILD_LDBM%g
22984 s%@BUILD_META@%$BUILD_META%g
22985 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
22986 s%@BUILD_NULL@%$BUILD_NULL%g
22987 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
22988 s%@BUILD_PERL@%$BUILD_PERL%g
22989 s%@BUILD_SHELL@%$BUILD_SHELL%g
22990 s%@BUILD_SQL@%$BUILD_SQL%g
22991 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
22992 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
22993 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
22994 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
22995 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
22996 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
22997 s%@BUILD_NULL_DYNAMIC@%$BUILD_NULL_DYNAMIC%g
22998 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
22999 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
23000 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
23001 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
23002 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
23003 s%@LDAP_LIBS@%$LDAP_LIBS%g
23004 s%@LDIF_LIBS@%$LDIF_LIBS%g
23005 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
23006 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
23007 s%@LDBM_LIBS@%$LDBM_LIBS%g
23008 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
23009 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
23010 s%@WRAP_LIBS@%$WRAP_LIBS%g
23011 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
23012 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
23013 s%@SLAPD_NO_STATIC@%$SLAPD_NO_STATIC%g
23014 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
23015 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
23016 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
23017 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
23018 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
23019 s%@KRB4_LIBS@%$KRB4_LIBS%g
23020 s%@KRB5_LIBS@%$KRB5_LIBS%g
23021 s%@READLINE_LIBS@%$READLINE_LIBS%g
23022 s%@SASL_LIBS@%$SASL_LIBS%g
23023 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
23024 s%@TLS_LIBS@%$TLS_LIBS%g
23025 s%@MODULES_LIBS@%$MODULES_LIBS%g
23026 s%@AUTH_LIBS@%$AUTH_LIBS%g
23027 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
23028 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
23029 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
23030 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
23031
23032 CEOF
23033 EOF
23034
23035 cat >> $CONFIG_STATUS <<\EOF
23036
23037 # Split the substitutions into bite-sized pieces for seds with
23038 # small command number limits, like on Digital OSF/1 and HP-UX.
23039 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
23040 ac_file=1 # Number of current file.
23041 ac_beg=1 # First line for current file.
23042 ac_end=$ac_max_sed_cmds # Line after last line for current file.
23043 ac_more_lines=:
23044 ac_sed_cmds=""
23045 while $ac_more_lines; do
23046   if test $ac_beg -gt 1; then
23047     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
23048   else
23049     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
23050   fi
23051   if test ! -s conftest.s$ac_file; then
23052     ac_more_lines=false
23053     rm -f conftest.s$ac_file
23054   else
23055     if test -z "$ac_sed_cmds"; then
23056       ac_sed_cmds="sed -f conftest.s$ac_file"
23057     else
23058       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
23059     fi
23060     ac_file=`expr $ac_file + 1`
23061     ac_beg=$ac_end
23062     ac_end=`expr $ac_end + $ac_max_sed_cmds`
23063   fi
23064 done
23065 if test -z "$ac_sed_cmds"; then
23066   ac_sed_cmds=cat
23067 fi
23068 EOF
23069
23070 cat >> $CONFIG_STATUS <<EOF
23071
23072 CONFIG_FILES=\${CONFIG_FILES-"\
23073 Makefile:build/top.mk:Makefile.in:build/dir.mk \
23074 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
23075 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
23076 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
23077 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
23078 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
23079 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
23080 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
23081 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
23082 include/Makefile:build/top.mk:include/Makefile.in \
23083 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
23084 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
23085 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23086 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
23087 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
23088 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
23089 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
23090 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
23091 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
23092 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
23093 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
23094 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
23095 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
23096 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
23097 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
23098 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
23099 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
23100 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
23101 servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk \
23102 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
23103 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
23104 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
23105 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
23106 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
23107 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
23108 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
23109 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
23110 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
23111 "}
23112 EOF
23113 cat >> $CONFIG_STATUS <<\EOF
23114 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
23115   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23116   case "$ac_file" in
23117   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
23118        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
23119   *) ac_file_in="${ac_file}.in" ;;
23120   esac
23121
23122   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
23123
23124   # Remove last slash and all that follows it.  Not all systems have dirname.
23125   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
23126   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23127     # The file is in a subdirectory.
23128     test ! -d "$ac_dir" && mkdir "$ac_dir"
23129     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
23130     # A "../" for each directory in $ac_dir_suffix.
23131     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
23132   else
23133     ac_dir_suffix= ac_dots=
23134   fi
23135
23136   case "$ac_given_srcdir" in
23137   .)  srcdir=.
23138       if test -z "$ac_dots"; then top_srcdir=.
23139       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
23140   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
23141   *) # Relative path.
23142     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
23143     top_srcdir="$ac_dots$ac_given_srcdir" ;;
23144   esac
23145
23146   case "$ac_given_INSTALL" in
23147   [/$]*) INSTALL="$ac_given_INSTALL" ;;
23148   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
23149   esac
23150
23151   echo creating "$ac_file"
23152   rm -f "$ac_file"
23153   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
23154   case "$ac_file" in
23155   *[Mm]akefile*) ac_comsub="1i\\
23156 # $configure_input" ;;
23157   *) ac_comsub= ;;
23158   esac
23159
23160   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
23161   sed -e "$ac_comsub
23162 s%@configure_input@%$configure_input%g
23163 s%@srcdir@%$srcdir%g
23164 s%@top_srcdir@%$top_srcdir%g
23165 s%@INSTALL@%$INSTALL%g
23166 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
23167 fi; done
23168 rm -f conftest.s*
23169
23170 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23171 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23172 #
23173 # ac_d sets the value in "#define NAME VALUE" lines.
23174 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23175 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
23176 ac_dC='\3'
23177 ac_dD='%g'
23178 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23179 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23180 ac_uB='\([      ]\)%\1#\2define\3'
23181 ac_uC=' '
23182 ac_uD='\4%g'
23183 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23184 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23185 ac_eB='$%\1#\2define\3'
23186 ac_eC=' '
23187 ac_eD='%g'
23188
23189 if test "${CONFIG_HEADERS+set}" != set; then
23190 EOF
23191 cat >> $CONFIG_STATUS <<EOF
23192   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
23193 EOF
23194 cat >> $CONFIG_STATUS <<\EOF
23195 fi
23196 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
23197   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23198   case "$ac_file" in
23199   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
23200        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
23201   *) ac_file_in="${ac_file}.in" ;;
23202   esac
23203
23204   echo creating $ac_file
23205
23206   rm -f conftest.frag conftest.in conftest.out
23207   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
23208   cat $ac_file_inputs > conftest.in
23209
23210 EOF
23211
23212 # Transform confdefs.h into a sed script conftest.vals that substitutes
23213 # the proper values into config.h.in to produce config.h.  And first:
23214 # Protect against being on the right side of a sed subst in config.status.
23215 # Protect against being in an unquoted here document in config.status.
23216 rm -f conftest.vals
23217 cat > conftest.hdr <<\EOF
23218 s/[\\&%]/\\&/g
23219 s%[\\$`]%\\&%g
23220 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
23221 s%ac_d%ac_u%gp
23222 s%ac_u%ac_e%gp
23223 EOF
23224 sed -n -f conftest.hdr confdefs.h > conftest.vals
23225 rm -f conftest.hdr
23226
23227 # This sed command replaces #undef with comments.  This is necessary, for
23228 # example, in the case of _POSIX_SOURCE, which is predefined and required
23229 # on some systems where configure will not decide to define it.
23230 cat >> conftest.vals <<\EOF
23231 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
23232 EOF
23233
23234 # Break up conftest.vals because some shells have a limit on
23235 # the size of here documents, and old seds have small limits too.
23236
23237 rm -f conftest.tail
23238 while :
23239 do
23240   ac_lines=`grep -c . conftest.vals`
23241   # grep -c gives empty output for an empty file on some AIX systems.
23242   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
23243   # Write a limited-size here document to conftest.frag.
23244   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
23245   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
23246   echo 'CEOF
23247   sed -f conftest.frag conftest.in > conftest.out
23248   rm -f conftest.in
23249   mv conftest.out conftest.in
23250 ' >> $CONFIG_STATUS
23251   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
23252   rm -f conftest.vals
23253   mv conftest.tail conftest.vals
23254 done
23255 rm -f conftest.vals
23256
23257 cat >> $CONFIG_STATUS <<\EOF
23258   rm -f conftest.frag conftest.h
23259   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
23260   cat conftest.in >> conftest.h
23261   rm -f conftest.in
23262   if cmp -s $ac_file conftest.h 2>/dev/null; then
23263     echo "$ac_file is unchanged"
23264     rm -f conftest.h
23265   else
23266     # Remove last slash and all that follows it.  Not all systems have dirname.
23267       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
23268       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23269       # The file is in a subdirectory.
23270       test ! -d "$ac_dir" && mkdir "$ac_dir"
23271     fi
23272     rm -f $ac_file
23273     mv conftest.h $ac_file
23274   fi
23275 fi; done
23276
23277 EOF
23278 cat >> $CONFIG_STATUS <<EOF
23279
23280 EOF
23281 cat >> $CONFIG_STATUS <<\EOF
23282
23283 date > stamp-h
23284 echo Please run \"make depend\" to build dependencies
23285
23286 exit 0
23287 EOF
23288 chmod +x $CONFIG_STATUS
23289 rm -fr confdefs* $ac_clean_files
23290 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
23291