]> git.sur5r.net Git - openldap/commitdiff
Initial round of changes for 2.3 beta
authorKurt Zeilenga <kurt@openldap.org>
Fri, 29 Apr 2005 23:28:51 +0000 (23:28 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 29 Apr 2005 23:28:51 +0000 (23:28 +0000)
280 files changed:
build/dir.mk
build/info.mk
build/lib-shared.mk
build/lib-static.mk
build/lib.mk
build/man.mk
build/mkrelease
build/mod.mk
build/openldap.m4
build/rules.mk
build/srv.mk
build/top.mk
build/version.var
clients/tools/common.c
clients/tools/common.h
clients/tools/ldapcompare.c
clients/tools/ldapdelete.c
clients/tools/ldapmodify.c
clients/tools/ldapmodrdn.c
clients/tools/ldappasswd.c
clients/tools/ldapsearch.c
clients/tools/ldapwhoami.c
configure
configure.in
contrib/README
contrib/ldapc++/Makefile.in
contrib/ldapc++/aclocal.m4
contrib/ldapc++/config.guess
contrib/ldapc++/config.sub
contrib/ldapc++/configure
contrib/ldapc++/examples/Makefile.am
contrib/ldapc++/examples/Makefile.in
contrib/ldapc++/examples/readSchema.cpp [new file with mode: 0644]
contrib/ldapc++/ltmain.sh
contrib/ldapc++/src/LDAPAsynConnection.cpp
contrib/ldapc++/src/LDAPAsynConnection.h
contrib/ldapc++/src/LDAPAttrType.cpp
contrib/ldapc++/src/LDAPAttrType.h
contrib/ldapc++/src/LDAPConnection.cpp
contrib/ldapc++/src/LDAPConnection.h
contrib/ldapc++/src/LDAPException.cpp
contrib/ldapc++/src/Makefile.am
contrib/ldapc++/src/Makefile.in
contrib/slapd-modules/comp_match/Makefile
contrib/slapd-modules/comp_match/crl.c [new file with mode: 0644]
contrib/slapd-modules/comp_match/crl.h [new file with mode: 0644]
contrib/slapd-modules/smbk5pwd/smbk5pwd.c
doc/devel/args
doc/devel/todo
doc/man/man1/ldapcompare.1
doc/man/man1/ldapdelete.1
doc/man/man1/ldapmodify.1
doc/man/man1/ldapmodrdn.1
doc/man/man1/ldappasswd.1
doc/man/man1/ldapsearch.1
doc/man/man1/ldapwhoami.1
doc/man/man5/slapd-bdb.5
doc/man/man5/slapd-dnssrv.5
doc/man/man5/slapd-ldap.5
doc/man/man5/slapd-ldbm.5
doc/man/man5/slapd-ldif.5 [new file with mode: 0644]
doc/man/man5/slapd-meta.5
doc/man/man5/slapd-monitor.5
doc/man/man5/slapd-null.5
doc/man/man5/slapd-passwd.5
doc/man/man5/slapd-perl.5
doc/man/man5/slapd-relay.5
doc/man/man5/slapd-shell.5
doc/man/man5/slapd-sql.5
doc/man/man5/slapd.access.5
doc/man/man5/slapd.conf.5
doc/man/man5/slapo-dynlist.5 [new file with mode: 0644]
doc/man/man5/slapo-pcache.5
doc/man/man5/slapo-ppolicy.5
doc/man/man8/slapacl.8
doc/man/man8/slapd.8
doc/man/man8/slapdn.8
doc/man/man8/slaptest.8
include/lber.h
include/lber_pvt.h
include/ldap.h
include/ldap_pvt_thread.h
include/ldap_rq.h
include/ldif.h
include/lutil.h
include/portable.h.in
libraries/liblber/memory.c
libraries/libldap/cyrus.c
libraries/libldap/init.c
libraries/libldap/open.c
libraries/libldap/os-ip.c
libraries/libldap_r/rq.c
libraries/libldap_r/thr_posix.c
libraries/libldap_r/thr_pth.c
libraries/libldap_r/tpool.c
libraries/liblutil/ldif.c
servers/slapd/Makefile.in
servers/slapd/abandon.c
servers/slapd/acl.c
servers/slapd/aclparse.c
servers/slapd/add.c
servers/slapd/at.c
servers/slapd/attr.c
servers/slapd/ava.c
servers/slapd/back-bdb/Makefile.in
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/alock.c [new file with mode: 0644]
servers/slapd/back-bdb/alock.h [new file with mode: 0644]
servers/slapd/back-bdb/attr.c
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/compare.c
servers/slapd/back-bdb/config.c
servers/slapd/back-bdb/dbcache.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/dn2entry.c
servers/slapd/back-bdb/dn2id.c
servers/slapd/back-bdb/error.c
servers/slapd/back-bdb/filterindex.c
servers/slapd/back-bdb/id2entry.c
servers/slapd/back-bdb/idl.c
servers/slapd/back-bdb/index.c
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-bdb/proto-bdb.h
servers/slapd/back-bdb/search.c
servers/slapd/back-bdb/tools.c
servers/slapd/back-dnssrv/bind.c
servers/slapd/back-dnssrv/init.c
servers/slapd/back-dnssrv/referral.c
servers/slapd/back-dnssrv/search.c
servers/slapd/back-hdb/Makefile.in
servers/slapd/back-ldap/back-ldap.h
servers/slapd/back-ldap/bind.c
servers/slapd/back-ldap/chain.c
servers/slapd/back-ldap/config.c
servers/slapd/back-ldap/init.c
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/back-ldbm.h
servers/slapd/back-ldbm/close.c
servers/slapd/back-ldbm/dbcache.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/entry.c
servers/slapd/back-ldbm/init.c
servers/slapd/back-ldbm/modrdn.c
servers/slapd/back-ldbm/proto-back-ldbm.h
servers/slapd/back-ldbm/search.c
servers/slapd/back-ldif/ldif.c
servers/slapd/back-meta/add.c
servers/slapd/back-meta/back-meta.h
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/candidates.c
servers/slapd/back-meta/compare.c
servers/slapd/back-meta/config.c
servers/slapd/back-meta/conn.c
servers/slapd/back-meta/delete.c
servers/slapd/back-meta/dncache.c
servers/slapd/back-meta/init.c
servers/slapd/back-meta/map.c
servers/slapd/back-meta/modify.c
servers/slapd/back-meta/modrdn.c
servers/slapd/back-meta/search.c
servers/slapd/back-meta/unbind.c
servers/slapd/back-monitor/back-monitor.h
servers/slapd/back-monitor/backend.c
servers/slapd/back-monitor/bind.c
servers/slapd/back-monitor/cache.c
servers/slapd/back-monitor/compare.c
servers/slapd/back-monitor/conn.c
servers/slapd/back-monitor/database.c
servers/slapd/back-monitor/entry.c
servers/slapd/back-monitor/init.c
servers/slapd/back-monitor/listener.c
servers/slapd/back-monitor/log.c
servers/slapd/back-monitor/modify.c
servers/slapd/back-monitor/operation.c
servers/slapd/back-monitor/overlay.c
servers/slapd/back-monitor/proto-back-monitor.h
servers/slapd/back-monitor/rww.c
servers/slapd/back-monitor/search.c
servers/slapd/back-monitor/sent.c
servers/slapd/back-monitor/thread.c
servers/slapd/back-monitor/time.c
servers/slapd/back-passwd/init.c
servers/slapd/back-passwd/proto-passwd.h
servers/slapd/back-passwd/search.c
servers/slapd/back-shell/add.c
servers/slapd/back-shell/delete.c
servers/slapd/back-shell/modrdn.c
servers/slapd/back-sql/add.c
servers/slapd/back-sql/delete.c
servers/slapd/back-sql/entry-id.c
servers/slapd/back-sql/modrdn.c
servers/slapd/back-sql/schema-map.c
servers/slapd/backend.c
servers/slapd/backover.c
servers/slapd/bconfig.c
servers/slapd/cancel.c
servers/slapd/compare.c
servers/slapd/config.c
servers/slapd/config.h
servers/slapd/connection.c
servers/slapd/controls.c
servers/slapd/cr.c
servers/slapd/daemon.c
servers/slapd/dn.c
servers/slapd/filterentry.c
servers/slapd/init.c
servers/slapd/main.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/mods.c
servers/slapd/oc.c
servers/slapd/oidm.c
servers/slapd/operation.c
servers/slapd/operational.c
servers/slapd/overlays/Makefile.in
servers/slapd/overlays/dynlist.c [new file with mode: 0644]
servers/slapd/overlays/glue.c
servers/slapd/overlays/lastmod.c
servers/slapd/overlays/overlays.c
servers/slapd/overlays/pcache.c
servers/slapd/overlays/ppolicy.c
servers/slapd/overlays/refint.c
servers/slapd/overlays/rwmdn.c
servers/slapd/overlays/rwmmap.c
servers/slapd/overlays/syncprov.c
servers/slapd/overlays/translucent.c
servers/slapd/proto-slap.h
servers/slapd/result.c
servers/slapd/root_dse.c
servers/slapd/sasl.c
servers/slapd/saslauthz.c
servers/slapd/schema/core.schema
servers/slapd/schema/ppolicy.schema
servers/slapd/schema_check.c
servers/slapd/schema_init.c
servers/slapd/schema_prep.c
servers/slapd/schemaparse.c
servers/slapd/slap.h
servers/slapd/slapacl.c
servers/slapd/slapadd.c
servers/slapd/slapcommon.c
servers/slapd/slapcommon.h
servers/slapd/slapdn.c
servers/slapd/slapi/slapi_utils.c
servers/slapd/syncrepl.c
servers/slapd/unbind.c
servers/slapd/value.c
tests/data/acl.out.master
tests/data/dn.out
tests/data/gluesync.out [new file with mode: 0644]
tests/data/meta.out [new file with mode: 0644]
tests/data/metaconcurrency.out [new file with mode: 0644]
tests/data/ppolicy.ldif
tests/data/slapd-acl.conf
tests/data/slapd-emptydn.conf
tests/data/slapd-glue-syncrepl1.conf [new file with mode: 0644]
tests/data/slapd-glue-syncrepl2.conf [new file with mode: 0644]
tests/data/slapd-meta.conf [new file with mode: 0644]
tests/data/slapd-meta2.conf [new file with mode: 0644]
tests/data/slapd-translucent-local.conf
tests/data/slapd-translucent-remote.conf
tests/data/test-meta.ldif [new file with mode: 0644]
tests/progs/slapd-addel.c
tests/progs/slapd-modify.c
tests/progs/slapd-modrdn.c
tests/progs/slapd-read.c
tests/progs/slapd-search.c
tests/progs/slapd-tester.c
tests/scripts/defines.sh
tests/scripts/relay
tests/scripts/test005-modrdn
tests/scripts/test006-acls
tests/scripts/test022-ppolicy
tests/scripts/test026-dn
tests/scripts/test027-emptydn
tests/scripts/test035-meta [new file with mode: 0755]
tests/scripts/test036-meta-concurrency [new file with mode: 0755]

index 8f7b434a5d9397ac97e7145c8e895021759b6b95..f56446bac421773cbc8a4d3c46556385ada9cf89 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index 2857d4431addf3deb15e02af4442c4016daa4c56..ae7286e78d8a489907128bda8e2cdbf21d68b64a 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index a77a64ab0742adba5a97bce29ee660005a64a157..3224867d4ce87c27f47d1c58c05b0500c5404f86 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index 3111f75d25b6cadc143db5099dee57fc179b5f85..85eab2a8d37eae2307e4a3f788cc751b22b1fcc4 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index f467ae3f3762bd28644cb85b764e2987508ad4d3..4694f85fdd1256f0d69881c37b902d5d965e2b15 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index 0e113f634a5555f337a3e9780758787222adea8e..6d25337bdb47148b939455c5729c228cbe70cad4 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index dcd32b2105816a51410da6327a5a0968fa5a639d..0b8554061ea084eff31a8c05996453aa3e1d15bc 100755 (executable)
@@ -64,6 +64,7 @@ echo "Rolling up $OL_STRING ..."
 tar cf $RELNAME.tar $RELNAME
 gzip -9 -c $RELNAME.tar > $RELNAME.tgz
 md5 $RELNAME.tgz > $RELNAME.md5
+sha1 $RELNAME.tgz > $RELNAME.sha1
 rm -f $RELNAME.tar
 
 ls -l $RELNAME.*
index 9ee55b3c010c51626367a69f8971f551641ae23e..eb04de59ea09ab490740dd3a96a64df2faa1e28b 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index 6ca7b6a552d8ca4c8d70b79bb6b91a5ade10ca8d..c69f1246f2704574ba59fecdeadbb791b3917510 100644 (file)
@@ -247,6 +247,75 @@ fi
 ])
 dnl
 dnl ====================================================================
+dnl DNS resolver macros
+AC_DEFUN([OL_RESOLVER_TRY],
+[if test $ol_cv_lib_resolver = no ; then
+       AC_CACHE_CHECK([for resolver link (]ifelse($2,,default,$2)[)],[$1],
+[
+       ol_RESOLVER_LIB=ifelse($2,,,$2)
+       ol_LIBS=$LIBS
+       LIBS="$ol_RESOLVER_LIB $LIBS"
+
+       AC_TRY_LINK([
+#ifdef HAVE_SYS_TYPES_H
+#      include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+#      include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#      include <resolv.h>
+#endif
+],[{
+       int len, status;
+       char *request = NULL;
+       unsigned char reply[64*1024];
+       unsigned char host[64*1024];
+       unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
+#else
+       /* Bind 4 interface */
+# ifndef T_SRV
+#  define T_SRV 33
+# endif
+       len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+       p = reply;
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+       /* Bind 4 interface w/ HFIXEDSZ */
+       p += HFIXEDSZ;
+#else
+       /* Bind 4 interface w/o HFIXEDSZ */
+       p += sizeof(HEADER);
+#endif
+       status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}],[$1=yes],[$1=no])
+
+       LIBS="$ol_LIBS"
+])
+
+       if test $$1 = yes ; then
+               ol_cv_lib_resolver=ifelse($2,,yes,$2)
+       fi
+fi
+])
+dnl --------------------------------------------------------------------
+dnl Try to locate appropriate library
+AC_DEFUN([OL_RESOLVER_LINK],
+[ol_cv_lib_resolver=no
+OL_RESOLVER_TRY(ol_cv_resolver_none)
+OL_RESOLVER_TRY(ol_cv_resolver_resolv,[-lresolv])
+OL_RESOLVER_TRY(ol_cv_resolver_bind,[-lbind])
+])
+dnl
+dnl ====================================================================
 dnl Berkeley DB macros
 dnl
 dnl --------------------------------------------------------------------
index 3e411c5bc064e1eb96c3f5c80180f1b3b7215c36..ec0114afe606c7f702614b037f4e7dc4359be901 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index b735c374fc72adf75fd3a31da143b54347c11fe5..06e9ee9dbf051a460070a169a1bc21a26ebf654a 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index 58b250d924133e86250a21cb5f4e00185e93059d..82e3ff1db9d3fae791d4117bee25e90515333a0d 100644 (file)
@@ -1,4 +1,6 @@
 # $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
 ## Copyright 1998-2005 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
index e283bb9b384de10b8e9db045a129eea858624bd5..d79d7657c058c43d13990593f5a7df98cf67214f 100644 (file)
@@ -15,7 +15,7 @@
 ol_package=OpenLDAP
 ol_major=2
 ol_minor=3
-ol_patch=2beta
+ol_patch=X
 ol_api_inc=20302
 ol_api_current=0
 ol_api_revision=2
index 39c6586d30e6d352124c66f775f11e17173c0162..083fbcdf8f0fe5b6e9350dadf62205a63aa9db5a 100644 (file)
@@ -86,6 +86,15 @@ static int chainingResolve = -1;
 static int chainingContinuation = -1;
 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
 
+static int gotintr;
+static int abcan;
+
+RETSIGTYPE
+do_sig( int sig )
+{
+       gotintr = abcan;
+}
+
 /* Set in main() */
 char *prog = NULL;
 
@@ -97,6 +106,17 @@ tool_init( void )
        ldap_pvt_textdomain(OPENLDAP_PACKAGE);
 }
 
+void
+tool_destroy( void )
+{
+#ifdef HAVE_CYRUS_SASL
+       sasl_done();
+#endif
+#ifdef HAVE_TLS
+       ldap_pvt_tls_destroy();
+#endif
+}
+
 void
 tool_common_usage( void )
 {
@@ -108,18 +128,19 @@ N_("  -D binddn  bind DN\n"),
 N_("  -e [!]<ext>[=<extparam>] general extensions (! indicates criticality)\n")
 N_("             [!]assert=<filter>     (an RFC 2254 Filter)\n")
 N_("             [!]authzid=<authzid>   (\"dn:<dn>\" or \"u:<user>\")\n")
-N_("             [!]manageDSAit\n")
-N_("             [!]noop\n")
-#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
-N_("             ppolicy\n")
-#endif
 #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
 N_("             [!]chaining[=<resolveBehavior>[/<continuationBehavior>]]\n")
 N_("                     one of \"chainingPreferred\", \"chainingRequired\",\n")
 N_("                     \"referralsPreferred\", \"referralsRequired\"\n")
 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
+N_("             [!]manageDSAit\n")
+N_("             [!]noop\n")
+#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
+N_("             ppolicy\n")
+#endif
 N_("             [!]postread[=<attrs>]  (a comma-separated attribute list)\n")
 N_("             [!]preread[=<attrs>]   (a comma-separated attribute list)\n"),
+N_("             abandon, cancel (SIGINT sends abandon/cancel (not really controls)\n")
 N_("  -f file    read operations from `file'\n"),
 N_("  -h host    LDAP server\n"),
 N_("  -H URI     LDAP Uniform Resource Indentifier(s)\n"),
@@ -343,6 +364,13 @@ tool_args( int argc, char **argv )
                                }
 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
 
+                       /* this shouldn't go here, really; but it's a feature... */
+                       } else if ( strcasecmp( control, "abandon" ) == 0 ) {
+                               abcan = LDAP_REQ_ABANDON;
+
+                       } else if ( strcasecmp( control, "cancel" ) == 0 ) {
+                               abcan = LDAP_REQ_EXTENDED;
+
                        } else {
                                fprintf( stderr, "Invalid general control name: %s\n",
                                        control );
@@ -631,28 +659,28 @@ tool_args( int argc, char **argv )
 
                if (api.ldapai_info_version != LDAP_API_INFO_VERSION) {
                        fprintf( stderr, "LDAP APIInfo version mismatch: "
-                               "got %d, expected %d\n",
+                               "library %d, header %d\n",
                                api.ldapai_info_version, LDAP_API_INFO_VERSION );
                        exit( EXIT_FAILURE );
                }
 
                if( api.ldapai_api_version != LDAP_API_VERSION ) {
                        fprintf( stderr, "LDAP API version mismatch: "
-                               "got %d, expected %d\n",
+                               "library %d, header %d\n",
                                api.ldapai_api_version, LDAP_API_VERSION );
                        exit( EXIT_FAILURE );
                }
 
                if( strcmp(api.ldapai_vendor_name, LDAP_VENDOR_NAME ) != 0 ) {
                        fprintf( stderr, "LDAP vendor name mismatch: "
-                               "got %s, expected %s\n",
+                               "library %s, header %s\n",
                                api.ldapai_vendor_name, LDAP_VENDOR_NAME );
                        exit( EXIT_FAILURE );
                }
 
                if( api.ldapai_vendor_version != LDAP_VENDOR_VERSION ) {
                        fprintf( stderr, "LDAP vendor version mismatch: "
-                               "got %d, expected %d\n",
+                               "library %d, header %d\n",
                                api.ldapai_vendor_version, LDAP_VENDOR_VERSION );
                        exit( EXIT_FAILURE );
                }
@@ -745,6 +773,10 @@ tool_conn_setup( int not, void (*private_setup)( LDAP * ) )
        (void) SIGNAL( SIGPIPE, SIG_IGN );
 #endif
 
+       if ( abcan ) {
+               SIGNAL( SIGINT, do_sig );
+       }
+
        if ( !not ) {
                int rc;
 
@@ -918,6 +950,18 @@ tool_bind( LDAP *ld )
        }
 }
 
+void
+tool_unbind( LDAP *ld )
+{
+       int err = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, NULL );
+
+       if ( err != LDAP_OPT_SUCCESS ) {
+               fprintf( stderr, "Could not unset controls\n");
+       }
+
+       (void) ldap_unbind_ext( ld, NULL, NULL );
+}
+
 
 /* Set server controls.  Add controls extra_c[0..count-1], if set. */
 void
@@ -1112,3 +1156,26 @@ tool_server_controls( LDAP *ld, LDAPControl *extra_c, int count )
                exit( EXIT_FAILURE );
        }
 }
+
+int
+tool_check_abandon( LDAP *ld, int msgid )
+{
+       int     rc;
+
+       switch ( gotintr ) {
+       case LDAP_REQ_EXTENDED:
+               rc = ldap_cancel_s( ld, msgid, NULL, NULL );
+               fprintf( stderr, "got interrupt, cancel got %d: %s\n",
+                               rc, ldap_err2string( rc ) );
+               return -1;
+
+       case LDAP_REQ_ABANDON:
+               rc = ldap_abandon( ld, msgid );
+               fprintf( stderr, "got interrupt, abandon got %d: %s\n",
+                               rc, ldap_err2string( rc ) );
+               return -1;
+       }
+
+       return 0;
+}
+
index d6903ac9f9a6dd6cfa64dec0533a54ff3b7bfccc..dad3108c02b8cf740da164810ef43e3d5199cdfb 100644 (file)
@@ -77,7 +77,10 @@ void tool_common_usage LDAP_P(( void ));
 void tool_args LDAP_P(( int, char ** ));
 LDAP *tool_conn_setup LDAP_P(( int dont, void (*private_setup)( LDAP * ) ));
 void tool_bind LDAP_P(( LDAP * ));
+void tool_unbind LDAP_P(( LDAP * ));
+void tool_destroy LDAP_P(( void ));
 void tool_server_controls LDAP_P(( LDAP *, LDAPControl *, int ));
+int tool_check_abandon LDAP_P(( LDAP *ld, int msgid ));
 
 LDAP_END_DECL
 
index 7023e9b63d1d6f9eefca3c16896dc34a1efcb6b4..a7a20a4f1487bb0078f6e3a7c6c9f33cfeb8d7ac 100644 (file)
@@ -217,8 +217,8 @@ main( int argc, char **argv )
 
        free( bvalue.bv_val );
 
-       ldap_unbind_ext( ld, NULL, NULL );
-
+       tool_unbind( ld );
+       tool_destroy();
        return rc;
 }
 
@@ -232,27 +232,88 @@ static int docompare(
        LDAPControl **sctrls,
        LDAPControl **cctrls )
 {
-       int                     rc;
+       int             rc, msgid, code;
+       LDAPMessage     *res;
+       char            *matcheddn;
+       char            *text;
+       char            **refs;
 
        if ( not ) {
                return LDAP_SUCCESS;
        }
 
-       rc = ldap_compare_ext_s( ld, dn, attr, bvalue,
-               sctrls, cctrls );
+       rc = ldap_compare_ext( ld, dn, attr, bvalue,
+               sctrls, cctrls, &msgid );
+       if ( rc == -1 ) {
+               return( rc );
+       }
+
+       for ( ; ; ) {
+               struct timeval  tv;
+
+               tv.tv_sec = 0;
+               tv.tv_usec = 100000;
+
+               if ( tool_check_abandon( ld, msgid ) ) {
+                       return LDAP_CANCELLED;
+               }
+
+               rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, &tv, &res );
+               if ( rc < 0 ) {
+                       ldap_perror( ld, "ldapcompare: ldap_result" );
+                       return rc;
+               }
+
+               if ( rc != 0 ) {
+                       break;
+               }
+       }
+
+       rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, NULL, 1 );
+
+       if( rc != LDAP_SUCCESS ) {
+               fprintf( stderr, "%s: ldap_parse_result: %s (%d)\n",
+                       prog, ldap_err2string( rc ), rc );
+               return rc;
+       }
+
+       if ( !quiet && ( verbose || ( code != LDAP_SUCCESS && code != LDAP_COMPARE_TRUE && code != LDAP_COMPARE_FALSE )||
+               (matcheddn && *matcheddn) || (text && *text) || (refs && *refs) ) )
+       {
+               printf( _("Compare Result: %s (%d)\n"),
+                       ldap_err2string( code ), code );
+
+               if( text && *text ) {
+                       printf( _("Additional info: %s\n"), text );
+               }
+
+               if( matcheddn && *matcheddn ) {
+                       printf( _("Matched DN: %s\n"), matcheddn );
+               }
+
+               if( refs ) {
+                       int i;
+                       for( i=0; refs[i]; i++ ) {
+                               printf(_("Referral: %s\n"), refs[i] );
+                       }
+               }
+       }
+
+       ber_memfree( text );
+       ber_memfree( matcheddn );
+       ber_memvfree( (void **) refs );
 
        /* if we were told to be quiet, use the return value. */
        if ( !quiet ) {
-               if ( rc == LDAP_COMPARE_TRUE ) {
+               if ( code == LDAP_COMPARE_TRUE ) {
                        printf(_("TRUE\n"));
-               } else if ( rc == LDAP_COMPARE_FALSE ) {
+               } else if ( code == LDAP_COMPARE_FALSE ) {
                        printf(_("FALSE\n"));
                } else {
                        printf(_("UNDEFINED\n"));
-                       ldap_perror( ld, "ldap_compare" );
                }
        }
 
-       return( rc );
+       return( code );
 }
 
index 4617aa502525876b7cf3319b4f29fd4696a2f332..526cd25cd70a912434c0fbab63a32440c0eea4f2 100644 (file)
@@ -39,6 +39,7 @@
 #include <ac/ctype.h>
 #include <ac/string.h>
 #include <ac/unistd.h>
+#include <ac/time.h>
 
 #include <ldap.h>
 #include "lutil.h"
@@ -197,9 +198,9 @@ main( int argc, char **argv )
                }
        }
 
-       ldap_unbind_ext( ld, NULL, NULL );
-
-    return( retval );
+       tool_unbind( ld );
+       tool_destroy();
+    return retval;
 }
 
 
@@ -233,10 +234,25 @@ static int dodelete(
                return rc;
        }
 
-       rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res );
-       if ( rc < 0 ) {
-               ldap_perror( ld, "ldapdelete: ldap_result" );
-               return rc;
+       for ( ; ; ) {
+               struct timeval tv;
+
+               if ( tool_check_abandon( ld, id ) ) {
+                       return LDAP_CANCELLED;
+               }
+
+               tv.tv_sec = 0;
+               tv.tv_usec = 100000;
+
+               rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, &tv, &res );
+               if ( rc < 0 ) {
+                       ldap_perror( ld, "ldapdelete: ldap_result" );
+                       return rc;
+               }
+
+               if ( rc != 0 ) {
+                       break;
+               }
        }
 
        rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, NULL, 1 );
@@ -250,7 +266,8 @@ static int dodelete(
        if( verbose || code != LDAP_SUCCESS ||
                (matcheddn && *matcheddn) || (text && *text) || (refs && *refs) )
        {
-               printf( _("Delete Result: %s (%d)\n"), ldap_err2string( code ), code );
+               printf( _("Delete Result: %s (%d)\n"),
+                       ldap_err2string( code ), code );
 
                if( text && *text ) {
                        printf( _("Additional info: %s\n"), text );
index 646f50d778a05a4ab853fd7e63014b0ce69e102e..f4da605fb7f9a13c20d1c1418bfa6f6c9b6e63eb 100644 (file)
@@ -405,13 +405,14 @@ main( int argc, char **argv )
 #endif
 
        if ( !not ) {
-               ldap_unbind_ext( ld, NULL, NULL );
+               tool_unbind( ld );
        }
 
        if ( rejfp != NULL ) {
                fclose( rejfp );
        }
 
+       tool_destroy();
        return( retval );
 }
 
@@ -1009,7 +1010,7 @@ domodify(
        }
 
        if ( !not ) {
-               int msgid;
+               int     msgid;
                if ( newentry ) {
                        rc = ldap_add_ext( ld, dn, pmods, pctrls, NULL, &msgid );
                } else {
@@ -1113,21 +1114,37 @@ static int process_response(
        const char *opstr,
        const char *dn )
 {
-       LDAPMessage *res;
-       int rc = LDAP_OTHER;
+       LDAPMessage     *res;
+       int             rc = LDAP_OTHER;
+       struct timeval  tv = { 0 };
 
-       if( ldap_result( ld, msgid,
+       for ( ; ; ) {
+               tv.tv_sec = 0;
+               tv.tv_usec = 100000;
+
+               rc = ldap_result( ld, msgid,
 #ifdef LDAP_GROUP_TRANSACTION
-               txn ? 0 : 1,
+                       txn ? 0 : 1,
 #else
-               1,
+                       1,
 #endif
-               NULL, &res ) == -1 ) {
-               ldap_get_option( ld, LDAP_OPT_ERROR_NUMBER, &rc );
-               return rc;
+                       &tv, &res );
+               if ( tool_check_abandon( ld, msgid ) ) {
+                       return LDAP_CANCELLED;
+               }
+
+               if ( rc == -1 ) {
+                       ldap_get_option( ld, LDAP_OPT_ERROR_NUMBER, &rc );
+                       return rc;
+               }
+
+               if ( rc != 0 ) {
+                       break;
+               }
        }
 
-       if( ldap_msgtype( res ) != LDAP_RES_INTERMEDIATE ) {
+done:;
+       if ( ldap_msgtype( res ) != LDAP_RES_INTERMEDIATE ) {
                rc = ldap_result2error( ld, res, 1 );
                if( rc != LDAP_SUCCESS ) ldap_perror( ld, opstr );
                return rc;
index 827a372d251377e78bdd1420c66d64a3c99fcd00..33c4b2934e3cfcbaf2d257c73f429799b165ca50 100644 (file)
@@ -52,6 +52,7 @@
 #include <ac/ctype.h>
 #include <ac/string.h>
 #include <ac/unistd.h>
+#include <ac/time.h>
 
 #include <ldap.h>
 #include "lutil.h"
@@ -227,8 +228,8 @@ main(int argc, char **argv)
        }
     }
 
-       ldap_unbind_ext( ld, NULL, NULL );
-
+       tool_unbind( ld );
+       tool_destroy();
     return( retval );
 }
 
@@ -263,10 +264,25 @@ static int domodrdn(
                return rc;
        }
 
-       rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res );
-       if ( rc < 0 ) {
-               ldap_perror( ld, "ldapmodrdn: ldap_result" );
-               return rc;
+       for ( ; ; ) {
+               struct timeval  tv = { 0 };
+
+               if ( tool_check_abandon( ld, id ) ) {
+                       return LDAP_CANCELLED;
+               }
+
+               tv.tv_sec = 0;
+               tv.tv_usec = 100000;
+
+               rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, &tv, &res );
+               if ( rc < 0 ) {
+                       ldap_perror( ld, "ldapmodrdn: ldap_result" );
+                       return rc;
+               }
+
+               if ( rc != 0 ) {
+                       break;
+               }
        }
 
        rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, NULL, 1 );
index 145b87fde35c1c28266412dca0275b9e68a68dfb..31556695c0f310e4bbeeb7a6566bfc41ff59d7ec 100644 (file)
@@ -196,7 +196,10 @@ main( int argc, char *argv[] )
 
        if( oldpwfile ) {
                rc = lutil_get_filed_password( oldpwfile, &oldpw );
-               if( rc ) return EXIT_FAILURE;
+               if( rc ) {
+                       rc = EXIT_FAILURE;
+                       goto done;
+               }
        }
 
        if( want_oldpw && oldpw.bv_val == NULL ) {
@@ -209,7 +212,8 @@ main( int argc, char *argv[] )
                        strcmp( oldpw.bv_val, ckoldpw ))
                {
                        fprintf( stderr, _("passwords do not match\n") );
-                       return EXIT_FAILURE;
+                       rc = EXIT_FAILURE;
+                       goto done;
                }
 
                oldpw.bv_len = strlen( oldpw.bv_val );
@@ -217,7 +221,10 @@ main( int argc, char *argv[] )
 
        if( newpwfile ) {
                rc = lutil_get_filed_password( newpwfile, &newpw );
-               if( rc ) return EXIT_FAILURE;
+               if( rc ) {
+                       rc = EXIT_FAILURE;
+                       goto done;
+               }
        }
 
        if( want_newpw && newpw.bv_val == NULL ) {
@@ -230,7 +237,8 @@ main( int argc, char *argv[] )
                        strcmp( newpw.bv_val, cknewpw ))
                {
                        fprintf( stderr, _("passwords do not match\n") );
-                       return EXIT_FAILURE;
+                       rc = EXIT_FAILURE;
+                       goto done;
                }
 
                newpw.bv_len = strlen( newpw.bv_val );
@@ -238,7 +246,10 @@ main( int argc, char *argv[] )
 
        if ( pw_file ) {
                rc = lutil_get_filed_password( pw_file, &passwd );
-               if( rc ) return EXIT_FAILURE;
+               if( rc ) {
+                       rc = EXIT_FAILURE;
+                       goto done;
+               }
 
        } else if ( want_bindpw ) {
                passwd.bv_val = getpassphrase( _("Enter LDAP Password: ") );
@@ -259,8 +270,8 @@ main( int argc, char *argv[] )
 
                if( ber == NULL ) {
                        perror( "ber_alloc_t" );
-                       ldap_unbind_ext( ld, NULL, NULL );
-                       return EXIT_FAILURE;
+                       rc = EXIT_FAILURE;
+                       goto done;
                }
 
                ber_printf( ber, "{" /*}*/ );
@@ -289,14 +300,14 @@ main( int argc, char *argv[] )
 
                if( rc < 0 ) {
                        perror( "ber_flatten2" );
-                       ldap_unbind_ext( ld, NULL, NULL );
-                       return EXIT_FAILURE;
+                       rc = EXIT_FAILURE;
+                       goto done;
                }
        }
 
        if ( not ) {
                rc = LDAP_SUCCESS;
-               goto skip;
+               goto done;
        }
 
        rc = ldap_extended_operation( ld,
@@ -307,14 +318,29 @@ main( int argc, char *argv[] )
 
        if( rc != LDAP_SUCCESS ) {
                ldap_perror( ld, "ldap_extended_operation" );
-               ldap_unbind_ext( ld, NULL, NULL );
-               return EXIT_FAILURE;
+               rc = EXIT_FAILURE;
+               goto done;
        }
 
-       rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res );
-       if ( rc < 0 ) {
-               ldap_perror( ld, "ldappasswd: ldap_result" );
-               return rc;
+       for ( ; ; ) {
+               struct timeval  tv;
+
+               if ( tool_check_abandon( ld, id ) ) {
+                       return LDAP_CANCELLED;
+               }
+
+               tv.tv_sec = 0;
+               tv.tv_usec = 100000;
+
+               rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, &tv, &res );
+               if ( rc < 0 ) {
+                       ldap_perror( ld, "ldappasswd: ldap_result" );
+                       return rc;
+               }
+
+               if ( rc != 0 ) {
+                       break;
+               }
        }
 
        rc = ldap_parse_result( ld, res,
@@ -322,14 +348,16 @@ main( int argc, char *argv[] )
 
        if( rc != LDAP_SUCCESS ) {
                ldap_perror( ld, "ldap_parse_result" );
-               return rc;
+               rc = EXIT_FAILURE;
+               goto done;
        }
 
        rc = ldap_parse_extended_result( ld, res, &retoid, &retdata, 1 );
 
        if( rc != LDAP_SUCCESS ) {
                ldap_perror( ld, "ldap_parse_result" );
-               return rc;
+               rc = EXIT_FAILURE;
+               goto done;
        }
 
        if( retdata != NULL ) {
@@ -339,8 +367,8 @@ main( int argc, char *argv[] )
 
                if( ber == NULL ) {
                        perror( "ber_init" );
-                       ldap_unbind_ext( ld, NULL, NULL );
-                       return EXIT_FAILURE;
+                       rc = EXIT_FAILURE;
+                       goto done;
                }
 
                /* we should check the tag */
@@ -381,9 +409,11 @@ main( int argc, char *argv[] )
        ber_memfree( retoid );
        ber_bvfree( retdata );
 
-skip:
-       /* disconnect from server */
-       ldap_unbind_ext( ld, NULL, NULL );
+       rc = ( code == LDAP_SUCCESS ) ? EXIT_SUCCESS : EXIT_FAILURE;
 
-       return code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
+done:
+       /* disconnect from server */
+       tool_unbind( ld ); 
+       tool_destroy();
+       return rc;
 }
index 5e07b00c1b5644a81969faa74b7a1824bd6b1d53..add14c38aee7cb56a2fd54ec945584b12617697d 100644 (file)
@@ -48,9 +48,7 @@
 #include <ac/errno.h>
 #include <sys/stat.h>
 
-#if defined(TEST_ABANDON) || defined(TEST_CANCEL)
 #include <ac/signal.h>
-#endif
 
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
@@ -234,7 +232,7 @@ urlize(char *url)
 }
 
 
-const char options[] = "a:Ab:E:F:l:Ls:S:tT:uz:"
+const char options[] = "a:Ab:cE:F:l:Ls:S:tT:uz:"
        "Cd:D:e:f:h:H:IkKMnO:p:P:QR:U:vVw:WxX:y:Y:Z";
 
 int
@@ -363,6 +361,7 @@ handle_private_option( int i )
 
                        domainScope = 1 + crit;
 #endif
+
 #ifdef LDAP_CONTROL_SUBENTRIES
                } else if ( strcasecmp( control, "subentries" ) == 0 ) {
                        if( subentries ) {
@@ -554,16 +553,6 @@ private_conn_setup( LDAP *ld )
        }
 }
 
-#if defined(TEST_ABANDON) || defined(TEST_CANCEL)
-static int gotintr;
-
-RETSIGTYPE
-do_sig( int sig )
-{
-       gotintr = 1;
-}
-#endif
-
 int
 main( int argc, char **argv )
 {
@@ -622,10 +611,6 @@ main( int argc, char **argv )
                attrs = &argv[optind];
        }
 
-#if defined(TEST_ABANDON) || defined(TEST_CANCEL)
-       SIGNAL( SIGINT, do_sig );
-#endif
-
        if ( infile != NULL ) {
                if ( infile[0] == '-' && infile[1] == '\0' ) {
                        fp = stdin;
@@ -708,7 +693,7 @@ getNextPage:
                        }
 
                        err = ber_printf( seber, "b", abs(subentries) == 1 ? 0 : 1 );
-                       if ( err == -1 ) {
+                       if ( err == -1 ) {
                                ber_free( seber, 1 );
                                fprintf( stderr, _("Subentries control encoding error!\n") );
                                return EXIT_FAILURE;
@@ -942,13 +927,8 @@ getNextPage:
        }
 #endif
 
-       ldap_unbind_ext( ld, NULL, NULL );
-#ifdef HAVE_CYRUS_SASL
-       sasl_done();
-#endif
-#ifdef HAVE_TLS
-       ldap_pvt_tls_destroy();
-#endif
+       tool_unbind( ld );
+       tool_destroy();
        return( rc );
 }
 
@@ -1026,6 +1006,11 @@ static int dosearch(
                sortattr ? LDAP_MSG_ALL : LDAP_MSG_ONE,
                NULL, &res )) > 0 )
        {
+               rc = tool_check_abandon( ld, msgid );
+               if ( rc ) {
+                       return rc;
+               }
+
                if( sortattr ) {
                        (void) ldap_sort_entries( ld, &res,
                                ( *sortattr == '\0' ) ? NULL : sortattr, strcasecmp );
@@ -1122,27 +1107,13 @@ static int dosearch(
 
                ldap_msgfree( res );
        }
-#if defined(TEST_ABANDON) || defined(TEST_CANCEL)
-       if ( gotintr ) {
-#ifdef TEST_CANCEL
-               rc = ldap_cancel_s( ld, msgid, NULL, NULL );
-               fprintf( stderr, "got interrupt, cancel got %d\n", rc );
-               return -1;
-#endif
-#ifdef TEST_ABANDON
-               rc = ldap_abandon( ld, msgid );
-               fprintf( stderr, "got interrupt, abandon got %d\n", rc );
-               return -1;
-#endif
-       }
-#endif
 
+done:
        if ( rc == -1 ) {
                ldap_perror( ld, "ldap_result" );
                return( rc );
        }
 
-done:
        ldap_msgfree( res );
 #ifdef LDAP_CONTROL_PAGEDRESULTS
        if ( pagedResults ) { 
index 1aca0400964ef2745d9ddff864372fc2dd61e948..e97a8dca114616204b0faf9395c4136fd8e4c246 100644 (file)
@@ -108,16 +108,18 @@ handle_private_option( int i )
 int
 main( int argc, char *argv[] )
 {
-       int rc;
-       char    *user = NULL;
+       int             rc;
+       char            *user = NULL;
 
-       LDAP           *ld = NULL;
+       LDAP            *ld = NULL;
 
-       char *matcheddn = NULL, *text = NULL, **refs = NULL;
-       char    *retoid = NULL;
-       struct berval *retdata = NULL;
+       char            *matcheddn = NULL, *text = NULL, **refs = NULL;
+       char            *retoid = NULL;
+       struct berval   *retdata = NULL;
+       int             id, code;
+       LDAPMessage     *res;
 
-    tool_init();
+       tool_init();
        prog = lutil_progname( "ldapwhoami", argc, argv );
 
        /* LDAPv3 only */
@@ -156,7 +158,51 @@ main( int argc, char *argv[] )
                tool_server_controls( ld, NULL, 0 );
        }
 
-       rc = ldap_whoami_s( ld, &retdata, NULL, NULL ); 
+       rc = ldap_whoami( ld, NULL, NULL, &id ); 
+
+       if( rc != LDAP_SUCCESS ) {
+               ldap_perror( ld, "ldap_extended_operation" );
+               rc = EXIT_FAILURE;
+               goto skip;
+       }
+
+       for ( ; ; ) {
+               struct timeval  tv;
+
+               if ( tool_check_abandon( ld, id ) ) {
+                       return LDAP_CANCELLED;
+               }
+
+               tv.tv_sec = 0;
+               tv.tv_usec = 100000;
+
+               rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, &tv, &res );
+               if ( rc < 0 ) {
+                       ldap_perror( ld, "ldapwhoami: ldap_result" );
+                       return rc;
+               }
+
+               if ( rc != 0 ) {
+                       break;
+               }
+       }
+
+       rc = ldap_parse_result( ld, res,
+               &code, &matcheddn, &text, &refs, NULL, 0 );
+
+       if( rc != LDAP_SUCCESS ) {
+               ldap_perror( ld, "ldap_parse_result" );
+               rc = EXIT_FAILURE;
+               goto skip;
+       }
+
+       rc = ldap_parse_extended_result( ld, res, &retoid, &retdata, 1 );
+
+       if( rc != LDAP_SUCCESS ) {
+               ldap_perror( ld, "ldap_parse_result" );
+               rc = EXIT_FAILURE;
+               goto skip;
+       }
 
        if( retdata != NULL ) {
                if( retdata->bv_len == 0 ) {
@@ -166,8 +212,8 @@ main( int argc, char *argv[] )
                }
        }
 
-       if( verbose || ( rc != LDAP_SUCCESS ) || matcheddn || text || refs ) {
-               printf( _("Result: %s (%d)\n"), ldap_err2string( rc ), rc );
+       if( verbose || ( code != LDAP_SUCCESS ) || matcheddn || text || refs ) {
+               printf( _("Result: %s (%d)\n"), ldap_err2string( code ), code );
 
                if( text && *text ) {
                        printf( _("Additional info: %s\n"), text );
@@ -193,7 +239,8 @@ main( int argc, char *argv[] )
 
 skip:
        /* disconnect from server */
-       ldap_unbind (ld);
+       tool_unbind( ld );
+       tool_destroy();
 
-       return rc == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
+       return code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
 }
index 67f733049e419c99ea9f3cbd386703616f424f6f..39023b745f1f4f64afab24ac3e53837569990ee7 100755 (executable)
--- a/configure
+++ b/configure
@@ -129,6 +129,8 @@ ac_help="$ac_help
     --enable-denyop      Deny Operation overlay no|yes|mod [no]"
 ac_help="$ac_help
     --enable-dyngroup    Dynamic Group overlay no|yes|mod [no]"
+ac_help="$ac_help
+    --enable-dynlist     Dynamic List overlay no|yes|mod [no]"
 ac_help="$ac_help
     --enable-glue        Backend Glue overlay no|yes|mod [yes]"
 ac_help="$ac_help
@@ -889,7 +891,7 @@ echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
 
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:893: checking host system type" >&5
+echo "configure:895: checking host system type" >&5
 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
 
 # Make sure we can run config.sub.
@@ -930,7 +932,7 @@ host_os=$ac_cv_host_os
 
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:934: checking target system type" >&5
+echo "configure:936: checking target system type" >&5
 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
 
 # Make sure we can run config.sub.
@@ -970,7 +972,7 @@ target_os=$ac_cv_target_os
 
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:974: checking build system type" >&5
+echo "configure:976: checking build system type" >&5
 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
 
 # Make sure we can run config.sub.
@@ -1047,7 +1049,7 @@ test "$host_alias" != "$target_alias" &&
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1051: checking for a BSD compatible install" >&5
+echo "configure:1053: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1104,7 +1106,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:1108: checking whether build environment is sane" >&5
+echo "configure:1110: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -1165,7 +1167,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1169: checking for $ac_word" >&5
+echo "configure:1171: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1195,7 +1197,7 @@ test -n "$AWK" && break
 done
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1199: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1201: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1235,7 +1237,7 @@ fi
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1239: checking for working aclocal" >&5
+echo "configure:1241: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1248,7 +1250,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1252: checking for working autoconf" >&5
+echo "configure:1254: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1261,7 +1263,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1265: checking for working automake" >&5
+echo "configure:1267: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1274,7 +1276,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1278: checking for working autoheader" >&5
+echo "configure:1280: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1287,7 +1289,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1291: checking for working makeinfo" >&5
+echo "configure:1293: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1307,7 +1309,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1311: checking for $ac_word" >&5
+echo "configure:1313: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1379,7 +1381,7 @@ OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
 
 
 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
-echo "configure:1383: checking configure arguments" >&5
+echo "configure:1385: checking configure arguments" >&5
 
 
 top_builddir=`pwd`
@@ -2239,8 +2241,8 @@ else
 fi
 # end --enable-sql
 
-Overlays="denyop dyngroup glue lastmod ppolicy proxycache rwm \
-       refint syncprov translucent unique"
+Overlays="denyop dyngroup dynlist glue lastmod ppolicy proxycache \
+       refint rwm syncprov translucent unique"
 
 # Check whether --with-xxslapoverlays or --without-xxslapoverlays was given.
 if test "${with_xxslapoverlays+set}" = set; then
@@ -2311,6 +2313,27 @@ else
 fi
 # end --enable-dyngroup
 
+# OpenLDAP --enable-dynlist
+       # Check whether --enable-dynlist or --disable-dynlist was given.
+if test "${enable_dynlist+set}" = set; then
+  enableval="$enable_dynlist"
+  
+       ol_arg=invalid
+       for ol_val in no yes mod ; do
+               if test "$enableval" = "$ol_val" ; then
+                       ol_arg="$ol_val"
+               fi
+       done
+       if test "$ol_arg" = "invalid" ; then
+               { echo "configure: error: bad value $enableval for --enable-dynlist" 1>&2; exit 1; }
+       fi
+       ol_enable_dynlist="$ol_arg"
+
+else
+       ol_enable_dynlist="no"
+fi
+# end --enable-dynlist
+
 # OpenLDAP --enable-glue
        # Check whether --enable-glue or --disable-glue was given.
 if test "${enable_glue+set}" = set; then
@@ -2810,6 +2833,7 @@ BUILD_SQL=no
 BUILD_CHAIN=no
 BUILD_DENYOP=no
 BUILD_DYNGROUP=no
+BUILD_DYNLIST=no
 BUILD_GLUE=no
 BUILD_LASTMOD=no
 BUILD_PPOLICY=no
@@ -2874,7 +2898,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2878: checking for $ac_word" >&5
+echo "configure:2902: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2926,7 +2950,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2930: checking for $ac_word" >&5
+echo "configure:2954: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2968,7 +2992,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2972: checking for $ac_word" >&5
+echo "configure:2996: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3018,12 +3042,12 @@ if test "X${PATH_SEPARATOR+set}" != Xset; then
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:3022: checking for Cygwin environment" >&5
+echo "configure:3046: checking for Cygwin environment" >&5
 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3027 "configure"
+#line 3051 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3034,7 +3058,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:3038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -3050,19 +3074,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:3054: checking for mingw32 environment" >&5
+echo "configure:3078: checking for mingw32 environment" >&5
 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3059 "configure"
+#line 3083 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3078,19 +3102,19 @@ echo "$ac_t""$ac_cv_mingw32" 1>&6
 MINGW32=
 test "$ac_cv_mingw32" = yes && MINGW32=yes
 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
-echo "configure:3082: checking for EMX OS/2 environment" >&5
+echo "configure:3106: checking for EMX OS/2 environment" >&5
 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3087 "configure"
+#line 3111 "configure"
 #include "confdefs.h"
 
 int main() {
 return __EMX__;
 ; return 0; }
 EOF
-if { (eval echo configure:3094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_emxos2=yes
 else
@@ -3106,7 +3130,7 @@ echo "$ac_t""$ac_cv_emxos2" 1>&6
 EMXOS2=
 test "$ac_cv_emxos2" = yes && EMXOS2=yes
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3110: checking how to run the C preprocessor" >&5
+echo "configure:3134: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3121,13 +3145,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 3125 "configure"
+#line 3149 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3138,13 +3162,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 3142 "configure"
+#line 3166 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3155,13 +3179,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 3159 "configure"
+#line 3183 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -3211,7 +3235,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3215: checking for $ac_word" >&5
+echo "configure:3239: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3241,7 +3265,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3245: checking for $ac_word" >&5
+echo "configure:3269: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3292,7 +3316,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3296: checking for $ac_word" >&5
+echo "configure:3320: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3324,7 +3348,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:3328: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+echo "configure:3352: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -3335,12 +3359,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 3339 "configure"
+#line 3363 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:3344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -3366,12 +3390,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:3370: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:3394: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:3375: checking whether we are using GNU C" >&5
+echo "configure:3399: checking whether we are using GNU C" >&5
 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3380,7 +3404,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -3399,7 +3423,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:3403: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:3427: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3442,7 +3466,7 @@ ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:3446: checking for ld used by GCC" >&5
+echo "configure:3470: checking for ld used by GCC" >&5
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -3472,10 +3496,10 @@ echo "configure:3446: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:3476: checking for GNU ld" >&5
+echo "configure:3500: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:3479: checking for non-GNU ld" >&5
+echo "configure:3503: checking for non-GNU ld" >&5
 fi
 if eval "test \"\${lt_cv_path_LD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3510,7 +3534,7 @@ else
 fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:3514: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:3538: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"\${lt_cv_prog_gnu_ld+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3527,7 +3551,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:3531: checking for $LD option to reload object files" >&5
+echo "configure:3555: checking for $LD option to reload object files" >&5
 if eval "test \"\${lt_cv_ld_reload_flag+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3539,7 +3563,7 @@ reload_flag=$lt_cv_ld_reload_flag
 test -n "$reload_flag" && reload_flag=" $reload_flag"
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:3543: checking for BSD-compatible nm" >&5
+echo "configure:3567: checking for BSD-compatible nm" >&5
 if eval "test \"\${lt_cv_path_NM+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3577,7 +3601,7 @@ NM="$lt_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
 echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
-echo "configure:3581: checking for a sed that does not truncate output" >&5
+echo "configure:3605: checking for a sed that does not truncate output" >&5
 if eval "test \"\${lt_cv_path_SED+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3661,7 +3685,7 @@ fi
 echo "$ac_t""$SED" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3665: checking whether ln -s works" >&5
+echo "configure:3689: checking whether ln -s works" >&5
 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3682,7 +3706,7 @@ else
 fi
 
 echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
-echo "configure:3686: checking how to recognise dependent libraries" >&5
+echo "configure:3710: checking how to recognise dependent libraries" >&5
 if eval "test \"\${lt_cv_deplibs_check_method+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3872,13 +3896,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:3876: checking for object suffix" >&5
+echo "configure:3900: checking for object suffix" >&5
 if eval "test \"\${ac_cv_objext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:3882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -3899,7 +3923,7 @@ ac_objext=$ac_cv_objext
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3903: checking for executable suffix" >&5
+echo "configure:3927: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3909,7 +3933,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -3940,7 +3964,7 @@ fi
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:3944: checking command to parse $NM output" >&5
+echo "configure:3968: checking command to parse $NM output" >&5
 if eval "test \"\${lt_cv_sys_global_symbol_pipe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4023,10 +4047,10 @@ void nm_test_func(){}
 int main(){nm_test_var='a';nm_test_func();return(0);}
 EOF
 
-  if { (eval echo configure:4027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:4051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     # Now try to grab the symbols.
     nlist=conftest.nm
-    if { (eval echo configure:4030: \"$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
+    if { (eval echo configure:4054: \"$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
       # Try sorting and uniquifying the output.
       if sort "$nlist" | uniq > "$nlist"T; then
        mv -f "$nlist"T "$nlist"
@@ -4077,7 +4101,7 @@ EOF
          save_CFLAGS="$CFLAGS"
          LIBS="conftstm.$ac_objext"
          CFLAGS="$CFLAGS$no_builtin_flag"
-         if { (eval echo configure:4081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
+         if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
            pipe_works=yes
          fi
          LIBS="$save_LIBS"
@@ -4126,17 +4150,17 @@ for ac_hdr in dlfcn.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4130: checking for $ac_hdr" >&5
+echo "configure:4154: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4135 "configure"
+#line 4159 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4172,7 +4196,7 @@ case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:4176: checking for ${ac_tool_prefix}file" >&5
+echo "configure:4200: checking for ${ac_tool_prefix}file" >&5
 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4234,7 +4258,7 @@ fi
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
     echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:4238: checking for file" >&5
+echo "configure:4262: checking for file" >&5
 if eval "test \"\${lt_cv_path_MAGIC_CMD+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4305,7 +4329,7 @@ esac
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4309: checking for $ac_word" >&5
+echo "configure:4333: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4337,7 +4361,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4341: checking for $ac_word" >&5
+echo "configure:4365: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4372,7 +4396,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4376: checking for $ac_word" >&5
+echo "configure:4400: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4404,7 +4428,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4408: checking for $ac_word" >&5
+echo "configure:4432: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_STRIP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4453,8 +4477,8 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4457 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:4458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 4481 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:4482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case `/usr/bin/file conftest.$ac_objext` in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -4475,7 +4499,7 @@ case $host in
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:4479: checking whether the C compiler needs -belf" >&5
+echo "configure:4503: checking whether the C compiler needs -belf" >&5
 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4488,14 +4512,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
 cross_compiling=$ac_cv_prog_cc_cross
 
      cat > conftest.$ac_ext <<EOF
-#line 4492 "configure"
+#line 4516 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -4525,7 +4549,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4529: checking for $ac_word" >&5
+echo "configure:4553: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4557,7 +4581,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4561: checking for $ac_word" >&5
+echo "configure:4585: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4592,7 +4616,7 @@ fi
   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4596: checking for $ac_word" >&5
+echo "configure:4620: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4624,7 +4648,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4628: checking for $ac_word" >&5
+echo "configure:4652: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4659,7 +4683,7 @@ fi
   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
 set dummy ${ac_tool_prefix}objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4663: checking for $ac_word" >&5
+echo "configure:4687: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4691,7 +4715,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4695: checking for $ac_word" >&5
+echo "configure:4719: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4727,12 +4751,12 @@ fi
   # recent cygwin and mingw systems supply a stub DllMain which the user
   # can override, but on older systems we have to supply one
   echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
-echo "configure:4731: checking if libtool should supply DllMain function" >&5
+echo "configure:4755: checking if libtool should supply DllMain function" >&5
 if eval "test \"\${lt_cv_need_dllmain+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4736 "configure"
+#line 4760 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4740,7 +4764,7 @@ extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
       DllMain (0, 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_need_dllmain=no
 else
@@ -4761,19 +4785,19 @@ echo "$ac_t""$lt_cv_need_dllmain" 1>&6
     SAVE_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS -mdll"
     echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
-echo "configure:4765: checking how to link DLLs" >&5
+echo "configure:4789: checking how to link DLLs" >&5
 if eval "test \"\${lt_cv_cc_dll_switch+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4770 "configure"
+#line 4794 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_dll_switch=-mdll
 else
@@ -4887,7 +4911,7 @@ set dummy $CC
 compiler="$2"
 
 echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:4891: checking for objdir" >&5
+echo "configure:4915: checking for objdir" >&5
 rm -f .libs 2>/dev/null
 mkdir .libs 2>/dev/null
 if test -d .libs; then
@@ -4914,7 +4938,7 @@ test -z "$pic_mode" && pic_mode=default
 # in isolation, and that seeing it set (from the cache) indicates that
 # the associated values are set (in the cache) correctly too.
 echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
-echo "configure:4918: checking for $compiler option to produce PIC" >&5
+echo "configure:4942: checking for $compiler option to produce PIC" >&5
 if eval "test \"\${lt_cv_prog_cc_pic+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5066,21 +5090,21 @@ else
 
   # Check to make sure the pic_flag actually works.
   echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
-echo "configure:5070: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
+echo "configure:5094: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
   if eval "test \"\${lt_cv_prog_cc_pic_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
       save_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
     cat > conftest.$ac_ext <<EOF
-#line 5077 "configure"
+#line 5101 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
         case $host_os in
       hpux9* | hpux10* | hpux11*)
@@ -5132,7 +5156,7 @@ if test -n "$lt_cv_prog_cc_shlib"; then
 fi
 
 echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
-echo "configure:5136: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
+echo "configure:5160: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
 if eval "test \"\${lt_cv_prog_cc_static_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5140,14 +5164,14 @@ else
   save_LDFLAGS="$LDFLAGS"
   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
   cat > conftest.$ac_ext <<EOF
-#line 5144 "configure"
+#line 5168 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_prog_cc_static_works=yes
 else
@@ -5174,7 +5198,7 @@ can_build_shared="$lt_cv_prog_cc_can_build_shared"
 
 # Check to see if options -o and -c are simultaneously supported by compiler
 echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
-echo "configure:5178: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo "configure:5202: checking if $compiler supports -c -o file.$ac_objext" >&5
 if eval "test \"\${lt_cv_compiler_c_o+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5193,7 +5217,7 @@ chmod -w .
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
 compiler_c_o=no
-if { (eval echo configure:5197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:5221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
   # The compiler can only warn and ignore the option if not recognized
   # So say no if there are warnings
   if test -s out/conftest.err; then
@@ -5222,7 +5246,7 @@ echo "$ac_t""$compiler_c_o" 1>&6
 if test x"$compiler_c_o" = x"yes"; then
   # Check to see if we can write to a .lo
   echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
-echo "configure:5226: checking if $compiler supports -c -o file.lo" >&5
+echo "configure:5250: checking if $compiler supports -c -o file.lo" >&5
   if eval "test \"\${lt_cv_compiler_o_lo+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5233,14 +5257,14 @@ else
   save_objext="$ac_objext"
   ac_objext=lo
   cat > conftest.$ac_ext <<EOF
-#line 5237 "configure"
+#line 5261 "configure"
 #include "confdefs.h"
 
 int main() {
 int some_variable = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
       # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings
@@ -5271,7 +5295,7 @@ hard_links="nottested"
 if test "$compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
   echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
-echo "configure:5275: checking if we can lock with hard links" >&5
+echo "configure:5299: checking if we can lock with hard links" >&5
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
@@ -5290,20 +5314,20 @@ fi
 if test "$GCC" = yes; then
   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
   echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
-echo "configure:5294: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo "configure:5318: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
   echo "int some_variable = 0;" > conftest.$ac_ext
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
   compiler_rtti_exceptions=no
   cat > conftest.$ac_ext <<EOF
-#line 5300 "configure"
+#line 5324 "configure"
 #include "confdefs.h"
 
 int main() {
 int some_variable = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
       # The compiler can only warn and ignore the option if not recognized
     # So say no if there are warnings
@@ -5330,7 +5354,7 @@ fi
 
 # See if the linker supports building shared libraries.
 echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
-echo "configure:5334: checking whether the linker ($LD) supports shared libraries" >&5
+echo "configure:5358: checking whether the linker ($LD) supports shared libraries" >&5
 
 allow_undefined_flag=
 no_undefined_flag=
@@ -6035,7 +6059,7 @@ test "$ld_shlibs" = no && can_build_shared=no
 
 # Check hardcoding attributes.
 echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
-echo "configure:6039: checking how to hardcode library paths into programs" >&5
+echo "configure:6063: checking how to hardcode library paths into programs" >&5
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" || \
    test -n "$runpath_var"; then
@@ -6063,7 +6087,7 @@ echo "$ac_t""$hardcode_action" 1>&6
 striplib=
 old_striplib=
 echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
-echo "configure:6067: checking whether stripping libraries is possible" >&5
+echo "configure:6091: checking whether stripping libraries is possible" >&5
 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
@@ -6077,7 +6101,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 # PORTME Fill in your ld.so characteristics
 echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
-echo "configure:6081: checking dynamic linker characteristics" >&5
+echo "configure:6105: checking dynamic linker characteristics" >&5
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -6499,11 +6523,11 @@ test "$dynamic_linker" = no && can_build_shared=no
 
 # Report the final consequences.
 echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
-echo "configure:6503: checking if libtool supports shared libraries" >&5
+echo "configure:6527: checking if libtool supports shared libraries" >&5
 echo "$ac_t""$can_build_shared" 1>&6
 
 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
-echo "configure:6507: checking whether to build shared libraries" >&5
+echo "configure:6531: checking whether to build shared libraries" >&5
 test "$can_build_shared" = "no" && enable_shared=no
 
 # On AIX, shared libraries and static libraries use the same namespace, and
@@ -6526,7 +6550,7 @@ esac
 echo "$ac_t""$enable_shared" 1>&6
 
 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
-echo "configure:6530: checking whether to build static libraries" >&5
+echo "configure:6554: checking whether to build static libraries" >&5
 # Make sure either enable_shared or enable_static is yes.
 test "$enable_shared" = yes || enable_static=yes
 echo "$ac_t""$enable_static" 1>&6
@@ -6567,12 +6591,12 @@ else
 
   *)
     echo $ac_n "checking for dllload""... $ac_c" 1>&6
-echo "configure:6571: checking for dllload" >&5
+echo "configure:6595: checking for dllload" >&5
 if eval "test \"\${ac_cv_func_dllload+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6576 "configure"
+#line 6600 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dllload(); below.  */
@@ -6596,7 +6620,7 @@ f = dllload;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dllload=yes"
 else
@@ -6614,12 +6638,12 @@ if eval "test \"`echo '$ac_cv_func_'dllload`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:6618: checking for shl_load" >&5
+echo "configure:6642: checking for shl_load" >&5
 if eval "test \"\${ac_cv_func_shl_load+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6623 "configure"
+#line 6647 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shl_load(); below.  */
@@ -6643,7 +6667,7 @@ f = shl_load;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shl_load=yes"
 else
@@ -6661,7 +6685,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:6665: checking for shl_load in -ldld" >&5
+echo "configure:6689: checking for shl_load in -ldld" >&5
 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6669,7 +6693,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6673 "configure"
+#line 6697 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6680,7 +6704,7 @@ int main() {
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:6684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6699,12 +6723,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:6703: checking for dlopen" >&5
+echo "configure:6727: checking for dlopen" >&5
 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6708 "configure"
+#line 6732 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen(); below.  */
@@ -6728,7 +6752,7 @@ f = dlopen;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dlopen=yes"
 else
@@ -6746,7 +6770,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6750: checking for dlopen in -ldl" >&5
+echo "configure:6774: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6754,7 +6778,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6758 "configure"
+#line 6782 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6765,7 +6789,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:6769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6784,7 +6808,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:6788: checking for dlopen in -lsvld" >&5
+echo "configure:6812: checking for dlopen in -lsvld" >&5
 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6792,7 +6816,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsvld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6796 "configure"
+#line 6820 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6803,7 +6827,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:6807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6822,7 +6846,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:6826: checking for dld_link in -ldld" >&5
+echo "configure:6850: checking for dld_link in -ldld" >&5
 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6830,7 +6854,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6834 "configure"
+#line 6858 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6841,7 +6865,7 @@ int main() {
 dld_link()
 ; return 0; }
 EOF
-if { (eval echo configure:6845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6900,7 +6924,7 @@ fi
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
-echo "configure:6904: checking whether a program can dlopen itself" >&5
+echo "configure:6928: checking whether a program can dlopen itself" >&5
 if eval "test \"\${lt_cv_dlopen_self+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6910,7 +6934,7 @@ else
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 6914 "configure"
+#line 6938 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -6971,7 +6995,7 @@ int main ()
     exit (status);
 }
 EOF
-  if { (eval echo configure:6975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  if { (eval echo configure:6999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -6994,7 +7018,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
     if test "x$lt_cv_dlopen_self" = xyes; then
       LDFLAGS="$LDFLAGS $link_static_flag"
       echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
-echo "configure:6998: checking whether a statically linked program can dlopen itself" >&5
+echo "configure:7022: checking whether a statically linked program can dlopen itself" >&5
 if eval "test \"\${lt_cv_dlopen_self_static+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7004,7 +7028,7 @@ else
     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 7008 "configure"
+#line 7032 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -7065,7 +7089,7 @@ int main ()
     exit (status);
 }
 EOF
-  if { (eval echo configure:7069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  if { (eval echo configure:7093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -7114,14 +7138,14 @@ if test "$enable_shared" = yes && test "$GCC" = yes; then
     # systems, -lgcc has to come before -lc. If gcc already passes -lc
     # to ld, don't add -lc before -lgcc.
     echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
-echo "configure:7118: checking whether -lc should be explicitly linked in" >&5
+echo "configure:7142: checking whether -lc should be explicitly linked in" >&5
     if eval "test \"\${lt_cv_archive_cmds_need_lc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   $rm conftest*
     echo 'static int dummy;' > conftest.$ac_ext
 
-    if { (eval echo configure:7125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+    if { (eval echo configure:7149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
       soname=conftest
       lib=conftest
       libobjs=conftest.$ac_objext
@@ -7134,7 +7158,7 @@ else
       libname=conftest
       save_allow_undefined_flag=$allow_undefined_flag
       allow_undefined_flag=
-      if { (eval echo configure:7138: \"$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; }
+      if { (eval echo configure:7162: \"$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; }
       then
        lt_cv_archive_cmds_need_lc=no
       else
@@ -7724,7 +7748,7 @@ if test $ol_enable_perl != no ; then
        # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7728: checking for $ac_word" >&5
+echo "configure:7752: checking for $ac_word" >&5
 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7777,7 +7801,7 @@ fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:7781: checking how to run the C preprocessor" >&5
+echo "configure:7805: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -7792,13 +7816,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 7796 "configure"
+#line 7820 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -7809,13 +7833,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 7813 "configure"
+#line 7837 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -7826,13 +7850,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 7830 "configure"
+#line 7854 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -7859,12 +7883,12 @@ echo "$ac_t""$CPP" 1>&6
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:7863: checking for Cygwin environment" >&5
+echo "configure:7887: checking for Cygwin environment" >&5
 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7868 "configure"
+#line 7892 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -7875,7 +7899,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:7879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -7891,19 +7915,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:7895: checking for mingw32 environment" >&5
+echo "configure:7919: checking for mingw32 environment" >&5
 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7900 "configure"
+#line 7924 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:7907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -7922,7 +7946,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:7926: checking for executable suffix" >&5
+echo "configure:7950: checking for executable suffix" >&5
 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7932,7 +7956,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:7936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:7960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.C | *.o | *.obj | *.xcoff) ;;
@@ -7953,13 +7977,13 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6
 ac_exeext=$EXEEXT
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:7957: checking for object suffix" >&5
+echo "configure:7981: checking for object suffix" >&5
 if eval "test \"\${ac_cv_objext+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:7963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -7983,7 +8007,7 @@ EOF
 
 
 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
-echo "configure:7987: checking for be_app in -lbe" >&5
+echo "configure:8011: checking for be_app in -lbe" >&5
 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7991,7 +8015,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbe -lroot -lnet $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7995 "configure"
+#line 8019 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8002,7 +8026,7 @@ int main() {
 be_app()
 ; return 0; }
 EOF
-if { (eval echo configure:8006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8028,7 +8052,7 @@ fi
 
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:8032: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:8056: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8045,7 +8069,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
 do
   CC="$ac_save_CC $ac_arg"
   cat > conftest.$ac_ext <<EOF
-#line 8049 "configure"
+#line 8073 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -8082,7 +8106,7 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 
 ; return 0; }
 EOF
-if { (eval echo configure:8086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_prog_cc_stdc="$ac_arg"; break
 else
@@ -8116,7 +8140,7 @@ if test -z "${MKDEP}"; then
        OL_MKDEP="${CC-cc}"
        if test -z "${MKDEP_FLAGS}"; then
                echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
-echo "configure:8120: checking for ${OL_MKDEP} depend flag" >&5
+echo "configure:8144: checking for ${OL_MKDEP} depend flag" >&5
 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8126,7 +8150,7 @@ else
                                cat > conftest.c <<EOF
  noCode;
 EOF
-                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
+                               if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:8154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
                                        | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
                                then
                                        if test ! -f conftest."${ac_object}" ; then
@@ -8159,7 +8183,7 @@ if test "${ol_cv_mkdep}" = no ; then
 fi
 
 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
-echo "configure:8163: checking for afopen in -ls" >&5
+echo "configure:8187: checking for afopen in -ls" >&5
 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8167,7 +8191,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ls  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8171 "configure"
+#line 8195 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8178,7 +8202,7 @@ int main() {
 afopen()
 ; return 0; }
 EOF
-if { (eval echo configure:8182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8222,17 +8246,17 @@ if test $ol_enable_modules != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8226: checking for $ac_hdr" >&5
+echo "configure:8250: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8231 "configure"
+#line 8255 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8264,7 +8288,7 @@ done
        fi
 
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:8268: checking for lt_dlinit in -lltdl" >&5
+echo "configure:8292: checking for lt_dlinit in -lltdl" >&5
 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8272,7 +8296,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8276 "configure"
+#line 8300 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8283,7 +8307,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:8287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8335,13 +8359,13 @@ fi
 
 # test for EBCDIC
 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
-echo "configure:8339: checking for EBCDIC" >&5
+echo "configure:8363: checking for EBCDIC" >&5
 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 8345 "configure"
+#line 8369 "configure"
 #include "confdefs.h"
 
 #if !('M' == 0xd4)
@@ -8350,7 +8374,7 @@ else
 
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8374,12 +8398,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:8378: checking for ANSI C header files" >&5
+echo "configure:8402: checking for ANSI C header files" >&5
 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8383 "configure"
+#line 8407 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -8387,7 +8411,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8404,7 +8428,7 @@ rm -f conftest*
 if test $ol_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 8408 "configure"
+#line 8432 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -8422,7 +8446,7 @@ fi
 if test $ol_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 8426 "configure"
+#line 8450 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -8443,7 +8467,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 8447 "configure"
+#line 8471 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #ifndef HAVE_EBCDIC
@@ -8461,7 +8485,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:8465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:8489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   :
 else
@@ -8495,12 +8519,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:8499: checking for $ac_hdr that defines DIR" >&5
+echo "configure:8523: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8504 "configure"
+#line 8528 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -8508,7 +8532,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -8533,7 +8557,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:8537: checking for opendir in -ldir" >&5
+echo "configure:8561: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8541,7 +8565,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8545 "configure"
+#line 8569 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8552,7 +8576,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:8556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8574,7 +8598,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:8578: checking for opendir in -lx" >&5
+echo "configure:8602: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8582,7 +8606,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8586 "configure"
+#line 8610 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8593,7 +8617,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:8597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8616,12 +8640,12 @@ fi
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:8620: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:8644: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8625 "configure"
+#line 8649 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -8637,7 +8661,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:8641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -8658,12 +8682,12 @@ EOF
 fi
 
 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:8662: checking POSIX termios" >&5
+echo "configure:8686: checking POSIX termios" >&5
 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8667 "configure"
+#line 8691 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <unistd.h>
@@ -8673,7 +8697,7 @@ int main() {
    tcgetattr(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:8677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_sys_posix_termios=yes
 else
@@ -8689,7 +8713,7 @@ echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
 
 
  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:8693: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+echo "configure:8717: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8698,7 +8722,7 @@ else
   gwinsz_in_termios_h=no
   if test $am_cv_sys_posix_termios = yes; then
     cat > conftest.$ac_ext <<EOF
-#line 8702 "configure"
+#line 8726 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <termios.h>
@@ -8718,7 +8742,7 @@ rm -f conftest*
 
   if test $gwinsz_in_termios_h = no; then
     cat > conftest.$ac_ext <<EOF
-#line 8722 "configure"
+#line 8746 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #     include <sys/ioctl.h>
@@ -8806,17 +8830,17 @@ for ac_hdr in \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8810: checking for $ac_hdr" >&5
+echo "configure:8834: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8815 "configure"
+#line 8839 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8847,12 +8871,12 @@ done
 for ac_func in sigaction sigset 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8851: checking for $ac_func" >&5
+echo "configure:8875: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8856 "configure"
+#line 8880 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8876,7 +8900,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:8880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -8903,7 +8927,7 @@ done
 
 if test $ac_cv_func_sigaction = no && test $ac_cv_func_sigaction = no ; then
        echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
-echo "configure:8907: checking for sigset in -lV3" >&5
+echo "configure:8931: checking for sigset in -lV3" >&5
 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8911,7 +8935,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lV3  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8915 "configure"
+#line 8939 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8922,7 +8946,7 @@ int main() {
 sigset()
 ; return 0; }
 EOF
-if { (eval echo configure:8926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8953,7 +8977,7 @@ fi
 
 if test "$ac_cv_header_winsock_h" = yes; then
 echo $ac_n "checking for winsock""... $ac_c" 1>&6
-echo "configure:8957: checking for winsock" >&5
+echo "configure:8981: checking for winsock" >&5
 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8961,7 +8985,7 @@ else
 for curlib in ws2_32 wsock32; do
        LIBS="$LIBS -l$curlib"
        cat > conftest.$ac_ext <<EOF
-#line 8965 "configure"
+#line 8989 "configure"
 #include "confdefs.h"
 #include <winsock.h>
                        
@@ -8974,7 +8998,7 @@ int main() {
                        
 ; return 0; }
 EOF
-if { (eval echo configure:8978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_winsock=yes
 else
@@ -9012,12 +9036,12 @@ fi
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:9016: checking for socket" >&5
+echo "configure:9040: checking for socket" >&5
 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9021 "configure"
+#line 9045 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -9041,7 +9065,7 @@ f = socket;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -9060,7 +9084,7 @@ else
   echo "$ac_t""no" 1>&6
        
        echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:9064: checking for main in -lsocket" >&5
+echo "configure:9088: checking for main in -lsocket" >&5
 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9068,14 +9092,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9072 "configure"
+#line 9096 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9103,7 +9127,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
-echo "configure:9107: checking for main in -lnet" >&5
+echo "configure:9131: checking for main in -lnet" >&5
 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9111,14 +9135,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9115 "configure"
+#line 9139 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9146,7 +9170,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
-echo "configure:9150: checking for main in -lnsl_s" >&5
+echo "configure:9174: checking for main in -lnsl_s" >&5
 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9154,14 +9178,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9158 "configure"
+#line 9182 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9189,7 +9213,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:9193: checking for main in -lnsl" >&5
+echo "configure:9217: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9197,14 +9221,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9201 "configure"
+#line 9225 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9232,7 +9256,7 @@ else
 fi
 
        echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:9236: checking for socket in -linet" >&5
+echo "configure:9260: checking for socket in -linet" >&5
 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9240,7 +9264,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9244 "configure"
+#line 9268 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9251,7 +9275,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:9255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9279,7 +9303,7 @@ else
 fi
 
        echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
-echo "configure:9283: checking for main in -lgen" >&5
+echo "configure:9307: checking for main in -lgen" >&5
 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9287,14 +9311,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9291 "configure"
+#line 9315 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:9298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9326,12 +9350,12 @@ fi
 
 
 echo $ac_n "checking for select""... $ac_c" 1>&6
-echo "configure:9330: checking for select" >&5
+echo "configure:9354: checking for select" >&5
 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9335 "configure"
+#line 9359 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char select(); below.  */
@@ -9355,7 +9379,7 @@ f = select;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_select=yes"
 else
@@ -9378,7 +9402,7 @@ fi
 
 if test "${ac_cv_header_winsock_h}" != yes; then
                                echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
-echo "configure:9382: checking types of arguments for select()" >&5
+echo "configure:9406: checking types of arguments for select()" >&5
  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9392,7 +9416,7 @@ else
      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
        cat > conftest.$ac_ext <<EOF
-#line 9396 "configure"
+#line 9420 "configure"
 #include "confdefs.h"
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -9411,7 +9435,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
           ac_not_found=no ; break 3
 else
@@ -9455,12 +9479,12 @@ fi
 for ac_func in poll 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9459: checking for $ac_func" >&5
+echo "configure:9483: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9464 "configure"
+#line 9488 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9484,7 +9508,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9512,17 +9536,17 @@ for ac_hdr in poll.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9516: checking for $ac_hdr" >&5
+echo "configure:9540: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9521 "configure"
+#line 9545 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9553,17 +9577,17 @@ for ac_hdr in sys/epoll.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9557: checking for $ac_hdr" >&5
+echo "configure:9581: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9562 "configure"
+#line 9586 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9591,12 +9615,12 @@ done
 
 if test "${ac_cv_header_sys_epoll_h}" = yes; then
 echo $ac_n "checking for epoll system call""... $ac_c" 1>&6
-echo "configure:9595: checking for epoll system call" >&5
+echo "configure:9619: checking for epoll system call" >&5
 if test "$cross_compiling" = yes; then
   echo "$ac_t""no" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9600 "configure"
+#line 9624 "configure"
 #include "confdefs.h"
 int main(int argc, char *argv)
 {
@@ -9604,7 +9628,7 @@ int main(int argc, char *argv)
        exit (epfd == -1 ? 1 : 0);
 }
 EOF
-if { (eval echo configure:9608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:9632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   echo "$ac_t""yes" 1>&6
 cat >> confdefs.h <<\EOF
@@ -9624,13 +9648,13 @@ fi
 
 # strerror checks
 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:9628: checking declaration of sys_errlist" >&5
+echo "configure:9652: checking declaration of sys_errlist" >&5
 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 9634 "configure"
+#line 9658 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -9643,7 +9667,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:9647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
        ol_cv_have_sys_errlist=yes
@@ -9666,20 +9690,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:9670: checking existence of sys_errlist" >&5
+echo "configure:9694: checking existence of sys_errlist" >&5
 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 9676 "configure"
+#line 9700 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:9683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_have_sys_errlist=yes
 else
@@ -9702,12 +9726,12 @@ fi
  for ac_func in strerror strerror_r
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9706: checking for $ac_func" >&5
+echo "configure:9730: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9711 "configure"
+#line 9735 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9731,7 +9755,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:9735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9758,13 +9782,13 @@ done
 ol_cv_func_strerror_r=no
 if test "${ac_cv_func_strerror_r}" = yes ; then
        echo $ac_n "checking non-posix strerror_r""... $ac_c" 1>&6
-echo "configure:9762: checking non-posix strerror_r" >&5
+echo "configure:9786: checking non-posix strerror_r" >&5
 if eval "test \"\${ol_cv_nonposix_strerror_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 9768 "configure"
+#line 9792 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -9780,7 +9804,7 @@ rm -f conftest*
 
        if test $ol_decl_strerror_r = yes ; then
                cat > conftest.$ac_ext <<EOF
-#line 9784 "configure"
+#line 9808 "configure"
 #include "confdefs.h"
 #include <string.h>
 int main() {
@@ -9791,7 +9815,7 @@ int main() {
                        
 ; return 0; }
 EOF
-if { (eval echo configure:9795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_nonposix_strerror_r=yes
 else
@@ -9806,7 +9830,7 @@ rm -f conftest*
   ol_cv_nonposix_strerror=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 9810 "configure"
+#line 9834 "configure"
 #include "confdefs.h"
 
                        main() {
@@ -9817,7 +9841,7 @@ else
                        }
                        
 EOF
-if { (eval echo configure:9821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:9845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_nonposix_strerror_r=yes
 else
@@ -9843,13 +9867,13 @@ fi
 
 elif test "${ac_cv_func_strerror}" = no ; then
        echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:9847: checking declaration of sys_errlist" >&5
+echo "configure:9871: checking declaration of sys_errlist" >&5
 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 9853 "configure"
+#line 9877 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -9862,7 +9886,7 @@ int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:9866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_dcl_sys_errlist=yes
        ol_cv_have_sys_errlist=yes
@@ -9885,20 +9909,20 @@ EOF
 
 
        echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:9889: checking existence of sys_errlist" >&5
+echo "configure:9913: checking existence of sys_errlist" >&5
 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 9895 "configure"
+#line 9919 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 char *c = (char *) *sys_errlist
 ; return 0; }
 EOF
-if { (eval echo configure:9902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_have_sys_errlist=yes
 else
@@ -9926,17 +9950,17 @@ for ac_hdr in regex.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9930: checking for $ac_hdr" >&5
+echo "configure:9954: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9935 "configure"
+#line 9959 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9967,14 +9991,14 @@ if test "$ac_cv_header_regex_h" != yes ; then
 fi
 
 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
-echo "configure:9971: checking for library containing regfree" >&5
+echo "configure:9995: checking for library containing regfree" >&5
 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_regfree="no"
 cat > conftest.$ac_ext <<EOF
-#line 9978 "configure"
+#line 10002 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9985,7 +10009,7 @@ int main() {
 regfree()
 ; return 0; }
 EOF
-if { (eval echo configure:9989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_regfree="none required"
 else
@@ -9996,7 +10020,7 @@ rm -f conftest*
 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10000 "configure"
+#line 10024 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10007,7 +10031,7 @@ int main() {
 regfree()
 ; return 0; }
 EOF
-if { (eval echo configure:10011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_regfree="-l$ac_lib"
 break
@@ -10030,7 +10054,7 @@ fi
 
 
 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
-echo "configure:10034: checking for compatible POSIX regex" >&5
+echo "configure:10058: checking for compatible POSIX regex" >&5
 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10039,7 +10063,7 @@ else
   ol_cv_c_posix_regex=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10043 "configure"
+#line 10067 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10065,7 +10089,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:10069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:10093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_c_posix_regex=yes
 else
@@ -10091,17 +10115,17 @@ for ac_hdr in sys/uuid.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10095: checking for $ac_hdr" >&5
+echo "configure:10119: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10100 "configure"
+#line 10124 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10131,14 +10155,14 @@ if test $ac_cv_header_sys_uuid_h = yes ; then
        save_LIBS="$LIBS"
        
 echo $ac_n "checking for library containing uuid_to_str""... $ac_c" 1>&6
-echo "configure:10135: checking for library containing uuid_to_str" >&5
+echo "configure:10159: checking for library containing uuid_to_str" >&5
 if eval "test \"\${ac_cv_search_uuid_to_str+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_uuid_to_str="no"
 cat > conftest.$ac_ext <<EOF
-#line 10142 "configure"
+#line 10166 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10149,7 +10173,7 @@ int main() {
 uuid_to_str()
 ; return 0; }
 EOF
-if { (eval echo configure:10153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_uuid_to_str="none required"
 else
@@ -10160,7 +10184,7 @@ rm -f conftest*
 test "$ac_cv_search_uuid_to_str" = "no" && for ac_lib in uuid; do
 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10164 "configure"
+#line 10188 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10171,7 +10195,7 @@ int main() {
 uuid_to_str()
 ; return 0; }
 EOF
-if { (eval echo configure:10175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_uuid_to_str="-l$ac_lib"
 break
 
 if test $have_uuid = no ; then
        echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
-echo "configure:10210: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
+echo "configure:10234: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
        save_LIBS="$LIBS"
        LIBS="$LIBS -lrpcrt4"
        cat > conftest.$ac_ext <<EOF
-#line 10214 "configure"
+#line 10238 "configure"
 #include "confdefs.h"
 
                int __stdcall UuidCreate(void *);
@@ -10223,7 +10247,7 @@ int main() {
                
 ; return 0; }
 EOF
-if { (eval echo configure:10227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   need_rpcrt=yes
 else
@@ -10240,388 +10264,285 @@ rm -f conftest*
        echo "$ac_t""$need_rpcrt" 1>&6
 fi
 
-ol_link_dnssrv=no
-echo $ac_n "checking for res_query""... $ac_c" 1>&6
-echo "configure:10246: checking for res_query" >&5
-if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
+ol_cv_lib_resolver=no
+if test $ol_cv_lib_resolver = no ; then
+       echo $ac_n "checking for resolver link (default)""... $ac_c" 1>&6
+echo "configure:10271: checking for resolver link (default)" >&5
+if eval "test \"\${ol_cv_resolver_none+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 10251 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char res_query(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char res_query();
-char (*f)();
+  
+       ol_RESOLVER_LIB=
+       ol_LIBS=$LIBS
+       LIBS="$ol_RESOLVER_LIB $LIBS"
 
-int main() {
+       cat > conftest.$ac_ext <<EOF
+#line 10281 "configure"
+#include "confdefs.h"
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_res_query) || defined (__stub___res_query)
-choke me
-#else
-f = res_query;
+#ifdef HAVE_SYS_TYPES_H
+#      include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+#      include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#      include <resolv.h>
 #endif
-
-; return 0; }
-EOF
-if { (eval echo configure:10275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_res_query=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_res_query=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for __res_query""... $ac_c" 1>&6
-echo "configure:10296: checking for __res_query" >&5
-if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 10301 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char __res_query(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char __res_query();
-char (*f)();
 
 int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub___res_query) || defined (__stub_____res_query)
-choke me
+{
+       int len, status;
+       char *request = NULL;
+       unsigned char reply[64*1024];
+       unsigned char host[64*1024];
+       unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
 #else
-f = __res_query;
+       /* Bind 4 interface */
+# ifndef T_SRV
+#  define T_SRV 33
+# endif
+       len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+       p = reply;
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+       /* Bind 4 interface w/ HFIXEDSZ */
+       p += HFIXEDSZ;
+#else
+       /* Bind 4 interface w/o HFIXEDSZ */
+       p += sizeof(HEADER);
 #endif
-
+       status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}
 ; return 0; }
 EOF
-if { (eval echo configure:10325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func___res_query=yes"
+  ol_cv_resolver_none=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func___res_query=no"
+  ol_cv_resolver_none=no
 fi
 rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
 
-       ac_cv_func_res_query=$ac_cv_func___res_query
-fi
-
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
-echo "configure:10349: checking for res_query in -lbind" >&5
-ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lbind  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10357 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char res_query();
-
-int main() {
-res_query()
-; return 0; }
-EOF
-if { (eval echo configure:10368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+       LIBS="$ol_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lbind $LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
-fi
+echo "$ac_t""$ol_cv_resolver_none" 1>&6
 
-       ac_cv_func_res_query=$ac_cv_lib_bind_res_query
+       if test $ol_cv_resolver_none = yes ; then
+               ol_cv_lib_resolver=yes
+       fi
 fi
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
-echo "configure:10400: checking for __res_query in -lbind" >&5
-ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if test $ol_cv_lib_resolver = no ; then
+       echo $ac_n "checking for resolver link (-lresolv)""... $ac_c" 1>&6
+echo "configure:10352: checking for resolver link (-lresolv)" >&5
+if eval "test \"\${ol_cv_resolver_resolv+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lbind  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10408 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char __res_query();
-
-int main() {
-__res_query()
-; return 0; }
-EOF
-if { (eval echo configure:10419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lbind $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-       ac_cv_func_res_query=$ac_cv_lib_bind___res_query
-fi
+  
+       ol_RESOLVER_LIB=-lresolv
+       ol_LIBS=$LIBS
+       LIBS="$ol_RESOLVER_LIB $LIBS"
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
-echo "configure:10451: checking for res_query in -lresolv" >&5
-ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lresolv  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10459 "configure"
+       cat > conftest.$ac_ext <<EOF
+#line 10362 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char res_query();
+
+#ifdef HAVE_SYS_TYPES_H
+#      include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+#      include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#      include <resolv.h>
+#endif
 
 int main() {
-res_query()
+{
+       int len, status;
+       char *request = NULL;
+       unsigned char reply[64*1024];
+       unsigned char host[64*1024];
+       unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
+#else
+       /* Bind 4 interface */
+# ifndef T_SRV
+#  define T_SRV 33
+# endif
+       len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+       p = reply;
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+       /* Bind 4 interface w/ HFIXEDSZ */
+       p += HFIXEDSZ;
+#else
+       /* Bind 4 interface w/o HFIXEDSZ */
+       p += sizeof(HEADER);
+#endif
+       status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}
 ; return 0; }
 EOF
-if { (eval echo configure:10470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_resolver_resolv=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_resolver_resolv=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lresolv $LIBS"
+       LIBS="$ol_LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-       ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
+echo "$ac_t""$ol_cv_resolver_resolv" 1>&6
+
+       if test $ol_cv_resolver_resolv = yes ; then
+               ol_cv_lib_resolver=-lresolv
+       fi
 fi
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
-echo "configure:10502: checking for __res_query in -lresolv" >&5
-ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if test $ol_cv_lib_resolver = no ; then
+       echo $ac_n "checking for resolver link (-lbind)""... $ac_c" 1>&6
+echo "configure:10433: checking for resolver link (-lbind)" >&5
+if eval "test \"\${ol_cv_resolver_bind+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lresolv  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10510 "configure"
+  
+       ol_RESOLVER_LIB=-lbind
+       ol_LIBS=$LIBS
+       LIBS="$ol_RESOLVER_LIB $LIBS"
+
+       cat > conftest.$ac_ext <<EOF
+#line 10443 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char __res_query();
+
+#ifdef HAVE_SYS_TYPES_H
+#      include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_ARPA_NAMESER_H
+#      include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
+#      include <resolv.h>
+#endif
 
 int main() {
-__res_query()
+{
+       int len, status;
+       char *request = NULL;
+       unsigned char reply[64*1024];
+       unsigned char host[64*1024];
+       unsigned char *p;
+
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
+#else
+       /* Bind 4 interface */
+# ifndef T_SRV
+#  define T_SRV 33
+# endif
+       len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
+#endif
+       p = reply;
+#ifdef NS_HFIXEDSZ
+       /* Bind 8/9 interface */
+       p += NS_HFIXEDSZ;
+#elif defined(HFIXEDSZ)
+       /* Bind 4 interface w/ HFIXEDSZ */
+       p += HFIXEDSZ;
+#else
+       /* Bind 4 interface w/o HFIXEDSZ */
+       p += sizeof(HEADER);
+#endif
+       status = dn_expand( reply, reply+len, p, host, sizeof(host));
+}
 ; return 0; }
 EOF
-if { (eval echo configure:10521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ol_cv_resolver_bind=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ol_cv_resolver_bind=no
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lresolv $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-fi
+       LIBS="$ol_LIBS"
 
-       ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
 fi
 
-if test $ac_cv_func_res_query = no ; then 
-       echo $ac_n "checking for _res_9_query in -lresolv""... $ac_c" 1>&6
-echo "configure:10553: checking for _res_9_query in -lresolv" >&5
-ac_lib_var=`echo resolv'_'_res_9_query | sed 'y%./+-:%__p__%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lresolv  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 10561 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char _res_9_query();
+echo "$ac_t""$ol_cv_resolver_bind" 1>&6
 
-int main() {
-_res_9_query()
-; return 0; }
-EOF
-if { (eval echo configure:10572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+       if test $ol_cv_resolver_bind = yes ; then
+               ol_cv_lib_resolver=-lbind
+       fi
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
 
-  LIBS="-lresolv $LIBS"
 
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-       ac_cv_func_res_query=$ac_cv_lib_resolv_res_9_query
-fi
-
-if test "$ac_cv_func_res_query" = yes ; then
+ol_link_dnssrv=no
+if test "$ol_cv_lib_resolver" != no ; then
        cat >> confdefs.h <<\EOF
 #define HAVE_RES_QUERY 1
 EOF
 
 
-       if test $ol_enable_dnssrv != no ; then
+       if test "$ol_enable_dnssrv" != no ; then
                ol_link_dnssrv=yes
        fi
+
+       if test "$ol_cv_lib_resolver" != yes ; then
+               LIBS="$ol_cv_lib_resolver $LIBS"
+       fi
 fi
 
-if test "$ol_enable_dnssrv" != no -a "$ol_link_dnssrv" = no ; then
-       { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
+if test "$ol_enable_dnssrv" = yes -o "$ol_enable_dnssrv" = mod ; then
+       if test "$ol_link_dnssrv" = no ; then
+               { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
+       fi
+else
+       ol_enable_dnssrv=no
 fi
 
 for ac_func in hstrerror 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10620: checking for $ac_func" >&5
+echo "configure:10541: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10625 "configure"
+#line 10546 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10645,7 +10566,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10673,12 +10594,12 @@ done
 for ac_func in getaddrinfo getnameinfo gai_strerror inet_ntop 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10677: checking for $ac_func" >&5
+echo "configure:10598: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10682 "configure"
+#line 10603 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10702,7 +10623,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:10706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10734,13 +10655,13 @@ if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
        fi
 elif test $ol_enable_ipv6 != no ; then
        echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
-echo "configure:10738: checking INET6_ADDRSTRLEN" >&5
+echo "configure:10659: checking INET6_ADDRSTRLEN" >&5
 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 10744 "configure"
+#line 10665 "configure"
 #include "confdefs.h"
 
 #                      include <netinet/in.h>
@@ -10765,13 +10686,13 @@ echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
 
 
        echo $ac_n "checking struct sockaddr_storage""... $ac_c" 1>&6
-echo "configure:10769: checking struct sockaddr_storage" >&5
+echo "configure:10690: checking struct sockaddr_storage" >&5
 if eval "test \"\${ol_cv_struct_sockaddr_storage+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 10775 "configure"
+#line 10696 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -10783,7 +10704,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_sockaddr_storage=yes
 else
@@ -10814,17 +10735,17 @@ if test $ol_enable_local != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10818: checking for $ac_hdr" >&5
+echo "configure:10739: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10823 "configure"
+#line 10744 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10870,17 +10791,17 @@ if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10874: checking for $ac_hdr" >&5
+echo "configure:10795: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10879 "configure"
+#line 10800 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10912,17 +10833,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:10916: checking for $ac_hdr" >&5
+echo "configure:10837: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10921 "configure"
+#line 10842 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10956,7 +10877,7 @@ done
 
                if test $krb5_impl = mit; then
                        echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
-echo "configure:10960: checking for main in -lk5crypto" >&5
+echo "configure:10881: checking for main in -lk5crypto" >&5
 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -10964,14 +10885,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lk5crypto  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10968 "configure"
+#line 10889 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:10975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10994,7 +10915,7 @@ fi
 
 
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:10998: checking for main in -lkrb5" >&5
+echo "configure:10919: checking for main in -lkrb5" >&5
 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11002,14 +10923,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11006 "configure"
+#line 10927 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:11013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11034,7 +10955,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -ldes""... $ac_c" 1>&6
-echo "configure:11038: checking for main in -ldes" >&5
+echo "configure:10959: checking for main in -ldes" >&5
 ac_lib_var=`echo des'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11042,14 +10963,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldes  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11046 "configure"
+#line 10967 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:11053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11072,7 +10993,7 @@ fi
 
 
                        echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
-echo "configure:11076: checking for main in -lkrb5" >&5
+echo "configure:10997: checking for main in -lkrb5" >&5
 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11080,14 +11001,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11084 "configure"
+#line 11005 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:11091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11146,17 +11067,17 @@ if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11150: checking for $ac_hdr" >&5
+echo "configure:11071: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11155 "configure"
+#line 11076 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11186,7 +11107,7 @@ done
        if test $ac_cv_header_kerberosIV_krb_h = yes ; then
                if test $krb5_impl = mit; then
                        echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:11190: checking for main in -lkrb4" >&5
+echo "configure:11111: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11194,14 +11115,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11198 "configure"
+#line 11119 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:11205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11226,7 +11147,7 @@ fi
 
                elif test $krb5_impl = heimdal; then
                        echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
-echo "configure:11230: checking for main in -lkrb4" >&5
+echo "configure:11151: checking for main in -lkrb4" >&5
 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11234,14 +11155,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb4 -lkrb5 -l$krb5crypto -lasn1 -lroken -lcom_err $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11238 "configure"
+#line 11159 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:11245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11283,7 +11204,7 @@ EOF
 
 
                        echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
-echo "configure:11287: checking for des_debug in Kerberos libraries" >&5
+echo "configure:11208: checking for des_debug in Kerberos libraries" >&5
 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -11291,7 +11212,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 11295 "configure"
+#line 11216 "configure"
 #include "confdefs.h"
 
 #include <kerberosIV/krb.h>
@@ -11304,7 +11225,7 @@ des_debug = 1;
 
 ; return 0; }
 EOF
-if { (eval echo configure:11308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_var_des_debug=yes
 else
@@ -11343,17 +11264,17 @@ if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11347: checking for $ac_hdr" >&5
+echo "configure:11268: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11352 "configure"
+#line 11273 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11382,7 +11303,7 @@ done
 
        if test $ac_cv_header_krb_h = yes ; then
                echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
-echo "configure:11386: checking for main in -lkrb" >&5
+echo "configure:11307: checking for main in -lkrb" >&5
 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11390,14 +11311,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lkrb -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11394 "configure"
+#line 11315 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:11401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11464,17 +11385,17 @@ if test $ol_with_tls != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11468: checking for $ac_hdr" >&5
+echo "configure:11389: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11473 "configure"
+#line 11394 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11504,7 +11425,7 @@ done
        if test $ac_cv_header_openssl_ssl_h = yes \
                -o $ac_cv_header_ssl_h = yes ; then
                echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
-echo "configure:11508: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
+echo "configure:11429: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11512,7 +11433,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11516 "configure"
+#line 11437 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11523,7 +11444,7 @@ int main() {
 SSLeay_add_ssl_algorithms()
 ; return 0; }
 EOF
-if { (eval echo configure:11527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11548,7 +11469,7 @@ fi
                        
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
-echo "configure:11552: checking for SSL_library_init in -lssl" >&5
+echo "configure:11473: checking for SSL_library_init in -lssl" >&5
 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11556,7 +11477,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11560 "configure"
+#line 11481 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11567,7 +11488,7 @@ int main() {
 SSL_library_init()
 ; return 0; }
 EOF
-if { (eval echo configure:11571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11593,7 +11514,7 @@ fi
 
                if test $have_ssleay = no ; then
                        echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
-echo "configure:11597: checking for ssl3_accept in -lssl" >&5
+echo "configure:11518: checking for ssl3_accept in -lssl" >&5
 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -11601,7 +11522,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 11605 "configure"
+#line 11526 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11612,7 +11533,7 @@ int main() {
 ssl3_accept()
 ; return 0; }
 EOF
-if { (eval echo configure:11616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11657,13 +11578,13 @@ EOF
                        fi
                fi
                echo $ac_n "checking OpenSSL library version (CRL checking capability)""... $ac_c" 1>&6
-echo "configure:11661: checking OpenSSL library version (CRL checking capability)" >&5
+echo "configure:11582: checking OpenSSL library version (CRL checking capability)" >&5
 if eval "test \"\${ol_cv_ssl_crl_compat+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 11667 "configure"
+#line 11588 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_OPENSSL_SSL_H
@@ -11740,12 +11661,12 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 
        
        echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
-echo "configure:11744: checking for _beginthread" >&5
+echo "configure:11665: checking for _beginthread" >&5
 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11749 "configure"
+#line 11670 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _beginthread(); below.  */
@@ -11769,7 +11690,7 @@ f = _beginthread;
 
 ; return 0; }
 EOF
-if { (eval echo configure:11773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__beginthread=yes"
 else
@@ -11825,17 +11746,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11829: checking for $ac_hdr" >&5
+echo "configure:11750: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11834 "configure"
+#line 11755 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11864,13 +11785,13 @@ done
 
        if test $ac_cv_header_pthread_h = yes ; then
                echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:11868: checking POSIX thread version" >&5
+echo "configure:11789: checking POSIX thread version" >&5
 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 11874 "configure"
+#line 11795 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -11881,11 +11802,11 @@ int main() {
        
 ; return 0; }
 EOF
-if { (eval echo configure:11885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
        cat > conftest.$ac_ext <<EOF
-#line 11889 "configure"
+#line 11810 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -11905,7 +11826,7 @@ else
   rm -rf conftest*
   
        cat > conftest.$ac_ext <<EOF
-#line 11909 "configure"
+#line 11830 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -11922,7 +11843,7 @@ else
   rm -rf conftest*
   
        cat > conftest.$ac_ext <<EOF
-#line 11926 "configure"
+#line 11847 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -11934,7 +11855,7 @@ else
   rm -rf conftest*
   
        cat > conftest.$ac_ext <<EOF
-#line 11938 "configure"
+#line 11859 "configure"
 #include "confdefs.h"
 
 #              include <pthread.h>
@@ -11981,12 +11902,12 @@ EOF
 
                
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:11985: checking for LinuxThreads pthread.h" >&5
+echo "configure:11906: checking for LinuxThreads pthread.h" >&5
 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 11990 "configure"
+#line 11911 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -12013,12 +11934,12 @@ EOF
 
                
        echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
-echo "configure:12017: checking for GNU Pth pthread.h" >&5
+echo "configure:11938: checking for GNU Pth pthread.h" >&5
 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12022 "configure"
+#line 11943 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 #ifdef _POSIX_THREAD_IS_GNU_PTH
@@ -12047,17 +11968,17 @@ echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:12051: checking for $ac_hdr" >&5
+echo "configure:11972: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 12056 "configure"
+#line 11977 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12087,14 +12008,14 @@ done
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
-echo "configure:12091: checking for pthread_create in default libraries" >&5
+echo "configure:12012: checking for pthread_create in default libraries" >&5
 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12098 "configure"
+#line 12019 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12161,7 +12082,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_create=yes
 else
@@ -12173,7 +12094,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12177 "configure"
+#line 12098 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12245,7 +12166,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:12170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_create=yes
 else
@@ -12270,7 +12191,7 @@ echo "$ac_t""$ol_cv_pthread_create" 1>&6
 if test "$ol_link_threads" = no ; then
        # try -kthread
        echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
-echo "configure:12274: checking for pthread link with -kthread" >&5
+echo "configure:12195: checking for pthread link with -kthread" >&5
 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12281,7 +12202,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12285 "configure"
+#line 12206 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12348,7 +12269,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_kthread=yes
 else
@@ -12360,7 +12281,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12364 "configure"
+#line 12285 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12432,7 +12353,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:12357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_kthread=yes
 else
@@ -12462,7 +12383,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -pthread
        echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
-echo "configure:12466: checking for pthread link with -pthread" >&5
+echo "configure:12387: checking for pthread link with -pthread" >&5
 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12473,7 +12394,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12477 "configure"
+#line 12398 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12540,7 +12461,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthread=yes
 else
@@ -12552,7 +12473,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12556 "configure"
+#line 12477 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12624,7 +12545,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:12549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_pthread=yes
 else
@@ -12654,7 +12575,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -pthreads
        echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
-echo "configure:12658: checking for pthread link with -pthreads" >&5
+echo "configure:12579: checking for pthread link with -pthreads" >&5
 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12665,7 +12586,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12669 "configure"
+#line 12590 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12732,7 +12653,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_pthreads=yes
 else
@@ -12744,7 +12665,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12748 "configure"
+#line 12669 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12816,7 +12737,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:12820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:12741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_pthreads=yes
 else
@@ -12846,7 +12767,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -mthreads
        echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
-echo "configure:12850: checking for pthread link with -mthreads" >&5
+echo "configure:12771: checking for pthread link with -mthreads" >&5
 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -12857,7 +12778,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 12861 "configure"
+#line 12782 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -12924,7 +12845,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_mthreads=yes
 else
@@ -12936,7 +12857,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 12940 "configure"
+#line 12861 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13008,7 +12929,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:12933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_mthreads=yes
 else
@@ -13038,7 +12959,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -thread
        echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
-echo "configure:13042: checking for pthread link with -thread" >&5
+echo "configure:12963: checking for pthread link with -thread" >&5
 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13049,7 +12970,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13053 "configure"
+#line 12974 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13116,7 +13037,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_thread=yes
 else
@@ -13128,7 +13049,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13132 "configure"
+#line 13053 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13200,7 +13121,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:13125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_thread=yes
 else
@@ -13231,7 +13152,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -lmach -lexc -lc_r
        echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
-echo "configure:13235: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
+echo "configure:13156: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13242,7 +13163,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13246 "configure"
+#line 13167 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13309,7 +13230,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
@@ -13321,7 +13242,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13325 "configure"
+#line 13246 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13393,7 +13314,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:13318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
 else
@@ -13423,7 +13344,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -lmach -lexc
        echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
-echo "configure:13427: checking for pthread link with -lpthread -lmach -lexc" >&5
+echo "configure:13348: checking for pthread link with -lpthread -lmach -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13434,7 +13355,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13438 "configure"
+#line 13359 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13501,7 +13422,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread_lmach_lexc=yes
 else
@@ -13513,7 +13434,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13517 "configure"
+#line 13438 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13585,7 +13506,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:13510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lpthread_lmach_lexc=yes
 else
@@ -13616,7 +13537,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread -Wl,-woff,85
        echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
-echo "configure:13620: checking for pthread link with -lpthread -Wl,-woff,85" >&5
+echo "configure:13541: checking for pthread link with -lpthread -Wl,-woff,85" >&5
 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13627,7 +13548,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13631 "configure"
+#line 13552 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13694,7 +13615,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -13706,7 +13627,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13710 "configure"
+#line 13631 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13778,7 +13699,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:13703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lib_lpthread_woff=yes
 else
@@ -13809,7 +13730,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthread
        echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
-echo "configure:13813: checking for pthread link with -lpthread" >&5
+echo "configure:13734: checking for pthread link with -lpthread" >&5
 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -13820,7 +13741,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 13824 "configure"
+#line 13745 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13887,7 +13808,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:13891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthread=yes
 else
@@ -13899,7 +13820,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 13903 "configure"
+#line 13824 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -13971,7 +13892,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:13975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:13896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lpthread=yes
 else
@@ -14001,7 +13922,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lc_r
        echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
-echo "configure:14005: checking for pthread link with -lc_r" >&5
+echo "configure:13926: checking for pthread link with -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14012,7 +13933,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14016 "configure"
+#line 13937 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14079,7 +14000,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lc_r=yes
 else
@@ -14091,7 +14012,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14095 "configure"
+#line 14016 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14163,7 +14084,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:14088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lc_r=yes
 else
@@ -14194,7 +14115,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -threads
        echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
-echo "configure:14198: checking for pthread link with -threads" >&5
+echo "configure:14119: checking for pthread link with -threads" >&5
 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14205,7 +14126,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14209 "configure"
+#line 14130 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14272,7 +14193,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_threads=yes
 else
@@ -14284,7 +14205,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14288 "configure"
+#line 14209 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14356,7 +14277,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:14281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_threads=yes
 else
@@ -14387,7 +14308,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lmach -lexc -lc_r
        echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
-echo "configure:14391: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
+echo "configure:14312: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14398,7 +14319,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14402 "configure"
+#line 14323 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14465,7 +14386,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
@@ -14477,7 +14398,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14481 "configure"
+#line 14402 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14549,7 +14470,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:14474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
 else
@@ -14579,7 +14500,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lmach -lexc
        echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
-echo "configure:14583: checking for pthread link with -lpthreads -lmach -lexc" >&5
+echo "configure:14504: checking for pthread link with -lpthreads -lmach -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14590,7 +14511,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14594 "configure"
+#line 14515 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14657,7 +14578,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
@@ -14669,7 +14590,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14673 "configure"
+#line 14594 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14741,7 +14662,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:14666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lpthreads_lmach_lexc=yes
 else
@@ -14771,7 +14692,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads -lexc
        echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
-echo "configure:14775: checking for pthread link with -lpthreads -lexc" >&5
+echo "configure:14696: checking for pthread link with -lpthreads -lexc" >&5
 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14782,7 +14703,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14786 "configure"
+#line 14707 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14849,7 +14770,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:14853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lpthreads_lexc=yes
 else
@@ -14861,7 +14782,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 14865 "configure"
+#line 14786 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -14933,7 +14854,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:14937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:14858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lpthreads_lexc=yes
 else
@@ -14964,7 +14885,7 @@ fi
 if test "$ol_link_threads" = no ; then
        # try -lpthreads
        echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
-echo "configure:14968: checking for pthread link with -lpthreads" >&5
+echo "configure:14889: checking for pthread link with -lpthreads" >&5
 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -14975,7 +14896,7 @@ else
 
                if test "$cross_compiling" = yes; then
   cat > conftest.$ac_ext <<EOF
-#line 14979 "configure"
+#line 14900 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -15042,7 +14963,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:15046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_pthread_lib_lpthreads=yes
 else
@@ -15054,7 +14975,7 @@ fi
 rm -f conftest*
 else
   cat > conftest.$ac_ext <<EOF
-#line 15058 "configure"
+#line 14979 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -15126,7 +15047,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:15130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:15051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_lib_lpthreads=yes
 else
                                                                                                for ac_func in sched_yield pthread_yield thr_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15167: checking for $ac_func" >&5
+echo "configure:15088: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15172 "configure"
+#line 15093 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15192,7 +15113,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -15221,7 +15142,7 @@ done
                                $ac_cv_func_pthread_yield = no -a \
                                $ac_cv_func_thr_yield = no ; then
                                                                echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:15225: checking for sched_yield in -lrt" >&5
+echo "configure:15146: checking for sched_yield in -lrt" >&5
 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -15229,7 +15150,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 15233 "configure"
+#line 15154 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -15240,7 +15161,7 @@ int main() {
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:15244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
                                                for ac_func in pthread_kill pthread_rwlock_destroy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15280: checking for $ac_func" >&5
+echo "configure:15201: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15285 "configure"
+#line 15206 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15305,7 +15226,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -15331,13 +15252,13 @@ done
 
 
                                                                        echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:15335: checking for pthread_detach with <pthread.h>" >&5
+echo "configure:15256: checking for pthread_detach with <pthread.h>" >&5
 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                                                                cat > conftest.$ac_ext <<EOF
-#line 15341 "configure"
+#line 15262 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -15349,7 +15270,7 @@ int main() {
 pthread_detach(NULL);
 ; return 0; }
 EOF
-if { (eval echo configure:15353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_func_pthread_detach=yes
 else
@@ -15381,12 +15302,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15385: checking for $ac_func" >&5
+echo "configure:15306: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15390 "configure"
+#line 15311 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15410,7 +15331,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -15439,12 +15360,12 @@ done
        for ac_func in pthread_kill_other_threads_np
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15443: checking for $ac_func" >&5
+echo "configure:15364: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15448 "configure"
+#line 15369 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -15468,7 +15389,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -15493,7 +15414,7 @@ fi
 done
 
        echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
-echo "configure:15497: checking for LinuxThreads implementation" >&5
+echo "configure:15418: checking for LinuxThreads implementation" >&5
 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15506,7 +15427,7 @@ echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
        
        
        echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
-echo "configure:15510: checking for LinuxThreads consistency" >&5
+echo "configure:15431: checking for LinuxThreads consistency" >&5
 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15531,7 +15452,7 @@ echo "$ac_t""$ol_cv_linux_threads" 1>&6
                        fi
 
                        echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:15535: checking if pthread_create() works" >&5
+echo "configure:15456: checking if pthread_create() works" >&5
 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15540,7 +15461,7 @@ else
                                ol_cv_pthread_create_works=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 15544 "configure"
+#line 15465 "configure"
 #include "confdefs.h"
 /* pthread test headers */
 #include <pthread.h>
@@ -15612,7 +15533,7 @@ int main(argc, argv)
 }
 
 EOF
-if { (eval echo configure:15616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:15537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_create_works=yes
 else
@@ -15634,7 +15555,7 @@ echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
 
                                                if test $ol_with_yielding_select = auto ; then
                                echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:15638: checking if select yields when using pthreads" >&5
+echo "configure:15559: checking if select yields when using pthreads" >&5
 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15643,7 +15564,7 @@ else
   ol_cv_pthread_select_yields=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 15647 "configure"
+#line 15568 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -15720,7 +15641,7 @@ int main(argc, argv)
        exit(2);
 }
 EOF
-if { (eval echo configure:15724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:15645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_pthread_select_yields=no
 else
@@ -15764,17 +15685,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:15768: checking for $ac_hdr" >&5
+echo "configure:15689: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15773 "configure"
+#line 15694 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -15804,12 +15725,12 @@ done
                ol_with_threads=found
 
                                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:15808: checking for cthread_fork" >&5
+echo "configure:15729: checking for cthread_fork" >&5
 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15813 "configure"
+#line 15734 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -15833,7 +15754,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_cthread_fork=yes"
 else
@@ -15855,7 +15776,7 @@ fi
 
                if test $ol_link_threads = no ; then
                                                                        echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
-echo "configure:15859: checking for cthread_fork with -all_load" >&5
+echo "configure:15780: checking for cthread_fork with -all_load" >&5
 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -15863,7 +15784,7 @@ else
                                                                save_LIBS="$LIBS"
                                LIBS="-all_load $LIBS"
                                cat > conftest.$ac_ext <<EOF
-#line 15867 "configure"
+#line 15788 "configure"
 #include "confdefs.h"
 #include <mach/cthreads.h>
 int main() {
@@ -15872,7 +15793,7 @@ int main() {
                                        
 ; return 0; }
 EOF
-if { (eval echo configure:15876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_cthread_all_load=yes
 else
@@ -15902,12 +15823,12 @@ echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
                                save_LIBS="$LIBS"
                LIBS="$LIBS -lthreads"
                echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:15906: checking for cthread_fork" >&5
+echo "configure:15827: checking for cthread_fork" >&5
 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15911 "configure"
+#line 15832 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char cthread_fork(); below.  */
@@ -15931,7 +15852,7 @@ f = cthread_fork;
 
 ; return 0; }
 EOF
-if { (eval echo configure:15935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_cthread_fork=yes"
 else
@@ -15981,17 +15902,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:15985: checking for $ac_hdr" >&5
+echo "configure:15906: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 15990 "configure"
+#line 15911 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -16020,7 +15941,7 @@ done
 
        if test $ac_cv_header_pth_h = yes ; then
                echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
-echo "configure:16024: checking for pth_version in -lpth" >&5
+echo "configure:15945: checking for pth_version in -lpth" >&5
 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -16028,7 +15949,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 16032 "configure"
+#line 15953 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -16039,7 +15960,7 @@ int main() {
 pth_version()
 ; return 0; }
 EOF
-if { (eval echo configure:16043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -16084,17 +16005,17 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16088: checking for $ac_hdr" >&5
+echo "configure:16009: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16093 "configure"
+#line 16014 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -16122,7 +16043,7 @@ done
 
        if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
                echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
-echo "configure:16126: checking for thr_create in -lthread" >&5
+echo "configure:16047: checking for thr_create in -lthread" >&5
 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -16130,7 +16051,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 16134 "configure"
+#line 16055 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -16141,7 +16062,7 @@ int main() {
 thr_create()
 ; return 0; }
 EOF
-if { (eval echo configure:16145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -16181,12 +16102,12 @@ EOF
                        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16185: checking for $ac_func" >&5
+echo "configure:16106: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16190 "configure"
+#line 16111 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -16210,7 +16131,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:16214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -16241,17 +16162,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16245: checking for $ac_hdr" >&5
+echo "configure:16166: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16250 "configure"
+#line 16171 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -16279,7 +16200,7 @@ done
 
        if test $ac_cv_header_lwp_lwp_h = yes ; then
                echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
-echo "configure:16283: checking for lwp_create in -llwp" >&5
+echo "configure:16204: checking for lwp_create in -llwp" >&5
 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -16287,7 +16208,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llwp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 16291 "configure"
+#line 16212 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -16298,7 +16219,7 @@ int main() {
 lwp_create()
 ; return 0; }
 EOF
-if { (eval echo configure:16302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -16351,17 +16272,17 @@ if test $ol_with_threads = manual ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16355: checking for $ac_hdr" >&5
+echo "configure:16276: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16360 "configure"
+#line 16281 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -16390,12 +16311,12 @@ done
        for ac_func in sched_yield pthread_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16394: checking for $ac_func" >&5
+echo "configure:16315: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16399 "configure"
+#line 16320 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -16419,7 +16340,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:16423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -16445,12 +16366,12 @@ done
 
        
        echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
-echo "configure:16449: checking for LinuxThreads pthread.h" >&5
+echo "configure:16370: checking for LinuxThreads pthread.h" >&5
 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16454 "configure"
+#line 16375 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -16480,17 +16401,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16484: checking for $ac_hdr" >&5
+echo "configure:16405: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16489 "configure"
+#line 16410 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -16520,17 +16441,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16524: checking for $ac_hdr" >&5
+echo "configure:16445: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16529 "configure"
+#line 16450 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -16560,17 +16481,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16564: checking for $ac_hdr" >&5
+echo "configure:16485: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16569 "configure"
+#line 16490 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16495: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -16629,20 +16550,20 @@ EOF
 
 
                        echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:16633: checking for thread specific errno" >&5
+echo "configure:16554: checking for thread specific errno" >&5
 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 16639 "configure"
+#line 16560 "configure"
 #include "confdefs.h"
 #include <errno.h>
 int main() {
 errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:16646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_errno_thread_specific=yes
 else
 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
 
                        echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
-echo "configure:16662: checking for thread specific h_errno" >&5
+echo "configure:16583: checking for thread specific h_errno" >&5
 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 16668 "configure"
+#line 16589 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 h_errno = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:16675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_h_errno_thread_specific=yes
 else
@@ -16724,12 +16645,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:16728: checking for $ac_func" >&5
+echo "configure:16649: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16733 "configure"
+#line 16654 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -16753,7 +16674,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:16757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -16782,19 +16703,19 @@ if test "$ac_cv_func_ctime_r" = no ; then
        ol_cv_func_ctime_r_nargs=0
 else
        echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
-echo "configure:16786: checking number of arguments of ctime_r" >&5
+echo "configure:16707: checking number of arguments of ctime_r" >&5
 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16791 "configure"
+#line 16712 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
 ; return 0; }
 EOF
-if { (eval echo configure:16798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs3=yes
 else
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 16810 "configure"
+#line 16731 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t ti; char *buffer; ctime_r(&ti,buffer);
 ; return 0; }
 EOF
-if { (eval echo configure:16817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_ctime_r_nargs2=yes
 else
 
 if test "$ac_cv_func_gethostbyname_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
-echo "configure:16857: checking number of arguments of gethostbyname_r" >&5
+echo "configure:16778: checking number of arguments of gethostbyname_r" >&5
 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16862 "configure"
+#line 16783 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -16872,7 +16793,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:16876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs5=yes
 else
@@ -16884,7 +16805,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 16888 "configure"
+#line 16809 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -16899,7 +16820,7 @@ struct hostent hent;struct hostent *rhent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:16903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyname_r_nargs6=yes
 else
  
 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
        echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
-echo "configure:16944: checking number of arguments of gethostbyaddr_r" >&5
+echo "configure:16865: checking number of arguments of gethostbyaddr_r" >&5
 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 16949 "configure"
+#line 16870 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -16961,7 +16882,7 @@ struct hostent hent; char buffer[BUFSIZE];
                        alen, AF_INET, &hent, buffer, bufsize, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:16965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs7=yes
 else
@@ -16973,7 +16894,7 @@ fi
 rm -f conftest*
 
        cat > conftest.$ac_ext <<EOF
-#line 16977 "configure"
+#line 16898 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -16991,7 +16912,7 @@ struct hostent hent;
                        &rhent, &h_errno);
 ; return 0; }
 EOF
-if { (eval echo configure:16995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_func_gethostbyaddr_r_nargs8=yes
 else
@@ -17041,17 +16962,17 @@ if test $ol_with_ldbm_api = auto \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:17045: checking for $ac_hdr" >&5
+echo "configure:16966: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 17050 "configure"
+#line 16971 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:17055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -17079,13 +17000,13 @@ done
 
 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
        echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
-echo "configure:17083: checking if Berkeley DB header compatibility" >&5
+echo "configure:17004: checking if Berkeley DB header compatibility" >&5
 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
                cat > conftest.$ac_ext <<EOF
-#line 17089 "configure"
+#line 17010 "configure"
 #include "confdefs.h"
 
 #if HAVE_DB_185_H
@@ -17122,7 +17043,7 @@ echo "$ac_t""$ol_cv_header_db1" 1>&6
                ol_cv_lib_db=no
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
-echo "configure:17126: checking for Berkeley DB link (default)" >&5
+echo "configure:17047: checking for Berkeley DB link (default)" >&5
 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17132,7 +17053,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17136 "configure"
+#line 17057 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17179,7 +17100,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -17203,7 +17124,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb43)""... $ac_c" 1>&6
-echo "configure:17207: checking for Berkeley DB link (-ldb43)" >&5
+echo "configure:17128: checking for Berkeley DB link (-ldb43)" >&5
 if eval "test \"\${ol_cv_db_db43+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17213,7 +17134,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17217 "configure"
+#line 17138 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17260,7 +17181,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db43=yes
 else
@@ -17284,7 +17205,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-43)""... $ac_c" 1>&6
-echo "configure:17288: checking for Berkeley DB link (-ldb-43)" >&5
+echo "configure:17209: checking for Berkeley DB link (-ldb-43)" >&5
 if eval "test \"\${ol_cv_db_db_43+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17294,7 +17215,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17298 "configure"
+#line 17219 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17341,7 +17262,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_43=yes
 else
@@ -17365,7 +17286,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4.3)""... $ac_c" 1>&6
-echo "configure:17369: checking for Berkeley DB link (-ldb-4.3)" >&5
+echo "configure:17290: checking for Berkeley DB link (-ldb-4.3)" >&5
 if eval "test \"\${ol_cv_db_db_4_dot_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17375,7 +17296,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17379 "configure"
+#line 17300 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17422,7 +17343,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_dot_3=yes
 else
@@ -17446,7 +17367,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4-3)""... $ac_c" 1>&6
-echo "configure:17450: checking for Berkeley DB link (-ldb-4-3)" >&5
+echo "configure:17371: checking for Berkeley DB link (-ldb-4-3)" >&5
 if eval "test \"\${ol_cv_db_db_4_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17456,7 +17377,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17460 "configure"
+#line 17381 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17503,7 +17424,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_3=yes
 else
@@ -17527,7 +17448,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
-echo "configure:17531: checking for Berkeley DB link (-ldb42)" >&5
+echo "configure:17452: checking for Berkeley DB link (-ldb42)" >&5
 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17537,7 +17458,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17541 "configure"
+#line 17462 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17584,7 +17505,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db42=yes
 else
@@ -17608,7 +17529,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
-echo "configure:17612: checking for Berkeley DB link (-ldb-42)" >&5
+echo "configure:17533: checking for Berkeley DB link (-ldb-42)" >&5
 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17618,7 +17539,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17622 "configure"
+#line 17543 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17665,7 +17586,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_42=yes
 else
@@ -17689,7 +17610,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
-echo "configure:17693: checking for Berkeley DB link (-ldb-4.2)" >&5
+echo "configure:17614: checking for Berkeley DB link (-ldb-4.2)" >&5
 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17699,7 +17620,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17703 "configure"
+#line 17624 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17746,7 +17667,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_dot_2=yes
 else
@@ -17770,7 +17691,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
-echo "configure:17774: checking for Berkeley DB link (-ldb-4-2)" >&5
+echo "configure:17695: checking for Berkeley DB link (-ldb-4-2)" >&5
 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17780,7 +17701,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17784 "configure"
+#line 17705 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17827,7 +17748,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_2=yes
 else
@@ -17851,7 +17772,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
-echo "configure:17855: checking for Berkeley DB link (-ldb-4)" >&5
+echo "configure:17776: checking for Berkeley DB link (-ldb-4)" >&5
 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17861,7 +17782,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17865 "configure"
+#line 17786 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17908,7 +17829,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4=yes
 else
@@ -17932,7 +17853,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
-echo "configure:17936: checking for Berkeley DB link (-ldb4)" >&5
+echo "configure:17857: checking for Berkeley DB link (-ldb4)" >&5
 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -17942,7 +17863,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 17946 "configure"
+#line 17867 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -17989,7 +17910,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:17993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db4=yes
 else
@@ -18013,7 +17934,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
-echo "configure:18017: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:17938: checking for Berkeley DB link (-ldb)" >&5
 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18023,7 +17944,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18027 "configure"
+#line 17948 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18070,7 +17991,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -18094,7 +18015,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
-echo "configure:18098: checking for Berkeley DB link (-ldb41)" >&5
+echo "configure:18019: checking for Berkeley DB link (-ldb41)" >&5
 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18104,7 +18025,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18108 "configure"
+#line 18029 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18151,7 +18072,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db41=yes
 else
@@ -18175,7 +18096,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
-echo "configure:18179: checking for Berkeley DB link (-ldb-41)" >&5
+echo "configure:18100: checking for Berkeley DB link (-ldb-41)" >&5
 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18185,7 +18106,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18189 "configure"
+#line 18110 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18232,7 +18153,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_41=yes
 else
@@ -18256,7 +18177,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
-echo "configure:18260: checking for Berkeley DB link (-ldb-4.1)" >&5
+echo "configure:18181: checking for Berkeley DB link (-ldb-4.1)" >&5
 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18266,7 +18187,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18270 "configure"
+#line 18191 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18313,7 +18234,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_dot_1=yes
 else
@@ -18337,7 +18258,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
-echo "configure:18341: checking for Berkeley DB link (-ldb-4-1)" >&5
+echo "configure:18262: checking for Berkeley DB link (-ldb-4-1)" >&5
 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18347,7 +18268,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18351 "configure"
+#line 18272 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18394,7 +18315,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_1=yes
 else
@@ -18418,7 +18339,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:18422: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:18343: checking for Berkeley DB link (-ldb3)" >&5
 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18428,7 +18349,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18432 "configure"
+#line 18353 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18475,7 +18396,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -18499,7 +18420,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
-echo "configure:18503: checking for Berkeley DB link (-ldb-3)" >&5
+echo "configure:18424: checking for Berkeley DB link (-ldb-3)" >&5
 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18509,7 +18430,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18513 "configure"
+#line 18434 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18556,7 +18477,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_3=yes
 else
@@ -18580,7 +18501,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
-echo "configure:18584: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:18505: checking for Berkeley DB link (-ldb2)" >&5
 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18590,7 +18511,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18594 "configure"
+#line 18515 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18637,7 +18558,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -18661,7 +18582,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
-echo "configure:18665: checking for Berkeley DB link (-ldb-2)" >&5
+echo "configure:18586: checking for Berkeley DB link (-ldb-2)" >&5
 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18671,7 +18592,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18675 "configure"
+#line 18596 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18718,7 +18639,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_2=yes
 else
@@ -18742,7 +18663,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
-echo "configure:18746: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:18667: checking for Berkeley DB link (-ldb1)" >&5
 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18752,7 +18673,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18756 "configure"
+#line 18677 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18799,7 +18720,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -18823,7 +18744,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
-echo "configure:18827: checking for Berkeley DB link (-ldb-1)" >&5
+echo "configure:18748: checking for Berkeley DB link (-ldb-1)" >&5
 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18833,7 +18754,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18837 "configure"
+#line 18758 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -18880,7 +18801,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:18884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_1=yes
 else
@@ -18915,17 +18836,17 @@ for ac_hdr in db.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:18919: checking for $ac_hdr" >&5
+echo "configure:18840: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 18924 "configure"
+#line 18845 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:18929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:18850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -18955,7 +18876,7 @@ if test $ac_cv_header_db_h = yes; then
        ol_cv_lib_db=no
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
-echo "configure:18959: checking for Berkeley DB link (default)" >&5
+echo "configure:18880: checking for Berkeley DB link (default)" >&5
 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -18965,7 +18886,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 18969 "configure"
+#line 18890 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19012,7 +18933,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_none=yes
 else
@@ -19036,7 +18957,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb43)""... $ac_c" 1>&6
-echo "configure:19040: checking for Berkeley DB link (-ldb43)" >&5
+echo "configure:18961: checking for Berkeley DB link (-ldb43)" >&5
 if eval "test \"\${ol_cv_db_db43+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19046,7 +18967,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19050 "configure"
+#line 18971 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19093,7 +19014,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db43=yes
 else
@@ -19117,7 +19038,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-43)""... $ac_c" 1>&6
-echo "configure:19121: checking for Berkeley DB link (-ldb-43)" >&5
+echo "configure:19042: checking for Berkeley DB link (-ldb-43)" >&5
 if eval "test \"\${ol_cv_db_db_43+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19127,7 +19048,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19131 "configure"
+#line 19052 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19174,7 +19095,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_43=yes
 else
@@ -19198,7 +19119,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4.3)""... $ac_c" 1>&6
-echo "configure:19202: checking for Berkeley DB link (-ldb-4.3)" >&5
+echo "configure:19123: checking for Berkeley DB link (-ldb-4.3)" >&5
 if eval "test \"\${ol_cv_db_db_4_dot_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19208,7 +19129,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19212 "configure"
+#line 19133 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19255,7 +19176,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_dot_3=yes
 else
@@ -19279,7 +19200,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4-3)""... $ac_c" 1>&6
-echo "configure:19283: checking for Berkeley DB link (-ldb-4-3)" >&5
+echo "configure:19204: checking for Berkeley DB link (-ldb-4-3)" >&5
 if eval "test \"\${ol_cv_db_db_4_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19289,7 +19210,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19293 "configure"
+#line 19214 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19336,7 +19257,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_3=yes
 else
@@ -19360,7 +19281,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb42)""... $ac_c" 1>&6
-echo "configure:19364: checking for Berkeley DB link (-ldb42)" >&5
+echo "configure:19285: checking for Berkeley DB link (-ldb42)" >&5
 if eval "test \"\${ol_cv_db_db42+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19370,7 +19291,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19374 "configure"
+#line 19295 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19417,7 +19338,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db42=yes
 else
@@ -19441,7 +19362,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-42)""... $ac_c" 1>&6
-echo "configure:19445: checking for Berkeley DB link (-ldb-42)" >&5
+echo "configure:19366: checking for Berkeley DB link (-ldb-42)" >&5
 if eval "test \"\${ol_cv_db_db_42+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19451,7 +19372,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19455 "configure"
+#line 19376 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19498,7 +19419,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_42=yes
 else
@@ -19522,7 +19443,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4.2)""... $ac_c" 1>&6
-echo "configure:19526: checking for Berkeley DB link (-ldb-4.2)" >&5
+echo "configure:19447: checking for Berkeley DB link (-ldb-4.2)" >&5
 if eval "test \"\${ol_cv_db_db_4_dot_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19532,7 +19453,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19536 "configure"
+#line 19457 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19579,7 +19500,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_dot_2=yes
 else
@@ -19603,7 +19524,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4-2)""... $ac_c" 1>&6
-echo "configure:19607: checking for Berkeley DB link (-ldb-4-2)" >&5
+echo "configure:19528: checking for Berkeley DB link (-ldb-4-2)" >&5
 if eval "test \"\${ol_cv_db_db_4_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19613,7 +19534,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19617 "configure"
+#line 19538 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19660,7 +19581,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_2=yes
 else
@@ -19684,7 +19605,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4)""... $ac_c" 1>&6
-echo "configure:19688: checking for Berkeley DB link (-ldb-4)" >&5
+echo "configure:19609: checking for Berkeley DB link (-ldb-4)" >&5
 if eval "test \"\${ol_cv_db_db_4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19694,7 +19615,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19698 "configure"
+#line 19619 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19741,7 +19662,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4=yes
 else
@@ -19765,7 +19686,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
-echo "configure:19769: checking for Berkeley DB link (-ldb4)" >&5
+echo "configure:19690: checking for Berkeley DB link (-ldb4)" >&5
 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19775,7 +19696,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19779 "configure"
+#line 19700 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19822,7 +19743,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db4=yes
 else
@@ -19846,7 +19767,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
-echo "configure:19850: checking for Berkeley DB link (-ldb)" >&5
+echo "configure:19771: checking for Berkeley DB link (-ldb)" >&5
 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19856,7 +19777,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19860 "configure"
+#line 19781 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19903,7 +19824,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db=yes
 else
@@ -19927,7 +19848,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb41)""... $ac_c" 1>&6
-echo "configure:19931: checking for Berkeley DB link (-ldb41)" >&5
+echo "configure:19852: checking for Berkeley DB link (-ldb41)" >&5
 if eval "test \"\${ol_cv_db_db41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -19937,7 +19858,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 19941 "configure"
+#line 19862 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -19984,7 +19905,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:19988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db41=yes
 else
@@ -20008,7 +19929,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-41)""... $ac_c" 1>&6
-echo "configure:20012: checking for Berkeley DB link (-ldb-41)" >&5
+echo "configure:19933: checking for Berkeley DB link (-ldb-41)" >&5
 if eval "test \"\${ol_cv_db_db_41+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20018,7 +19939,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20022 "configure"
+#line 19943 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20065,7 +19986,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:19990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_41=yes
 else
@@ -20089,7 +20010,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4.1)""... $ac_c" 1>&6
-echo "configure:20093: checking for Berkeley DB link (-ldb-4.1)" >&5
+echo "configure:20014: checking for Berkeley DB link (-ldb-4.1)" >&5
 if eval "test \"\${ol_cv_db_db_4_dot_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20099,7 +20020,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20103 "configure"
+#line 20024 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20146,7 +20067,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_dot_1=yes
 else
@@ -20170,7 +20091,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-4-1)""... $ac_c" 1>&6
-echo "configure:20174: checking for Berkeley DB link (-ldb-4-1)" >&5
+echo "configure:20095: checking for Berkeley DB link (-ldb-4-1)" >&5
 if eval "test \"\${ol_cv_db_db_4_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20180,7 +20101,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20184 "configure"
+#line 20105 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20227,7 +20148,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_4_1=yes
 else
@@ -20251,7 +20172,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
-echo "configure:20255: checking for Berkeley DB link (-ldb3)" >&5
+echo "configure:20176: checking for Berkeley DB link (-ldb3)" >&5
 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20261,7 +20182,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20265 "configure"
+#line 20186 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20308,7 +20229,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db3=yes
 else
@@ -20332,7 +20253,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-3)""... $ac_c" 1>&6
-echo "configure:20336: checking for Berkeley DB link (-ldb-3)" >&5
+echo "configure:20257: checking for Berkeley DB link (-ldb-3)" >&5
 if eval "test \"\${ol_cv_db_db_3+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20342,7 +20263,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20346 "configure"
+#line 20267 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20389,7 +20310,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_3=yes
 else
@@ -20413,7 +20334,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
-echo "configure:20417: checking for Berkeley DB link (-ldb2)" >&5
+echo "configure:20338: checking for Berkeley DB link (-ldb2)" >&5
 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20423,7 +20344,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20427 "configure"
+#line 20348 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20470,7 +20391,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db2=yes
 else
@@ -20494,7 +20415,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-2)""... $ac_c" 1>&6
-echo "configure:20498: checking for Berkeley DB link (-ldb-2)" >&5
+echo "configure:20419: checking for Berkeley DB link (-ldb-2)" >&5
 if eval "test \"\${ol_cv_db_db_2+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20504,7 +20425,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20508 "configure"
+#line 20429 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20551,7 +20472,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_2=yes
 else
@@ -20575,7 +20496,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
-echo "configure:20579: checking for Berkeley DB link (-ldb1)" >&5
+echo "configure:20500: checking for Berkeley DB link (-ldb1)" >&5
 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20585,7 +20506,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20589 "configure"
+#line 20510 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20632,7 +20553,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db1=yes
 else
@@ -20656,7 +20577,7 @@ fi
 
 if test $ol_cv_lib_db = no ; then
        echo $ac_n "checking for Berkeley DB link (-ldb-1)""... $ac_c" 1>&6
-echo "configure:20660: checking for Berkeley DB link (-ldb-1)" >&5
+echo "configure:20581: checking for Berkeley DB link (-ldb-1)" >&5
 if eval "test \"\${ol_cv_db_db_1+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20666,7 +20587,7 @@ else
        LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
 
        cat > conftest.$ac_ext <<EOF
-#line 20670 "configure"
+#line 20591 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20713,7 +20634,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:20717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_db_db_1=yes
 else
@@ -20739,7 +20660,7 @@ fi
        if test "$ol_cv_lib_db" != no ; then
                ol_cv_berkeley_db=yes
                echo $ac_n "checking for Berkeley DB version match""... $ac_c" 1>&6
-echo "configure:20743: checking for Berkeley DB version match" >&5
+echo "configure:20664: checking for Berkeley DB version match" >&5
 if eval "test \"\${ol_cv_berkeley_db_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20754,7 +20675,7 @@ else
   ol_cv_berkeley_db_version=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 20758 "configure"
+#line 20679 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20790,7 +20711,7 @@ main()
        return 0;
 }
 EOF
-if { (eval echo configure:20794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:20715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_berkeley_db_version=yes
 else
@@ -20814,7 +20735,7 @@ echo "$ac_t""$ol_cv_berkeley_db_version" 1>&6
        fi
 
                echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
-echo "configure:20818: checking for Berkeley DB thread support" >&5
+echo "configure:20739: checking for Berkeley DB thread support" >&5
 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -20829,7 +20750,7 @@ else
   ol_cv_berkeley_db_thread=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 20833 "configure"
+#line 20754 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_DB_185_H
@@ -20896,7 +20817,7 @@ main()
        return rc;
 }
 EOF
-if { (eval echo configure:20900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:20821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_berkeley_db_thread=yes
 else
@@ -20959,13 +20880,13 @@ if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
                { echo "configure: error: BDB/HDB: BerkeleyDB not available" 1>&2; exit 1; }
        else
                echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
-echo "configure:20963: checking Berkeley DB version for BDB backend" >&5
+echo "configure:20884: checking Berkeley DB version for BDB backend" >&5
 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 20969 "configure"
+#line 20890 "configure"
 #include "confdefs.h"
 
 #include <db.h>
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
        echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
-echo "configure:21016: checking for MDBM library" >&5
+echo "configure:20937: checking for MDBM library" >&5
 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
-echo "configure:21022: checking for mdbm_set_chain" >&5
+echo "configure:20943: checking for mdbm_set_chain" >&5
 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21027 "configure"
+#line 20948 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mdbm_set_chain(); below.  */
@@ -21047,7 +20968,7 @@ f = mdbm_set_chain;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_mdbm_set_chain=yes"
 else
@@ -21066,7 +20987,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
-echo "configure:21070: checking for mdbm_set_chain in -lmdbm" >&5
+echo "configure:20991: checking for mdbm_set_chain in -lmdbm" >&5
 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -21074,7 +20995,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21078 "configure"
+#line 20999 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -21085,7 +21006,7 @@ int main() {
 mdbm_set_chain()
 ; return 0; }
 EOF
-if { (eval echo configure:21089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -21120,17 +21041,17 @@ echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21124: checking for $ac_hdr" >&5
+echo "configure:21045: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21129 "configure"
+#line 21050 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -21157,7 +21078,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:21161: checking for db" >&5
+echo "configure:21082: checking for db" >&5
 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 
 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
        echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
-echo "configure:21194: checking for GDBM library" >&5
+echo "configure:21115: checking for GDBM library" >&5
 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
-echo "configure:21200: checking for gdbm_open" >&5
+echo "configure:21121: checking for gdbm_open" >&5
 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21205 "configure"
+#line 21126 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gdbm_open(); below.  */
@@ -21225,7 +21146,7 @@ f = gdbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gdbm_open=yes"
 else
@@ -21244,7 +21165,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:21248: checking for gdbm_open in -lgdbm" >&5
+echo "configure:21169: checking for gdbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -21252,7 +21173,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgdbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21256 "configure"
+#line 21177 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -21263,7 +21184,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:21267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -21298,17 +21219,17 @@ echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21302: checking for $ac_hdr" >&5
+echo "configure:21223: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21307 "configure"
+#line 21228 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -21335,7 +21256,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:21339: checking for db" >&5
+echo "configure:21260: checking for db" >&5
 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
 
 if test $ol_with_ldbm_api = ndbm ; then
        echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:21373: checking for NDBM library" >&5
+echo "configure:21294: checking for NDBM library" >&5
 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
        ol_LIBS="$LIBS"
        echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:21379: checking for dbm_open" >&5
+echo "configure:21300: checking for dbm_open" >&5
 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21384 "configure"
+#line 21305 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -21404,7 +21325,7 @@ f = dbm_open;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -21423,7 +21344,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:21427: checking for dbm_open in -lndbm" >&5
+echo "configure:21348: checking for dbm_open in -lndbm" >&5
 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -21431,7 +21352,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lndbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21435 "configure"
+#line 21356 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -21442,7 +21363,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:21446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -21462,7 +21383,7 @@ else
   echo "$ac_t""no" 1>&6
 
                        echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:21466: checking for dbm_open in -ldbm" >&5
+echo "configure:21387: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -21470,7 +21391,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldbm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21474 "configure"
+#line 21395 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -21481,7 +21402,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:21485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -21518,17 +21439,17 @@ echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21522: checking for $ac_hdr" >&5
+echo "configure:21443: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21527 "configure"
+#line 21448 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -21555,7 +21476,7 @@ fi
 done
 
  echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:21559: checking for db" >&5
+echo "configure:21480: checking for db" >&5
 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -21615,17 +21536,17 @@ if test $ol_enable_wrappers != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21619: checking for $ac_hdr" >&5
+echo "configure:21540: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21624 "configure"
+#line 21545 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -21647,11 +21568,11 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
                echo $ac_n "checking for TCP wrappers library""... $ac_c" 1>&6
-echo "configure:21651: checking for TCP wrappers library" >&5
+echo "configure:21572: checking for TCP wrappers library" >&5
                save_LIBS="$LIBS"
                LIBS="$LIBS -lwrap"
                cat > conftest.$ac_ext <<EOF
-#line 21655 "configure"
+#line 21576 "configure"
 #include "confdefs.h"
 
 #include <tcpd.h>
@@ -21666,7 +21587,7 @@ hosts_access(req)
                
 ; return 0; }
 EOF
-if { (eval echo configure:21670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""-lwrap" 1>&6
                have_wrappers=yes
@@ -21678,7 +21599,7 @@ else
   
                                LIBS="$LIBS -lnsl"
                cat > conftest.$ac_ext <<EOF
-#line 21682 "configure"
+#line 21603 "configure"
 #include "confdefs.h"
 
 #include <tcpd.h>
@@ -21693,7 +21614,7 @@ hosts_access(req)
                
 ; return 0; }
 EOF
-if { (eval echo configure:21697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""-lwrap -lnsl" 1>&6
                have_wrappers=yes
 
 if test $ol_enable_syslog != no ; then
        echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:21737: checking for openlog" >&5
+echo "configure:21658: checking for openlog" >&5
 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21742 "configure"
+#line 21663 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char openlog(); below.  */
@@ -21762,7 +21683,7 @@ f = openlog;
 
 ; return 0; }
 EOF
-if { (eval echo configure:21766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_openlog=yes"
 else
@@ -21794,17 +21715,17 @@ if test $ol_enable_sql != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21798: checking for $ac_hdr" >&5
+echo "configure:21719: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21803 "configure"
+#line 21724 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 done
 
 
+       sql_LIBS="$LIBS"
+       LIBS="$LTHREAD_LIBS"
+
        echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
-echo "configure:21838: checking for SQLDriverConnect in -liodbc" >&5
+echo "configure:21762: checking for SQLDriverConnect in -liodbc" >&5
 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -21842,7 +21766,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-liodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21846 "configure"
+#line 21770 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -21853,7 +21777,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:21857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -21878,7 +21802,7 @@ fi
                ol_link_sql="-liodbc"
        else
                echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
-echo "configure:21882: checking for SQLDriverConnect in -lodbc" >&5
+echo "configure:21806: checking for SQLDriverConnect in -lodbc" >&5
 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -21886,7 +21810,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lodbc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21890 "configure"
+#line 21814 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -21897,7 +21821,7 @@ int main() {
 SQLDriverConnect()
 ; return 0; }
 EOF
-if { (eval echo configure:21901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -21923,6 +21847,8 @@ fi
                fi
        fi
 
+       LIBS="$sql_LIBS"
+
        if test $ol_link_sql != no ; then
                SLAPD_SQL_LIBS="$ol_link_sql"
 
@@ -21939,17 +21865,17 @@ if test $ol_with_cyrus_sasl != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:21943: checking for $ac_hdr" >&5
+echo "configure:21869: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 21948 "configure"
+#line 21874 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:21953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:21879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -21978,7 +21904,7 @@ done
 
        if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
                echo $ac_n "checking for sasl_client_init in -lsasl2""... $ac_c" 1>&6
-echo "configure:21982: checking for sasl_client_init in -lsasl2" >&5
+echo "configure:21908: checking for sasl_client_init in -lsasl2" >&5
 ac_lib_var=`echo sasl2'_'sasl_client_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -21986,7 +21912,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl2  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 21990 "configure"
+#line 21916 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -21997,7 +21923,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:22001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -22016,7 +21942,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
-echo "configure:22020: checking for sasl_client_init in -lsasl" >&5
+echo "configure:21946: checking for sasl_client_init in -lsasl" >&5
 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -22024,7 +21950,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsasl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 22028 "configure"
+#line 21954 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -22035,7 +21961,7 @@ int main() {
 sasl_client_init()
 ; return 0; }
 EOF
-if { (eval echo configure:22039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:21965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
                fi
        else
                echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
-echo "configure:22075: checking Cyrus SASL library version" >&5
+echo "configure:22001: checking Cyrus SASL library version" >&5
 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 22081 "configure"
+#line 22007 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SASL_SASL_H
@@ -22126,12 +22052,12 @@ EOF
                ac_save_LIBS="$LIBS"
                LIBS="$LIBS $ol_link_sasl"
                echo $ac_n "checking for sasl_version""... $ac_c" 1>&6
-echo "configure:22130: checking for sasl_version" >&5
+echo "configure:22056: checking for sasl_version" >&5
 if eval "test \"\${ac_cv_func_sasl_version+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22135 "configure"
+#line 22061 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char sasl_version(); below.  */
@@ -22155,7 +22081,7 @@ f = sasl_version;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_sasl_version=yes"
 else
@@ -22216,13 +22142,13 @@ if test $ol_with_fetch != no ; then
        ol_LIBS=$LIBS
 LIBS="-lfetch -lcom_err $LIBS"
 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
-echo "configure:22220: checking fetch(3) library" >&5
+echo "configure:22146: checking fetch(3) library" >&5
 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 22226 "configure"
+#line 22152 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -22232,7 +22158,7 @@ int main() {
 struct url *u = fetchParseURL("file:///"); 
 ; return 0; }
 EOF
-if { (eval echo configure:22236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_lib_fetch=yes
 else
@@ -22269,12 +22195,12 @@ if test $ol_enable_crypt != no ; then
        LIBS="$TLS_LIBS $LIBS"
 
        echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:22273: checking for crypt" >&5
+echo "configure:22199: checking for crypt" >&5
 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22278 "configure"
+#line 22204 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char crypt(); below.  */
@@ -22298,7 +22224,7 @@ f = crypt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_crypt=yes"
 else
@@ -22318,7 +22244,7 @@ else
 
                LIBS="$save_LIBS"
                echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:22322: checking for crypt in -lcrypt" >&5
+echo "configure:22248: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -22326,7 +22252,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 22330 "configure"
+#line 22256 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -22337,7 +22263,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:22341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 if test $ol_enable_proctitle != no ; then
        echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:22386: checking for setproctitle" >&5
+echo "configure:22312: checking for setproctitle" >&5
 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22391 "configure"
+#line 22317 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char setproctitle(); below.  */
@@ -22411,7 +22337,7 @@ f = setproctitle;
 
 ; return 0; }
 EOF
-if { (eval echo configure:22415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_setproctitle=yes"
 else
@@ -22430,7 +22356,7 @@ else
   echo "$ac_t""no" 1>&6
 
                echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:22434: checking for setproctitle in -lutil" >&5
+echo "configure:22360: checking for setproctitle in -lutil" >&5
 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -22438,7 +22364,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 22442 "configure"
+#line 22368 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -22449,7 +22375,7 @@ int main() {
 setproctitle()
 ; return 0; }
 EOF
-if { (eval echo configure:22453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -22489,17 +22415,17 @@ if test $ol_enable_slp != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:22493: checking for $ac_hdr" >&5
+echo "configure:22419: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22498 "configure"
+#line 22424 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:22429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -22528,7 +22454,7 @@ done
 
        if test $ac_cv_header_slp_h = yes ; then
                echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
-echo "configure:22532: checking for SLPOpen in -lslp" >&5
+echo "configure:22458: checking for SLPOpen in -lslp" >&5
 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -22536,7 +22462,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lslp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 22540 "configure"
+#line 22466 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -22547,7 +22473,7 @@ int main() {
 SLPOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:22551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -22589,17 +22515,17 @@ if test "$ol_with_multiple_precision" != "no" ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:22593: checking for $ac_hdr" >&5
+echo "configure:22519: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22598 "configure"
+#line 22524 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:22529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -22629,17 +22555,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:22633: checking for $ac_hdr" >&5
+echo "configure:22559: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22638 "configure"
+#line 22564 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:22569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -22669,17 +22595,17 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:22673: checking for $ac_hdr" >&5
+echo "configure:22599: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22678 "configure"
+#line 22604 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:22609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -22728,7 +22654,7 @@ done
 
        if test $ac_cv_header_gmp_h = yes ; then
                echo $ac_n "checking for __gmpz_add_ui in -lgmp""... $ac_c" 1>&6
-echo "configure:22732: checking for __gmpz_add_ui in -lgmp" >&5
+echo "configure:22658: checking for __gmpz_add_ui in -lgmp" >&5
 ac_lib_var=`echo gmp'_'__gmpz_add_ui | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -22736,7 +22662,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgmp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 22740 "configure"
+#line 22666 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -22747,7 +22673,7 @@ int main() {
 __gmpz_add_ui()
 ; return 0; }
 EOF
-if { (eval echo configure:22751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -22774,7 +22700,7 @@ fi
        fi
 
        echo $ac_n "checking for multiple precision support""... $ac_c" 1>&6
-echo "configure:22778: checking for multiple precision support" >&5
+echo "configure:22704: checking for multiple precision support" >&5
 
        ol_mp_support="none"
        case "$ol_with_multiple_precision" in
 
 
 echo $ac_n "checking long long""... $ac_c" 1>&6
-echo "configure:22837: checking long long" >&5
+echo "configure:22763: checking long long" >&5
 if eval "test \"\${ol_cv_type_long_long+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 22843 "configure"
+#line 22769 "configure"
 #include "confdefs.h"
 
 int main() {
 long long x;
 ; return 0; }
 EOF
-if { (eval echo configure:22850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:22776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_long_long=yes
 else
@@ -22867,12 +22793,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:22871: checking for ANSI C header files" >&5
+echo "configure:22797: checking for ANSI C header files" >&5
 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22876 "configure"
+#line 22802 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -22880,7 +22806,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:22884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:22810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -22897,7 +22823,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 22901 "configure"
+#line 22827 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -22915,7 +22841,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 22919 "configure"
+#line 22845 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -22936,7 +22862,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 22940 "configure"
+#line 22866 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -22954,7 +22880,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:22958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:22884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   :
 else
@@ -22978,12 +22904,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:22982: checking for mode_t" >&5
+echo "configure:22908: checking for mode_t" >&5
 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 22987 "configure"
+#line 22913 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -23014,12 +22940,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:23018: checking for off_t" >&5
+echo "configure:22944: checking for off_t" >&5
 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23023 "configure"
+#line 22949 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -23050,12 +22976,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:23054: checking for pid_t" >&5
+echo "configure:22980: checking for pid_t" >&5
 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23059 "configure"
+#line 22985 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -23086,19 +23012,19 @@ EOF
 fi
 
 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:23090: checking for ptrdiff_t" >&5
+echo "configure:23016: checking for ptrdiff_t" >&5
 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23095 "configure"
+#line 23021 "configure"
 #include "confdefs.h"
 #include <stddef.h>
 int main() {
 ptrdiff_t p
 ; return 0; }
 EOF
-if { (eval echo configure:23102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_type_ptrdiff_t=yes
 else
@@ -23119,12 +23045,12 @@ EOF
    fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:23123: checking return type of signal handlers" >&5
+echo "configure:23049: checking return type of signal handlers" >&5
 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23128 "configure"
+#line 23054 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -23141,7 +23067,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:23145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -23160,12 +23086,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:23164: checking for size_t" >&5
+echo "configure:23090: checking for size_t" >&5
 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23169 "configure"
+#line 23095 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:23201: checking for ssize_t" >&5
+echo "configure:23127: checking for ssize_t" >&5
 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23206 "configure"
+#line 23132 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -23233,12 +23159,12 @@ EOF
 fi
 
 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
-echo "configure:23237: checking for caddr_t" >&5
+echo "configure:23163: checking for caddr_t" >&5
 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23242 "configure"
+#line 23168 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
 
 
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:23274: checking for socklen_t" >&5
+echo "configure:23200: checking for socklen_t" >&5
 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23279 "configure"
+#line 23205 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -23289,7 +23215,7 @@ int main() {
 socklen_t len;
 ; return 0; }
 EOF
-if { (eval echo configure:23293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_socklen_t=yes
 else
@@ -23310,12 +23236,12 @@ EOF
   fi
  
 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
-echo "configure:23314: checking for member st_blksize in aggregate type struct stat" >&5
+echo "configure:23240: checking for member st_blksize in aggregate type struct stat" >&5
 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23319 "configure"
+#line 23245 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -23323,7 +23249,7 @@ int main() {
 struct stat foo; foo.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:23327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_struct_member_st_blksize=yes
 else
@@ -23345,12 +23271,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:23349: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:23275: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23354 "configure"
+#line 23280 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -23359,7 +23285,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:23363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -23380,12 +23306,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:23384: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:23310: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23389 "configure"
+#line 23315 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -23393,7 +23319,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:23397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -23414,12 +23340,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:23418: checking for uid_t in sys/types.h" >&5
+echo "configure:23344: checking for uid_t in sys/types.h" >&5
 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23423 "configure"
+#line 23349 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -23448,19 +23374,19 @@ EOF
 fi
 
 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:23452: checking for sig_atomic_t" >&5
+echo "configure:23378: checking for sig_atomic_t" >&5
 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23457 "configure"
+#line 23383 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
 sig_atomic_t atomic;
 ; return 0; }
 EOF
-if { (eval echo configure:23464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_type_sig_atomic_t=yes
 else
@@ -23484,13 +23410,13 @@ EOF
 
 # test for pw_gecos in struct passwd
 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
-echo "configure:23488: checking struct passwd for pw_gecos" >&5
+echo "configure:23414: checking struct passwd for pw_gecos" >&5
 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 23494 "configure"
+#line 23420 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -23500,7 +23426,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:23504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_gecos=yes
 else
 
 # test for pw_passwd in struct passwd
 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
-echo "configure:23526: checking struct passwd for pw_passwd" >&5
+echo "configure:23452: checking struct passwd for pw_passwd" >&5
 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
        cat > conftest.$ac_ext <<EOF
-#line 23532 "configure"
+#line 23458 "configure"
 #include "confdefs.h"
 #include <pwd.h>
 int main() {
@@ -23538,7 +23464,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:23542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_struct_passwd_pw_passwd=yes
 else
@@ -23560,7 +23486,7 @@ fi
 
 
 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:23564: checking if toupper() requires islower()" >&5
+echo "configure:23490: checking if toupper() requires islower()" >&5
 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -23569,7 +23495,7 @@ else
   ol_cv_c_upper_lower=safe
 else
   cat > conftest.$ac_ext <<EOF
-#line 23573 "configure"
+#line 23499 "configure"
 #include "confdefs.h"
 
 #include <ctype.h>
@@ -23581,7 +23507,7 @@ main()
                exit(1);
 }
 EOF
-if { (eval echo configure:23585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:23511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ol_cv_c_upper_lower=no
 else
@@ -23604,12 +23530,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:23608: checking for working const" >&5
+echo "configure:23534: checking for working const" >&5
 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23613 "configure"
+#line 23539 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -23658,7 +23584,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:23662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -23679,12 +23605,12 @@ EOF
 fi
 
 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:23683: checking if compiler understands volatile" >&5
+echo "configure:23609: checking if compiler understands volatile" >&5
 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 23688 "configure"
+#line 23614 "configure"
 #include "confdefs.h"
 int x, y, z;
 int main() {
@@ -23693,7 +23619,7 @@ volatile int a; int * volatile b = x ? &y : &z;
       *b = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:23697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_c_volatile=yes
 else
@@ -23724,14 +23650,14 @@ EOF
 
 else
        echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:23728: checking whether byte ordering is bigendian" >&5
+echo "configure:23654: checking whether byte ordering is bigendian" >&5
 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 23735 "configure"
+#line 23661 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -23742,11 +23668,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:23746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 23750 "configure"
+#line 23676 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -23757,7 +23683,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:23761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -23777,7 +23703,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 23781 "configure"
+#line 23707 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -23790,7 +23716,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:23794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:23720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ac_cv_c_bigendian=no
 else
 fi
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:23820: checking size of short" >&5 
+echo "configure:23746: checking size of short" >&5 
 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 23826 "configure"
+#line 23752 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <stdlib.h>
@@ -23833,7 +23759,7 @@ int main() {
 switch (0) case 0: case (sizeof (short) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:23837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_short=$ac_size
 else
@@ -23856,13 +23782,13 @@ EOF
  
  
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:23860: checking size of int" >&5 
+echo "configure:23786: checking size of int" >&5 
 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 23866 "configure"
+#line 23792 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <stdlib.h>
@@ -23873,7 +23799,7 @@ int main() {
 switch (0) case 0: case (sizeof (int) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:23877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_int=$ac_size
 else
@@ -23896,13 +23822,13 @@ EOF
  
  
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:23900: checking size of long" >&5 
+echo "configure:23826: checking size of long" >&5 
 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 23906 "configure"
+#line 23832 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <stdlib.h>
@@ -23913,7 +23839,7 @@ int main() {
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:23917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long=$ac_size
 else
@@ -23936,13 +23862,13 @@ EOF
  
 
 echo $ac_n "checking size of wchar_t""... $ac_c" 1>&6
-echo "configure:23940: checking size of wchar_t" >&5 
+echo "configure:23866: checking size of wchar_t" >&5 
 if eval "test \"\${ac_cv_sizeof_wchar_t+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
   cat > conftest.$ac_ext <<EOF
-#line 23946 "configure"
+#line 23872 "configure"
 #include "confdefs.h"
 #include "confdefs.h" 
 #include <stdlib.h>
@@ -23953,7 +23879,7 @@ int main() {
 switch (0) case 0: case (sizeof (wchar_t) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:23957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:23883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_wchar_t=$ac_size
 else
@@ -24004,7 +23930,7 @@ EOF
 
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:24008: checking for 8-bit clean memcmp" >&5
+echo "configure:23934: checking for 8-bit clean memcmp" >&5
 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -24012,7 +23938,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 24016 "configure"
+#line 23942 "configure"
 #include "confdefs.h"
 
 main()
@@ -24022,7 +23948,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:24026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
+if { (eval echo configure:23952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>&5
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -24048,12 +23974,12 @@ EOF
 fi
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:24052: checking for strftime" >&5
+echo "configure:23978: checking for strftime" >&5
 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24057 "configure"
+#line 23983 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -24077,7 +24003,7 @@ f = strftime;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -24099,7 +24025,7 @@ else
   echo "$ac_t""no" 1>&6
 # strftime is in -lintl on SCO UNIX.
 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:24103: checking for strftime in -lintl" >&5
+echo "configure:24029: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -24107,7 +24033,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 24111 "configure"
+#line 24037 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -24118,7 +24044,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:24122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 
 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
-echo "configure:24150: checking for inet_aton()" >&5
+echo "configure:24076: checking for inet_aton()" >&5
 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24155 "configure"
+#line 24081 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -24173,7 +24099,7 @@ struct in_addr in;
 int rc = inet_aton( "255.255.255.255", &in );
 ; return 0; }
 EOF
-if { (eval echo configure:24177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ol_cv_func_inet_aton=yes
 else
@@ -24195,12 +24121,12 @@ EOF
  
 
 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
-echo "configure:24199: checking for _spawnlp" >&5
+echo "configure:24125: checking for _spawnlp" >&5
 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24204 "configure"
+#line 24130 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _spawnlp(); below.  */
@@ -24224,7 +24150,7 @@ f = _spawnlp;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__spawnlp=yes"
 else
 
 
 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
-echo "configure:24252: checking for _snprintf" >&5
+echo "configure:24178: checking for _snprintf" >&5
 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24257 "configure"
+#line 24183 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _snprintf(); below.  */
@@ -24277,7 +24203,7 @@ f = _snprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__snprintf=yes"
 else
 
 
 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
-echo "configure:24307: checking for _vsnprintf" >&5
+echo "configure:24233: checking for _vsnprintf" >&5
 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24312 "configure"
+#line 24238 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _vsnprintf(); below.  */
@@ -24332,7 +24258,7 @@ f = _vsnprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__vsnprintf=yes"
 else
 
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:24362: checking for vprintf" >&5
+echo "configure:24288: checking for vprintf" >&5
 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24367 "configure"
+#line 24293 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -24387,7 +24313,7 @@ f = vprintf;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:24415: checking for _doprnt" >&5
+echo "configure:24341: checking for _doprnt" >&5
 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24420 "configure"
+#line 24346 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -24440,7 +24366,7 @@ f = _doprnt;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -24469,12 +24395,12 @@ if test $ac_cv_func_vprintf = yes ; then
                for ac_func in snprintf vsnprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:24473: checking for $ac_func" >&5
+echo "configure:24399: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24478 "configure"
+#line 24404 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -24498,7 +24424,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -24581,12 +24507,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:24585: checking for $ac_func" >&5
+echo "configure:24511: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24590 "configure"
+#line 24516 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -24610,7 +24536,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -24638,12 +24564,12 @@ done
 for ac_func in getopt getpeereid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:24642: checking for $ac_func" >&5
+echo "configure:24568: checking for $ac_func" >&5
 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24647 "configure"
+#line 24573 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -24667,7 +24593,7 @@ f = $ac_func;
 
 ; return 0; }
 EOF
-if { (eval echo configure:24671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -24699,19 +24625,19 @@ if test "$ac_cv_func_getopt" != yes; then
 fi
 if test "$ac_cv_func_getpeereid" != yes; then
        echo $ac_n "checking for msg_accrights in msghdr""... $ac_c" 1>&6
-echo "configure:24703: checking for msg_accrights in msghdr" >&5
+echo "configure:24629: checking for msg_accrights in msghdr" >&5
 if eval "test \"\${ol_cv_msghdr_msg_accrights+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24708 "configure"
+#line 24634 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 int main() {
 struct msghdr m; m.msg_accrightslen=0
 ; return 0; }
 EOF
-if { (eval echo configure:24715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:24641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_msghdr_msg_accrights=yes
 else
@@ -24734,19 +24660,19 @@ EOF
 
        if test "$ac_cv_func_getpeereid" != yes; then
                echo $ac_n "checking for msg_control in msghdr""... $ac_c" 1>&6
-echo "configure:24738: checking for msg_control in msghdr" >&5
+echo "configure:24664: checking for msg_control in msghdr" >&5
 if eval "test \"\${ol_cv_msghdr_msg_control+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24743 "configure"
+#line 24669 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 int main() {
 struct msghdr m; m.msg_control=(struct cmsghdr *)0
 ; return 0; }
 EOF
-if { (eval echo configure:24750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:24676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ol_cv_msghdr_msg_control=yes
 else
@@ -24791,17 +24717,17 @@ if test "$ol_enable_slapi" != no ; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:24795: checking for $ac_hdr" >&5
+echo "configure:24721: checking for $ac_hdr" >&5
 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 24800 "configure"
+#line 24726 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:24805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:24731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -24832,7 +24758,7 @@ done
                { echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
        fi
        echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
-echo "configure:24836: checking for lt_dlinit in -lltdl" >&5
+echo "configure:24762: checking for lt_dlinit in -lltdl" >&5
 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -24840,7 +24766,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lltdl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 24844 "configure"
+#line 24770 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -24851,7 +24777,7 @@ int main() {
 lt_dlinit()
 ; return 0; }
 EOF
-if { (eval echo configure:24855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -25224,6 +25150,20 @@ EOF
 
 fi
 
+if test "$ol_enable_dynlist" != no ; then
+       BUILD_DYNLIST=$ol_enable_dynlist
+       if test "$ol_enable_dynlist" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dynlist.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+       fi
+       cat >> confdefs.h <<EOF
+#define SLAPD_OVER_DYNLIST $MFLAG
+EOF
+
+fi
+
 if test "$ol_enable_glue" != no ; then
        BUILD_GLUE=$ol_enable_glue
        if test "$ol_enable_glue" = mod ; then
@@ -25417,6 +25357,7 @@ fi
   
   
   
+  
 
 
 
@@ -25670,6 +25611,7 @@ s%@BUILD_SQL@%$BUILD_SQL%g
 s%@BUILD_CHAIN@%$BUILD_CHAIN%g
 s%@BUILD_DENYOP@%$BUILD_DENYOP%g
 s%@BUILD_DYNGROUP@%$BUILD_DYNGROUP%g
+s%@BUILD_DYNLIST@%$BUILD_DYNLIST%g
 s%@BUILD_GLUE@%$BUILD_GLUE%g
 s%@BUILD_LASTMOD@%$BUILD_LASTMOD%g
 s%@BUILD_PPOLICY@%$BUILD_PPOLICY%g
index e4eaab8054548bd5cf26eb69f5e9875c9681691e..07384b14a1f4e13f4a52d516338776f59c603aa9 100644 (file)
@@ -242,8 +242,8 @@ OL_ARG_ENABLE(sql,[    --enable-sql   enable sql backend no|yes|mod],
 
 dnl ----------------------------------------------------------------
 dnl SLAPD Overlay Options
-Overlays="denyop dyngroup glue lastmod ppolicy proxycache rwm \
-       refint syncprov translucent unique"
+Overlays="denyop dyngroup dynlist glue lastmod ppolicy proxycache \
+       refint rwm syncprov translucent unique"
 
 AC_ARG_WITH(xxslapoverlays,[
 SLAPD Overlay Options:])
@@ -254,6 +254,8 @@ OL_ARG_ENABLE(denyop,[    --enable-denyop     Deny Operation overlay no|yes|mod]
        no, [no yes mod])
 OL_ARG_ENABLE(dyngroup,[    --enable-dyngroup    Dynamic Group overlay no|yes|mod],
        no, [no yes mod])
+OL_ARG_ENABLE(dynlist,[    --enable-dynlist      Dynamic List overlay no|yes|mod],
+       no, [no yes mod])
 OL_ARG_ENABLE(glue,[    --enable-glue    Backend Glue overlay no|yes|mod],
        yes, [no yes mod])
 OL_ARG_ENABLE(lastmod,[    --enable-lastmod      Last Modification overlay no|yes|mod],
@@ -523,6 +525,7 @@ BUILD_SQL=no
 BUILD_CHAIN=no
 BUILD_DENYOP=no
 BUILD_DYNGROUP=no
+BUILD_DYNLIST=no
 BUILD_GLUE=no
 BUILD_LASTMOD=no
 BUILD_PPOLICY=no
@@ -968,51 +971,28 @@ fi
 
 dnl ----------------------------------------------------------------
 dnl Check for resolver routines
-dnl      need to check for both res_query and __res_query
-dnl   need to check -lc, -lbind, and -lresolv
-ol_link_dnssrv=no
-AC_CHECK_FUNC(res_query,:)
-if test $ac_cv_func_res_query = no ; then 
-       AC_CHECK_FUNC(__res_query,:)
-       ac_cv_func_res_query=$ac_cv_func___res_query
-fi
-
-if test $ac_cv_func_res_query = no ; then 
-       AC_CHECK_LIB(bind, res_query)
-       ac_cv_func_res_query=$ac_cv_lib_bind_res_query
-fi
-
-if test $ac_cv_func_res_query = no ; then 
-       AC_CHECK_LIB(bind, __res_query)
-       ac_cv_func_res_query=$ac_cv_lib_bind___res_query
-fi
-
-if test $ac_cv_func_res_query = no ; then 
-       AC_CHECK_LIB(resolv, res_query)
-       ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
-fi
-
-if test $ac_cv_func_res_query = no ; then 
-       AC_CHECK_LIB(resolv, __res_query)
-       ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
-fi
-
-if test $ac_cv_func_res_query = no ; then 
-       AC_CHECK_LIB(resolv, _res_9_query)
-       ac_cv_func_res_query=$ac_cv_lib_resolv_res_9_query
-fi
+OL_RESOLVER_LINK
 
-if test "$ac_cv_func_res_query" = yes ; then
+ol_link_dnssrv=no
+if test "$ol_cv_lib_resolver" != no ; then
        AC_DEFINE(HAVE_RES_QUERY,1,
                [define if you have res_query()])
 
-       if test $ol_enable_dnssrv != no ; then
+       if test "$ol_enable_dnssrv" != no ; then
                ol_link_dnssrv=yes
        fi
+
+       if test "$ol_cv_lib_resolver" != yes ; then
+               LIBS="$ol_cv_lib_resolver $LIBS"
+       fi
 fi
 
-if test "$ol_enable_dnssrv" != no -a "$ol_link_dnssrv" = no ; then
-       AC_MSG_ERROR([DNSSRV requires res_query()])
+if test "$ol_enable_dnssrv" = yes -o "$ol_enable_dnssrv" = mod ; then
+       if test "$ol_link_dnssrv" = no ; then
+               AC_MSG_ERROR([DNSSRV requires res_query()])
+       fi
+else
+       ol_enable_dnssrv=no
 fi
 
 AC_CHECK_FUNCS( hstrerror )
@@ -2094,6 +2074,9 @@ if test $ol_enable_sql != no ; then
                AC_MSG_ERROR([could not locate SQL headers])
        ])
 
+       sql_LIBS="$LIBS"
+       LIBS="$LTHREAD_LIBS"
+
        AC_CHECK_LIB(iodbc,SQLDriverConnect,[have_iodbc=yes],[have_iodbc=no])
        if test $have_iodbc = yes ; then
                ol_link_sql="-liodbc"
@@ -2104,6 +2087,8 @@ if test $ol_enable_sql != no ; then
                fi
        fi
 
+       LIBS="$sql_LIBS"
+
        if test $ol_link_sql != no ; then
                SLAPD_SQL_LIBS="$ol_link_sql"
 
@@ -2801,6 +2786,17 @@ if test "$ol_enable_dyngroup" != no ; then
        AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNGROUP,$MFLAG,[define for Dynamic Group overlay])
 fi
 
+if test "$ol_enable_dynlist" != no ; then
+       BUILD_DYNLIST=$ol_enable_dynlist
+       if test "$ol_enable_dynlist" = mod ; then
+               MFLAG=SLAPD_MOD_DYNAMIC
+               SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dynlist.la"
+       else
+               MFLAG=SLAPD_MOD_STATIC
+       fi
+       AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNLIST,$MFLAG,[define for Dynamic List overlay])
+fi
+
 if test "$ol_enable_glue" != no ; then
        BUILD_GLUE=$ol_enable_glue
        if test "$ol_enable_glue" = mod ; then
@@ -2960,6 +2956,7 @@ dnl overlays
   AC_SUBST(BUILD_CHAIN)
   AC_SUBST(BUILD_DENYOP)
   AC_SUBST(BUILD_DYNGROUP)
+  AC_SUBST(BUILD_DYNLIST)
   AC_SUBST(BUILD_GLUE)
   AC_SUBST(BUILD_LASTMOD)
   AC_SUBST(BUILD_PPOLICY)
index 49fd8b36215c723ae694f10d003202e877b832cf..c500e97a921eb1ea068fb270ac847f42f673447a 100644 (file)
@@ -11,12 +11,6 @@ Current contributions:
                LDAP C++ API
                Contributed by SuSE Gmbh.
 
-       ldapsasl
-               LDAP SASL auxprop plugin
-               Contributed by Symas Corp.
-               Note: this module is now part of Cyrus SASL
-               and no longer included here.
-
        slapd-modules
                Native modules
 
index aedb193700a1abf8a85388550f66092ceb8c3927..2c50a3eb4371536fdbf818b68f0c84abe19ed333 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
 # @configure_input@
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,7 +16,6 @@
 
 # Copyright 2000-2003, OpenLDAP Foundation, All Rights Reserved.
 # COPYING RESTRICTIONS APPLY, see COPYRIGHT file
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
@@ -24,7 +23,6 @@ pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 top_builddir = .
-
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
@@ -38,11 +36,49 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 host_triplet = @host@
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS TODO \
+       acconfig.h config.guess config.sub depcomp install-sh \
+       ltmain.sh missing mkinstalldirs
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-exec-recursive install-info-recursive \
+       install-recursive installcheck-recursive installdirs-recursive \
+       pdf-recursive ps-recursive uninstall-info-recursive \
+       uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
+AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -53,6 +89,7 @@ CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CXX = @CXX@
+CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -64,6 +101,8 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -88,8 +127,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
 ac_ct_RANLIB = @ac_ct_RANLIB@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
@@ -97,7 +138,10 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
 am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
+am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -118,6 +162,7 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localstatedir = @localstatedir@
 mandir = @mandir@
+mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -125,43 +170,43 @@ sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-
 EXTRA_DIST = BUGS
 SUBDIRS = src examples
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/src/config.h
-CONFIG_CLEAN_FILES =
-DIST_SOURCES =
-
-RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
-       ps-recursive install-info-recursive uninstall-info-recursive \
-       all-recursive install-data-recursive install-exec-recursive \
-       installdirs-recursive install-recursive uninstall-recursive \
-       check-recursive installcheck-recursive
-DIST_COMMON = README AUTHORS Makefile.am Makefile.in TODO acconfig.h \
-       aclocal.m4 config.guess config.sub configure configure.in \
-       depcomp install-sh ltmain.sh missing mkinstalldirs
-DIST_SUBDIRS = $(SUBDIRS)
 all: all-recursive
 
 .SUFFIXES:
-
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+am--refresh:
+       @:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+             cd $(srcdir) && $(AUTOMAKE) --foreign  \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --foreign  Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
-       cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
-
-$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        $(SHELL) ./config.status --recheck
-$(srcdir)/configure:  $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
-       cd $(srcdir) && $(AUTOCONF)
 
-$(ACLOCAL_M4):  configure.in 
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
 mostlyclean-libtool:
@@ -181,7 +226,13 @@ uninstall-info-am:
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 $(RECURSIVE_TARGETS):
-       @set fnord $$MAKEFLAGS; amf=$$2; \
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -193,7 +244,7 @@ $(RECURSIVE_TARGETS):
            local_target="$$target"; \
          fi; \
          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+         || eval $$failcom; \
        done; \
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
@@ -201,7 +252,13 @@ $(RECURSIVE_TARGETS):
 
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive:
-       @set fnord $$MAKEFLAGS; amf=$$2; \
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
        dot_seen=no; \
        case "$@" in \
          distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
@@ -222,7 +279,7 @@ maintainer-clean-recursive:
            local_target="$$target"; \
          fi; \
          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+         || eval $$failcom; \
        done && test -z "$$fail"
 tags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -233,14 +290,6 @@ ctags-recursive:
          test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
        done
 
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -249,14 +298,23 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
          $(AWK) '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
        mkid -fID $$unique
+tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
        tags=; \
        here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
-           test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+           test ! -f $$subdir/TAGS || \
+             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
        list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
@@ -265,10 +323,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
          done | \
          $(AWK) '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
-       test -z "$(ETAGS_ARGS)$$tags$$unique" \
-         || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-            $$tags $$unique
-
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
@@ -291,19 +350,6 @@ GTAGS:
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = .
-distdir = $(PACKAGE)-$(VERSION)
-
-am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
-
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
 
 distdir: $(DISTFILES)
        $(am__remove_distdir)
@@ -319,7 +365,7 @@ distdir: $(DISTFILES)
          dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
          if test "$$dir" != "$$file" && test "$$dir" != "."; then \
            dir="/$$dir"; \
-           $(mkinstalldirs) "$(distdir)$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
          else \
            dir=''; \
          fi; \
@@ -334,15 +380,17 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
-       list='$(SUBDIRS)'; for subdir in $$list; do \
+       list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
-           test -d $(distdir)/$$subdir \
-           || mkdir $(distdir)/$$subdir \
+           test -d "$(distdir)/$$subdir" \
+           || $(mkdir_p) "$(distdir)/$$subdir" \
            || exit 1; \
+           distdir=`$(am__cd) $(distdir) && pwd`; \
+           top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
            (cd $$subdir && \
              $(MAKE) $(AM_MAKEFLAGS) \
-               top_distdir="$(top_distdir)" \
-               distdir=../$(distdir)/$$subdir \
+               top_distdir="$$top_distdir" \
+               distdir="$$distdir/$$subdir" \
                distdir) \
              || exit 1; \
          fi; \
@@ -353,26 +401,53 @@ distdir: $(DISTFILES)
          ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
        || chmod -R a+r $(distdir)
 dist-gzip: distdir
-       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       $(am__remove_distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+       $(am__remove_distdir)
+
+dist-tarZ: distdir
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       $(am__remove_distdir)
+
+dist-shar: distdir
+       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       $(am__remove_distdir)
+
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
        $(am__remove_distdir)
 
 dist dist-all: distdir
-       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
        $(am__remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
 # tarfile.
 distcheck: dist
-       $(am__remove_distdir)
-       GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+       case '$(DIST_ARCHIVES)' in \
+       *.tar.gz*) \
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+       *.zip*) \
+         unzip $(distdir).zip ;;\
+       esac
        chmod -R a-w $(distdir); chmod a+w $(distdir)
-       mkdir $(distdir)/=build
-       mkdir $(distdir)/=inst
+       mkdir $(distdir)/_build
+       mkdir $(distdir)/_inst
        chmod a-w $(distdir)
-       dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
          && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-         && cd $(distdir)/=build \
+         && cd $(distdir)/_build \
          && ../configure --srcdir=.. --prefix="$$dc_install_base" \
            $(DISTCHECK_CONFIGURE_FLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) \
@@ -385,21 +460,22 @@ distcheck: dist
                distuninstallcheck \
          && chmod -R a-w "$$dc_install_base" \
          && ({ \
-              (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
               && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
               && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
               && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
                    distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
              } || { rm -rf "$$dc_destdir"; exit 1; }) \
          && rm -rf "$$dc_destdir" \
-         && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
-         && rm -f $(distdir).tar.gz \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && rm -rf $(DIST_ARCHIVES) \
          && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
        $(am__remove_distdir)
-       @echo "$(distdir).tar.gz is ready for distribution" | \
-         sed 'h;s/./=/g;p;x;p;x'
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
 distuninstallcheck:
-       cd $(distuninstallcheck_dir) \
+       @cd $(distuninstallcheck_dir) \
        && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
           || { echo "ERROR: files left after uninstall:" ; \
                if test -n "$(DESTDIR)"; then \
@@ -408,11 +484,11 @@ distuninstallcheck:
                $(distuninstallcheck_listfiles) ; \
                exit 1; } >&2
 distcleancheck: distclean
-       if test '$(srcdir)' = . ; then \
+       @if test '$(srcdir)' = . ; then \
          echo "ERROR: distcleancheck can only run from a VPATH build" ; \
          exit 1 ; \
        fi
-       test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
          || { echo "ERROR: files left in build directory after distclean:" ; \
               $(distcleancheck_listfiles) ; \
               exit 1; } >&2
@@ -421,7 +497,6 @@ check: check-recursive
 all-am: Makefile
 installdirs: installdirs-recursive
 installdirs-am:
-
 install: install-recursive
 install-exec: install-exec-recursive
 install-data: install-data-recursive
@@ -433,7 +508,7 @@ install-am: all-am
 installcheck: installcheck-recursive
 install-strip:
        $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         INSTALL_STRIP_FLAG=-s \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
@@ -441,7 +516,7 @@ mostlyclean-generic:
 clean-generic:
 
 distclean-generic:
-       -rm -f Makefile $(CONFIG_CLEAN_FILES)
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
@@ -452,6 +527,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -f Makefile
 distclean-am: clean-am distclean-generic distclean-libtool \
        distclean-tags
 
@@ -459,6 +535,8 @@ dvi: dvi-recursive
 
 dvi-am:
 
+html: html-recursive
+
 info: info-recursive
 
 info-am:
@@ -475,7 +553,8 @@ installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-       -rm -rf autom4te.cache
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-recursive
@@ -494,23 +573,20 @@ uninstall-am: uninstall-info-am
 
 uninstall-info: uninstall-info-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
-       clean-generic clean-libtool clean-recursive ctags \
-       ctags-recursive dist dist-all dist-gzip distcheck distclean \
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+       check-am clean clean-generic clean-libtool clean-recursive \
+       ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+       dist-shar dist-tarZ dist-zip distcheck distclean \
        distclean-generic distclean-libtool distclean-recursive \
        distclean-tags distcleancheck distdir distuninstallcheck dvi \
-       dvi-am dvi-recursive info info-am info-recursive install \
-       install-am install-data install-data-am install-data-recursive \
-       install-exec install-exec-am install-exec-recursive \
-       install-info install-info-am install-info-recursive install-man \
-       install-recursive install-strip installcheck installcheck-am \
-       installdirs installdirs-am installdirs-recursive \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-exec install-exec-am \
+       install-info install-info-am install-man install-strip \
+       installcheck installcheck-am installdirs installdirs-am \
        maintainer-clean maintainer-clean-generic \
        maintainer-clean-recursive mostlyclean mostlyclean-generic \
-       mostlyclean-libtool mostlyclean-recursive pdf pdf-am \
-       pdf-recursive ps ps-am ps-recursive tags tags-recursive \
-       uninstall uninstall-am uninstall-info-am \
-       uninstall-info-recursive uninstall-recursive
+       mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+       tags tags-recursive uninstall uninstall-am uninstall-info-am
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index a407448bb6fbba989bd2f3f0d48c25a4b1eaaaa1..88e4c65908e130ddecab7dfe80ea9be76f6f889c 100644 (file)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.7.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-# Do all the work for Automake.                            -*- Autoconf -*-
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
-# This macro actually does too much some checks are only needed if
-# your package does certain things.  But this isn't really a big deal.
+# serial 47 AC_PROG_LIBTOOL
 
-# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+                [m4_ifdef([AC_PROVIDE_$1],
+                          [$2], [$3])])])
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+       [AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+            [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+            [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+            [define([LT_AC_PROG_GCJ],
+               defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
 
-# serial 8
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
 
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
 
-AC_PREREQ([2.54])
 
-# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
-# the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
 
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
- AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
 
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-AC_SUBST([CYGPATH_W])
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
 
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
- AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
 
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
 
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_MISSING_PROG(AMTAR, tar)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
 
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
 
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated.  The stamp files are numbered to have different names.
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
 
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+# Constants:
+rm="rm -f"
 
-# Copyright 2002  Free Software Foundation, Inc.
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
 
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
 
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-        [AM_AUTOMAKE_VERSION([1.7.2])])
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
 
-# Helper functions for option handling.                    -*- Autoconf -*-
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
 
-# Copyright 2001, 2002  Free Software Foundation, Inc.
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+       [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-# serial 2
+AC_ARG_WITH([pic],
+    [AC_HELP_STRING([--with-pic],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
 
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
 
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME.  Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
 
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
-#
-# Check to make sure that the build environment is sane.
-#
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
 
-# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+            [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+        [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
 
-# serial 3
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
 
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
 
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+[$]*
+EOF
+  exit 0
+fi
 
-   test "$[2]" = conftest.file
-   )
-then
-   # Ok.
-   :
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+       echo_test_string="`eval $cmd`" &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
 else
-   AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+        test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+        test "X$echo_testing_string" = "X$echo_test_string"; then
+       # Cool, printf works
+       :
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+       export CONFIG_SHELL
+       SHELL="$CONFIG_SHELL"
+       export SHELL
+       echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      else
+       # maybe with a smaller string...
+       prev=:
+
+       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+         then
+           break
+         fi
+         prev="$cmd"
+       done
+
+       if test "$prev" != 'sed 50q "[$]0"'; then
+         echo_test_string=`eval $prev`
+         export echo_test_string
+         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+       else
+         # Oops.  We lost completely, so just stick with echo.
+         echo=echo
+       fi
+      fi
+    fi
+  fi
+fi
 fi
-AC_MSG_RESULT(yes)])
 
-#  -*- Autoconf -*-
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
 
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
 
-# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+       [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
 
-# serial 3
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
 
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
+need_locks="$enable_libtool_lock"
 
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
 
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
 else
-  am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+    ifelse([$6], , :, [$6])
 fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
 ])
 
-# AM_AUX_DIR_EXPAND
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
 
-# Copyright 2001 Free Software Foundation, Inc.
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
 
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory.  The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run.  This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-#    fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-#    fails if $ac_aux_dir is absolute,
-#    fails when called from a subdirectory in a VPATH build with
-#          a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
-#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-#   MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH.  The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
 
-# Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
 
-AC_DEFUN([AM_AUX_DIR_EXPAND], [
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    ;;
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    # 
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+              = "XX$teststring") >/dev/null 2>&1 &&
+           new_result=`expr "X$teststring" : ".*" 2>&1` &&
+           lt_cv_sys_max_cmd_len=$new_result &&
+           test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    teststring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
 ])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
 
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
 
-# Copyright 2001 Free Software Foundation, Inc.
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
 
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
+#include <stdio.h>
 
-# AM_PROG_INSTALL_STRIP
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
 
-# Copyright 2001 Free Software Foundation, Inc.
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
 
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries.  This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
-  AC_CHECK_TOOL([STRIP], [strip], :)
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
 fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
 
-# serial 4                                             -*- Autoconf -*-
 
-# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
 
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+   ;;
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+  *)
+    AC_CHECK_FUNC([shl_load],
+         [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+       [AC_CHECK_FUNC([dlopen],
+             [lt_cv_dlopen="dlopen"],
+         [AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+           [AC_CHECK_LIB([svld], [dlopen],
+                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+             [AC_CHECK_LIB([dld], [dld_link],
+                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  esac
 
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
 
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
-               [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
 
-  am_cv_$1_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    echo '#include "conftest.h"' > conftest.c
-    echo 'int i;' > conftest.h
-    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+         lt_cv_dlopen_self, [dnl
+         _LT_AC_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
 
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=conftest.c object=conftest.o \
-       depfile=conftest.Po tmpdepfile=conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
-       grep conftest.h conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      am_cv_$1_dependencies_compiler_type=$depmode
-      break
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_AC_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
     fi
-  done
 
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
 
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
 
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[rm -f .deps 2>/dev/null
-mkdir .deps 2>/dev/null
-if test -d .deps; then
-  DEPDIR=.deps
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  DEPDIR=_deps
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
 fi
-rmdir .deps 2>/dev/null
-AC_SUBST([DEPDIR])
-])
+])# AC_LIBTOOL_DLOPEN_SELF
 
 
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking Speeds up one-time builds
-  --enable-dependency-tracking  Do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
 ])
+])# AC_LIBTOOL_PROG_CC_C_O
 
-# Generate code to set up dependency tracking.   -*- Autoconf -*-
 
-# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
 
-#serial 2
 
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
   else
-    continue
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
   fi
-  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
-  # Extract the definition of DEP_FILES from the Makefile without
-  # running `make'.
-  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n -e '/^U = / s///p' < "$mf"`
-  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
-  # We invoke sed twice because it is the simplest approach to
-  # changing $(DEPDIR) to its actual value in the expansion.
-  for file in `sed -n -e '
-    /^DEP_FILES = .*\\\\$/ {
-      s/^DEP_FILES = //
-      :loop
-       s/\\\\$//
-       p
-       n
-       /\\\\$/ b loop
-      p
-    }
-    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
 
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
 
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
-     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
 
-# Check to see how 'make' treats includes.     -*- Autoconf -*-
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
 
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
 
-# serial 2
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
 
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-doit:
-       @echo done
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
-fi
-AC_SUBST(am__include)
-AC_SUBST(am__quote)
-AC_MSG_RESULT($_am_result)
-rm -f confinc confmf
-])
-
-# AM_CONDITIONAL                                              -*- Autoconf -*-
-
-# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 5
-
-AC_PREREQ(2.52)
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.])
-fi])])
-
-# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
-
-# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-AC_PREREQ([2.52])
-
-# serial 6
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
-
-# serial 46 AC_PROG_LIBTOOL
-
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])
-
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.13)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-AC_REQUIRE([LT_AC_PROG_SED])dnl
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
 
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  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'
+  ;;
 
-_LT_AC_PROG_ECHO_BACKSLASH
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
-  fi
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
   ;;
-esac
 
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
 
-AC_ARG_ENABLE(libtool-lock,
-  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
 
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
       ;;
-    *N32*)
-      LD="${LD-ld} -n32"
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
       ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
-  fi
-  rm -rf conftest*
-  ;;
+    ;;
 
-*-*-linux*)
-  # Test if the compiler is 64bit
-  echo 'int i;' > conftest.$ac_ext
-  lt_cv_cc_64bit_output=no
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *"ELF 64"*)
-      lt_cv_cc_64bit_output=yes
-      ;;
-    esac
-  fi
-  rm -rf conftest*
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
   ;;
-  
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_SAVE
-     AC_LANG_C
-     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_RESTORE])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
   fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-
-  # recent cygwin and mingw systems supply a stub DllMain which the user
-  # can override, but on older systems we have to supply one
-  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
-    [AC_TRY_LINK([],
-      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
-      DllMain (0, 0, 0);],
-      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
-
-  case $host/$CC in
-  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
-    # old mingw systems require "-dll" to link a DLL, while more recent ones
-    # require "-mdll"
-    SAVE_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS -mdll"
-    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
-      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
-    CFLAGS="$SAVE_CFLAGS" ;;
-  *-*-cygwin* | *-*-pw32*)
-    # cygwin systems need to pass --dll to the linker, and not link
-    # crt.o which will require a WinMain@16 definition.
-    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
-  esac
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
   ;;
-  ])
-esac
-
-_LT_AC_LTCONFIG_HACK
 
-])
+freebsd1*)
+  dynamic_linker=no
+  ;;
 
-# AC_LIBTOOL_HEADER_ASSERT
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
-[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
-    [lt_cv_func_assert_works],
-    [case $host in
-    *-*-solaris*)
-      if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
-        case `$CC --version 2>/dev/null` in
-        [[12]].*) lt_cv_func_assert_works=no ;;
-        *)        lt_cv_func_assert_works=yes ;;
-        esac
-      fi
-      ;;
-    esac])
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
 
-if test "x$lt_cv_func_assert_works" = xyes; then
-  AC_CHECK_HEADERS(assert.h)
-fi
-])# AC_LIBTOOL_HEADER_ASSERT
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
 
-# _LT_AC_CHECK_DLFCN
-# --------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)
-])# _LT_AC_CHECK_DLFCN
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
 
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
 
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
 
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
 
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
 
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
 
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
 
-# Transform an extracted symbol line into symbol name and symbol address
-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'"
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
 
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
   ;;
-cygwin* | mingw* | pw32*)
-  symcode='[[ABCDGISTW]]'
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
-hpux*) # Its linker distinguishes data from code symbols
-  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  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'"
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
   ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
   ;;
-solaris* | sysv5*)
-  symcode='[[BDT]]'
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
-sysv4)
-  symcode='[[DFNSTU]]'
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
   ;;
-esac
 
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $host_os in
-mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
   ;;
-esac
 
-# If we're using GNU nm, then use its standard symbol codes.
-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
-  symcode='[[ABCDGISTW]]'
-fi
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
 
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
 
-  # Write the raw and C identifiers.
-lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[       ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
 
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-       mv -f "$nlist"T "$nlist"
-      else
-       rm -f "$nlist"T
-      fi
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
 
-      # Make sure that we snagged all the symbols we need.
-      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
-       if egrep ' nm_test_func$' "$nlist" >/dev/null; then
-         cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
-EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
 
-         cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
 
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
-         sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
-         cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr) 0}
-};
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
 
-#ifdef __cplusplus
-}
-#endif
-EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         save_LIBS="$LIBS"
-         save_CFLAGS="$CFLAGS"
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$no_builtin_flag"
-         if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
-           pipe_works=yes
-         fi
-         LIBS="$save_LIBS"
-         CFLAGS="$save_CFLAGS"
-       else
-         echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
-       fi
-      else
-       echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
-      fi
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
     else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
     fi
-  else
-    echo "$progname: failed program was:" >&AC_FD_CC
-    cat conftest.$ac_ext >&5
   fi
-  rm -f conftest* conftst*
 
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  global_symbol_to_cdecl=
-  global_symbol_to_c_name_address=
-else
-  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
-  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
-fi
-if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
-then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+       ;;
+    esac
 
-# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-# ---------------------------------
-AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
-[# Find the correct PATH separator.  Usually this is `:', but
-# DJGPP uses `;' like DOS.
-if test "X${PATH_SEPARATOR+set}" != Xset; then
-  UNAME=${UNAME-`uname 2>/dev/null`}
-  case X$UNAME in
-    *-DOS) lt_cv_sys_path_separator=';' ;;
-    *)     lt_cv_sys_path_separator=':' ;;
-  esac
-  PATH_SEPARATOR=$lt_cv_sys_path_separator
-fi
-])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
 
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-                             [AC_DIVERT_PUSH(NOTICE)])
-_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
 
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
+      case $tagname in
+      CXX)
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
+         AC_LIBTOOL_LANG_CXX_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
 
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
+      F77)
+       if test -n "$F77" && test "X$F77" != "Xno"; then
+         AC_LIBTOOL_LANG_F77_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
 
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
+      GCJ)
+       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+         AC_LIBTOOL_LANG_GCJ_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
 
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit 0
-fi
+      RC)
+       AC_LIBTOOL_LANG_RC_CONFIG
+       ;;
 
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+      *)
+       AC_MSG_ERROR([Unsupported tag name: $tagname])
+       ;;
+      esac
 
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
     fi
   done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
 fi
+])# _LT_AC_TAGCONFIG
 
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
 
-  IFS="${IFS=  }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$save_ifs"
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
 
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-        test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-        test "X$echo_testing_string" = "X$echo_test_string"; then
-       # Cool, printf works
-       :
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-       export CONFIG_SHELL
-       SHELL="$CONFIG_SHELL"
-       export SHELL
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      else
-       # maybe with a smaller string...
-       prev=:
 
-       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-         then
-           break
-         fi
-         prev="$cmd"
-       done
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
 
-       if test "$prev" != 'sed 50q "[$]0"'; then
-         echo_test_string=`eval $prev`
-         export echo_test_string
-         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-       else
-         # Oops.  We lost completely, so just stick with echo.
-         echo=echo
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
        fi
-      fi
-    fi
-  fi
-fi
-fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
 
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
 
-AC_SUBST(ECHO)
-AC_DIVERT_POP
-])# _LT_AC_PROG_ECHO_BACKSLASH
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
 
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
 
-#include <stdio.h>
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
 
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
 
-    exit (status);
-}]
 EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_unknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
   fi
 fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_HELP_STRING([--with-gnu-ld],
+       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case "$host_cpu" in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case $host_vendor in
+  motorola)
+    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]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      # Tru64's nm complains that /dev/null is an invalid object file
+      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+      */dev/null* | *'Invalid file or object type'*)
+       lt_cv_path_NM="$tmp_nm -B"
+       break
+        ;;
+      *)
+       case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+       */dev/null*)
+         lt_cv_path_NM="$tmp_nm -p"
+         break
+         ;;
+       *)
+         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+         continue # so that we can try to find one that supports BSD flags
+         ;;
+       esac
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
+# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case $enable_ltdl_convenience in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
+# quotes!).  If your package is not flat and you're not using automake,
+# define top_builddir and top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+# _LT_AC_PROG_CXXCPP
+# ---------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+        [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+          [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[    ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[        ]]" >/dev/null; then :
+  else
+    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_LD
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+       grep 'no-whole-archive' > /dev/null; then
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+       for ld_flag in $LDFLAGS; do
+         case $ld_flag in
+         *-brtl*)
+           aix_use_runtimelinking=yes
+           break
+           ;;
+         esac
+       done
+      esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    _LT_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[[012]]|aix4.[[012]].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+       collect2name=`${CC} -print-prog-name=collect2`
+       if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+       then
+         # We have reworked collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+       else
+         # We have old collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+       fi
+      esac
+      shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+       shared_flag="$shared_flag "'${wl}-G'
+      fi
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+       shared_flag='-G'
+      else
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag='${wl}-G'
+       else
+         shared_flag='${wl}-bM:SRE'
+       fi
+      fi
+    fi
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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"
+     else
+      if test "$host_cpu" = ia64; then
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+       # Warning - without using the other run time loading flags,
+       # -berok will link without error, but may produce a broken library.
+       _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+       # -bexpall does not export symbols beginning with underscore (_)
+       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+       # Exported symbols can be pulled into shared objects from archives
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+       # This is similar to how AIX traditionally builds it's shared libraries.
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+       cp $export_symbols $output_objdir/$soname.def;
+      else
+       echo EXPORTS > $output_objdir/$soname.def;
+       cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case "$host_os" in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case "$cc_basename" in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      ghcx)
+       # Green Hills C++ Compiler
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  freebsd[[12]]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                               # but as the default
+                               # location of the library.
+
+    case $cc_basename in
+    CC)
+      # FIXME: insert proper C++ library support
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      aCC)
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       esac
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test $with_gnu_ld = no; then
+           case "$host_cpu" in
+           ia64*|hppa*64*)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+             ;;
+           *)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           esac
+         fi
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+       # SGI C++
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+       # Archives containing C++ object files must be created using
+       # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test "$with_gnu_ld" = no; then
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+         else
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+         fi
+       fi
+       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+       ;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+       ;;
+      icpc)
+       # Intel C++
+       with_gnu_ld=yes
+       # version 8.0 and above of icpc choke on multiply defined symbols
+       # if we add $predep_objects and $postdep_objects, however 7.1 and
+       # earlier do not add the objects themselves.
+       case `$CC -V 2>&1` in
+       *"Version 7."*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       *)  # Version 8.0 or newer
+         tmp_idyn=
+         case $host_cpu in
+           ia64*) tmp_idyn=' -i_dynamic';;
+         esac
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       esac
+       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+       ;;
+      pgCC)
+        # Portland Group C++ compiler
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+        ;;
+      cxx)
+       # Compaq C++
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+       runpath_var=LD_RUN_PATH
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+       ;;
+      RCC)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      cxx)
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Archives containing C++ object files must be created using
+       # the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+       ;;
+      RCC)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      cxx)
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+         echo "-hidden">> $lib.exp~
+         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+         $rm $lib.exp'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+       # Sun C++ 4.x
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      lcc)
+       # Lucid
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+       # Sun C++ 4.2, 5.x and Centerline C++
+       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+       case $host_os in
+         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+         *)
+           # The C++ compiler is used as linker so we must use $wl
+           # flag to pass the commands to the underlying system
+           # linker.
+           # Supported since Solaris 2.6 (maybe 2.5.1?)
+           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+           ;;
+       esac
+       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+       # Archives containing C++ object files must be created using
+       # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+       ;;
+      gcx)
+       # Green Hills C++ Compiler
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+       # The C++ compiler must be used to create the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+       ;;
+      *)
+       # GNU C++ compiler with Solaris linker
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+         if $CC --version | grep -v '^2\.7' > /dev/null; then
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         else
+           # g++ 2.7 appears to require `-G' NOT `-shared' on this
+           # platform.
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         fi
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+       fi
+       ;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+       # NonStop-UX NCC 3.20
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+         || test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+          else
+            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+          _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+        else
+          _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+          _LT_AC_TAGVAR(predep_objects, $1)="$p"
+        else
+          _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+          _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+        else
+          _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
 
-# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
+  # Clean up.
+  rm -f a.out a.exe
 else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
 
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
+$rm -f confest.$objext
 
-  cygwin* | mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
 
-  *)
-    AC_CHECK_FUNC([shl_load],
-          [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
-       [AC_CHECK_FUNC([dlopen],
-             [lt_cv_dlopen="dlopen"],
-         [AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-           [AC_CHECK_LIB([svld], [dlopen],
-                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-             [AC_CHECK_LIB([dld], [dld_link],
-                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
-             ])
-           ])
-         ])
-       ])
-      ])
-    ;;
-  esac
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
   fi
+  ;;
+aix4* | aix5*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+AC_MSG_RESULT([$enable_shared])
 
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
 
-    save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
 
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-         lt_cv_dlopen_self, [dnl
-         _LT_AC_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-         lt_cv_dlopen_self_static, [dnl
-         _LT_AC_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
+AC_LIBTOOL_CONFIG($1)
 
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
 
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
 
-AC_DEFUN([_LT_AC_LTCONFIG_HACK],
-[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
-sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
 
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
+# Source file extension for Java test sources.
+ac_ext=java
 
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
 
-# Constants:
-rm="rm -f"
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
 
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-need_locks="$enable_libtool_lock"
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
 
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
-if test x"$host" != x"$build"; then
-  ac_tool_prefix=${host_alias}-
-else
-  ac_tool_prefix=
-fi
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
 
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
+AC_LIBTOOL_CONFIG($1)
 
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
 
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
-    ;;
-  *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
 
-# Allow CC to be a program name with arguments.
-set dummy $CC
-compiler="[$]2"
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
 
-AC_MSG_CHECKING([for objdir])
-rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-AC_MSG_RESULT($objdir)
+# Source file extension for RC test sources.
+ac_ext=rc
 
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
 
-AC_ARG_WITH(pic,
-[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
-pic_mode="$withval", pic_mode=default)
-test -z "$pic_mode" && pic_mode=default
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
 
-# We assume here that the value for lt_cv_prog_cc_pic will not be cached
-# in isolation, and that seeing it set (from the cache) indicates that
-# the associated values are set (in the cache) correctly too.
-AC_MSG_CHECKING([for $compiler option to produce PIC])
-AC_CACHE_VAL(lt_cv_prog_cc_pic,
-[ lt_cv_prog_cc_pic=
-  lt_cv_prog_cc_shlib=
-  lt_cv_prog_cc_wl=
-  lt_cv_prog_cc_static=
-  lt_cv_prog_cc_no_builtin=
-  lt_cv_prog_cc_can_build_shared=$can_build_shared
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
 
-  if test "$GCC" = yes; then
-    lt_cv_prog_cc_wl='-Wl,'
-    lt_cv_prog_cc_static='-static'
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
 
-    case $host_os in
-    aix*)
-      # Below there is a dirty hack to force normal static linking with -ldl
-      # The problem is because libdl dynamically linked with both libc and
-      # libC (AIX C++ library), which obviously doesn't included in libraries
-      # list by gcc. This cause undefined symbols with -static flags.
-      # This hack allows C programs to be linked with "-static -ldl", but
-      # not sure about C++ programs.
-      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
-      ;;
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_cv_prog_cc_pic='-fno-common'
-      ;;
-    cygwin* | mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_cv_prog_cc_pic='-DDLL_EXPORT'
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-        lt_cv_prog_cc_pic=-Kconform_pic
-      fi
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars.  Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
       ;;
     *)
-      lt_cv_prog_cc_pic='-fPIC'
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
       ;;
     esac
-  else
-    # PORTME Check for PIC flags for the system compiler.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      lt_cv_prog_cc_wl='-Wl,'
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_cv_prog_cc_static='-Bstatic'
-      else
-       lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
+  done
 
-    hpux9* | hpux10* | hpux11*)
-      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
-      lt_cv_prog_cc_pic='+Z'
-      ;;
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
 
-    irix5* | irix6* | nonstopux*)
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static='-non_shared'
-      # PIC (with -KPIC) is the default.
-      ;;
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
 
-    cygwin* | mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_cv_prog_cc_pic='-DDLL_EXPORT'
-      ;;
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
 
-    newsos6)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      ;;
+# A sed program that does not truncate output.
+SED=$lt_SED
 
-    osf3* | osf4* | osf5*)
-      # All OSF/1 code is PIC.
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static='-non_shared'
-      ;;
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
 
-    sco3.2v5*)
-      lt_cv_prog_cc_pic='-Kpic'
-      lt_cv_prog_cc_static='-dn'
-      lt_cv_prog_cc_shlib='-belf'
-      ;;
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-    solaris*)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Wl,'
-      ;;
+# The names of the tagged configurations supported by this script.
+available_tags=
 
-    sunos4*)
-      lt_cv_prog_cc_pic='-PIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Qoption ld '
-      ;;
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Wl,'
-      ;;
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
-    uts4*)
-      lt_cv_prog_cc_pic='-pic'
-      lt_cv_prog_cc_static='-Bstatic'
-      ;;
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_cv_prog_cc_pic='-Kconform_pic'
-       lt_cv_prog_cc_static='-Bstatic'
-      fi
-      ;;
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
 
-    *)
-      lt_cv_prog_cc_can_build_shared=no
-      ;;
-    esac
-  fi
-])
-if test -z "$lt_cv_prog_cc_pic"; then
-  AC_MSG_RESULT([none])
-else
-  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
-
-  # Check to make sure the pic_flag actually works.
-  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
-  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
-    AC_TRY_COMPILE([], [], [dnl
-      case $host_os in
-      hpux9* | hpux10* | hpux11*)
-       # On HP-UX, both CC and GCC only warn that PIC is supported... then
-       # they create non-PIC objects.  So, if there were any warnings, we
-       # assume that PIC is not supported.
-       if test -s conftest.err; then
-         lt_cv_prog_cc_pic_works=no
-       else
-         lt_cv_prog_cc_pic_works=yes
-       fi
-       ;;
-      *)
-       lt_cv_prog_cc_pic_works=yes
-       ;;
-      esac
-    ], [dnl
-      lt_cv_prog_cc_pic_works=no
-    ])
-    CFLAGS="$save_CFLAGS"
-  ])
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
 
-  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
-    lt_cv_prog_cc_pic=
-    lt_cv_prog_cc_can_build_shared=no
-  else
-    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
-  fi
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
 
-  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
-fi
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
 
-# Check for any special shared library compilation flags.
-if test -n "$lt_cv_prog_cc_shlib"; then
-  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
-  if echo "$old_CC $old_CFLAGS " | egrep -e "[[        ]]$lt_cv_prog_cc_shlib[[        ]]" >/dev/null; then :
-  else
-   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
-    lt_cv_prog_cc_can_build_shared=no
-  fi
-fi
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
 
-AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
-AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
-  lt_cv_prog_cc_static_works=no
-  save_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
-  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
-  LDFLAGS="$save_LDFLAGS"
-])
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
 
-# Belt *and* braces to stop my trousers falling down:
-test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
-AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
-
-pic_flag="$lt_cv_prog_cc_pic"
-special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
-wl="$lt_cv_prog_cc_wl"
-link_static_flag="$lt_cv_prog_cc_static"
-no_builtin_flag="$lt_cv_prog_cc_no_builtin"
-can_build_shared="$lt_cv_prog_cc_can_build_shared"
-
-
-# Check to see if options -o and -c are simultaneously supported by compiler
-AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
-AC_CACHE_VAL([lt_cv_compiler_c_o], [
-$rm -r conftest 2>/dev/null
-mkdir conftest
-cd conftest
-echo "int some_variable = 0;" > conftest.$ac_ext
-mkdir out
-# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
-# that will create temporary files in the current directory regardless of
-# the output directory.  Thus, making CWD read-only will cause this test
-# to fail, enabling locking or at least warning the user not to do parallel
-# builds.
-chmod -w .
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
-compiler_c_o=no
-if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
-  # The compiler can only warn and ignore the option if not recognized
-  # So say no if there are warnings
-  if test -s out/conftest.err; then
-    lt_cv_compiler_c_o=no
-  else
-    lt_cv_compiler_c_o=yes
-  fi
-else
-  # Append any errors to the config.log.
-  cat out/conftest.err 1>&AC_FD_CC
-  lt_cv_compiler_c_o=no
-fi
-CFLAGS="$save_CFLAGS"
-chmod u+w .
-$rm conftest* out/*
-rmdir out
-cd ..
-rmdir conftest
-$rm -r conftest 2>/dev/null
-])
-compiler_c_o=$lt_cv_compiler_c_o
-AC_MSG_RESULT([$compiler_c_o])
-
-if test x"$compiler_c_o" = x"yes"; then
-  # Check to see if we can write to a .lo
-  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
-  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
-  lt_cv_compiler_o_lo=no
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -c -o conftest.lo"
-  save_objext="$ac_objext"
-  ac_objext=lo
-  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
-    # The compiler can only warn and ignore the option if not recognized
-    # So say no if there are warnings
-    if test -s conftest.err; then
-      lt_cv_compiler_o_lo=no
-    else
-      lt_cv_compiler_o_lo=yes
-    fi
-  ])
-  ac_objext="$save_objext"
-  CFLAGS="$save_CFLAGS"
-  ])
-  compiler_o_lo=$lt_cv_compiler_o_lo
-  AC_MSG_RESULT([$compiler_o_lo])
-else
-  compiler_o_lo=no
-fi
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
-# Check to see if we can do hard links to lock some files if needed
-hard_links="nottested"
-if test "$compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
 
-if test "$GCC" = yes; then
-  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
-  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
-  compiler_rtti_exceptions=no
-  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
-    # The compiler can only warn and ignore the option if not recognized
-    # So say no if there are warnings
-    if test -s conftest.err; then
-      compiler_rtti_exceptions=no
-    else
-      compiler_rtti_exceptions=yes
-    fi
-  ])
-  CFLAGS="$save_CFLAGS"
-  AC_MSG_RESULT([$compiler_rtti_exceptions])
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
 
-  if test "$compiler_rtti_exceptions" = "yes"; then
-    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
-  else
-    no_builtin_flag=' -fno-builtin'
-  fi
-fi
+# A C compiler.
+LTCC=$lt_LTCC
 
-# See if the linker supports building shared libraries.
-AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 
-allow_undefined_flag=
-no_undefined_flag=
-need_lib_prefix=unknown
-need_version=unknown
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-archive_cmds=
-archive_expsym_cmds=
-old_archive_from_new_cmds=
-old_archive_from_expsyms_cmds=
-export_dynamic_flag_spec=
-whole_archive_flag_spec=
-thread_safe_flag_spec=
-hardcode_into_libs=no
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-hardcode_shlibpath_var=unsupported
-runpath_var=
-link_all_deplibs=unknown
-always_export_symbols=no
-export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
-# include_expsyms should be a list of space-separated symbols to be *always*
-# included in the symbol list
-include_expsyms=
-# exclude_expsyms can be an egrep regular expression of symbols to exclude
-# it will be wrapped by ` (' and `)$', so one must not match beginning or
-# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-# as well as any symbol that contains `d'.
-exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
-# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-# platforms (ab)use it in PIC code, but their linkers get confused if
-# the symbol is explicitly referenced.  Since portable code cannot
-# rely on this symbol name, it's probably fine to never include it in
-# preloaded symbol tables.
-extract_expsyms_cmds=
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
 
-case $host_os in
-cygwin* | mingw* | pw32*)
-  # FIXME: the MSVC++ port hasn't been tested in a loooong time
-  # When not using gcc, we currently assume that we are using
-  # Microsoft Visual C++.
-  if test "$GCC" != yes; then
-    with_gnu_ld=no
-  fi
-  ;;
-openbsd*)
-  with_gnu_ld=no
-  ;;
-esac
+# An ERE matcher.
+EGREP=$lt_EGREP
 
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
-  # If archive_cmds runs LD, not CC, wlarc should be empty
-  wlarc='${wl}'
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
 
-  # See if GNU ld supports shared libraries.
-  case $host_os in
-  aix3* | aix4* | aix5*)
-    # On AIX, the GNU linker is very broken
-    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
-    ld_shlibs=no
-    cat <<EOF 1>&2
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+# A BSD-compatible nm program.
+NM=$lt_NM
 
-EOF
-    ;;
+# A symbol stripping program
+STRIP=$lt_STRIP
 
-  amigaos*)
-    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)'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-
-    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-    # that the semantics of dynamic libraries on AmigaOS, at least up
-    # to version 4, is to share data among multiple programs linked
-    # with the same dynamic library.  Since this doesn't match the
-    # behavior of shared libraries on other platforms, we can use
-    # them.
-    ld_shlibs=no
-    ;;
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
 
-  beos*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      allow_undefined_flag=unsupported
-      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
 
-  cygwin* | mingw* | pw32*)
-    # hardcode_libdir_flag_spec is actually meaningless, as there is
-    # no search path for DLLs.
-    hardcode_libdir_flag_spec='-L$libdir'
-    allow_undefined_flag=unsupported
-    always_export_symbols=yes
-
-    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
-      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
-      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
-      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
-      else $CC -o impgen impgen.c ; fi)~
-      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
-
-    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
-
-    # cygwin and mingw dlls have different entry points and sets of symbols
-    # to exclude.
-    # FIXME: what about values for MSVC?
-    dll_entry=__cygwin_dll_entry@12
-    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
-    case $host_os in
-    mingw*)
-      # mingw values
-      dll_entry=_DllMainCRTStartup@12
-      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
-      ;;
-    esac
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
 
-    # mingw and cygwin differ, and it's simplest to just exclude the union
-    # of the two symbol sets.
-    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
+# Used on cygwin: assembler.
+AS=$lt_AS
 
-    # recent cygwin and mingw systems supply a stub DllMain which the user
-    # can override, but on older systems we have to supply one (in ltdll.c)
-    if test "x$lt_cv_need_dllmain" = "xyes"; then
-      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
-      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~
-       test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
-    else
-      ltdll_obj=
-      ltdll_cmds=
-    fi
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
-    # Extract the symbol export list from an `--export-all' def file,
-    # then regenerate the def file from the symbol export list, so that
-    # the compiled dll only exports the symbol export list.
-    # Be careful not to strip the DATA tag left be newer dlltools.
-    export_symbols_cmds="$ltdll_cmds"'
-      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
-      sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
-
-    # If the export-symbols file already is a .def file (1st line
-    # is EXPORTS), use it as is.
-    # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
-       cp $export_symbols $output_objdir/$soname-def;
-      else
-       echo EXPORTS > $output_objdir/$soname-def;
-       _lt_hint=1;
-       cat $export_symbols | while read symbol; do
-        set dummy \$symbol;
-        case \[$]# in
-          2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
-          4) echo "   \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
-          *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
-        esac;
-        _lt_hint=`expr 1 + \$_lt_hint`;
-       done;
-      fi~
-      '"$ltdll_cmds"'
-      $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~
-      $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~
-      $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~
-      $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~
-      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
-    ;;
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
 
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-      wlarc=
-    else
-      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    fi
-    ;;
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
 
-  solaris* | sysv5*)
-    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
-      ld_shlibs=no
-      cat <<EOF 1>&2
+# Object file suffix (normally "o").
+objext="$ac_objext"
 
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
+# Old archive suffix (normally "a").
+libext="$libext"
 
-EOF
-    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
 
-  sunos4*)
-    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    wlarc=
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
+# Executable file suffix (normally "").
+exeext="$exeext"
 
-  *)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
-  esac
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
 
-  if test "$ld_shlibs" = yes; then
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    case $host_os in
-    cygwin* | mingw* | pw32*)
-      # dlltool doesn't understand --whole-archive et. al.
-      whole_archive_flag_spec=
-      ;;
-    *)
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
-       whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       whole_archive_flag_spec=
-      fi
-      ;;
-    esac
-  fi
-else
-  # PORTME fill in a description of your system's linker (not GNU ld)
-  case $host_os in
-  aix3*)
-    allow_undefined_flag=unsupported
-    always_export_symbols=yes
-    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'
-    # Note: this linker hardcodes the directories in LIBPATH if there
-    # are no directories specified by -L.
-    hardcode_minus_L=yes
-    if test "$GCC" = yes && test -z "$link_static_flag"; then
-      # Neither direct hardcoding nor static linking is supported with a
-      # broken collect2.
-      hardcode_direct=unsupported
-    fi
-    ;;
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
-  aix4* | aix5*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
 
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
-       for ld_flag in $LDFLAGS; do
-         case $ld_flag in
-         *-brtl*)
-           aix_use_runtimelinking=yes
-           break
-         ;;
-         esac
-       done
-      esac
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
 
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
 
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+# Do we need a version for libraries?
+need_version=$need_version
 
-    hardcode_direct=yes
-    archive_cmds=''
-    hardcode_libdir_separator=':'
-    if test "$GCC" = yes; then
-      case $host_os in aix4.[[012]]|aix4.[[012]].*)
-       collect2name=`${CC} -print-prog-name=collect2`
-       if test -f "$collect2name" && \
-         strings "$collect2name" | grep resolve_lib_name >/dev/null
-       then
-         # We have reworked collect2
-         hardcode_direct=yes
-       else
-         # We have old collect2
-         hardcode_direct=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         hardcode_minus_L=yes
-         hardcode_libdir_flag_spec='-L$libdir'
-         hardcode_libdir_separator=
-       fi
-      esac
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
 
-      shared_flag='-shared'
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-       shared_flag='${wl}-G'
-      else
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag='${wl}-G'
-       else
-         shared_flag='${wl}-bM:SRE'
-       fi
-      fi
-    fi
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
 
-    # It seems that -bexpall can do strange things, so it is better to
-    # generate a list of symbols to export.
-    always_export_symbols=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      allow_undefined_flag='-berok'
-      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
-      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"
-    else
-      if test "$host_cpu" = ia64; then
-       hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-       allow_undefined_flag="-z nodefs"
-       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"
-      else
-       hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
-       # Warning - without using the other run time loading flags,
-       # -berok will link without error, but may produce a broken library.
-       allow_undefined_flag='${wl}-berok'
-       # This is a bit strange, but is similar to how AIX traditionally builds
-       # it's shared libraries.
-       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'
-      fi
-    fi
-    ;;
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
 
-  amigaos*)
-    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)'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-    # see comment about different semantics on the GNU ld section
-    ld_shlibs=no
-    ;;
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
 
-  cygwin* | mingw* | pw32*)
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    # hardcode_libdir_flag_spec is actually meaningless, as there is
-    # no search path for DLLs.
-    hardcode_libdir_flag_spec=' '
-    allow_undefined_flag=unsupported
-    # Tell ltmain to make .lib files, not .a files.
-    libext=lib
-    # FIXME: Setting linknames here is a bad hack.
-    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-    # The linker will automatically build a .lib file if we build a DLL.
-    old_archive_from_new_cmds='true'
-    # FIXME: Should let the user specify the lib program.
-    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
-    fix_srcfile_path='`cygpath -w "$srcfile"`'
-    ;;
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
 
-  darwin* | rhapsody*)
-    case "$host_os" in
-    rhapsody* | darwin1.[[012]])
-      allow_undefined_flag='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      allow_undefined_flag='-flat_namespace -undefined suppress'
-      ;;
-    esac
-    # FIXME: Relying on posixy $() will cause problems for
-    #        cross-compilation, but unfortunately the echo tests do not
-    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
-    #       `"' quotes if we put them in here... so don't!
-    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)'
-    # We need to add '_' to the symbols in $export_symbols first
-    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    whole_archive_flag_spec='-all_load $convenience'
-    ;;
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
 
-  freebsd1*)
-    ld_shlibs=no
-    ;;
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
 
-  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-  # support.  Future versions do this automatically, but an explicit c++rt0.o
-  # does not break anything, and helps significantly (at the cost of a little
-  # extra space).
-  freebsd2.2*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
 
-  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-  freebsd2*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_minus_L=yes
-    hardcode_shlibpath_var=no
-    ;;
+# Library versioning type.
+version_type=$version_type
 
-  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-  freebsd*)
-    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
 
-  hpux9* | hpux10* | hpux11*)
-    case $host_os in
-    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' ;;
-    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
-    esac
-    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_direct=yes
-    hardcode_minus_L=yes # Not in the search PATH, but as the default
-                        # location of the library.
-    export_dynamic_flag_spec='${wl}-E'
-    ;;
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
 
-  irix5* | irix6* | nonstopux*)
-    if test "$GCC" = yes; then
-      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'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    else
-      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'
-      hardcode_libdir_flag_spec='-rpath $libdir'
-    fi
-    hardcode_libdir_separator=:
-    link_all_deplibs=yes
-    ;;
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
 
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-    else
-      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-    fi
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-  newsos6)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_shlibpath_var=no
-    ;;
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
 
-  openbsd*)
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-    else
-      case "$host_os" in
-      openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-        ;;
-      *)
-        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-        ;;
-      esac
-    fi
-    ;;
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
 
-  os2*)
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-    allow_undefined_flag=unsupported
-    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'
-    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-    ;;
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
 
-  osf3*)
-    if test "$GCC" = yes; then
-      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      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'
-    else
-      allow_undefined_flag=' -expect_unresolved \*'
-      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'
-    fi
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    ;;
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
 
-  osf4* | osf5*)       # as osf3* with the addition of -msym flag
-    if test "$GCC" = yes; then
-      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      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'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    else
-      allow_undefined_flag=' -expect_unresolved \*'
-      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'
-      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-      $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'
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
 
-      #Both c and cxx compiler support -rpath directly
-      hardcode_libdir_flag_spec='-rpath $libdir'
-    fi
-    hardcode_libdir_separator=:
-    ;;
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
 
-  sco3.2v5*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_shlibpath_var=no
-    runpath_var=LD_RUN_PATH
-    hardcode_runpath_var=yes
-    export_dynamic_flag_spec='${wl}-Bexport'
-    ;;
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
 
-  solaris*)
-    # gcc --version < 3.0 without binutils cannot create self contained
-    # shared libraries reliably, requiring libgcc.a to resolve some of
-    # the object symbols generated in some cases.  Libraries that use
-    # assert need libgcc.a to resolve __eprintf, for example.  Linking
-    # a copy of libgcc.a into every shared library to guarantee resolving
-    # such symbols causes other problems:  According to Tim Van Holder
-    # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
-    # (to the application) exception stack for one thing.
-    no_undefined_flag=' -z defs'
-    if test "$GCC" = yes; then
-      case `$CC --version 2>/dev/null` in
-      [[12]].*)
-       cat <<EOF 1>&2
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
 
-*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
-*** create self contained shared libraries on Solaris systems, without
-*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
-*** -no-undefined support, which will at least allow you to build shared
-*** libraries.  However, you may find that when you link such libraries
-*** into an application without using GCC, you have to manually add
-*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
-*** upgrade to a newer version of GCC.  Another option is to rebuild your
-*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
 
-EOF
-        no_undefined_flag=
-       ;;
-      esac
-    fi
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_shlibpath_var=no
-    case $host_os in
-    solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
-    esac
-    link_all_deplibs=yes
-    ;;
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
 
-  sunos4*)
-    if test "x$host_vendor" = xsequent; then
-      # Use $CC to link under sequent, because it throws in some extra .o
-      # files that make .init and .fini sections work.
-      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-    fi
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_direct=yes
-    hardcode_minus_L=yes
-    hardcode_shlibpath_var=no
-    ;;
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
 
-  sysv4)
-    case $host_vendor in
-      sni)
-        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-        hardcode_direct=yes # is this really true???
-        ;;
-      siemens)
-        ## LD is ld it makes a PLAMLIB
-        ## CC just makes a GrossModule.
-        archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-        reload_cmds='$CC -r -o $output$reload_objs'
-        hardcode_direct=no
-        ;;
-      motorola)
-        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-        hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-        ;;
-    esac
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
 
-  sysv4.3*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_shlibpath_var=no
-    export_dynamic_flag_spec='-Bexport'
-    ;;
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
 
-  sysv5*)
-    no_undefined_flag=' -z text'
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec=
-    hardcode_shlibpath_var=no
-    runpath_var='LD_RUN_PATH'
-    ;;
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
 
-  uts4*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_shlibpath_var=no
-    ;;
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
 
-  dgux*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_shlibpath_var=no
-    ;;
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
 
-  sysv4*MP*)
-    if test -d /usr/nec; then
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ld_shlibs=yes
-    fi
-    ;;
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 
-  sysv4.2uw2*)
-    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_minus_L=no
-    hardcode_shlibpath_var=no
-    hardcode_runpath_var=yes
-    runpath_var=LD_RUN_PATH
-    ;;
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
-  sysv5uw7* | unixware7*)
-    no_undefined_flag='${wl}-z ${wl}text'
-    if test "$GCC" = yes; then
-      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    fi
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
-  *)
-    ld_shlibs=no
-    ;;
-  esac
-fi
-AC_MSG_RESULT([$ld_shlibs])
-test "$ld_shlibs" = no && can_build_shared=no
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
 
-# Check hardcoding attributes.
-AC_MSG_CHECKING([how to hardcode library paths into programs])
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var"; then
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
 
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$hardcode_shlibpath_var" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-AC_MSG_RESULT([$hardcode_action])
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-  AC_MSG_RESULT([no])
-fi
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
 
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
 
-# PORTME Fill in your ld.so characteristics
-AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
 
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix $libname.a'
-  shlibpath_var=LIBPATH
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
 
-  # AIX has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}.so$major'
-  ;;
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
 
-aix4* | aix5*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-            echo ' yes '
-            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-         :
-       else
-         can_build_shared=no
-       fi
-       ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can
-    # not hardcode correct soname into executable. Probably we can
-    # add versioning support to collect2, so additional links can
-    # be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}.so$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  hardcode_into_libs=yes
-  ;;
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
 
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  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'
-  ;;
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
 
-beos*)
-  library_names_spec='${libname}.so'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
 
-bsdi4*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  export_dynamic_flag_spec=-rdynamic
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  need_version=no
-  need_lib_prefix=no
-  case $GCC,$host_os in
-  yes,cygwin*)
-    library_names_spec='$libname.dll.a'
-    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
-    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog .libs/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    ;;
-  yes,mingw*)
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
-    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
-    ;;
-  yes,pw32*)
-    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
-    ;;
-  *)
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
 
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  # FIXME: Relying on posixy $() will cause problems for
-  #        cross-compilation, but unfortunately the echo tests do not
-  #        yet detect zsh echo's removal of \ escapes.
-  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)'
-  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  ;;
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  *)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
 
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  dynamic_linker="$host_os dld.sl"
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  shlibpath_var=SHLIB_PATH
-  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
-  soname_spec='${libname}${release}.sl$major'
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)          version_type=irix ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  ;;
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-# This must be Linux ELF.
-linux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
     ;;
   esac
 
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
 
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
-    soname_spec='${libname}${release}.so$major'
-    dynamic_linker='NetBSD ld.elf_so'
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
   fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
+fi
+])# AC_LIBTOOL_CONFIG
 
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
 
-openbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case "$host_os" in
-    openbsd2.[[89]] | openbsd2.[[89]].*)
-      shlibpath_overrides_runpath=no
-      ;;
-    *)
-      shlibpath_overrides_runpath=yes
-      ;;
-    esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
 
-os2*)
-  libname_spec='$name'
-  need_lib_prefix=no
-  library_names_spec='$libname.dll $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_version=no
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  hardcode_into_libs=yes
-  ;;
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  shlibpath_var=LD_LIBRARY_PATH
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
   ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
   ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
   fi
-  need_version=yes
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
   ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
   ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
   ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
+osf*)
+  symcode='[[BCDEGQRST]]'
   ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
-    soname_spec='$libname.so.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
+solaris* | sysv5*)
+  symcode='[[BDRT]]'
   ;;
-
-*)
-  dynamic_linker=no
+sysv4)
+  symcode='[[DFNSTU]]'
   ;;
 esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-# Report the final consequences.
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
 
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case "$host_os" in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
   ;;
+esac
 
-aix4*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
 esac
-AC_MSG_RESULT([$enable_shared])
 
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
 
-if test "$hardcode_action" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
-AC_LIBTOOL_DLOPEN_SELF
+  # Check to see that the pipe works correctly.
+  pipe_works=no
 
-if test "$enable_shared" = yes && test "$GCC" = yes; then
-  case $archive_cmds in
-  *'~'*)
-    # FIXME: we may have to deal with multi-command sequences.
-    ;;
-  '$CC '*)
-    # Test whether the compiler implicitly links with -lc since on some
-    # systems, -lgcc has to come before -lc. If gcc already passes -lc
-    # to ld, don't add -lc before -lgcc.
-    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
-    [$rm conftest*
-    echo 'static int dummy;' > conftest.$ac_ext
-
-    if AC_TRY_EVAL(ac_compile); then
-      soname=conftest
-      lib=conftest
-      libobjs=conftest.$ac_objext
-      deplibs=
-      wl=$lt_cv_prog_cc_wl
-      compiler_flags=-v
-      linker_flags=-v
-      verstring=
-      output_objdir=.
-      libname=conftest
-      save_allow_undefined_flag=$allow_undefined_flag
-      allow_undefined_flag=
-      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
-      then
-       lt_cv_archive_cmds_need_lc=no
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
       else
-       lt_cv_archive_cmds_need_lc=yes
+       rm -f "$nlist"T
       fi
-      allow_undefined_flag=$save_allow_undefined_flag
-    else
-      cat conftest.err 1>&5
-    fi])
-    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
-    ;;
-  esac
-fi
-need_lc=${lt_cv_archive_cmds_need_lc-yes}
-
-# The second clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  :
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  test -f Makefile && make "$ltmain"
-fi
 
-if test -f "$ltmain"; then
-  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
-  $rm -f "${ofile}T"
-
-  echo creating $ofile
-
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS SED \
-    AR AR_FLAGS CC LD LN_S NM SHELL \
-    reload_flag reload_cmds wl \
-    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
-    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
-    library_names_spec soname_spec \
-    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
-    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
-    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
-    old_striplib striplib file_magic_cmd export_symbols_cmds \
-    deplibs_check_method allow_undefined_flag no_undefined_flag \
-    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
-    global_symbol_to_c_name_address \
-    hardcode_libdir_flag_spec hardcode_libdir_separator  \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
-
-    case $var in
-    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
-    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+       if grep ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-  cat <<__EOF__ > "${ofile}T"
-#! $SHELL
+EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
 
-# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996-2000 Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+         cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
 
-# A sed that does not truncate output.
-SED=$lt_SED
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+         cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
 
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="${SED} -e s/^X//"
+#ifdef __cplusplus
+}
+#endif
+EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+         if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
 
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
 
-# ### BEGIN LIBTOOL CONFIG
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       else
+         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68)
+         # Green Hills C++ Compiler
+         # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case "$cc_basename" in
+           xlc*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         ghcx)
+           # Green Hills C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+           if test "$host_cpu" != ia64; then
+             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+           fi
+           ;;
+         aCC)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+           case "$host_cpu" in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux*)
+       case $cc_basename in
+         KCC)
+           # KAI C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         icpc* | ecpc*)
+           # Intel C++
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         pgCC)
+           # Portland Group C++ compiler.
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         cxx)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           ;;
+         RCC)
+           # Rational C++ 2.4.1
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         cxx)
+           # Digital/Compaq C++
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      sco*)
+       case $cc_basename in
+         CC)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+           ;;
+         gcx)
+           # Green Hills C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC)
+           # Sun C++ 4.x
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         lcc)
+           # Lucid
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC)
+           # NonStop-UX NCC 3.20
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      unixware*)
+       ;;
+      vxworks*)
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+       ;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$need_lc
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
 
-# The host system.
-host_alias=$host_alias
-host=$host
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
 
-# The default C compiler.
-CC=$lt_CC
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
 
-# The linker used to build libraries.
-LD=$lt_LD
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case "$cc_basename" in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
 
-# A BSD-compatible nm program.
-NM=$lt_NM
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
 
-# A symbol stripping program
-STRIP=$STRIP
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      pgcc | pgf77 | pgf90)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
 
-# Used on cygwin: assembler.
-AS=$lt_AS
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
 
-# How to pass a linker flag through the compiler.
-wl=$lt_wl
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
 
-# Old archive suffix (normally "a").
-libext="$libext"
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
 
-# Executable file suffix (normally "").
-exeext="$exeext"
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_pic_flag
-pic_mode=$pic_mode
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_compiler_c_o
 
-# Can we write directly to a .lo ?
-compiler_o_lo=$lt_compiler_o_lo
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
 
-# Must we lock files when doing compilation ?
-need_locks=$lt_need_locks
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
 
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
+  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
 
-# Do we need a version for libraries?
-need_version=$need_version
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<EOF 1>&2
 
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
 
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
+EOF
+      fi
+      ;;
 
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
 
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_link_static_flag
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
 
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_no_builtin_flag
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
 
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<EOF 1>&2
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
 
-# Library versioning type.
-version_type=$version_type
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      tmp_addflag=
+      case $CC,$host_cpu in
+      pgf77* | pgf90* )                        # Portland Group f77 and f90 compilers
+        tmp_addflag=' -fpic' ;;
+      ecc*,ia64* | icc*,ia64*)         # Intel C compiler on ia64
+        tmp_addflag=' -i_dynamic' ;;
+      efc*,ia64* | ifort*,ia64*)       # Intel Fortran compiler on ia64
+        tmp_addflag=' -i_dynamic -nofor_main' ;;
+      ifc* | ifort*)                   # Intel Fortran compiler
+       tmp_addflag=' -nofor_main' ;;
+      esac
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+        *\ 2.11.*) ;; # other 2.11 versions
+        *) supports_anon_versioning=yes ;;
+      esac
+      if test $supports_anon_versioning = yes; then
+        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        _LT_AC_TAGVAR(archive_expsym_cmds, $1)=$_LT_AC_TAGVAR(archive_cmds, $1)
+      fi
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+    ;;
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+      runpath_var=LD_RUN_PATH
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+       esac
 
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
 
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[[012]]|aix4.[[012]].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+         else
+         # We have old collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+       if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+       fi
+       fi
+      fi
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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"
+       else
+       if test "$host_cpu" = ia64; then
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        _LT_AC_SYS_LIBPATH_AIX
+        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+         # -bexpall does not export symbols beginning with underscore (_)
+         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+         # Exported symbols can be pulled into shared objects from archives
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+         # This is similar to how AIX traditionally builds it's shared libraries.
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
 
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
 
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
+    bsdi[[45]]*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
+    darwin* | rhapsody*)
+      case "$host_os" in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case "$cc_basename" in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+    fi
+      ;;
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
+    freebsd1*)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
 
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_global_symbol_pipe
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
+    hpux9*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       case "$host_cpu" in
+       hppa*64*)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       ia64*)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       *)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+        openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+          ;;
+        *)
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
 
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
+    osf3*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+      else
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $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'
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
+       # Both c and cxx compiler support -rpath directly
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
+      esac
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
 
-# ### END LIBTOOL CONFIG
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
-__EOF__
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
 
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "${ofile}T"
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
 
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
-    ;;
-  esac
 
-  case $host_os in
-  cygwin* | mingw* | pw32* | os2*)
-    cat <<'EOF' >> "${ofile}T"
-      # This is a source program that is used to create dlls on Windows
-      # Don't remove nor modify the starting and closing comments
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
 # /* ltdll.c starts here */
 # #define WIN32_LEAN_AND_MEAN
 # #include <windows.h>
@@ -3601,847 +5951,943 @@ EOF
 #   return TRUE;
 # }
 # /* ltdll.c ends here */
-       # This is a source program that is used to create import libraries
-       # on Windows for dlls which lack them. Don't remove nor modify the
-       # starting and closing comments
-# /* impgen.c starts here */
-# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
-#
-#  This file is part of GNU libtool.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#  */
-#
-# #include <stdio.h>           /* for printf() */
-# #include <unistd.h>          /* for open(), lseek(), read() */
-# #include <fcntl.h>           /* for O_RDONLY, O_BINARY */
-# #include <string.h>          /* for strdup() */
-#
-# /* O_BINARY isn't required (or even defined sometimes) under Unix */
-# #ifndef O_BINARY
-# #define O_BINARY 0
-# #endif
-#
-# static unsigned int
-# pe_get16 (fd, offset)
-#      int fd;
-#      int offset;
-# {
-#   unsigned char b[2];
-#   lseek (fd, offset, SEEK_SET);
-#   read (fd, b, 2);
-#   return b[0] + (b[1]<<8);
-# }
-#
-# static unsigned int
-# pe_get32 (fd, offset)
-#     int fd;
-#     int offset;
-# {
-#   unsigned char b[4];
-#   lseek (fd, offset, SEEK_SET);
-#   read (fd, b, 4);
-#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# static unsigned int
-# pe_as32 (ptr)
-#      void *ptr;
-# {
-#   unsigned char *b = ptr;
-#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# int
-# main (argc, argv)
-#     int argc;
-#     char *argv[];
-# {
-#     int dll;
-#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
-#     unsigned long export_rva, export_size, nsections, secptr, expptr;
-#     unsigned long name_rvas, nexp;
-#     unsigned char *expdata, *erva;
-#     char *filename, *dll_name;
-#
-#     filename = argv[1];
-#
-#     dll = open(filename, O_RDONLY|O_BINARY);
-#     if (dll < 1)
-#      return 1;
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_MSG_RESULT([$SED])
+])
+
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
 #
-#     dll_name = filename;
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+        [AM_AUTOMAKE_VERSION([1.9.5])])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 #
-#     for (i=0; filename[i]; i++)
-#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
-#          dll_name = filename + i +1;
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
 #
-#     pe_header_offset = pe_get32 (dll, 0x3c);
-#     opthdr_ofs = pe_header_offset + 4 + 20;
-#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
 #
-#     if (num_entries < 1) /* no exports */
-#      return 1;
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
 #
-#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
-#     export_size = pe_get32 (dll, opthdr_ofs + 100);
-#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
-#     secptr = (pe_header_offset + 4 + 20 +
-#            pe_get16 (dll, pe_header_offset + 4 + 16));
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
 #
-#     expptr = 0;
-#     for (i = 0; i < nsections; i++)
-#     {
-#      char sname[8];
-#      unsigned long secptr1 = secptr + 40 * i;
-#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
-#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
-#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
-#      lseek(dll, secptr1, SEEK_SET);
-#      read(dll, sname, 8);
-#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
-#      {
-#          expptr = fptr + (export_rva - vaddr);
-#          if (export_rva + export_size > vaddr + vsize)
-#              export_size = vsize - (export_rva - vaddr);
-#          break;
-#      }
-#     }
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
 #
-#     expdata = (unsigned char*)malloc(export_size);
-#     lseek (dll, expptr, SEEK_SET);
-#     read (dll, expdata, export_size);
-#     erva = expdata - export_rva;
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
 #
-#     nexp = pe_as32 (expdata+24);
-#     name_rvas = pe_as32 (expdata+32);
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
 #
-#     printf ("EXPORTS\n");
-#     for (i = 0; i<nexp; i++)
-#     {
-#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
-#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
-#     }
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
 #
-#     return 0;
-# }
-# /* impgen.c ends here */
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
 
-EOF
-    ;;
-  esac
 
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
 
-  mv -f "${ofile}T" "$ofile" || \
-    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
-  chmod +x "$ofile"
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
 fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
 
-])# _LT_AC_LTCONFIG_HACK
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+#serial 3
 
-# AC_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(shared,
-changequote(<<, >>)dnl
-<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
-  enable_shared=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_shared=yes
-    fi
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
   done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
-])
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)])
 
-# AC_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(static,
-changequote(<<, >>)dnl
-<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
-  enable_static=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_static=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 ])
 
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)])
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
+# serial 8
 
-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
-#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
-#   `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(fast-install,
-changequote(<<, >>)dnl
-<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case $enableval in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
-  enable_fast_install=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_fast_install=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac],
-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
 ])
 
-# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)])
 
-# AC_LIBTOOL_PICMODE - implement the --with-pic flag
-# Usage: AC_LIBTOOL_PICMODE[(MODE)]
-#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
-#   `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)])
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
 
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-  /*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
-  ;;
-  *)
-  ac_save_MAGIC_CMD="$MAGIC_CMD"
-  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="ifelse([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           egrep "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<EOF 1>&2
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
 
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  MAGIC_CMD="$ac_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
 else
-  AC_MSG_RESULT(no)
+  am__leading_dot=_
 fi
-])
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
 
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# AC_PATH_MAGIC - find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
-AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
+# serial 3
 
-# AC_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by GCC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
 fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
-       test "$with_gnu_ld" != no && break
-      else
-       test "$with_gnu_ld" != yes && break
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
 fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
 ])
 
-# AC_PROG_LD_GNU -
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
-  lt_cv_prog_gnu_ld=yes
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
 else
-  lt_cv_prog_gnu_ld=no
-fi])
-with_gnu_ld=$lt_cv_prog_gnu_ld
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
 ])
 
-# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
-[lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-test -n "$reload_flag" && reload_flag=" $reload_flag"
-])
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given egrep regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake.  There are at least two reasons why we must not
+# use `-m 0755':
+#   - it causes special bits like SGID to be ignored,
+#   - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out.  Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
 
-case $host_os in
-aix4* | aix5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# Helper functions for option handling.                     -*- Autoconf -*-
 
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-bsdi4*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
+# serial 3
 
-cygwin* | mingw* | pw32*)
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  case "$host_os" in
-  rhapsody* | darwin1.[[012]])
-    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
-    ;;
-  *) # Darwin 1.3 on
-    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
-    ;;
-  esac
-  ;;
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
-freebsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-hpux10.20*|hpux11*)
-  lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libc.sl
-  ;;
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-  irix5* | nonstopux*)
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
-    ;;
-  *)
-    case $LD in
-    *-32|*"-32 ") libmagic=32-bit;;
-    *-n32|*"-n32 ") libmagic=N32;;
-    *-64|*"-64 ") libmagic=64-bit;;
-    *) libmagic=never-match;;
-    esac
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
-    ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
 
-# This must be Linux ELF.
-linux*)
-  case $host_cpu in
-  alpha* | hppa* | i*86 | m68* | mips | mipsel | powerpc* | s390* | sparc* | ia64* | x86_64*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
-  ;;
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
 
-netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
-  fi
-  ;;
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
 
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
 
-openbsd*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
-  else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
-  fi
-  ;;
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-osf3* | osf4* | osf5*)
-  # this will be overridden with pass_all, but let us keep it just in case
-  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# Check how to create a tarball.                            -*- Autoconf -*-
 
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  lt_cv_file_magic_test_file=/lib/libc.so
-  ;;
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 
-sysv5uw[[78]]* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# serial 2
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  case $host_vendor in
-  motorola)
-    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]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
     ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
     ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
     ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
     ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
     ;;
   esac
-  ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-])
-
 
-# AC_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
-AC_MSG_CHECKING([for BSD-compatible nm])
-AC_CACHE_VAL(lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm=$ac_dir/${ac_tool_prefix}nm
-    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -B"
-       break
-      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -p"
-       break
-      else
-       lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-       continue # so that we can try to find one that supports BSD flags
-      fi
-    fi
-  done
-  IFS="$ac_save_ifs"
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-AC_MSG_RESULT([$NM])
-])
-
-# AC_CHECK_LIBM - check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32*)
-  # These system don't have libm
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, main, LIBM="-lm")
-  ;;
-esac
-])
-
-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library and LTDLINCL to the include flags for
-# the libltdl header and adds --enable-ltdl-convenience to the
-# configure arguments.  Note that LIBLTDL and LTDLINCL are not
-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
-# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
-# with '${top_builddir}/' and LTDLINCL will be prefixed with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
 
-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library and LTDLINCL to the include flags for
-# the libltdl header and adds --enable-ltdl-install to the configure
-# arguments.  Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
-# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
-# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
-# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
-# with '${top_srcdir}/' (note the single quotes!).  If your package is
-# not flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, main,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
   fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_executable_p="test -f"
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
-      fi
-    done
-  done
 done
+rm -rf conftest.dir
 
-  # Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-: ${TMPDIR=/tmp}
-{
-  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=$TMPDIR/sed$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
-{
-   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
-   { (exit 1); exit 1; }
-}
-  _max=0
-  _count=0
-  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
-  # along with /bin/sed that truncates output.
-  for _sed in $_sed_list /usr/xpg4/bin/sed; do
-    test ! -f ${_sed} && break
-    cat /dev/null > "$tmp/sed.in"
-    _count=0
-    echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
-    # Check for GNU sed and select it if it is found.
-    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
-      lt_cv_path_SED=${_sed}
-      break
-    fi
-    while true; do
-      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
-      mv "$tmp/sed.tmp" "$tmp/sed.in"
-      cp "$tmp/sed.in" "$tmp/sed.nl"
-      echo >>"$tmp/sed.nl"
-      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
-      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
-      # 40000 chars as input seems more than enough
-      test $_count -gt 10 && break
-      _count=`expr $_count + 1`
-      if test $_count -gt $_max; then
-        _max=$_count
-        lt_cv_path_SED=$_sed
-      fi
-    done
-  done
-  rm -rf "$tmp"
-])
-if test "X$SED" != "X"; then
-  lt_cv_path_SED=$SED
-else
-  SED=$lt_cv_path_SED
-fi
-AC_MSG_RESULT([$SED])
-])
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
 
index b9766334c2195ca788ab1f1c7a13a5a106d9ac06..44f30e6c1a315fe443cd287cab12a17a72822ee1 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2001-07-12'
+timestamp='2005-02-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -24,8 +24,9 @@ timestamp='2001-07-12'
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Written by Per Bothner <bothner@cygnus.com>.
-# Please send patches to <config-patches@gnu.org>.
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
@@ -52,7 +53,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -87,30 +88,42 @@ if test $# != 0; then
   exit 1
 fi
 
+trap 'exit 1' 1 2 15
 
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
 
-# CC_FOR_BUILD -- compiler used by this script.
 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
 # use `HOST_CC' if defined, but it is deprecated.
 
-set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int dummy(){}" > $dummy.c ;
-       for c in cc gcc c89 ; do
-         ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
-         if test $? = 0 ; then
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+       for c in cc gcc c89 c99 ; do
+         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
             CC_FOR_BUILD="$c"; break ;
          fi ;
        done ;
-       rm -f $dummy.c $dummy.o $dummy.rel ;
        if test x"$CC_FOR_BUILD" = x ; then
          CC_FOR_BUILD=no_compiler_found ;
        fi
        ;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac'
+esac ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -131,35 +144,36 @@ case "${UNAME_MACHINE}" in
        test -z "$VENDOR" && VENDOR=unknown
        ;;
 esac
-test -e /etc/SuSE-release && VENDOR=suse
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
 
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
-       # Netbsd (nbsd) targets should (where applicable) match one or
+       # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
        # switched to ELF, *-*-netbsd* would select the old
        # object file format.  This provides both forward
        # compatibility and a consistent mechanism for selecting the
        # object file format.
-       # Determine the machine/vendor (is the vendor relevant).
-       case "${UNAME_MACHINE}" in
-           amiga) machine=m68k-unknown ;;
-           arm32) machine=arm-unknown ;;
-           atari*) machine=m68k-atari ;;
-           sun3*) machine=m68k-sun ;;
-           mac68k) machine=m68k-apple ;;
-           macppc) machine=powerpc-apple ;;
-           hp3[0-9][05]) machine=m68k-hp ;;
-           ibmrt|romp-ibm) machine=romp-ibm ;;
-           *) machine=${UNAME_MACHINE}-unknown ;;
+       #
+       # Note: NetBSD doesn't particularly care about the vendor
+       # portion of the name.  We always set it to "unknown".
+       sysctl="sysctl -n hw.machine_arch"
+       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+       case "${UNAME_MACHINE_ARCH}" in
+           armeb) machine=armeb-unknown ;;
+           arm*) machine=arm-unknown ;;
+           sh3el) machine=shl-unknown ;;
+           sh3eb) machine=sh-unknown ;;
+           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
        esac
        # The Operating System including object format, if it has switched
        # to ELF recently, or will in the future.
-       case "${UNAME_MACHINE}" in
-           i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+       case "${UNAME_MACHINE_ARCH}" in
+           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
                eval $set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep __ELF__ >/dev/null
@@ -176,71 +190,123 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # The OS release
-       release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       # Debian GNU/NetBSD machines have a different userland, and
+       # thus, need a distinct triplet. However, they do not need
+       # kernel version information, so it can be replaced with a
+       # suitable tag, in the style of linux-gnu.
+       case "${UNAME_VERSION}" in
+           Debian*)
+               release='-gnu'
+               ;;
+           *)
+               release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+               ;;
+       esac
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
        exit 0 ;;
+    amd64:OpenBSD:*:*)
+       echo x86_64-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    amiga:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    cats:OpenBSD:*:*)
+       echo arm-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    hp300:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    luna88k:OpenBSD:*:*)
+       echo m88k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mac68k:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    macppc:OpenBSD:*:*)
+       echo powerpc-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+       echo m88k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+       echo powerpc-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sgi:OpenBSD:*:*)
+       echo mips64-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sun3:OpenBSD:*:*)
+       echo m68k-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    *:OpenBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    *:ekkoBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       exit 0 ;;
+    macppc:MirBSD:*:*)
+       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+       exit 0 ;;
+    *:MirBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       exit 0 ;;
     alpha:OSF1:*:*)
-       if test $UNAME_RELEASE = "V4.0"; then
+       case $UNAME_RELEASE in
+       *4.0)
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-       fi
+               ;;
+       *5.*)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               ;;
+       esac
+       # According to Compaq, /usr/sbin/psrinfo has been available on
+       # OSF/1 and Tru64 systems produced since 1995.  I hope that
+       # covers most systems running today.  This code pipes the CPU
+       # types through head -n 1, so we only detect the type of CPU 0.
+       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+       case "$ALPHA_CPU_TYPE" in
+           "EV4 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "EV4.5 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "LCA4 (21066/21068)")
+               UNAME_MACHINE="alpha" ;;
+           "EV5 (21164)")
+               UNAME_MACHINE="alphaev5" ;;
+           "EV5.6 (21164A)")
+               UNAME_MACHINE="alphaev56" ;;
+           "EV5.6 (21164PC)")
+               UNAME_MACHINE="alphapca56" ;;
+           "EV5.7 (21164PC)")
+               UNAME_MACHINE="alphapca57" ;;
+           "EV6 (21264)")
+               UNAME_MACHINE="alphaev6" ;;
+           "EV6.7 (21264A)")
+               UNAME_MACHINE="alphaev67" ;;
+           "EV6.8CB (21264C)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8AL (21264B)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8CX (21264D)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.9A (21264/EV69A)")
+               UNAME_MACHINE="alphaev69" ;;
+           "EV7 (21364)")
+               UNAME_MACHINE="alphaev7" ;;
+           "EV7.9 (21364A)")
+               UNAME_MACHINE="alphaev79" ;;
+       esac
+       # A Pn.n version is a patched version.
        # A Vn.n version is a released version.
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
-       cat <<EOF >$dummy.s
-       .data
-\$Lformat:
-       .byte 37,100,45,37,120,10,0     # "%d-%x\n"
-
-       .text
-       .globl main
-       .align 4
-       .ent main
-main:
-       .frame \$30,16,\$26,0
-       ldgp \$29,0(\$27)
-       .prologue 1
-       .long 0x47e03d80 # implver \$0
-       lda \$2,-1
-       .long 0x47e20c21 # amask \$2,\$1
-       lda \$16,\$Lformat
-       mov \$0,\$17
-       not \$1,\$18
-       jsr \$26,printf
-       ldgp \$29,0(\$26)
-       mov 0,\$16
-       jsr \$26,exit
-       .end main
-EOF
-       eval $set_cc_for_build
-       $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-       if test "$?" = 0 ; then
-               case `./$dummy` in
-                       0-0)
-                               UNAME_MACHINE="alpha"
-                               ;;
-                       1-0)
-                               UNAME_MACHINE="alphaev5"
-                               ;;
-                       1-1)
-                               UNAME_MACHINE="alphaev56"
-                               ;;
-                       1-101)
-                               UNAME_MACHINE="alphapca56"
-                               ;;
-                       2-303)
-                               UNAME_MACHINE="alphaev6"
-                               ;;
-                       2-307)
-                               UNAME_MACHINE="alphaev67"
-                               ;;
-               esac
-       fi
-       rm -f $dummy.s $dummy
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
        exit 0 ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
@@ -254,33 +320,21 @@ EOF
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
        exit 0;;
-    amiga:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
     *:[Aa]miga[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-amigaos
        exit 0 ;;
-    arc64:OpenBSD:*:*)
-       echo mips64el-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    arc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    hkmips:OpenBSD:*:*)
-       echo mips-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    pmax:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sgi:OpenBSD:*:*)
-       echo mips-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
+    *:[Mm]orph[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-morphos
        exit 0 ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
        exit 0 ;;
+    *:z/VM:*:*)
+       echo s390-ibm-zvmoe
+       exit 0 ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+       exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
        exit 0;;
@@ -298,6 +352,13 @@ EOF
     NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
        exit 0 ;;
+    DRS?6000:unix:4.0:6*)
+       echo sparc-icl-nx6
+       exit 0 ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+       case `/usr/bin/uname -p` in
+           sparc) echo sparc-icl-nx7 && exit 0 ;;
+       esac ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit 0 ;;
@@ -326,7 +387,7 @@ EOF
        echo m68k-sun-sunos${UNAME_RELEASE}
        exit 0 ;;
     sun*:*:4.2BSD:*)
-       UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
        case "`/bin/arch`" in
            sun3)
@@ -340,9 +401,6 @@ EOF
     aushp:SunOS:*:*)
        echo sparc-auspex-sunos${UNAME_RELEASE}
        exit 0 ;;
-    atari*:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -369,17 +427,8 @@ EOF
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
         exit 0 ;;
-    sun3*:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mac68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-       echo m88k-unknown-openbsd${UNAME_RELEASE}
+    m68k:machten:*:*)
+       echo m68k-apple-machten${UNAME_RELEASE}
        exit 0 ;;
     powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
@@ -397,6 +446,7 @@ EOF
        echo clipper-intergraph-clix${UNAME_RELEASE}
        exit 0 ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
+       eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
@@ -418,16 +468,20 @@ EOF
          exit (-1);
        }
 EOF
-       eval $set_cc_for_build
-       $CC_FOR_BUILD $dummy.c -o $dummy \
-         && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+       $CC_FOR_BUILD -o $dummy $dummy.c \
+         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+         && exit 0
        echo mips-mips-riscos${UNAME_RELEASE}
        exit 0 ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
        exit 0 ;;
+    Motorola:*:4.3:PL8-*)
+       echo powerpc-harris-powermax
+       exit 0 ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+       echo powerpc-harris-powermax
+       exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
        echo powerpc-harris-powerunix
        exit 0 ;;
@@ -488,6 +542,7 @@ EOF
        exit 0 ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               eval $set_cc_for_build
                sed 's/^                //' << EOF >$dummy.c
                #include <sys/systemcfg.h>
 
@@ -499,9 +554,7 @@ EOF
                        exit(0);
                        }
 EOF
-               eval $set_cc_for_build
-               $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-               rm -f $dummy.c $dummy
+               $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
                echo rs6000-ibm-aix3.2.5
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
@@ -510,7 +563,7 @@ EOF
        fi
        exit 0 ;;
     *:AIX:*:[45])
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
        else
@@ -550,10 +603,8 @@ EOF
            9000/31? )            HP_ARCH=m68000 ;;
            9000/[34]?? )         HP_ARCH=m68k ;;
            9000/[678][0-9][0-9])
-              case "${HPUX_REV}" in
-                11.[0-9][0-9])
-                  if [ -x /usr/bin/getconf ]; then
-                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+               if [ -x /usr/bin/getconf ]; then
+                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
                     case "${sc_cpu_version}" in
                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
@@ -562,12 +613,13 @@ EOF
                         case "${sc_kernel_bits}" in
                           32) HP_ARCH="hppa2.0n" ;;
                           64) HP_ARCH="hppa2.0w" ;;
+                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
                         esac ;;
                     esac
-                  fi ;;
-              esac
-              if [ "${HP_ARCH}" = "" ]; then
-              sed 's/^              //' << EOF >$dummy.c
+               fi
+               if [ "${HP_ARCH}" = "" ]; then
+                   eval $set_cc_for_build
+                   sed 's/^              //' << EOF >$dummy.c
 
               #define _HPUX_SOURCE
               #include <stdlib.h>
@@ -600,12 +652,21 @@ EOF
                   exit (0);
               }
 EOF
-       eval $set_cc_for_build
-       (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
-       if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
-       rm -f $dummy.c $dummy
-       fi ;;
+                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   test -z "$HP_ARCH" && HP_ARCH=hppa
+               fi ;;
        esac
+       if [ ${HP_ARCH} = "hppa2.0w" ]
+       then
+           # avoid double evaluation of $set_cc_for_build
+           test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+           then
+               HP_ARCH="hppa2.0w"
+           else
+               HP_ARCH="hppa64"
+           fi
+       fi
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
        exit 0 ;;
     ia64:HP-UX:*:*)
@@ -613,6 +674,7 @@ EOF
        echo ia64-hp-hpux${HPUX_REV}
        exit 0 ;;
     3050*:HI-UX:*:*)
+       eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
        #include <unistd.h>
        int
@@ -638,9 +700,7 @@ EOF
          exit (0);
        }
 EOF
-       eval $set_cc_for_build
-       $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
        echo unknown-hitachi-hiuxwe2
        exit 0 ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -668,9 +728,6 @@ EOF
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
        exit 0 ;;
-    hppa*:OpenBSD:*:*)
-       echo hppa-unknown-openbsd
-       exit 0 ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
         exit 0 ;;
@@ -689,9 +746,6 @@ EOF
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
         exit 0 ;;
-    CRAY*X-MP:*:*:*)
-       echo xmp-cray-unicos
-        exit 0 ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
@@ -704,26 +758,25 @@ EOF
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
-    CRAY*T3D:*:*:*)
-       echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
     CRAY*T3E:*:*:*)
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
     CRAY*SV1:*:*:*)
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
-    CRAY-2:*:*:*)
-       echo cray2-cray-unicos
-        exit 0 ;;
+    *:UNICOS/mp:*:*)
+       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit 0 ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
         exit 0 ;;
-    hp300:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit 0 ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -737,9 +790,6 @@ EOF
     *:FreeBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit 0 ;;
-    *:OpenBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-       exit 0 ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
        exit 0 ;;
@@ -749,15 +799,24 @@ EOF
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
        exit 0 ;;
+    x86:Interix*:[34]*)
+       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+       exit 0 ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit 0 ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
        # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i386-pc-interix
+       echo i586-pc-interix
        exit 0 ;;
     i*:UWIN*:*)
        echo ${UNAME_MACHINE}-pc-uwin
        exit 0 ;;
+    amd64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit 0 ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin
        exit 0 ;;
@@ -765,29 +824,81 @@ EOF
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit 0 ;;
     *:GNU:*:*)
+       # the GNU system
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
        exit 0 ;;
+    *:GNU/*:*:*)
+       # other systems with GNU libc and userland
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+       exit 0 ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
        exit 0 ;;
     arm*:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit 0 ;;
+    cris:Linux:*:*)
+       echo cris-axis-linux
+       exit 0 ;;
+    crisv32:Linux:*:*)
+       echo crisv32-axis-linux
+       exit 0 ;;
+    frv:Linux:*:*)
+       echo frv-${VENDOR}-linux
+       exit 0 ;;
     ia64:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit 0 ;;
+    m32r*:Linux:*:*)
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
+       exit 0 ;;
     m68*:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit 0 ;;
     mips:Linux:*:*)
-       case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
-         big)    echo mips-${VENDOR}-linux && exit 0 ;;
-         little) echo mipsel-${VENDOR}-linux && exit 0 ;;
-       esac
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef mips
+       #undef mipsel
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mipsel
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=mips
+       #else
+       CPU=
+       #endif
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+       test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
        ;;
-    ppc:Linux:*:*|ppc64:Linux:*:*)
+    mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef mips64
+       #undef mips64el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mips64el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=mips64
+       #else
+       CPU=
+       #endif
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+       test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
+       ;;
+    ppc:Linux:*:*)
        echo powerpc-${VENDOR}-linux
        exit 0 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-${VENDOR}-linux
+       exit 0 ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -796,10 +907,10 @@ EOF
          PCA57) UNAME_MACHINE=alphapca56 ;;
          EV6)   UNAME_MACHINE=alphaev6 ;;
          EV67)  UNAME_MACHINE=alphaev67 ;;
-         EV68*) UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev68 ;;
         esac
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       if test "$?" = 0 ; then LIBC="-libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
        exit 0 ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
@@ -816,6 +927,9 @@ EOF
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
        exit 0 ;;
+    sh64*:Linux:*:*)
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
+       exit 0 ;;
     sh*:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit 0 ;;
@@ -829,7 +943,8 @@ EOF
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
        # problems with other programs or directories called `ld' in the path.
-       ld_supported_targets=`cd /; ld --help 2>&1 \
+       # Set LC_ALL=C to ensure ld outputs messages in English.
+       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
                         | sed -ne '/supported targets:/!d
                                    s/[         ][      ]*/ /g
                                    s/.*supported targets: *//
@@ -841,7 +956,7 @@ EOF
                ;;
          a.out-i386-linux)
                echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
-               exit 0 ;;               
+               exit 0 ;;
          coff-i386)
                echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
                exit 0 ;;
@@ -852,33 +967,32 @@ EOF
                exit 0 ;;
        esac
        # Determine whether the default compiler is a.out or elf
-       cat >$dummy.c <<EOF
-#include <features.h>
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-       int main (int argc, char *argv[]) {
-#else
-       int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __ELF__
-# ifdef __GLIBC__
-#  if __GLIBC__ >= 2
-    printf ("%s-${VENDOR}-linux\n", argv[1]);
-#  else
-    printf ("%s-${VENDOR}-linuxlibc1\n", argv[1]);
-#  endif
-# else
-   printf ("%s-${VENDOR}-linuxlibc1\n", argv[1]);
-# endif
-#else
-  printf ("%s-${VENDOR}-linuxaout\n", argv[1]);
-#endif
-  return 0;
-}
-EOF
        eval $set_cc_for_build
-       $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+       sed 's/^        //' << EOF >$dummy.c
+       #include <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #ifdef __INTEL_COMPILER
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/' && exit 0
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
        ;;
     i*86:DYNIX/ptx:4*:*)
@@ -895,6 +1009,26 @@ EOF
         # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
        exit 0 ;;
+    i*86:OS/2:*:*)
+       # If we were able to find `uname', then EMX Unix compatibility
+       # is probably installed.
+       echo ${UNAME_MACHINE}-pc-os2-emx
+       exit 0 ;;
+    i*86:XTS-300:*:STOP)
+       echo ${UNAME_MACHINE}-unknown-stop
+       exit 0 ;;
+    i*86:atheos:*:*)
+       echo ${UNAME_MACHINE}-unknown-atheos
+       exit 0 ;;
+       i*86:syllable:*:*)
+       echo ${UNAME_MACHINE}-pc-syllable
+       exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+       echo i386-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    i*86:*DOS:*:*)
+       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       exit 0 ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -916,22 +1050,19 @@ EOF
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
-               UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-               (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-               (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
                        && UNAME_MACHINE=i586
-               (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
                        && UNAME_MACHINE=i686
-               (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
                        && UNAME_MACHINE=i686
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
        else
                echo ${UNAME_MACHINE}-pc-sysv32
        fi
        exit 0 ;;
-    i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit 0 ;;
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -955,9 +1086,15 @@ EOF
        # "miniframe"
        echo m68010-convergent-sysv
        exit 0 ;;
-    M68*:*:R3V[567]*:*)
+    mc68k:UNIX:SYSTEM5:3.51m)
+       echo m68k-convergent-sysv
+       exit 0 ;;
+    M680?0:D-NIX:5.3:*)
+       echo m68k-diab-dnix
+       exit 0 ;;
+    M68*:*:R3V[5678]*:*)
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -974,9 +1111,6 @@ EOF
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
        exit 0 ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
        echo sparc-unknown-lynxos${UNAME_RELEASE}
        exit 0 ;;
@@ -1003,8 +1137,8 @@ EOF
                echo ns32k-sni-sysv
        fi
        exit 0 ;;
-    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                           # says <Richard.M.Bartel@ccMail.Census.GOV>
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
         exit 0 ;;
     *:UNIX_System_V:4*:FTX*)
@@ -1016,6 +1150,10 @@ EOF
        # From seanf@swdc.stratus.com.
        echo i860-stratus-sysv4
        exit 0 ;;
+    *:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo hppa1.1-stratus-vos
+       exit 0 ;;
     mc68*:A/UX:*:*)
        echo m68k-apple-aux${UNAME_RELEASE}
        exit 0 ;;
@@ -1044,6 +1182,9 @@ EOF
     SX-5:SUPER-UX:*:*)
        echo sx5-nec-superux${UNAME_RELEASE}
        exit 0 ;;
+    SX-6:SUPER-UX:*:*)
+       echo sx6-nec-superux${UNAME_RELEASE}
+       exit 0 ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
        exit 0 ;;
@@ -1051,18 +1192,28 @@ EOF
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
        exit 0 ;;
     *:Darwin:*:*)
-       echo `uname -p`-apple-darwin${UNAME_RELEASE}
+       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+       case $UNAME_PROCESSOR in
+           *86) UNAME_PROCESSOR=i686 ;;
+           unknown) UNAME_PROCESSOR=powerpc ;;
+       esac
+       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
        exit 0 ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
-       if test "${UNAME_MACHINE}" = "x86pc"; then
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = "x86"; then
+               UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
        fi
-       echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
        exit 0 ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit 0 ;;
-    NSR-[KW]:NONSTOP_KERNEL:*:*)
+    NSE-?:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk${UNAME_RELEASE}
+       exit 0 ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
        exit 0 ;;
     *:NonStop-UX:*:*)
@@ -1085,11 +1236,6 @@ EOF
        fi
        echo ${UNAME_MACHINE}-unknown-plan9
        exit 0 ;;
-    i*86:OS/2:*:*)
-       # If we were able to find `uname', then EMX Unix compatibility
-       # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
-       exit 0 ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
        exit 0 ;;
@@ -1108,11 +1254,28 @@ EOF
     *:ITS:*:*)
        echo pdp10-unknown-its
        exit 0 ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+       exit 0 ;;
+    *:DragonFly:*:*)
+       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit 0 ;;
+    *:*VMS:*:*)
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       case "${UNAME_MACHINE}" in
+           A*) echo alpha-dec-vms && exit 0 ;;
+           I*) echo ia64-dec-vms && exit 0 ;;
+           V*) echo vax-dec-vms && exit 0 ;;
+       esac ;;
+    *:XENIX:*:SysV)
+       echo i386-pc-xenix
+       exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 
+eval $set_cc_for_build
 cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
 # include <sys/types.h>
@@ -1227,9 +1390,7 @@ main ()
 }
 EOF
 
-eval $set_cc_for_build
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
 
 # Apollos put the system type in the environment.
 
index 4334d1209af900a0720574ed7c50cfa97cea78e3..c884ad4e34816758e8af53ce64798dde0f39f42c 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2001-06-08'
+timestamp='2005-02-10'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -29,7 +29,8 @@ timestamp='2001-06-08'
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Please send patches to <config-patches@gnu.org>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -69,7 +70,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -117,7 +118,8 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -143,7 +145,7 @@ case $os in
        -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis)
+       -apple | -axis | -knuth | -cray)
                os=
                basic_machine=$1
                ;;
@@ -223,26 +225,50 @@ esac
 case $basic_machine in
        # Recognize the basic CPU types without company name.
        # Some are omitted here because they have special meanings below.
-       tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
-               | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
-               | pyramid | mn10200 | mn10300 | tron | a29k \
-               | 580 | i960 | h8300 \
-               | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
-               | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
-               | hppa64 \
-               | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
-               | alphaev6[78] \
-               | we32k | ns16k | clipper | i370 | sh | sh[34] \
-               | powerpc | powerpcle \
-               | 1750a | dsp16xx | pdp10 | pdp11 \
-               | mips16 | mips64 | mipsel | mips64el \
-               | mips64orion | mips64orionel | mipstx39 | mipstx39el \
-               | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
-               | mips64vr5000 | mips64vr5000el | mcore | s390 | s390x \
-               | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
-               | v850 | c4x \
-               | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
-               | pj | pjl | h8500 | z8k)
+       1750a | 580 \
+       | a29k \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+       | am33_2.0 \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64vr | mips64vrel \
+       | mips64orion | mips64orionel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | msp430 \
+       | ns16k | ns32k \
+       | openrisc | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+       | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k)
                basic_machine=$basic_machine-unknown
                ;;
        m6811 | m68hc11 | m6812 | m68hc12)
@@ -265,31 +291,62 @@ case $basic_machine in
                exit 1
                ;;
        # Recognize the basic CPU types with company name.
-       # FIXME: clean up the formatting here.
-       vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
-             | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
-             | arm-*  | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
-             | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-             | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
-             | xmp-* | ymp-* \
-             | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
-             | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
-             | hppa2.0n-* | hppa64-* \
-             | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
-             | alphaev6[78]-* \
-             | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
-             | clipper-* | orion-* \
-             | sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
-             | powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
-             | mips16-* | mips64-* | mipsel-* \
-             | mips64el-* | mips64orion-* | mips64orionel-* \
-             | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
-             | mipstx39-* | mipstx39el-* | mcore-* \
-             | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
-             | [cjt]90-* \
-             | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
-             | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
-             | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
+       580-* \
+       | a29k-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+       | avr-* \
+       | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | msp430-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* \
+       | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa-* \
+       | ymp-* \
+       | z8k-*)
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
@@ -307,6 +364,9 @@ case $basic_machine in
                basic_machine=a29k-amd
                os=-udi
                ;;
+       abacus)
+               basic_machine=abacus-unknown
+               ;;
        adobe68k)
                basic_machine=m68010-adobe
                os=-scout
@@ -321,6 +381,12 @@ case $basic_machine in
                basic_machine=a29k-none
                os=-bsd
                ;;
+       amd64)
+               basic_machine=x86_64-pc
+               ;;
+       amd64-*)
+               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        amdahl)
                basic_machine=580-amdahl
                os=-sysv
@@ -352,6 +418,10 @@ case $basic_machine in
                basic_machine=ns32k-sequent
                os=-dynix
                ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
@@ -372,30 +442,45 @@ case $basic_machine in
                basic_machine=c38-convex
                os=-bsd
                ;;
-       cray | ymp)
-               basic_machine=ymp-cray
+       cray | j90)
+               basic_machine=j90-cray
                os=-unicos
                ;;
-       cray2)
-               basic_machine=cray2-cray
-               os=-unicos
+       craynv)
+               basic_machine=craynv-cray
+               os=-unicosmp
                ;;
-       [cjt]90)
-               basic_machine=${basic_machine}-cray
-               os=-unicos
+       cr16c)
+               basic_machine=cr16c-unknown
+               os=-elf
                ;;
        crds | unos)
                basic_machine=m68k-crds
                ;;
+       crisv32 | crisv32-* | etraxfs*)
+               basic_machine=crisv32-axis
+               ;;
        cris | cris-* | etrax*)
                basic_machine=cris-axis
                ;;
+       crx)
+               basic_machine=crx-unknown
+               os=-elf
+               ;;
        da30 | da30-*)
                basic_machine=m68k-da30
                ;;
        decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
                basic_machine=mips-dec
                ;;
+       decsystem10* | dec10*)
+               basic_machine=pdp10-dec
+               os=-tops10
+               ;;
+       decsystem20* | dec20*)
+               basic_machine=pdp10-dec
+               os=-tops20
+               ;;
        delta | 3300 | motorola-3300 | motorola-delta \
              | 3300-motorola | delta-motorola)
                basic_machine=m68k-motorola
@@ -404,6 +489,10 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       djgpp)
+               basic_machine=i586-pc
+               os=-msdosdjgpp
+               ;;
        dpx20 | dpx20-*)
                basic_machine=rs6000-bull
                os=-bosx
@@ -576,26 +665,20 @@ case $basic_machine in
                basic_machine=m68k-atari
                os=-mint
                ;;
-       mipsel*-linux*)
-               basic_machine=mipsel-unknown
-               ;;
-       mips*-linux*)
-               basic_machine=mips-unknown
-               ;;
        mips3*-*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
                ;;
        mips3*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
                ;;
-       mmix*)
-               basic_machine=mmix-knuth
-               os=-mmixware
-               ;;
        monitor)
                basic_machine=m68k-rom68k
                os=-coff
                ;;
+       morphos)
+               basic_machine=powerpc-unknown
+               os=-morphos
+               ;;
        msdos)
                basic_machine=i386-pc
                os=-msdos
@@ -675,6 +758,14 @@ case $basic_machine in
                basic_machine=hppa1.1-oki
                os=-proelf
                ;;
+       or32 | or32-*)
+               basic_machine=or32-unknown
+               os=-coff
+               ;;
+       os400)
+               basic_machine=powerpc-ibm
+               os=-os400
+               ;;
        OSE68000 | ose68000)
                basic_machine=m68000-ericsson
                os=-ose
@@ -697,44 +788,58 @@ case $basic_machine in
        pbb)
                basic_machine=m68k-tti
                ;;
-        pc532 | pc532-*)
+       pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
-       pentium | p5 | k5 | k6 | nexgen)
+       pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
-       pentiumpro | p6 | 6x86 | athlon)
+       pentiumpro | p6 | 6x86 | athlon | athlon_*)
                basic_machine=i686-pc
                ;;
-       pentiumii | pentium2)
+       pentiumii | pentium2 | pentiumiii | pentium3)
                basic_machine=i686-pc
                ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+       pentium4)
+               basic_machine=i786-pc
+               ;;
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
                basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        pentiumpro-* | p6-* | 6x86-* | athlon-*)
                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
-       pentiumii-* | pentium2-*)
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
+       pentium4-*)
+               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        pn)
                basic_machine=pn-gould
                ;;
        power)  basic_machine=power-ibm
                ;;
        ppc)    basic_machine=powerpc-unknown
-               ;;
-       ppc64)  basic_machine=powerpc-unknown
                ;;
        ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ppcle | powerpclittle | ppc-le | powerpc-little)
                basic_machine=powerpcle-unknown
-               ;;
+               ;;
        ppcle-* | powerpclittle-*)
                basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        ps2)
                basic_machine=i386-ibm
                ;;
@@ -752,10 +857,26 @@ case $basic_machine in
        rtpc | rtpc-*)
                basic_machine=romp-ibm
                ;;
+       s390 | s390-*)
+               basic_machine=s390-ibm
+               ;;
+       s390x | s390x-*)
+               basic_machine=s390x-ibm
+               ;;
        sa29200)
                basic_machine=a29k-amd
                os=-udi
                ;;
+       sb1)
+               basic_machine=mipsisa64sb1-unknown
+               ;;
+       sb1el)
+               basic_machine=mipsisa64sb1el-unknown
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
        sequent)
                basic_machine=i386-sequent
                ;;
@@ -763,7 +884,10 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
-       sparclite-wrs)
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparclite-wrs | simso-wrs)
                basic_machine=sparclite-wrs
                os=-vxworks
                ;;
@@ -830,22 +954,42 @@ case $basic_machine in
                os=-dynix
                ;;
        t3e)
-               basic_machine=t3e-cray
+               basic_machine=alphaev5-cray
+               os=-unicos
+               ;;
+       t90)
+               basic_machine=t90-cray
                os=-unicos
                ;;
        tic54x | c54x*)
                basic_machine=tic54x-unknown
                os=-coff
                ;;
+       tic55x | c55x*)
+               basic_machine=tic55x-unknown
+               os=-coff
+               ;;
+       tic6x | c6x*)
+               basic_machine=tic6x-unknown
+               os=-coff
+               ;;
        tx39)
                basic_machine=mipstx39-unknown
                ;;
        tx39el)
                basic_machine=mipstx39el-unknown
                ;;
+       toad1)
+               basic_machine=pdp10-xkl
+               os=-tops20
+               ;;
        tower | tower-32)
                basic_machine=m68k-ncr
                ;;
+       tpf)
+               basic_machine=s390x-ibm
+               os=-tpf
+               ;;
        udi29k)
                basic_machine=a29k-amd
                os=-udi
@@ -867,8 +1011,8 @@ case $basic_machine in
                os=-vms
                ;;
        vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
-               ;;
+               basic_machine=f301-fujitsu
+               ;;
        vxworks960)
                basic_machine=i960-wrs
                os=-vxworks
@@ -889,17 +1033,17 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
-       windows32)
-               basic_machine=i386-pc
-               os=-windows32-msvcrt
-               ;;
-       xmp)
-               basic_machine=xmp-cray
-               os=-unicos
+       xbox)
+               basic_machine=i686-pc
+               os=-mingw32
                ;;
-        xps | xps100)
+       xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       ymp)
+               basic_machine=ymp-cray
+               os=-unicos
+               ;;
        z8k-*-coff)
                basic_machine=z8k-unknown
                os=-sim
@@ -920,19 +1064,12 @@ case $basic_machine in
        op60c)
                basic_machine=hppa1.1-oki
                ;;
-       mips)
-               case $os in
-               linux*)
-                       basic_machine=mips-unknown
-                       ;;
-               *)
-                       basic_machine=mips-mips
-                       ;;
-               esac
-               ;;
        romp)
                basic_machine=romp-ibm
                ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
        rs6000)
                basic_machine=rs6000-ibm
                ;;
@@ -949,13 +1086,16 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh3 | sh4)
+       sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sparc | sparcv9 | sparcv9b)
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b)
                basic_machine=sparc-sun
                ;;
-        cydra)
+       cydra)
                basic_machine=cydra-cydrome
                ;;
        orion)
@@ -970,10 +1110,6 @@ case $basic_machine in
        pmac | pmac-mpw)
                basic_machine=powerpc-apple
                ;;
-       c4x*)
-               basic_machine=c4x-none
-               os=-coff
-               ;;
        *-unknown)
                # Make sure to match an already-canonicalized machine name.
                ;;
@@ -1029,16 +1165,20 @@ case $os in
              | -aos* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+             | -mingw32* | -linux* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
+             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1050,8 +1190,10 @@ case $os in
                        ;;
                esac
                ;;
+       -nto-qnx*)
+               ;;
        -nto*)
-               os=-nto-qnx
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
              | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@@ -1060,6 +1202,9 @@ case $os in
        -mac*)
                os=`echo $os | sed -e 's|mac|macos|'`
                ;;
+       -linux-dietlibc)
+               os=-linux-dietlibc
+               ;;
        -sunos5*)
                os=`echo $os | sed -e 's|sunos5|solaris2|'`
                ;;
@@ -1069,6 +1214,9 @@ case $os in
        -opened*)
                os=-openedition
                ;;
+        -os400*)
+               os=-os400
+               ;;
        -wince*)
                os=-wince
                ;;
@@ -1087,14 +1235,23 @@ case $os in
        -acis*)
                os=-aos
                ;;
+       -atheos*)
+               os=-atheos
+               ;;
+       -syllable*)
+               os=-syllable
+               ;;
        -386bsd)
                os=-bsd
                ;;
        -ctix* | -uts*)
                os=-sysv
                ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
        -ns2 )
-               os=-nextstep2
+               os=-nextstep2
                ;;
        -nsk*)
                os=-nsk
@@ -1106,6 +1263,9 @@ case $os in
        -sinix*)
                os=-sysv4
                ;;
+        -tpf*)
+               os=-tpf
+               ;;
        -triton*)
                os=-sysv3
                ;;
@@ -1133,8 +1293,17 @@ case $os in
        -xenix)
                os=-xenix
                ;;
-        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
+       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+               os=-mint
+               ;;
+       -aros*)
+               os=-aros
+               ;;
+       -kaos*)
+               os=-kaos
+               ;;
+       -zvmoe)
+               os=-zvmoe
                ;;
        -none)
                ;;
@@ -1167,10 +1336,14 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
+    c4x-* | tic4x-*)
+        os=-coff
+        ;;
+       # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
                ;;
-        pdp11-*)
+       pdp11-*)
                os=-none
                ;;
        *-dec | vax-*)
@@ -1197,6 +1370,9 @@ case $basic_machine in
        mips*-*)
                os=-elf
                ;;
+       or32-*)
+               os=-coff
+               ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
                os=-sysv3
                ;;
@@ -1209,6 +1385,9 @@ case $basic_machine in
        *-ibm)
                os=-aix
                ;;
+       *-knuth)
+               os=-mmixware
+               ;;
        *-wec)
                os=-proelf
                ;;
@@ -1260,19 +1439,19 @@ case $basic_machine in
        *-next)
                os=-nextstep3
                ;;
-        *-gould)
+       *-gould)
                os=-sysv
                ;;
-        *-highlevel)
+       *-highlevel)
                os=-bsd
                ;;
        *-encore)
                os=-bsd
                ;;
-        *-sgi)
+       *-sgi)
                os=-irix
                ;;
-        *-siemens)
+       *-siemens)
                os=-sysv4
                ;;
        *-masscomp)
@@ -1341,10 +1520,16 @@ case $basic_machine in
                        -mvs* | -opened*)
                                vendor=ibm
                                ;;
+                       -os400*)
+                               vendor=ibm
+                               ;;
                        -ptx*)
                                vendor=sequent
                                ;;
-                       -vxsim* | -vxworks*)
+                       -tpf*)
+                               vendor=ibm
+                               ;;
+                       -vxsim* | -vxworks* | -windiss*)
                                vendor=wrs
                                ;;
                        -aux*)
@@ -1359,6 +1544,9 @@ case $basic_machine in
                        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
                                vendor=atari
                                ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
                esac
                basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
index b1f9a8f37175d0abce807a78779d397be1286a89..301e542d9e237d82c61405b2b723d09de5b685f7 100755 (executable)
@@ -1,9 +1,8 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.59.
 #
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -20,9 +19,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
 else
   as_unset=false
@@ -41,7 +41,7 @@ for as_var in \
   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
   LC_TELEPHONE LC_TIME
 do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
     $as_unset $as_var
@@ -218,16 +218,17 @@ rm -f conf$$ conf$$.exe conf$$.file
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
 else
+  test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
 as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
 # Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 # IFS
@@ -240,17 +241,6 @@ IFS="      $as_nl"
 $as_unset CDPATH
 
 
-# Find the correct PATH separator.  Usually this is `:', but
-# DJGPP uses `;' like DOS.
-if test "X${PATH_SEPARATOR+set}" != Xset; then
-  UNAME=${UNAME-`uname 2>/dev/null`}
-  case X$UNAME in
-    *-DOS) lt_cv_sys_path_separator=';' ;;
-    *)     lt_cv_sys_path_separator=':' ;;
-  esac
-  PATH_SEPARATOR=$lt_cv_sys_path_separator
-fi
-
 
 # Check that we are running under the correct shell.
 SHELL=${CONFIG_SHELL-/bin/sh}
@@ -269,7 +259,7 @@ if test "X$1" = X--no-reexec; then
 elif test "X$1" = X--fallback-echo; then
   # Avoid inline document here, it may be left over
   :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
   # Yippee, $echo works!
   :
 else
@@ -281,14 +271,14 @@ if test "X$1" = X--fallback-echo; then
   # used as fallback echo
   shift
   cat <<EOF
-
+$*
 EOF
   exit 0
 fi
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 if test -z "$ECHO"; then
 if test "X${echo_test_string+set}" != Xset; then
@@ -315,8 +305,9 @@ else
   #
   # So, first we look for a working echo in the user's PATH.
 
-  IFS="${IFS=  }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
   for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
@@ -325,7 +316,7 @@ else
       break
     fi
   done
-  IFS="$save_ifs"
+  IFS="$lt_save_ifs"
 
   if test "X$echo" = Xecho; then
     # We didn't find a better echo, so look for alternatives.
@@ -399,6 +390,11 @@ fi
 
 
 
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
@@ -467,7 +463,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S ECHO RANLIB ac_ct_RANLIB CPP EGREP LIBTOOL LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -826,7 +822,7 @@ done
 
 # Be sure to have absolute paths.
 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-              localstatedir libdir includedir oldincludedir infodir mandir
+             localstatedir libdir includedir oldincludedir infodir mandir
 do
   eval ac_val=$`echo $ac_var`
   case $ac_val in
@@ -866,10 +862,10 @@ if test -z "$srcdir"; then
   # Try the directory containing this script, then its parent.
   ac_confdir=`(dirname "$0") 2>/dev/null ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$0" : 'X\(//\)[^/]' \| \
-         X"$0" : 'X\(//\)$' \| \
-         X"$0" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$0" : 'X\(//\)[^/]' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$0" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -936,6 +932,18 @@ ac_env_CPP_set=${CPP+set}
 ac_env_CPP_value=$CPP
 ac_cv_env_CPP_set=${CPP+set}
 ac_cv_env_CPP_value=$CPP
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
 
 #
 # Report the --help message.
@@ -969,9 +977,9 @@ _ACEOF
   cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
+                         [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
+                         [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1015,19 +1023,25 @@ if test -n "$ac_init_help"; then
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking Speeds up one-time builds
-  --enable-dependency-tracking  Do not reject slow dependency extractors
-  --enable-shared=PKGS  build shared libraries default=yes
-  --enable-static=PKGS  build static libraries default=yes
-  --enable-fast-install=PKGS  optimize for fast installation default=yes
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-shared[=PKGS]
+                          build shared libraries [default=yes]
+  --enable-static[=PKGS]
+                          build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
 --enable-debug
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-gnu-ld           assume the C compiler uses GNU ld default=no
-  --with-pic              try to use only PIC/non-PIC objects default=use both
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-tags[=TAGS]
+                          include additional configurations [automatic]
   --with-libldap=DIR          Path to the libldap library /usr/local/lib
   --with-ldap-includes=DIR    Path to the libldap include files /usr/local/include
 
@@ -1041,6 +1055,9 @@ Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
   CPP         C preprocessor
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1078,12 +1095,45 @@ case $srcdir in
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
     cd $ac_dir
     # Check for guested configure; otherwise get Cygnus style configure.
@@ -1094,7 +1144,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
       echo
       $SHELL $ac_srcdir/configure  --help=recursive
     elif test -f $ac_srcdir/configure.ac ||
-           test -f $ac_srcdir/configure.in; then
+          test -f $ac_srcdir/configure.in; then
       echo
       $ac_configure --help
     else
@@ -1108,8 +1158,7 @@ test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1121,7 +1170,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.57.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
 
@@ -1198,19 +1247,19 @@ do
     2)
       ac_configure_args1="$ac_configure_args1 '$ac_arg'"
       if test $ac_must_keep_next = true; then
-        ac_must_keep_next=false # Got value, back to normal.
+       ac_must_keep_next=false # Got value, back to normal.
       else
-        case $ac_arg in
-          *=* | --config-cache | -C | -disable-* | --disable-* \
-          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-          | -with-* | --with-* | -without-* | --without-* | --x)
-            case "$ac_configure_args0 " in
-              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-            esac
-            ;;
-          -* ) ac_must_keep_next=true ;;
-        esac
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
       fi
       ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
       # Get rid of the leading space.
@@ -1244,12 +1293,12 @@ _ASBOX
     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
     *ac_space=\ *)
       sed -n \
-        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+       "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
       ;;
     *)
       sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
 }
@@ -1278,7 +1327,7 @@ _ASBOX
       for ac_var in $ac_subst_files
       do
        eval ac_val=$`echo $ac_var`
-        echo "$ac_var='"'"'$ac_val'"'"'"
+       echo "$ac_var='"'"'$ac_val'"'"'"
       done | sort
       echo
     fi
@@ -1297,7 +1346,7 @@ _ASBOX
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core core.* *.core &&
+  rm -f core *.core &&
   rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
      ' 0
@@ -1377,7 +1426,7 @@ fi
 # value.
 ac_cache_corrupted=false
 for ac_var in `(set) 2>&1 |
-               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+              sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
@@ -1394,13 +1443,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+       { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+       { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
 echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+       { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
 echo "$as_me:   current value: $ac_new_val" >&2;}
-        ac_cache_corrupted=:
+       ac_cache_corrupted=:
       fi;;
   esac
   # Pass precious variables to config.status.
@@ -1448,7 +1497,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-am__api_version="1.7"
+am__api_version="1.9"
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -1485,6 +1534,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
 echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
@@ -1501,6 +1551,7 @@ do
 case $as_dir/ in
   ./ | .// | /cC/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -1508,20 +1559,20 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-          if test $ac_prog = install &&
-            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # AIX install.  It has an incompatible calling convention.
-            :
-          elif test $ac_prog = install &&
-            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # program-specific install script used by HP pwplus--don't use.
-            :
-          else
-            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-            break 3
-          fi
-        fi
+       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
       done
     done
     ;;
@@ -1609,7 +1660,6 @@ _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
 rm conftest.sed
 
-
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 
@@ -1623,6 +1673,39 @@ else
 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -1665,7 +1748,7 @@ done
 
 echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1692,7 +1775,16 @@ echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
- # test to see if srcdir already configured
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
 if test "`cd $srcdir && pwd`" != "`pwd`" &&
    test -f $srcdir/config.status; then
   { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
@@ -1740,9 +1832,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
 install_sh=${install_sh-"$am_aux_dir/install-sh"}
 
 # Installed binaries are usually stripped using `strip' when the user
@@ -1835,6 +1924,13 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
 
 
 
@@ -1853,6 +1949,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
 echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
@@ -1869,6 +1966,7 @@ do
 case $as_dir/ in
   ./ | .// | /cC/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -1876,20 +1974,20 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-          if test $ac_prog = install &&
-            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # AIX install.  It has an incompatible calling convention.
-            :
-          elif test $ac_prog = install &&
-            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-            # program-specific install script used by HP pwplus--don't use.
-            :
-          else
-            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-            break 3
-          fi
-        fi
+       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
       done
     done
     ;;
@@ -2033,7 +2131,6 @@ ac_compiler=`set X $ac_compile; echo $2`
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2053,8 +2150,8 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C++ compiler default output" >&5
-echo $ECHO_N "checking for C++ compiler default output... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5
+echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
@@ -2074,23 +2171,23 @@ do
   test -f "$ac_file" || continue
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-        ;;
+       ;;
     conftest.$ac_ext )
-        # This is the source file.
-        ;;
+       # This is the source file.
+       ;;
     [ab].out )
-        # We found the default executable, but exeext='' is most
-        # certainly right.
-        break;;
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
     *.* )
-        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-        # FIXME: I believe we export ac_cv_exeext for Libtool,
-        # but it would be cool to find out if it's true.  Does anybody
-        # maintain Libtool? --akim.
-        export ac_cv_exeext
-        break;;
+       ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       # FIXME: I believe we export ac_cv_exeext for Libtool,
+       # but it would be cool to find out if it's true.  Does anybody
+       # maintain Libtool? --akim.
+       export ac_cv_exeext
+       break;;
     * )
-        break;;
+       break;;
   esac
 done
 else
@@ -2164,8 +2261,8 @@ for ac_file in conftest.exe conftest conftest.*; do
   case $ac_file in
     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          export ac_cv_exeext
-          break;;
+         export ac_cv_exeext
+         break;;
     * ) break;;
   esac
 done
@@ -2190,7 +2287,6 @@ if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2241,7 +2337,6 @@ if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2261,11 +2356,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2278,7 +2383,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_compiler_gnu=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
@@ -2294,7 +2399,6 @@ if test "${ac_cv_prog_cxx_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2311,11 +2415,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2328,7 +2442,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_prog_cxx_g=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
@@ -2348,8 +2462,7 @@ else
   fi
 fi
 for ac_declaration in \
-   ''\
-   '#include <stdlib.h>' \
+   '' \
    'extern "C" void std::exit (int) throw (); using std::exit;' \
    'extern "C" void std::exit (int); using std::exit;' \
    'extern "C" void exit (int) throw ();' \
@@ -2357,14 +2470,13 @@ for ac_declaration in \
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
 $ac_declaration
+#include <stdlib.h>
 int
 main ()
 {
@@ -2375,11 +2487,21 @@ exit (42);
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2392,9 +2514,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 continue
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2411,11 +2532,21 @@ exit (42);
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2427,7 +2558,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 rm -f conftest*
 if test -n "$ac_declaration"; then
@@ -2441,24 +2572,16 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-rm -f .deps 2>/dev/null
-mkdir .deps 2>/dev/null
-if test -d .deps; then
-  DEPDIR=.deps
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  DEPDIR=_deps
-fi
-rmdir .deps 2>/dev/null
-
+DEPDIR="${am__leading_dot}deps"
 
           ac_config_commands="$ac_config_commands depfiles"
 
 
 am_make=${MAKE-make}
 cat > confinc << 'END'
-doit:
+am__doit:
        @echo done
+.PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
 echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
@@ -2533,18 +2656,34 @@ else
   # using a relative directory.
   cp "$am_depcomp" conftest.dir
   cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
 
   am_cv_CXX_dependencies_compiler_type=none
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
   for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
     # We need to recreate these files for each test, as the compiler may
     # overwrite some of them when testing with obscure command lines.
     # This happens at least with the AIX C compiler.
-    echo '#include "conftest.h"' > conftest.c
-    echo 'int i;' > conftest.h
-    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
     case $depmode in
     nosideeffect)
@@ -2562,13 +2701,25 @@ else
     # mode.  It turns out that the SunPro C++ compiler does not properly
     # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=conftest.c object=conftest.o \
-       depfile=conftest.Po tmpdepfile=conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
-       grep conftest.h conftest.Po > /dev/null 2>&1 &&
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      am_cv_CXX_dependencies_compiler_type=$depmode
-      break
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
     fi
   done
 
@@ -2600,68 +2751,74 @@ fi
 if test "${enable_shared+set}" = set; then
   enableval="$enable_shared"
   p=${PACKAGE-default}
-case $enableval in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
-  enable_shared=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_shared=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
   enable_shared=yes
 fi;
+
 # Check whether --enable-static or --disable-static was given.
 if test "${enable_static+set}" = set; then
   enableval="$enable_static"
   p=${PACKAGE-default}
-case $enableval in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
-  enable_static=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_static=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
   enable_static=yes
 fi;
+
 # Check whether --enable-fast-install or --disable-fast-install was given.
 if test "${enable_fast_install+set}" = set; then
   enableval="$enable_fast_install"
   p=${PACKAGE-default}
-case $enableval in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
-  enable_fast_install=no
-  # Look at the argument we got.  We use all the common list separators.
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-  for pkg in $enableval; do
-    if test "X$pkg" = "X$p"; then
-      enable_fast_install=yes
-    fi
-  done
-  IFS="$ac_save_ifs"
-  ;;
-esac
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
   enable_fast_install=yes
 fi;
+
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
   { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
@@ -3057,7 +3214,6 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3077,11 +3233,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3094,7 +3260,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_compiler_gnu=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
@@ -3110,7 +3276,6 @@ if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3127,11 +3292,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3144,7 +3319,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_prog_cc_g=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
@@ -3171,7 +3346,6 @@ else
   ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3199,6 +3373,16 @@ static char *f (char * (*g) (char **, int), char **p, ...)
   va_end (v);
   return s;
 }
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -3225,11 +3409,21 @@ do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3242,7 +3436,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext
+rm -f conftest.err conftest.$ac_objext
 done
 rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
@@ -3270,19 +3464,28 @@ cat >conftest.$ac_ext <<_ACEOF
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
-   ''\
-   '#include <stdlib.h>' \
+   '' \
    'extern "C" void std::exit (int) throw (); using std::exit;' \
    'extern "C" void std::exit (int); using std::exit;' \
    'extern "C" void exit (int) throw ();' \
@@ -3290,14 +3493,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
 $ac_declaration
+#include <stdlib.h>
 int
 main ()
 {
@@ -3308,11 +3510,21 @@ exit (42);
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3325,9 +3537,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 continue
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3344,11 +3555,21 @@ exit (42);
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3360,7 +3581,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 rm -f conftest*
 if test -n "$ac_declaration"; then
@@ -3374,7 +3595,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3399,18 +3620,34 @@ else
   # using a relative directory.
   cp "$am_depcomp" conftest.dir
   cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
 
   am_cv_CC_dependencies_compiler_type=none
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
   for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
     # We need to recreate these files for each test, as the compiler may
     # overwrite some of them when testing with obscure command lines.
     # This happens at least with the AIX C compiler.
-    echo '#include "conftest.h"' > conftest.c
-    echo 'int i;' > conftest.h
-    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
     case $depmode in
     nosideeffect)
@@ -3428,13 +3665,25 @@ else
     # mode.  It turns out that the SunPro C++ compiler does not properly
     # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=conftest.c object=conftest.o \
-       depfile=conftest.Po tmpdepfile=conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
-       grep conftest.h conftest.Po > /dev/null 2>&1 &&
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      am_cv_CC_dependencies_compiler_type=$depmode
-      break
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
     fi
   done
 
@@ -3462,16 +3711,77 @@ else
 fi
 
 
-# Find the correct PATH separator.  Usually this is `:', but
-# DJGPP uses `;' like DOS.
-if test "X${PATH_SEPARATOR+set}" != Xset; then
-  UNAME=${UNAME-`uname 2>/dev/null`}
-  case X$UNAME in
-    *-DOS) lt_cv_sys_path_separator=';' ;;
-    *)     lt_cv_sys_path_separator=':' ;;
-  esac
-  PATH_SEPARATOR=$lt_cv_sys_path_separator
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+
+fi
+
+SED=$lt_cv_path_SED
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
 fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
 
 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
@@ -3484,8 +3794,8 @@ fi;
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by GCC" >&5
-echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -3495,12 +3805,12 @@ echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
   esac
   case $ac_prog in
     # Accept absolute paths.
-    [\\/]* | [A-Za-z]:[\\/]*)
+    [\\/]* | ?:[\\/]*)
       re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+       ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -3524,22 +3834,26 @@ if test "${lt_cv_path_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -z "$LD"; then
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some GNU ld's only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
-      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
        test "$with_gnu_ld" != no && break
-      else
+       ;;
+      *)
        test "$with_gnu_ld" != yes && break
-      fi
+       ;;
+      esac
     fi
   done
-  IFS="$ac_save_ifs"
+  IFS="$lt_save_ifs"
 else
   lt_cv_path_LD="$LD" # Let the user override the test with a path.
 fi
@@ -3562,11 +3876,14 @@ if test "${lt_cv_prog_gnu_ld+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
-else
+  ;;
+*)
   lt_cv_prog_gnu_ld=no
-fi
+  ;;
+esac
 fi
 echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
@@ -3583,7 +3900,20 @@ fi
 echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
 reload_flag=$lt_cv_ld_reload_flag
-test -n "$reload_flag" && reload_flag=" $reload_flag"
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
 
 echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
@@ -3594,120 +3924,42 @@ else
   # Let the user override the test.
   lt_cv_path_NM="$NM"
 else
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
-    tmp_nm=$ac_dir/${ac_tool_prefix}nm
-    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
       # Check to see if the nm accepts a BSD-compat flag.
       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
       #   nm: unknown option "B" ignored
       # Tru64's nm complains that /dev/null is an invalid object file
-      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+      */dev/null* | *'Invalid file or object type'*)
        lt_cv_path_NM="$tmp_nm -B"
        break
-      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
-       lt_cv_path_NM="$tmp_nm -p"
-       break
-      else
-       lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-       continue # so that we can try to find one that supports BSD flags
-      fi
+        ;;
+      *)
+       case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+       */dev/null*)
+         lt_cv_path_NM="$tmp_nm -p"
+         break
+         ;;
+       *)
+         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+         continue # so that we can try to find one that supports BSD flags
+         ;;
+       esac
+      esac
     fi
   done
-  IFS="$ac_save_ifs"
+  IFS="$lt_save_ifs"
   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 fi
 fi
-
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
 NM="$lt_cv_path_NM"
-echo "$as_me:$LINENO: result: $NM" >&5
-echo "${ECHO_T}$NM" >&6
-
-echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
-if test "${lt_cv_path_SED+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_executable_p="test -f"
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-
-  # Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-: ${TMPDIR=/tmp}
-{
-  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=$TMPDIR/sed$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
-{
-   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
-   { (exit 1); exit 1; }
-}
-  _max=0
-  _count=0
-  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
-  # along with /bin/sed that truncates output.
-  for _sed in $_sed_list /usr/xpg4/bin/sed; do
-    test ! -f ${_sed} && break
-    cat /dev/null > "$tmp/sed.in"
-    _count=0
-    echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
-    # Check for GNU sed and select it if it is found.
-    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
-      lt_cv_path_SED=${_sed}
-      break
-    fi
-    while true; do
-      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
-      mv "$tmp/sed.tmp" "$tmp/sed.in"
-      cp "$tmp/sed.in" "$tmp/sed.nl"
-      echo >>"$tmp/sed.nl"
-      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
-      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
-      # 40000 chars as input seems more than enough
-      test $_count -gt 10 && break
-      _count=`expr $_count + 1`
-      if test $_count -gt $_max; then
-        _max=$_count
-        lt_cv_path_SED=$_sed
-      fi
-    done
-  done
-  rm -rf "$tmp"
-
-fi
-
-if test "X$SED" != "X"; then
-  lt_cv_path_SED=$SED
-else
-  SED=$lt_cv_path_SED
-fi
-echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6
 
 echo "$as_me:$LINENO: checking whether ln -s works" >&5
 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
@@ -3735,7 +3987,7 @@ lt_cv_deplibs_check_method='unknown'
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given egrep regex.
+# which responds to the $file_magic_cmd with a given extended regex.
 # If you have `file' or equivalent on your system and you're not sure
 # whether `pass_all' will *always* work, you probably want this one.
 
@@ -3748,37 +4000,36 @@ beos*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-bsdi4*)
+bsdi[45]*)
   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
   lt_cv_file_magic_cmd='/usr/bin/file -L'
   lt_cv_file_magic_test_file=/shlib/libc.so
   ;;
 
-cygwin* | mingw* | pw32*)
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
   ;;
 
 darwin* | rhapsody*)
-  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  case "$host_os" in
-  rhapsody* | darwin1.[012])
-    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
-    ;;
-  *) # Darwin 1.3 on
-    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
-    ;;
-  esac
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
-freebsd*)
+freebsd* | kfreebsd*-gnu | dragonfly*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
       # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
       lt_cv_file_magic_cmd=/usr/bin/file
       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
       ;;
@@ -3792,50 +4043,44 @@ gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-hpux10.20*|hpux11*)
-  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libc.sl
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-  irix5* | nonstopux*)
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+  case "$host_cpu" in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
     ;;
   *)
-    case $LD in
-    *-32|*"-32 ") libmagic=32-bit;;
-    *-n32|*"-n32 ") libmagic=N32;;
-    *-64|*"-64 ") libmagic=64-bit;;
-    *) libmagic=never-match;;
-    esac
-    # this will be overridden with pass_all, but let us keep it just in case
-    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
     ;;
   esac
-  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
   lt_cv_deplibs_check_method=pass_all
   ;;
 
 # This must be Linux ELF.
 linux*)
-  case $host_cpu in
-  alpha* | hppa* | i*86 | m68* | mips | mipsel | powerpc* | s390* | sparc* | ia64* | x86_64*)
-    lt_cv_deplibs_check_method=pass_all ;;
-  *)
-    # glibc up to 2.1.1 does not perform some relocations on ARM
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
-  esac
-  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
 netbsd*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
   fi
   ;;
 
@@ -3845,20 +4090,19 @@ newos6*)
   lt_cv_file_magic_test_file=/usr/lib/libnls.so
   ;;
 
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
 openbsd*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   fi
   ;;
 
 osf3* | osf4* | osf5*)
-  # this will be overridden with pass_all, but let us keep it just in case
-  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
-  lt_cv_file_magic_test_file=/shlib/libc.so
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3867,11 +4111,6 @@ sco3.2v5*)
   ;;
 
 solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  lt_cv_file_magic_test_file=/lib/libc.so
-  ;;
-
-sysv5uw[78]* | sysv4*uw2*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3898,6 +4137,10 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
     ;;
   esac
   ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 esac
 
 fi
@@ -3905,211 +4148,210 @@ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
 
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
+# Allow CC to be a program name with arguments.
+compiler=$CC
 
 
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
 
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-echo "$as_me:$LINENO: checking command to parse $NM output" >&5
-echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-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'"
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  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'"
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris* | sysv5*)
-  symcode='[BDT]'
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
   ;;
-sysv4)
-  symcode='[DFNSTU]'
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 4194 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
   ;;
-esac
 
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $host_os in
-mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
   ;;
-esac
 
-# If we're using GNU nm, then use its standard symbol codes.
-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
-  symcode='[ABCDGISTW]'
-fi
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-  # Write the raw and C identifiers.
-lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[        ]\($symcode$symcode*\)[         ][      ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+int
+main ()
+{
 
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
+  ;
+  return 0;
 }
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
-  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-       mv -f "$nlist"T "$nlist"
-      else
-       rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
-       if egrep ' nm_test_func$' "$nlist" >/dev/null; then
-         cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
-
-         cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
-         sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
-         cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         save_LIBS="$LIBS"
-         save_CFLAGS="$CFLAGS"
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$no_builtin_flag"
-         if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest$ac_exeext; then
-           pipe_works=yes
-         fi
-         LIBS="$save_LIBS"
-         CFLAGS="$save_CFLAGS"
-       else
-         echo "cannot find nm_test_func in $nlist" >&5
-       fi
-      else
-       echo "cannot find nm_test_var in $nlist" >&5
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
-    fi
-  else
-    echo "$progname: failed program was:" >&5
-    cat conftest.$ac_ext >&5
-  fi
-  rm -f conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
+  (exit $ac_status); }; }; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+lt_cv_cc_needs_belf=no
 fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  global_symbol_to_cdecl=
-  global_symbol_to_c_name_address=
-else
-  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
-  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
-fi
-if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
-then
-  echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6
-else
-  echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6
 fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -4139,7 +4381,6 @@ do
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4150,7 +4391,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #else
 # include <assert.h>
 #endif
-                     Syntax error
+                    Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -4162,6 +4403,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -4182,7 +4424,6 @@ rm -f conftest.err conftest.$ac_ext
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4200,6 +4441,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -4246,7 +4488,6 @@ do
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4257,7 +4498,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #else
 # include <assert.h>
 #endif
-                     Syntax error
+                    Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -4269,6 +4510,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -4289,7 +4531,6 @@ rm -f conftest.err conftest.$ac_ext
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4307,6 +4548,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -4346,28 +4588,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4388,11 +4614,21 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4405,12 +4641,11 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_header_stdc=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4432,7 +4667,6 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4457,7 +4691,6 @@ if test $ac_cv_header_stdc = yes; then
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4469,9 +4702,9 @@ cat >>conftest.$ac_ext <<_ACEOF
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #else
 # define ISLOWER(c) \
-                   (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 #endif
 
@@ -4482,7 +4715,7 @@ main ()
   int i;
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
+       || toupper (i) != TOUPPER (i))
       exit(2);
   exit (0);
 }
@@ -4507,7 +4740,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
@@ -4532,7 +4765,7 @@ fi
 
 
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                  inttypes.h stdint.h unistd.h
+                 inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -4541,7 +4774,6 @@ if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4553,11 +4785,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4570,7 +4812,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_Header=no"
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -4601,7 +4843,6 @@ else
 echo "$as_me:$LINENO: checking $ac_header usability" >&5
 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4612,11 +4853,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4629,7 +4880,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -4637,7 +4888,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking $ac_header presence" >&5
 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4655,6 +4905,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -4674,33 +4925,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -4711,7 +4961,7 @@ echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=$ac_header_preproc"
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
@@ -4728,196 +4978,258 @@ done
 
 
 
-
-
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $MAGIC_CMD in
-  /*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
-  ;;
-  *)
-  ac_save_MAGIC_CMD="$MAGIC_CMD"
-  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="/usr/bin:$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           egrep "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  MAGIC_CMD="$ac_save_MAGIC_CMD"
-  ;;
-esac
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
 fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+if test -z "$ac_cpp_err"; then
+  :
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
 fi
+rm -f conftest.err conftest.$ac_ext
 
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  case $MAGIC_CMD in
-  /*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-  ?:/*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
-  ;;
-  *)
-  ac_save_MAGIC_CMD="$MAGIC_CMD"
-  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="/usr/bin:$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           egrep "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<EOF 1>&2
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
 
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
-  MAGIC_CMD="$ac_save_MAGIC_CMD"
-  ;;
-esac
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  ac_cv_prog_CXXCPP=$CXXCPP
 fi
-
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
   else
-    MAGIC_CMD=:
+    ac_cpp_err=
   fi
+else
+  ac_cpp_err=yes
 fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  fi
-  ;;
-esac
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
 fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+if test "${ac_cv_prog_F77+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4926,40 +5238,40 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
 
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 fi
 fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-  RANLIB=$ac_ct_RANLIB
-else
-  RANLIB="$ac_cv_prog_RANLIB"
+    test -n "$F77" && break
+  done
 fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4968,7 +5280,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    ac_cv_prog_ac_ct_F77="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 
 fi
 fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
+  test -n "$ac_ct_F77" && break
+done
+
+  F77=$ac_ct_F77
 fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  STRIP=$ac_ct_STRIP
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-
-enable_dlopen=no
-enable_win32_dll=no
-
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
 
-fi;
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line 5049 "configure"' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+# Provide some information about the compiler.
+echo "$as_me:5309:" \
+     "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-linux*)
-  # Test if the compiler is 64bit
-  echo 'int i;' > conftest.$ac_ext
-  lt_cv_cc_64bit_output=no
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *"ELF 64"*)
-      lt_cv_cc_64bit_output=yes
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
-if test "${lt_cv_cc_needs_belf+set}" = set; then
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
 
-
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-     cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
+      end
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_f77_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-int
-main ()
-{
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
 
-  ;
-  return 0;
-}
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_f77_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  lt_cv_cc_needs_belf=yes
+  ac_cv_prog_f77_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-lt_cv_cc_needs_belf=no
+ac_cv_prog_f77_g=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
   fi
-  ;;
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
 
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
 
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
 
-# Constants:
-rm="rm -f"
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
 
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-need_locks="$enable_libtool_lock"
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    ;;
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+              = "XX$teststring") >/dev/null 2>&1 &&
+           new_result=`expr "X$teststring" : ".*" 2>&1` &&
+           lt_cv_sys_max_cmd_len=$new_result &&
+           test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    teststring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
 
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
+fi
 
-if test x"$host" != x"$build"; then
-  ac_tool_prefix=${host_alias}-
+if test -n $lt_cv_sys_max_cmd_len ; then
+  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
 else
-  ac_tool_prefix=
+  echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
 fi
 
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
 
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDRT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[      ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+       if grep ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+         cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+         cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+  echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | grep "[     ]$lt_prog_cc_shlib[     ]" >/dev/null; then :
+  else
+    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6378: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:6382: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case "$cc_basename" in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      pgcc | pgf77 | pgf90)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6633: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:6637: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:6693: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:6697: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      tmp_addflag=
+      case $CC,$host_cpu in
+      pgf77* | pgf90* )                        # Portland Group f77 and f90 compilers
+        tmp_addflag=' -fpic' ;;
+      ecc*,ia64* | icc*,ia64*)         # Intel C compiler on ia64
+        tmp_addflag=' -i_dynamic' ;;
+      efc*,ia64* | ifort*,ia64*)       # Intel Fortran compiler on ia64
+        tmp_addflag=' -i_dynamic -nofor_main' ;;
+      ifc* | ifort*)                   # Intel Fortran compiler
+       tmp_addflag=' -nofor_main' ;;
+      esac
+      archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+        *\ 2.11.*) ;; # other 2.11 versions
+        *) supports_anon_versioning=yes ;;
+      esac
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds=$archive_cmds
+      fi
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      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'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         hardcode_direct=yes
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+       if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+       fi
+       fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+       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"
+       else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' ${wl}-bernotok'
+         allow_undefined_flag=' ${wl}-berok'
+         # -bexpall does not export symbols beginning with underscore (_)
+         always_export_symbols=yes
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec=' '
+         archive_cmds_need_lc=yes
+         # This is similar to how AIX traditionally builds it's shared libraries.
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      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)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case "$host_os" in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc=no
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec=''
+      link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case "$cc_basename" in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       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'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       case "$host_cpu" in
+       hppa*64*)
+         hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+         hardcode_libdir_flag_spec_ld='+b $libdir'
+         hardcode_libdir_separator=:
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       ia64*)
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       *)
+         hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+         hardcode_libdir_separator=:
+         hardcode_direct=yes
+         export_dynamic_flag_spec='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       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'
+      else
+       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'
+       hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+          archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          hardcode_libdir_flag_spec='-R$libdir'
+          ;;
+        *)
+          archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      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'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       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'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       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'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       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'
+       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       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'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $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'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+       whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc=no
+        else
+         archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 8893 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 8991 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+# Report which librarie types wil actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS=$lt_AS
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+  withval="$with_tags"
+  tagnames="$withval"
+fi;
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
+         ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+       grep 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+       for ld_flag in $LDFLAGS; do
+         case $ld_flag in
+         *-brtl*)
+           aix_use_runtimelinking=yes
+           break
+           ;;
+         esac
+       done
+      esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[012]|aix4.[012].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+       collect2name=`${CC} -print-prog-name=collect2`
+       if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+       then
+         # We have reworked collect2
+         hardcode_direct_CXX=yes
+       else
+         # We have old collect2
+         hardcode_direct_CXX=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L_CXX=yes
+         hardcode_libdir_flag_spec_CXX='-L$libdir'
+         hardcode_libdir_separator_CXX=
+       fi
+      esac
+      shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+       shared_flag="$shared_flag "'${wl}-G'
+      fi
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+       shared_flag='-G'
+      else
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag='${wl}-G'
+       else
+         shared_flag='${wl}-bM:SRE'
+       fi
+      fi
+    fi
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$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"
+     else
+      if test "$host_cpu" = ia64; then
+       hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+       allow_undefined_flag_CXX="-z nodefs"
+       archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+       # Warning - without using the other run time loading flags,
+       # -berok will link without error, but may produce a broken library.
+       no_undefined_flag_CXX=' ${wl}-bernotok'
+       allow_undefined_flag_CXX=' ${wl}-berok'
+       # -bexpall does not export symbols beginning with underscore (_)
+       always_export_symbols_CXX=yes
+       # Exported symbols can be pulled into shared objects from archives
+       whole_archive_flag_spec_CXX=' '
+       archive_cmds_need_lc_CXX=yes
+       # This is similar to how AIX traditionally builds it's shared libraries.
+       archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+       cp $export_symbols $output_objdir/$soname.def;
+      else
+       echo EXPORTS > $output_objdir/$soname.def;
+       cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case "$host_os" in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case "$cc_basename" in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      ghcx)
+       # Green Hills C++ Compiler
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=yes # Not in the search PATH,
+                               # but as the default
+                               # location of the library.
+
+    case $cc_basename in
+    CC)
+      # FIXME: insert proper C++ library support
+      ld_shlibs_CXX=no
+      ;;
+    aCC)
+      archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case "$host_cpu" in
+      hppa*64*)
+       hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+       hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+       hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+       hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+       hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator_CXX=:
+       export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case "$host_cpu" in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      aCC)
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+         ;;
+       *)
+         archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       esac
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test $with_gnu_ld = no; then
+           case "$host_cpu" in
+           ia64*|hppa*64*)
+             archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+             ;;
+           *)
+             archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           esac
+         fi
+       else
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC)
+       # SGI C++
+       archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+       # Archives containing C++ object files must be created using
+       # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test "$with_gnu_ld" = no; then
+           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+         else
+           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+         fi
+       fi
+       link_all_deplibs_CXX=yes
+       ;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+       archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+       hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+       ;;
+      icpc)
+       # Intel C++
+       with_gnu_ld=yes
+       # version 8.0 and above of icpc choke on multiply defined symbols
+       # if we add $predep_objects and $postdep_objects, however 7.1 and
+       # earlier do not add the objects themselves.
+       case `$CC -V 2>&1` in
+       *"Version 7."*)
+         archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       *)  # Version 8.0 or newer
+         tmp_idyn=
+         case $host_cpu in
+           ia64*) tmp_idyn=' -i_dynamic';;
+         esac
+         archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       esac
+       archive_cmds_need_lc_CXX=no
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+       whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+       ;;
+      pgCC)
+        # Portland Group C++ compiler
+       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+        ;;
+      cxx)
+       # Compaq C++
+       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+       runpath_var=LD_RUN_PATH
+       hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+       ;;
+      RCC)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      cxx)
+       allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+         archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+         hardcode_libdir_separator_CXX=:
+
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Archives containing C++ object files must be created using
+       # the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+       ;;
+      RCC)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      cxx)
+       allow_undefined_flag_CXX=' -expect_unresolved \*'
+       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+       archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+         echo "-hidden">> $lib.exp~
+         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+         $rm $lib.exp'
+
+       hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+        archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+         hardcode_libdir_separator_CXX=:
+
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC)
+       # Sun C++ 4.x
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      lcc)
+       # Lucid
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC)
+       # Sun C++ 4.2, 5.x and Centerline C++
+       no_undefined_flag_CXX=' -zdefs'
+       archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+       archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+       hardcode_libdir_flag_spec_CXX='-R$libdir'
+       hardcode_shlibpath_var_CXX=no
+       case $host_os in
+         solaris2.[0-5] | solaris2.[0-5].*) ;;
+         *)
+           # The C++ compiler is used as linker so we must use $wl
+           # flag to pass the commands to the underlying system
+           # linker.
+           # Supported since Solaris 2.6 (maybe 2.5.1?)
+           whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+           ;;
+       esac
+       link_all_deplibs_CXX=yes
+
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+       # Archives containing C++ object files must be created using
+       # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+       ;;
+      gcx)
+       # Green Hills C++ Compiler
+       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+       # The C++ compiler must be used to create the archive.
+       old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+       ;;
+      *)
+       # GNU C++ compiler with Solaris linker
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+         if $CC --version | grep -v '^2\.7' > /dev/null; then
+           archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         else
+           # g++ 2.7 appears to require `-G' NOT `-shared' on this
+           # platform.
+           archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         fi
+
+         hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+       fi
+       ;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC)
+       # NonStop-UX NCC 3.20
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+         || test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$compiler_lib_search_path_CXX"; then
+            compiler_lib_search_path_CXX="${prev}${p}"
+          else
+            compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$postdeps_CXX"; then
+          postdeps_CXX="${prev}${p}"
+        else
+          postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$predep_objects_CXX"; then
+          predep_objects_CXX="$p"
+        else
+          predep_objects_CXX="$predep_objects_CXX $p"
+        fi
+       else
+        if test -z "$postdep_objects_CXX"; then
+          postdep_objects_CXX="$p"
+        else
+          postdep_objects_CXX="$postdep_objects_CXX $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       ;;
+      *)
+       lt_prog_compiler_pic_CXX='-fPIC'
+       ;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         lt_prog_compiler_static_CXX='-Bstatic'
+       else
+         lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68)
+         # Green Hills C++ Compiler
+         # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case "$cc_basename" in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++)
+           lt_prog_compiler_pic_CXX='-KPIC'
+           ;;
+         ghcx)
+           # Green Hills C++ Compiler
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+           if test "$host_cpu" != ia64; then
+             lt_prog_compiler_pic_CXX='+Z'
+           fi
+           ;;
+         aCC)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+           case "$host_cpu" in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             lt_prog_compiler_pic_CXX='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux*)
+       case $cc_basename in
+         KCC)
+           # KAI C++ Compiler
+           lt_prog_compiler_wl_CXX='--backend -Wl,'
+           lt_prog_compiler_pic_CXX='-fPIC'
+           ;;
+         icpc* | ecpc*)
+           # Intel C++
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-static'
+           ;;
+         pgCC)
+           # Portland Group C++ compiler.
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-fpic'
+           lt_prog_compiler_static_CXX='-static'
+           ;;
+         cxx)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           lt_prog_compiler_pic_CXX=
+           lt_prog_compiler_static_CXX='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx)
+           lt_prog_compiler_pic_CXX='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC)
+           lt_prog_compiler_wl_CXX='--backend -Wl,'
+           ;;
+         RCC)
+           # Rational C++ 2.4.1
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         cxx)
+           # Digital/Compaq C++
+           lt_prog_compiler_wl_CXX='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           lt_prog_compiler_pic_CXX=
+           lt_prog_compiler_static_CXX='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      sco*)
+       case $cc_basename in
+         CC)
+           lt_prog_compiler_pic_CXX='-fPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           lt_prog_compiler_wl_CXX='-Qoption ld '
+           ;;
+         gcx)
+           # Green Hills C++ Compiler
+           lt_prog_compiler_pic_CXX='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC)
+           # Sun C++ 4.x
+           lt_prog_compiler_pic_CXX='-pic'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           ;;
+         lcc)
+           # Lucid
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC)
+           # NonStop-UX NCC 3.20
+           lt_prog_compiler_pic_CXX='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      unixware*)
+       ;;
+      vxworks*)
+       ;;
+      *)
+       lt_prog_compiler_can_build_shared_CXX=no
+       ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:11211: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:11215: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:11271: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:11275: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_CXX=no
+        else
+         archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 12634 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 12732 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS=$lt_AS
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+       else
+         tagname=""
+       fi
+       ;;
+
+      F77)
+       if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4* | aix5*)
+  test "$enable_shared" = yes && enable_static=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_F77='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_F77='-Bstatic'
+      else
+       lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case "$cc_basename" in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_F77='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl_F77='-Wl,'
+       lt_prog_compiler_pic_F77='-KPIC'
+       lt_prog_compiler_static_F77='-static'
+        ;;
+      pgcc | pgf77 | pgf90)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_F77='-Wl,'
+       lt_prog_compiler_pic_F77='-fpic'
+       lt_prog_compiler_static_F77='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic_F77='-Kconform_pic'
+       lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:13587: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:13591: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:13647: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:13651: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs_F77=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag_F77=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs_F77=no
+       cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      tmp_addflag=
+      case $CC,$host_cpu in
+      pgf77* | pgf90* )                        # Portland Group f77 and f90 compilers
+        tmp_addflag=' -fpic' ;;
+      ecc*,ia64* | icc*,ia64*)         # Intel C compiler on ia64
+        tmp_addflag=' -i_dynamic' ;;
+      efc*,ia64* | ifort*,ia64*)       # Intel Fortran compiler on ia64
+        tmp_addflag=' -i_dynamic -nofor_main' ;;
+      ifc* | ifort*)                   # Intel Fortran compiler
+       tmp_addflag=' -nofor_main' ;;
+      esac
+      archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+        *\ 2.11.*) ;; # other 2.11 versions
+        *) supports_anon_versioning=yes ;;
+      esac
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_F77=$archive_cmds_F77
+      fi
+    else
+      ld_shlibs_F77=no
+    fi
+    ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec_F77=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         hardcode_direct_F77=yes
+         else
+         # We have old collect2
+         hardcode_direct_F77=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L_F77=yes
+         hardcode_libdir_flag_spec_F77='-L$libdir'
+         hardcode_libdir_separator_F77=
+         fi
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+       if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+       fi
+       fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_f77_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+       archive_expsym_cmds_F77="\$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"
+       else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag_F77="-z nodefs"
+         archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_f77_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag_F77=' ${wl}-bernotok'
+         allow_undefined_flag_F77=' ${wl}-berok'
+         # -bexpall does not export symbols beginning with underscore (_)
+         always_export_symbols_F77=yes
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec_F77=' '
+         archive_cmds_need_lc_F77=yes
+         # This is similar to how AIX traditionally builds it's shared libraries.
+         archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case "$host_os" in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_F77=no
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77=''
+      link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case "$cc_basename" in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds_F77='$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'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       case "$host_cpu" in
+       hppa*64*)
+         hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+         hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+         hardcode_libdir_separator_F77=:
+         hardcode_direct_F77=no
+         hardcode_shlibpath_var_F77=no
+         ;;
+       ia64*)
+         hardcode_libdir_flag_spec_F77='-L$libdir'
+         hardcode_direct_F77=no
+         hardcode_shlibpath_var_F77=no
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_F77=yes
+         ;;
+       *)
+         hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+         hardcode_libdir_separator_F77=:
+         hardcode_direct_F77=yes
+         export_dynamic_flag_spec_F77='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_F77=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$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'
+      else
+       archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+          archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          hardcode_libdir_flag_spec_F77='-R$libdir'
+          ;;
+        *)
+          archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$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'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_F77='$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'
+      else
+       allow_undefined_flag_F77=' -expect_unresolved \*'
+       archive_cmds_F77='$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'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_F77='$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'
+       hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag_F77=' -expect_unresolved \*'
+       archive_cmds_F77='$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'
+       archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $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'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+       whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
+      esac
+      link_all_deplibs_F77=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_F77=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds_F77='$CC -r -o $output$reload_objs'
+         hardcode_direct_F77=no
+        ;;
+       motorola)
+         archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var_F77=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_F77=no
+        else
+         archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case "$host_cpu" in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
     ;;
-  *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+  esac
+fi
+
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS=$lt_AS
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
 fi
 
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+       else
+         tagname=""
+       fi
+       ;;
+
+      GCJ)
+       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
 # Allow CC to be a program name with arguments.
-set dummy $CC
-compiler="$2"
+compiler=$CC
 
-echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6
-rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  objdir=.libs
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # MS-DOS does not allow filenames that begin with a dot.
-  objdir=_libs
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:15703: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:15707: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
 fi
-rmdir .libs 2>/dev/null
-echo "$as_me:$LINENO: result: $objdir" >&5
-echo "${ECHO_T}$objdir" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
 
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
 
+fi
 
-# Check whether --with-pic or --without-pic was given.
-if test "${with_pic+set}" = set; then
-  withval="$with_pic"
-  pic_mode="$withval"
-else
-  pic_mode=default
-fi;
-test -z "$pic_mode" && pic_mode=default
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
 
-# We assume here that the value for lt_cv_prog_cc_pic will not be cached
-# in isolation, and that seeing it set (from the cache) indicates that
-# the associated values are set (in the cache) correctly too.
 echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
-if test "${lt_cv_prog_cc_pic+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-   lt_cv_prog_cc_pic=
-  lt_cv_prog_cc_shlib=
-  lt_cv_prog_cc_wl=
-  lt_cv_prog_cc_static=
-  lt_cv_prog_cc_no_builtin=
-  lt_cv_prog_cc_can_build_shared=$can_build_shared
 
   if test "$GCC" = yes; then
-    lt_cv_prog_cc_wl='-Wl,'
-    lt_cv_prog_cc_static='-static'
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
 
     case $host_os in
-    aix*)
-      # Below there is a dirty hack to force normal static linking with -ldl
-      # The problem is because libdl dynamically linked with both libc and
-      # libC (AIX C++ library), which obviously doesn't included in libraries
-      # list by gcc. This cause undefined symbols with -static flags.
-      # This hack allows C programs to be linked with "-static -ldl", but
-      # not sure about C++ programs.
-      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
       ;;
+
     amigaos*)
       # FIXME: we need at least 68020 code to build shared libraries, but
       # adding the `-m68020' flag to GCC prevents building anything better,
       # like `-m68040'.
-      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
       ;;
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
     darwin* | rhapsody*)
       # PIC is the default on this platform
       # Common symbols not allowed in MH_DYLIB files
-      lt_cv_prog_cc_pic='-fno-common'
+      lt_prog_compiler_pic_GCJ='-fno-common'
       ;;
-    cygwin* | mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_cv_prog_cc_pic='-DDLL_EXPORT'
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
       ;;
+
     sysv4*MP*)
       if test -d /usr/nec; then
-        lt_cv_prog_cc_pic=-Kconform_pic
+       lt_prog_compiler_pic_GCJ=-Kconform_pic
       fi
       ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_GCJ='-fPIC'
+       ;;
+      esac
+      ;;
+
     *)
-      lt_cv_prog_cc_pic='-fPIC'
+      lt_prog_compiler_pic_GCJ='-fPIC'
       ;;
     esac
   else
-    # PORTME Check for PIC flags for the system compiler.
+    # PORTME Check for flag to pass linker flags through the system compiler.
     case $host_os in
-    aix3* | aix4* | aix5*)
-      lt_cv_prog_cc_wl='-Wl,'
-      # All AIX code is PIC.
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
       if test "$host_cpu" = ia64; then
        # AIX 5 now supports IA64 processor
-       lt_cv_prog_cc_static='-Bstatic'
+       lt_prog_compiler_static_GCJ='-Bstatic'
       else
-       lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+       lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case "$cc_basename" in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
 
     hpux9* | hpux10* | hpux11*)
-      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
-      lt_cv_prog_cc_pic='+Z'
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case "$host_cpu" in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic_GCJ='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static='-non_shared'
+      lt_prog_compiler_wl_GCJ='-Wl,'
       # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
       ;;
 
-    cygwin* | mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_cv_prog_cc_pic='-DDLL_EXPORT'
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
       ;;
 
-    newsos6)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl_GCJ='-Wl,'
+       lt_prog_compiler_pic_GCJ='-KPIC'
+       lt_prog_compiler_static_GCJ='-static'
+        ;;
+      pgcc | pgf77 | pgf90)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_GCJ='-Wl,'
+       lt_prog_compiler_pic_GCJ='-fpic'
+       lt_prog_compiler_static_GCJ='-static'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
       ;;
 
     osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
       # All OSF/1 code is PIC.
-      lt_cv_prog_cc_wl='-Wl,'
-      lt_cv_prog_cc_static='-non_shared'
+      lt_prog_compiler_static_GCJ='-non_shared'
       ;;
 
     sco3.2v5*)
-      lt_cv_prog_cc_pic='-Kpic'
-      lt_cv_prog_cc_static='-dn'
-      lt_cv_prog_cc_shlib='-belf'
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
       ;;
 
     solaris*)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Wl,'
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
       ;;
 
     sunos4*)
-      lt_cv_prog_cc_pic='-PIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Qoption ld '
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic_GCJ='-Kconform_pic'
+       lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:15958: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:15962: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s conftest.err; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case "$host_os" in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:16018: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:16022: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test ! -s out/conftest.err; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w .
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs_GCJ=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag_GCJ=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      lt_cv_prog_cc_pic='-KPIC'
-      lt_cv_prog_cc_static='-Bstatic'
-      lt_cv_prog_cc_wl='-Wl,'
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs_GCJ=no
+       cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
       ;;
 
-    uts4*)
-      lt_cv_prog_cc_pic='-pic'
-      lt_cv_prog_cc_static='-Bstatic'
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
       ;;
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_cv_prog_cc_pic='-Kconform_pic'
-       lt_cv_prog_cc_static='-Bstatic'
+  linux*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      tmp_addflag=
+      case $CC,$host_cpu in
+      pgf77* | pgf90* )                        # Portland Group f77 and f90 compilers
+        tmp_addflag=' -fpic' ;;
+      ecc*,ia64* | icc*,ia64*)         # Intel C compiler on ia64
+        tmp_addflag=' -i_dynamic' ;;
+      efc*,ia64* | ifort*,ia64*)       # Intel Fortran compiler on ia64
+        tmp_addflag=' -i_dynamic -nofor_main' ;;
+      ifc* | ifort*)                   # Intel Fortran compiler
+       tmp_addflag=' -nofor_main' ;;
+      esac
+      archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      supports_anon_versioning=no
+      case `$LD -v 2>/dev/null` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+        *\ 2.11.*) ;; # other 2.11 versions
+        *) supports_anon_versioning=yes ;;
+      esac
+      if test $supports_anon_versioning = yes; then
+        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+$echo "local: *; };" >> $output_objdir/$libname.ver~
+        $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+      else
+        archive_expsym_cmds_GCJ=$archive_cmds_GCJ
       fi
-      ;;
+    else
+      ld_shlibs_GCJ=no
+    fi
+    ;;
 
     *)
-      lt_cv_prog_cc_can_build_shared=no
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
       ;;
     esac
-  fi
-
-fi
-
-if test -z "$lt_cv_prog_cc_pic"; then
-  echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6
-else
-  echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5
-echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6
-
-  # Check to make sure the pic_flag actually works.
-  echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6
-  if test "${lt_cv_prog_cc_pic_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
-    cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
+    if test "$ld_shlibs_GCJ" = yes; then
+      runpath_var=LD_RUN_PATH
+      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+      export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec_GCJ=
+      fi
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct_GCJ=unsupported
+      fi
+      ;;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-        case $host_os in
-      hpux9* | hpux10* | hpux11*)
-       # On HP-UX, both CC and GCC only warn that PIC is supported... then
-       # they create non-PIC objects.  So, if there were any warnings, we
-       # assume that PIC is not supported.
-       if test -s conftest.err; then
-         lt_cv_prog_cc_pic_works=no
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
        else
-         lt_cv_prog_cc_pic_works=yes
+         export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
        fi
-       ;;
-      *)
-       lt_cv_prog_cc_pic_works=yes
-       ;;
-      esac
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-      lt_cv_prog_cc_pic_works=no
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-    CFLAGS="$save_CFLAGS"
-
-fi
-
-
-  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
-    lt_cv_prog_cc_pic=
-    lt_cv_prog_cc_can_build_shared=no
-  else
-    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
-  fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+       esac
 
-  echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5
-echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6
-fi
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
 
-# Check for any special shared library compilation flags.
-if test -n "$lt_cv_prog_cc_shlib"; then
-  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5
-echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;}
-  if echo "$old_CC $old_CFLAGS " | egrep -e "[         ]$lt_cv_prog_cc_shlib[  ]" >/dev/null; then :
-  else
-   { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
-echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
-    lt_cv_prog_cc_can_build_shared=no
-  fi
-fi
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         hardcode_direct_GCJ=yes
+         else
+         # We have old collect2
+         hardcode_direct_GCJ=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L_GCJ=yes
+         hardcode_libdir_flag_spec_GCJ='-L$libdir'
+         hardcode_libdir_separator_GCJ=
+         fi
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+       if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+       fi
+       fi
+      fi
 
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6
-if test "${lt_cv_prog_cc_static_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-    lt_cv_prog_cc_static_works=no
-  save_LDFLAGS="$LDFLAGS"
-  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5531,189 +16412,51 @@ main ()
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  lt_cv_prog_cc_static_works=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS="$save_LDFLAGS"
-
-fi
-
-
-# Belt *and* braces to stop my trousers falling down:
-test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
-echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5
-echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6
-
-pic_flag="$lt_cv_prog_cc_pic"
-special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
-wl="$lt_cv_prog_cc_wl"
-link_static_flag="$lt_cv_prog_cc_static"
-no_builtin_flag="$lt_cv_prog_cc_no_builtin"
-can_build_shared="$lt_cv_prog_cc_can_build_shared"
-
-
-# Check to see if options -o and -c are simultaneously supported by compiler
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_compiler_c_o+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-$rm -r conftest 2>/dev/null
-mkdir conftest
-cd conftest
-echo "int some_variable = 0;" > conftest.$ac_ext
-mkdir out
-# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
-# that will create temporary files in the current directory regardless of
-# the output directory.  Thus, making CWD read-only will cause this test
-# to fail, enabling locking or at least warning the user not to do parallel
-# builds.
-chmod -w .
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
-compiler_c_o=no
-if { (eval echo configure:5590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
-  # The compiler can only warn and ignore the option if not recognized
-  # So say no if there are warnings
-  if test -s out/conftest.err; then
-    lt_cv_compiler_c_o=no
-  else
-    lt_cv_compiler_c_o=yes
-  fi
-else
-  # Append any errors to the config.log.
-  cat out/conftest.err 1>&5
-  lt_cv_compiler_c_o=no
-fi
-CFLAGS="$save_CFLAGS"
-chmod u+w .
-$rm conftest* out/*
-rmdir out
-cd ..
-rmdir conftest
-$rm -r conftest 2>/dev/null
-
-fi
-
-compiler_c_o=$lt_cv_compiler_c_o
-echo "$as_me:$LINENO: result: $compiler_c_o" >&5
-echo "${ECHO_T}$compiler_c_o" >&6
-
-if test x"$compiler_c_o" = x"yes"; then
-  # Check to see if we can write to a .lo
-  echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6
-  if test "${lt_cv_compiler_o_lo+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-  lt_cv_compiler_o_lo=no
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -c -o conftest.lo"
-  save_objext="$ac_objext"
-  ac_objext=lo
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-int some_variable = 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-      # The compiler can only warn and ignore the option if not recognized
-    # So say no if there are warnings
-    if test -s conftest.err; then
-      lt_cv_compiler_o_lo=no
-    else
-      lt_cv_compiler_o_lo=yes
-    fi
 
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  ac_objext="$save_objext"
-  CFLAGS="$save_CFLAGS"
-
-fi
-
-  compiler_o_lo=$lt_cv_compiler_o_lo
-  echo "$as_me:$LINENO: result: $compiler_o_lo" >&5
-echo "${ECHO_T}$compiler_o_lo" >&6
-else
-  compiler_o_lo=no
-fi
-
-# Check to see if we can do hard links to lock some files if needed
-hard_links="nottested"
-if test "$compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-if test "$GCC" = yes; then
-  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
-  echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
-  compiler_rtti_exceptions=no
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+       archive_expsym_cmds_GCJ="\$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"
+       else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag_GCJ="-z nodefs"
+         archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -5723,799 +16466,544 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int some_variable = 0;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-      # The compiler can only warn and ignore the option if not recognized
-    # So say no if there are warnings
-    if test -s conftest.err; then
-      compiler_rtti_exceptions=no
-    else
-      compiler_rtti_exceptions=yes
-    fi
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS"
-  echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$compiler_rtti_exceptions" >&6
-
-  if test "$compiler_rtti_exceptions" = "yes"; then
-    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
-  else
-    no_builtin_flag=' -fno-builtin'
-  fi
-fi
-
-# See if the linker supports building shared libraries.
-echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6
-
-allow_undefined_flag=
-no_undefined_flag=
-need_lib_prefix=unknown
-need_version=unknown
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-archive_cmds=
-archive_expsym_cmds=
-old_archive_from_new_cmds=
-old_archive_from_expsyms_cmds=
-export_dynamic_flag_spec=
-whole_archive_flag_spec=
-thread_safe_flag_spec=
-hardcode_into_libs=no
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-hardcode_shlibpath_var=unsupported
-runpath_var=
-link_all_deplibs=unknown
-always_export_symbols=no
-export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
-# include_expsyms should be a list of space-separated symbols to be *always*
-# included in the symbol list
-include_expsyms=
-# exclude_expsyms can be an egrep regular expression of symbols to exclude
-# it will be wrapped by ` (' and `)$', so one must not match beginning or
-# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-# as well as any symbol that contains `d'.
-exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
-# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-# platforms (ab)use it in PIC code, but their linkers get confused if
-# the symbol is explicitly referenced.  Since portable code cannot
-# rely on this symbol name, it's probably fine to never include it in
-# preloaded symbol tables.
-extract_expsyms_cmds=
-
-case $host_os in
-cygwin* | mingw* | pw32*)
-  # FIXME: the MSVC++ port hasn't been tested in a loooong time
-  # When not using gcc, we currently assume that we are using
-  # Microsoft Visual C++.
-  if test "$GCC" != yes; then
-    with_gnu_ld=no
-  fi
-  ;;
-openbsd*)
-  with_gnu_ld=no
-  ;;
-esac
-
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
-  # If archive_cmds runs LD, not CC, wlarc should be empty
-  wlarc='${wl}'
-
-  # See if GNU ld supports shared libraries.
-  case $host_os in
-  aix3* | aix4* | aix5*)
-    # On AIX, the GNU linker is very broken
-    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
-    ld_shlibs=no
-    cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-    ;;
-
-  amigaos*)
-    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)'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-
-    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-    # that the semantics of dynamic libraries on AmigaOS, at least up
-    # to version 4, is to share data among multiple programs linked
-    # with the same dynamic library.  Since this doesn't match the
-    # behavior of shared libraries on other platforms, we can use
-    # them.
-    ld_shlibs=no
-    ;;
 
-  beos*)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      allow_undefined_flag=unsupported
-      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  cygwin* | mingw* | pw32*)
-    # hardcode_libdir_flag_spec is actually meaningless, as there is
-    # no search path for DLLs.
-    hardcode_libdir_flag_spec='-L$libdir'
-    allow_undefined_flag=unsupported
-    always_export_symbols=yes
-
-    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
-      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
-      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
-      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
-      else $CC -o impgen impgen.c ; fi)~
-      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
-
-    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
-
-    # cygwin and mingw dlls have different entry points and sets of symbols
-    # to exclude.
-    # FIXME: what about values for MSVC?
-    dll_entry=__cygwin_dll_entry@12
-    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
-    case $host_os in
-    mingw*)
-      # mingw values
-      dll_entry=_DllMainCRTStartup@12
-      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag_GCJ=' ${wl}-bernotok'
+         allow_undefined_flag_GCJ=' ${wl}-berok'
+         # -bexpall does not export symbols beginning with underscore (_)
+         always_export_symbols_GCJ=yes
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec_GCJ=' '
+         archive_cmds_need_lc_GCJ=yes
+         # This is similar to how AIX traditionally builds it's shared libraries.
+         archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
       ;;
-    esac
 
-    # mingw and cygwin differ, and it's simplest to just exclude the union
-    # of the two symbol sets.
-    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
+    amigaos*)
+      archive_cmds_GCJ='$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)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
 
-    # recent cygwin and mingw systems supply a stub DllMain which the user
-    # can override, but on older systems we have to supply one (in ltdll.c)
-    if test "x$lt_cv_need_dllmain" = "xyes"; then
-      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
-      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~
-       test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
-    else
-      ltdll_obj=
-      ltdll_cmds=
-    fi
+    bsdi[45]*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
 
-    # Extract the symbol export list from an `--export-all' def file,
-    # then regenerate the def file from the symbol export list, so that
-    # the compiled dll only exports the symbol export list.
-    # Be careful not to strip the DATA tag left be newer dlltools.
-    export_symbols_cmds="$ltdll_cmds"'
-      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
-      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
-
-    # If the export-symbols file already is a .def file (1st line
-    # is EXPORTS), use it as is.
-    # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
-       cp $export_symbols $output_objdir/$soname-def;
-      else
-       echo EXPORTS > $output_objdir/$soname-def;
-       _lt_hint=1;
-       cat $export_symbols | while read symbol; do
-        set dummy \$symbol;
-        case \$# in
-          2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
-          4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
-          *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
-        esac;
-        _lt_hint=`expr 1 + \$_lt_hint`;
-       done;
-      fi~
-      '"$ltdll_cmds"'
-      $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~
-      $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~
-      $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~
-      $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~
-      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
-    ;;
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
 
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-      wlarc=
+    darwin* | rhapsody*)
+      case "$host_os" in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_GCJ=no
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ=''
+      link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
     else
-      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      case "$cc_basename" in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
     fi
-    ;;
-
-  solaris* | sysv5*)
-    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
-      ld_shlibs=no
-      cat <<EOF 1>&2
+      ;;
 
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-EOF
-    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
+    freebsd1*)
+      ld_shlibs_GCJ=no
+      ;;
 
-  sunos4*)
-    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    wlarc=
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-  *)
-    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-    else
-      ld_shlibs=no
-    fi
-    ;;
-  esac
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-  if test "$ld_shlibs" = yes; then
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    case $host_os in
-    cygwin* | mingw* | pw32*)
-      # dlltool doesn't understand --whole-archive et. al.
-      whole_archive_flag_spec=
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
       ;;
-    *)
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
-       whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
-       whole_archive_flag_spec=
+       archive_cmds_GCJ='$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'
       fi
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
       ;;
-    esac
-  fi
-else
-  # PORTME fill in a description of your system's linker (not GNU ld)
-  case $host_os in
-  aix3*)
-    allow_undefined_flag=unsupported
-    always_export_symbols=yes
-    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'
-    # Note: this linker hardcodes the directories in LIBPATH if there
-    # are no directories specified by -L.
-    hardcode_minus_L=yes
-    if test "$GCC" = yes && test -z "$link_static_flag"; then
-      # Neither direct hardcoding nor static linking is supported with a
-      # broken collect2.
-      hardcode_direct=unsupported
-    fi
-    ;;
-
-  aix4* | aix5*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
 
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[23]|aix4.[23].*|aix5*)
-       for ld_flag in $LDFLAGS; do
-         case $ld_flag in
-         *-brtl*)
-           aix_use_runtimelinking=yes
-           break
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
          ;;
-         esac
-       done
-      esac
-
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
-
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-    hardcode_direct=yes
-    archive_cmds=''
-    hardcode_libdir_separator=':'
-    if test "$GCC" = yes; then
-      case $host_os in aix4.[012]|aix4.[012].*)
-       collect2name=`${CC} -print-prog-name=collect2`
-       if test -f "$collect2name" && \
-         strings "$collect2name" | grep resolve_lib_name >/dev/null
-       then
-         # We have reworked collect2
-         hardcode_direct=yes
-       else
-         # We have old collect2
-         hardcode_direct=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         hardcode_minus_L=yes
-         hardcode_libdir_flag_spec='-L$libdir'
-         hardcode_libdir_separator=
-       fi
-      esac
-
-      shared_flag='-shared'
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-       shared_flag='${wl}-G'
+       *)
+         archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
       else
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag='${wl}-G'
-       else
-         shared_flag='${wl}-bM:SRE'
-       fi
+       case "$host_cpu" in
+       hppa*64*|ia64*)
+         archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
       fi
-    fi
+      if test "$with_gnu_ld" = no; then
+       case "$host_cpu" in
+       hppa*64*)
+         hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+         hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+         hardcode_libdir_separator_GCJ=:
+         hardcode_direct_GCJ=no
+         hardcode_shlibpath_var_GCJ=no
+         ;;
+       ia64*)
+         hardcode_libdir_flag_spec_GCJ='-L$libdir'
+         hardcode_direct_GCJ=no
+         hardcode_shlibpath_var_GCJ=no
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_GCJ=yes
+         ;;
+       *)
+         hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+         hardcode_libdir_separator_GCJ=:
+         hardcode_direct_GCJ=yes
+         export_dynamic_flag_spec_GCJ='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_GCJ=yes
+         ;;
+       esac
+      fi
+      ;;
 
-    # It seems that -bexpall can do strange things, so it is better to
-    # generate a list of symbols to export.
-    always_export_symbols=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      allow_undefined_flag='-berok'
-      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
-      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"
-    else
-      if test "$host_cpu" = ia64; then
-       hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-       allow_undefined_flag="-z nodefs"
-       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"
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$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'
       else
-       hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
-       # Warning - without using the other run time loading flags,
-       # -berok will link without error, but may produce a broken library.
-       allow_undefined_flag='${wl}-berok'
-       # This is a bit strange, but is similar to how AIX traditionally builds
-       # it's shared libraries.
-       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'
+       archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
       fi
-    fi
-    ;;
-
-  amigaos*)
-    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)'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-    # see comment about different semantics on the GNU ld section
-    ld_shlibs=no
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    # hardcode_libdir_flag_spec is actually meaningless, as there is
-    # no search path for DLLs.
-    hardcode_libdir_flag_spec=' '
-    allow_undefined_flag=unsupported
-    # Tell ltmain to make .lib files, not .a files.
-    libext=lib
-    # FIXME: Setting linknames here is a bad hack.
-    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-    # The linker will automatically build a .lib file if we build a DLL.
-    old_archive_from_new_cmds='true'
-    # FIXME: Should let the user specify the lib program.
-    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
-    fix_srcfile_path='`cygpath -w "$srcfile"`'
-    ;;
-
-  darwin* | rhapsody*)
-    case "$host_os" in
-    rhapsody* | darwin1.[012])
-      allow_undefined_flag='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      allow_undefined_flag='-flat_namespace -undefined suppress'
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
       ;;
-    esac
-    # FIXME: Relying on posixy $() will cause problems for
-    #        cross-compilation, but unfortunately the echo tests do not
-    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
-    #       `"' quotes if we put them in here... so don't!
-    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)'
-    # We need to add '_' to the symbols in $export_symbols first
-    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    whole_archive_flag_spec='-all_load $convenience'
-    ;;
-
-  freebsd1*)
-    ld_shlibs=no
-    ;;
-
-  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-  # support.  Future versions do this automatically, but an explicit c++rt0.o
-  # does not break anything, and helps significantly (at the cost of a little
-  # extra space).
-  freebsd2.2*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-  freebsd2*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_minus_L=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-  freebsd*)
-    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  hpux9* | hpux10* | hpux11*)
-    case $host_os in
-    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' ;;
-    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
-    esac
-    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_direct=yes
-    hardcode_minus_L=yes # Not in the search PATH, but as the default
-                        # location of the library.
-    export_dynamic_flag_spec='${wl}-E'
-    ;;
-
-  irix5* | irix6* | nonstopux*)
-    if test "$GCC" = yes; then
-      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'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    else
-      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'
-      hardcode_libdir_flag_spec='-rpath $libdir'
-    fi
-    hardcode_libdir_separator=:
-    link_all_deplibs=yes
-    ;;
-
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-    else
-      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-    fi
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  newsos6)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    hardcode_shlibpath_var=no
-    ;;
 
-  openbsd*)
-    hardcode_direct=yes
-    hardcode_shlibpath_var=no
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-    else
-      case "$host_os" in
-      openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-       hardcode_libdir_flag_spec='-R$libdir'
-        ;;
-      *)
-        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-        ;;
-      esac
-    fi
-    ;;
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-  os2*)
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_minus_L=yes
-    allow_undefined_flag=unsupported
-    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'
-    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-    ;;
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-  osf3*)
-    if test "$GCC" = yes; then
-      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      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'
-    else
-      allow_undefined_flag=' -expect_unresolved \*'
-      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'
-    fi
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator=:
-    ;;
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+          archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          hardcode_libdir_flag_spec_GCJ='-R$libdir'
+          ;;
+        *)
+          archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
 
-  osf4* | osf5*)       # as osf3* with the addition of -msym flag
-    if test "$GCC" = yes; then
-      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-      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'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    else
-      allow_undefined_flag=' -expect_unresolved \*'
-      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'
-      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-      $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'
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$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'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
 
-      #Both c and cxx compiler support -rpath directly
-      hardcode_libdir_flag_spec='-rpath $libdir'
-    fi
-    hardcode_libdir_separator=:
-    ;;
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_GCJ='$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'
+      else
+       allow_undefined_flag_GCJ=' -expect_unresolved \*'
+       archive_cmds_GCJ='$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'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
 
-  sco3.2v5*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_shlibpath_var=no
-    runpath_var=LD_RUN_PATH
-    hardcode_runpath_var=yes
-    export_dynamic_flag_spec='${wl}-Bexport'
-    ;;
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_GCJ='$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'
+       hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag_GCJ=' -expect_unresolved \*'
+       archive_cmds_GCJ='$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'
+       archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $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'
 
-  solaris*)
-    # gcc --version < 3.0 without binutils cannot create self contained
-    # shared libraries reliably, requiring libgcc.a to resolve some of
-    # the object symbols generated in some cases.  Libraries that use
-    # assert need libgcc.a to resolve __eprintf, for example.  Linking
-    # a copy of libgcc.a into every shared library to guarantee resolving
-    # such symbols causes other problems:  According to Tim Van Holder
-    # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
-    # (to the application) exception stack for one thing.
-    no_undefined_flag=' -z defs'
-    if test "$GCC" = yes; then
-      case `$CC --version 2>/dev/null` in
-      [12].*)
-       cat <<EOF 1>&2
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
 
-*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
-*** create self contained shared libraries on Solaris systems, without
-*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
-*** -no-undefined support, which will at least allow you to build shared
-*** libraries.  However, you may find that when you link such libraries
-*** into an application without using GCC, you have to manually add
-*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
-*** upgrade to a newer version of GCC.  Another option is to rebuild your
-*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
 
-EOF
-        no_undefined_flag=
-       ;;
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+       whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
       esac
-    fi
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec='-R$libdir'
-    hardcode_shlibpath_var=no
-    case $host_os in
-    solaris2.[0-5] | solaris2.[0-5].*) ;;
-    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
-    esac
-    link_all_deplibs=yes
-    ;;
-
-  sunos4*)
-    if test "x$host_vendor" = xsequent; then
-      # Use $CC to link under sequent, because it throws in some extra .o
-      # files that make .init and .fini sections work.
-      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-    fi
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_direct=yes
-    hardcode_minus_L=yes
-    hardcode_shlibpath_var=no
-    ;;
-
-  sysv4)
-    case $host_vendor in
-      sni)
-        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-        hardcode_direct=yes # is this really true???
-        ;;
-      siemens)
-        ## LD is ld it makes a PLAMLIB
-        ## CC just makes a GrossModule.
-        archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-        reload_cmds='$CC -r -o $output$reload_objs'
-        hardcode_direct=no
-        ;;
-      motorola)
-        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-        hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-        ;;
-    esac
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
+      link_all_deplibs_GCJ=yes
+      ;;
 
-  sysv4.3*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_shlibpath_var=no
-    export_dynamic_flag_spec='-Bexport'
-    ;;
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-  sysv5*)
-    no_undefined_flag=' -z text'
-    # $CC -shared without GNU ld will not create a library from C++
-    # object files and a static libstdc++, better avoid it by now
-    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-    hardcode_libdir_flag_spec=
-    hardcode_shlibpath_var=no
-    runpath_var='LD_RUN_PATH'
-    ;;
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_GCJ=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+         hardcode_direct_GCJ=no
+        ;;
+       motorola)
+         archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-  uts4*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_shlibpath_var=no
-    ;;
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
 
-  dgux*)
-    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_libdir_flag_spec='-L$libdir'
-    hardcode_shlibpath_var=no
-    ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var_GCJ=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs_GCJ=yes
+      fi
+      ;;
 
-  sysv4*MP*)
-    if test -d /usr/nec; then
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      runpath_var=LD_RUN_PATH
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
       hardcode_runpath_var=yes
-      ld_shlibs=yes
-    fi
-    ;;
-
-  sysv4.2uw2*)
-    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-    hardcode_direct=yes
-    hardcode_minus_L=no
-    hardcode_shlibpath_var=no
-    hardcode_runpath_var=yes
-    runpath_var=LD_RUN_PATH
-    ;;
+      runpath_var=LD_RUN_PATH
+      ;;
 
-  sysv5uw7* | unixware7*)
-    no_undefined_flag='${wl}-z ${wl}text'
-    if test "$GCC" = yes; then
-      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    else
-      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-    fi
-    runpath_var='LD_RUN_PATH'
-    hardcode_shlibpath_var=no
-    ;;
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-  *)
-    ld_shlibs=no
-    ;;
-  esac
-fi
-echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6
-test "$ld_shlibs" = no && can_build_shared=no
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
 
-# Check hardcoding attributes.
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var"; then
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$hardcode_shlibpath_var" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
   fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_GCJ=no
+        else
+         archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
 
-# PORTME Fill in your ld.so characteristics
 echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
+shrext_cmds=".so"
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -6525,16 +17013,35 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
 
 case $host_os in
 aix3*)
   version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix $libname.a'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
-  # AIX has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}.so$major'
+  # AIX has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
   ;;
 
 aix4* | aix5*)
@@ -6544,7 +17051,7 @@ aix4* | aix5*)
   hardcode_into_libs=yes
   if test "$host_cpu" = ia64; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
@@ -6554,57 +17061,54 @@ aix4* | aix5*)
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
-       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-            echo ' yes '
-            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-         :
-       else
-         can_build_shared=no
-       fi
-       ;;
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can
-    # not hardcode correct soname into executable. Probably we can
-    # add versioning support to collect2, so additional links can
-    # be useful in future.
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
     if test "$aix_use_runtimelinking" = yes; then
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
     else
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
       library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}.so$major'
+      soname_spec='${libname}${release}${shared_ext}$major'
     fi
     shlibpath_var=LIBPATH
   fi
-  hardcode_into_libs=yes
   ;;
 
 amigaos*)
   library_names_spec='$libname.ixlibrary $libname.a'
   # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  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'
+  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'
   ;;
 
 beos*)
-  library_names_spec='${libname}.so'
+  library_names_spec='${libname}${shared_ext}'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  export_dynamic_flag_spec=-rdynamic
   # the default ld.so.conf also contains /usr/contrib/lib and
   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
   # libtool to hard-code these into programs
@@ -6612,29 +17116,55 @@ bsdi4*)
 
 cygwin* | mingw* | pw32*)
   version_type=windows
+  shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
+
   case $GCC,$host_os in
-  yes,cygwin*)
+  yes,cygwin* | yes,mingw* | yes,pw32*)
     library_names_spec='$libname.dll.a'
-    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
-    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog .libs/$dlname \$dldir/$dlname'
-    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
     ;;
-  yes,mingw*)
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
-    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
-    ;;
-  yes,pw32*)
-    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
-    ;;
+
   *)
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
   esac
   dynamic_linker='Win32 ld.exe'
@@ -6647,30 +17177,58 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  # FIXME: Relying on posixy $() will cause problems for
-  #        cross-compilation, but unfortunately the echo tests do not
-  #        yet detect zsh echo's removal of \ escapes.
-  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)'
-  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
   ;;
 
 freebsd1*)
   dynamic_linker=no
   ;;
 
-freebsd*)
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
       need_version=yes
       ;;
   esac
@@ -6679,7 +17237,11 @@ freebsd*)
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  *)
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
@@ -6690,8 +17252,8 @@ gnu*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
-  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   hardcode_into_libs=yes
   ;;
@@ -6699,14 +17261,45 @@ gnu*)
 hpux9* | hpux10* | hpux11*)
   # Give a soname corresponding to the major version so that dld.sl refuses to
   # link against other versions.
-  dynamic_linker="$host_os dld.sl"
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  shlibpath_var=SHLIB_PATH
-  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
-  soname_spec='${libname}${release}.sl$major'
+  case "$host_cpu" in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555.
   postinstall_cmds='chmod 555 $lib'
   ;;
@@ -6714,21 +17307,29 @@ hpux9* | hpux10* | hpux11*)
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
-    *)          version_type=irix ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
     ;;
   *)
     case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
     *) libsuff= shlibsuff= libmagic=never-match;;
     esac
     ;;
@@ -6737,6 +17338,7 @@ irix5* | irix6* | nonstopux*)
   shlibpath_overrides_runpath=no
   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
   ;;
 
 # No shared lib support for Linux oldld, aout, or coff.
@@ -6749,8 +17351,8 @@ linux*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -6759,12 +17361,11 @@ linux*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  case $host_cpu:$lt_cv_cc_64bit_output in
-  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
-    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
-    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
-    ;;
-  esac
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
   # powerpc, because MkLinux only supported shared libraries with the
@@ -6775,17 +17376,29 @@ linux*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
-    soname_spec='${libname}${release}.so$major'
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -6795,7 +17408,17 @@ netbsd*)
 
 newsos6)
   version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -6804,46 +17427,47 @@ openbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case "$host_os" in
-    openbsd2.[89] | openbsd2.[89].*)
-      shlibpath_overrides_runpath=no
-      ;;
-    *)
-      shlibpath_overrides_runpath=yes
-      ;;
-    esac
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
   else
     shlibpath_overrides_runpath=yes
   fi
-  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
   ;;
 
 os2*)
   libname_spec='$name'
+  shrext_cmds=".dll"
   need_lib_prefix=no
-  library_names_spec='$libname.dll $libname.a'
+  library_names_spec='$libname${shared_ext} $libname.a'
   dynamic_linker='OS/2 ld.exe'
   shlibpath_var=LIBPATH
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
+  need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  hardcode_into_libs=yes
   ;;
 
 sco3.2v5*)
   version_type=osf
-  soname_spec='${libname}${release}.so$major'
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -6851,8 +17475,8 @@ solaris*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -6862,7 +17486,7 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -6874,8 +17498,8 @@ sunos4*)
 
 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
   version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -6896,31 +17520,22 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
   esac
   ;;
 
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
-  soname_spec='${libname}${release}.so$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 sysv4*MP*)
   if test -d /usr/nec ;then
     version_type=linux
-    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
-    soname_spec='$libname.so.$major'
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
 *)
   dynamic_linker=no
   ;;
@@ -6929,44 +17544,35 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
 echo "${ECHO_T}$dynamic_linker" >&6
 test "$dynamic_linker" = no && can_build_shared=no
 
-# Report the final consequences.
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
-
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case "$host_os" in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-
-aix4*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
 
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
 
-if test "$hardcode_action" = relink; then
+if test "$hardcode_action_GCJ" = relink; then
   # Fast installation is not supported
   enable_fast_install=no
 elif test "$shlibpath_overrides_runpath" = yes ||
@@ -6975,9 +17581,33 @@ elif test "$shlibpath_overrides_runpath" = yes ||
   enable_fast_install=needless
 fi
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
 fi
 
 if test "x$enable_dlopen" != xyes; then
@@ -6995,11 +17625,94 @@ else
     lt_cv_dlopen_self=yes
     ;;
 
-  cygwin* | mingw* | pw32*)
+  mingw* | pw32*)
     lt_cv_dlopen="LoadLibrary"
     lt_cv_dlopen_libs=
    ;;
 
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
   *)
     echo "$as_me:$LINENO: checking for shl_load" >&5
 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
@@ -7007,21 +17720,28 @@ if test "${ac_cv_func_shl_load+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shl_load (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef shl_load
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -7052,11 +17772,21 @@ return f != shl_load;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7069,7 +17799,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_shl_load=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
 echo "${ECHO_T}$ac_cv_func_shl_load" >&6
@@ -7084,7 +17815,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldld  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7108,11 +17838,21 @@ shl_load ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7125,7 +17865,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_dld_shl_load=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
@@ -7139,21 +17880,28 @@ if test "${ac_cv_func_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
+
 #ifdef __STDC__
 # include <limits.h>
 #else
 # include <assert.h>
 #endif
+
+#undef dlopen
+
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
@@ -7184,11 +17932,21 @@ return f != dlopen;
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7201,7 +17959,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_func_dlopen=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
 echo "${ECHO_T}$ac_cv_func_dlopen" >&6
@@ -7216,7 +17975,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7240,11 +17998,21 @@ dlopen ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7257,7 +18025,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
@@ -7273,7 +18042,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsvld  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7297,11 +18065,21 @@ dlopen ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7314,7 +18092,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_svld_dlopen=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
@@ -7330,7 +18109,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldld  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7354,11 +18132,21 @@ dld_link ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -7371,7 +18159,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_dld_dld_link=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
@@ -7407,7 +18196,7 @@ fi
   case $lt_cv_dlopen in
   dlopen)
     save_CPPFLAGS="$CPPFLAGS"
-        test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
     save_LDFLAGS="$LDFLAGS"
     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
@@ -7423,10 +18212,108 @@ else
          if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self=cross
 else
-    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 18218 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 7429 "configure"
+#line 18316 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -7471,266 +18358,587 @@ else
 extern "C" void exit (int);
 #endif
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS=$lt_AS
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
 
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 7527 "configure"
-#include "confdefs.h"
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
 
-#include <stdio.h>
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
 
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW         DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW       RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW     DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW     0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
-    fi
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
 
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
 
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
 
-if test "$enable_shared" = yes && test "$GCC" = yes; then
-  case $archive_cmds in
-  *'~'*)
-    # FIXME: we may have to deal with multi-command sequences.
-    ;;
-  '$CC '*)
-    # Test whether the compiler implicitly links with -lc since on some
-    # systems, -lgcc has to come before -lc. If gcc already passes -lc
-    # to ld, don't add -lc before -lgcc.
-    echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-    if test "${lt_cv_archive_cmds_need_lc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  $rm conftest*
-    echo 'static int dummy;' > conftest.$ac_ext
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
 
-    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-      soname=conftest
-      lib=conftest
-      libobjs=conftest.$ac_objext
-      deplibs=
-      wl=$lt_cv_prog_cc_wl
-      compiler_flags=-v
-      linker_flags=-v
-      verstring=
-      output_objdir=.
-      libname=conftest
-      save_allow_undefined_flag=$allow_undefined_flag
-      allow_undefined_flag=
-      if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-      then
-       lt_cv_archive_cmds_need_lc=no
-      else
-       lt_cv_archive_cmds_need_lc=yes
-      fi
-      allow_undefined_flag=$save_allow_undefined_flag
-    else
-      cat conftest.err 1>&5
-    fi
-fi
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
 
-    echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5
-echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6
-    ;;
-  esac
-fi
-need_lc=${lt_cv_archive_cmds_need_lc-yes}
 
-# The second clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  :
 else
   # If there is no Makefile yet, we rely on a make rule to execute
   # `config.status --recheck' to rerun these tests and create the
   # libtool script then.
-  test -f Makefile && make "$ltmain"
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
 fi
 
-if test -f "$ltmain"; then
-  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
-  $rm -f "${ofile}T"
 
-  echo creating $ofile
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+       else
+         tagname=""
+       fi
+       ;;
+
+      RC)
+
 
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS SED \
-    AR AR_FLAGS CC LD LN_S NM SHELL \
-    reload_flag reload_cmds wl \
-    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
-    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
-    library_names_spec soname_spec \
-    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
-    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
-    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
-    old_striplib striplib file_magic_cmd export_symbols_cmds \
-    deplibs_check_method allow_undefined_flag no_undefined_flag \
-    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
-    global_symbol_to_c_name_address \
-    hardcode_libdir_flag_spec hardcode_libdir_separator  \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS AS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
 
     case $var in
-    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
-    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
     postinstall_cmds | postuninstall_cmds | \
-    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
       # Double-quote double-evaled strings.
       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
       ;;
@@ -7738,48 +18946,18 @@ if test -f "$ltmain"; then
       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
       ;;
     esac
-  done
-
-  cat <<__EOF__ > "${ofile}T"
-#! $SHELL
-
-# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996-2000 Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed that does not truncate output.
-SED=$lt_SED
+  done
 
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="${SED} -e s/^X//"
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
 
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+cfgfile="$ofile"
 
-# ### BEGIN LIBTOOL CONFIG
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
 
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
@@ -7793,7 +18971,10 @@ build_libtool_libs=$enable_shared
 build_old_libs=$enable_static
 
 # Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$need_lc
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
 
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
@@ -7801,6 +18982,12 @@ fast_install=$enable_fast_install
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
@@ -7809,14 +18996,20 @@ echo=$lt_echo
 AR=$lt_AR
 AR_FLAGS=$lt_AR_FLAGS
 
-# The default C compiler.
-CC=$lt_CC
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
 
 # Is the compiler the GNU C compiler?
-with_gcc=$GCC
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
 
 # The linker used to build libraries.
-LD=$lt_LD
+LD=$lt_LD_RC
 
 # Whether we need hard or soft links.
 LN_S=$lt_LN_S
@@ -7825,7 +19018,7 @@ LN_S=$lt_LN_S
 NM=$lt_NM
 
 # A symbol stripping program
-STRIP=$STRIP
+STRIP=$lt_STRIP
 
 # Used to examine libraries when file_magic_cmd begins "file"
 MAGIC_CMD=$MAGIC_CMD
@@ -7847,7 +19040,7 @@ reload_flag=$lt_reload_flag
 reload_cmds=$lt_reload_cmds
 
 # How to pass a linker flag through the compiler.
-wl=$lt_wl
+wl=$lt_lt_prog_compiler_wl_RC
 
 # Object file suffix (normally "o").
 objext="$ac_objext"
@@ -7855,18 +19048,21 @@ objext="$ac_objext"
 # Old archive suffix (normally "a").
 libext="$libext"
 
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
 # Executable file suffix (normally "").
 exeext="$exeext"
 
 # Additional compiler flags for building library objects.
-pic_flag=$lt_pic_flag
+pic_flag=$lt_lt_prog_compiler_pic_RC
 pic_mode=$pic_mode
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_compiler_c_o
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
-# Can we write directly to a .lo ?
-compiler_o_lo=$lt_compiler_o_lo
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
 
 # Must we lock files when doing compilation ?
 need_locks=$lt_need_locks
@@ -7887,19 +19083,19 @@ dlopen_self=$enable_dlopen_self
 dlopen_self_static=$enable_dlopen_self_static
 
 # Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_link_static_flag
+link_static_flag=$lt_lt_prog_compiler_static_RC
 
 # Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_no_builtin_flag
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
 
 # Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
 
 # Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
 
 # Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
 
 # Library versioning type.
 version_type=$version_type
@@ -7916,26 +19112,50 @@ soname_spec=$lt_soname_spec
 
 # Commands used to build and install an old-style archive.
 RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
+old_archive_cmds=$lt_old_archive_cmds_RC
 old_postinstall_cmds=$lt_old_postinstall_cmds
 old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
 # Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
 
 # Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
 
 # Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
 postinstall_cmds=$lt_postinstall_cmds
 postuninstall_cmds=$lt_postuninstall_cmds
 
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
 # Commands to strip libraries.
 old_striplib=$lt_old_striplib
 striplib=$lt_striplib
 
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
 
@@ -7943,10 +19163,10 @@ deplibs_check_method=$lt_deplibs_check_method
 file_magic_cmd=$lt_file_magic_cmd
 
 # Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
+allow_undefined_flag=$lt_allow_undefined_flag_RC
 
 # Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
+no_undefined_flag=$lt_no_undefined_flag_RC
 
 # Commands used to finish a libtool library installation in a directory.
 finish_cmds=$lt_finish_cmds
@@ -7955,13 +19175,13 @@ finish_cmds=$lt_finish_cmds
 finish_eval=$lt_finish_eval
 
 # Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_global_symbol_pipe
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 
 # Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
 # Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
 # This is the shared library runtime path variable.
 runpath_var=$runpath_var
@@ -7973,36 +19193,45 @@ shlibpath_var=$shlibpath_var
 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
 # How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
+hardcode_action=$hardcode_action_RC
 
 # Whether we should hardcode library paths into libraries.
 hardcode_into_libs=$hardcode_into_libs
 
 # Flag to hardcode \$libdir into a binary during linking.
 # This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
 
 # Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
 
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
 # resulting binary.
-hardcode_direct=$hardcode_direct
+hardcode_direct=$hardcode_direct_RC
 
 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
 # resulting binary.
-hardcode_minus_L=$hardcode_minus_L
+hardcode_minus_L=$hardcode_minus_L_RC
 
 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
 # the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
 
 # Variables whose values should be saved in libtool wrapper scripts and
 # restored at relink time.
 variables_saved_for_relink="$variables_saved_for_relink"
 
 # Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
+link_all_deplibs=$link_all_deplibs_RC
 
 # Compile-time system search path for libraries
 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
@@ -8011,234 +19240,75 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
+fix_srcfile_path="$fix_srcfile_path_RC"
 
 # Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
+always_export_symbols=$always_export_symbols_RC
 
 # The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
+export_symbols_cmds=$lt_export_symbols_cmds_RC
 
 # The commands to extract the exported symbol list from a shared archive.
 extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
 # Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
+exclude_expsyms=$lt_exclude_expsyms_RC
 
 # Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
+include_expsyms=$lt_include_expsyms_RC
 
-# ### END LIBTOOL CONFIG
+# ### END LIBTOOL TAG CONFIG: $tagname
 
 __EOF__
 
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "${ofile}T"
 
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
 fi
-EOF
-    ;;
-  esac
 
-  case $host_os in
-  cygwin* | mingw* | pw32* | os2*)
-    cat <<'EOF' >> "${ofile}T"
-      # This is a source program that is used to create dlls on Windows
-      # Don't remove nor modify the starting and closing comments
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-       # This is a source program that is used to create import libraries
-       # on Windows for dlls which lack them. Don't remove nor modify the
-       # starting and closing comments
-# /* impgen.c starts here */
-# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
-#
-#  This file is part of GNU libtool.
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#  */
-#
-# #include <stdio.h>           /* for printf() */
-# #include <unistd.h>          /* for open(), lseek(), read() */
-# #include <fcntl.h>           /* for O_RDONLY, O_BINARY */
-# #include <string.h>          /* for strdup() */
-#
-# /* O_BINARY isn't required (or even defined sometimes) under Unix */
-# #ifndef O_BINARY
-# #define O_BINARY 0
-# #endif
-#
-# static unsigned int
-# pe_get16 (fd, offset)
-#      int fd;
-#      int offset;
-# {
-#   unsigned char b[2];
-#   lseek (fd, offset, SEEK_SET);
-#   read (fd, b, 2);
-#   return b[0] + (b[1]<<8);
-# }
-#
-# static unsigned int
-# pe_get32 (fd, offset)
-#     int fd;
-#     int offset;
-# {
-#   unsigned char b[4];
-#   lseek (fd, offset, SEEK_SET);
-#   read (fd, b, 4);
-#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# static unsigned int
-# pe_as32 (ptr)
-#      void *ptr;
-# {
-#   unsigned char *b = ptr;
-#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# int
-# main (argc, argv)
-#     int argc;
-#     char *argv[];
-# {
-#     int dll;
-#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
-#     unsigned long export_rva, export_size, nsections, secptr, expptr;
-#     unsigned long name_rvas, nexp;
-#     unsigned char *expdata, *erva;
-#     char *filename, *dll_name;
-#
-#     filename = argv[1];
-#
-#     dll = open(filename, O_RDONLY|O_BINARY);
-#     if (dll < 1)
-#      return 1;
-#
-#     dll_name = filename;
-#
-#     for (i=0; filename[i]; i++)
-#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
-#          dll_name = filename + i +1;
-#
-#     pe_header_offset = pe_get32 (dll, 0x3c);
-#     opthdr_ofs = pe_header_offset + 4 + 20;
-#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
-#
-#     if (num_entries < 1) /* no exports */
-#      return 1;
-#
-#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
-#     export_size = pe_get32 (dll, opthdr_ofs + 100);
-#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
-#     secptr = (pe_header_offset + 4 + 20 +
-#            pe_get16 (dll, pe_header_offset + 4 + 16));
-#
-#     expptr = 0;
-#     for (i = 0; i < nsections; i++)
-#     {
-#      char sname[8];
-#      unsigned long secptr1 = secptr + 40 * i;
-#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
-#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
-#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
-#      lseek(dll, secptr1, SEEK_SET);
-#      read(dll, sname, 8);
-#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
-#      {
-#          expptr = fptr + (export_rva - vaddr);
-#          if (export_rva + export_size > vaddr + vsize)
-#              export_size = vsize - (export_rva - vaddr);
-#          break;
-#      }
-#     }
-#
-#     expdata = (unsigned char*)malloc(export_size);
-#     lseek (dll, expptr, SEEK_SET);
-#     read (dll, expdata, export_size);
-#     erva = expdata - export_rva;
-#
-#     nexp = pe_as32 (expdata+24);
-#     name_rvas = pe_as32 (expdata+32);
-#
-#     printf ("EXPORTS\n");
-#     for (i = 0; i<nexp; i++)
-#     {
-#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
-#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
-#     }
-#
-#     return 0;
-# }
-# /* impgen.c ends here */
 
-EOF
-    ;;
-  esac
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
+CC="$lt_save_CC"
 
-  mv -f "${ofile}T" "$ofile" || \
-    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
-  chmod +x "$ofile"
-fi
+       ;;
+
+      *)
+       { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+      esac
 
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
 
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
 
 
 
@@ -8251,6 +19321,24 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 # Prevent multiple expansion
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
@@ -8304,7 +19392,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8322,11 +19409,21 @@ main ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8339,7 +19436,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_resolv_main=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
@@ -8361,7 +19459,6 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-llber  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8385,11 +19482,21 @@ ber_strdup ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8402,7 +19509,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_lber_ber_strdup=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_lber_ber_strdup" >&5
@@ -8430,7 +19538,6 @@ LIBS="-lldap
     -llber
      $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8454,11 +19561,21 @@ ldap_add_ext ();
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8471,7 +19588,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_lib_ldap_ldap_add_ext=no
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_add_ext" >&5
@@ -8495,7 +19613,6 @@ if test "${ac_cv_header_time+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8516,11 +19633,21 @@ return 0;
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8533,7 +19660,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_cv_header_time=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
 echo "${ECHO_T}$ac_cv_header_time" >&6
@@ -8558,7 +19685,6 @@ else
 echo "$as_me:$LINENO: checking ldap.h usability" >&5
 echo $ECHO_N "checking ldap.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8569,11 +19695,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8586,7 +19722,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -8594,7 +19730,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking ldap.h presence" >&5
 echo $ECHO_N "checking ldap.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8612,6 +19747,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -8631,33 +19767,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: ldap.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: ldap.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ldap.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ldap.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: ldap.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ldap.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: ldap.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: ldap.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ldap.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ldap.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ldap.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ldap.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ldap.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ldap.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ldap.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ldap.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: ldap.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: ldap.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ldap.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ldap.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -8677,7 +19812,6 @@ fi
 
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8714,7 +19848,6 @@ else
 echo "$as_me:$LINENO: checking lber.h usability" >&5
 echo $ECHO_N "checking lber.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8725,11 +19858,21 @@ $ac_includes_default
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -8742,7 +19885,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 ac_header_compiler=no
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
@@ -8750,7 +19893,6 @@ echo "${ECHO_T}$ac_header_compiler" >&6
 echo "$as_me:$LINENO: checking lber.h presence" >&5
 echo $ECHO_N "checking lber.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8768,6 +19910,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
     ac_cpp_err=
   fi
@@ -8787,33 +19930,32 @@ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
 echo "${ECHO_T}$ac_header_preproc" >&6
 
 # So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc in
-  yes:no )
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
     { echo "$as_me:$LINENO: WARNING: lber.h: accepted by the compiler, rejected by the preprocessor!" >&5
 echo "$as_me: WARNING: lber.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: lber.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: lber.h: proceeding with the preprocessor's result" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+    { echo "$as_me:$LINENO: WARNING: lber.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: lber.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-  no:yes )
+  no:yes:* )
     { echo "$as_me:$LINENO: WARNING: lber.h: present but cannot be compiled" >&5
 echo "$as_me: WARNING: lber.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: lber.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: lber.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lber.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: lber.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lber.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: lber.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lber.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: lber.h:     section \"Present But Cannot Be Compiled\"" >&2;}
     { echo "$as_me:$LINENO: WARNING: lber.h: proceeding with the preprocessor's result" >&5
 echo "$as_me: WARNING: lber.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lber.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: lber.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to bug-autoconf@gnu.org. ##
-## ------------------------------------ ##
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
 _ASBOX
     ) |
       sed "s/^/$as_me: WARNING:     /" >&2
@@ -8833,7 +19975,6 @@ fi
 
 
 cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8889,13 +20030,13 @@ _ACEOF
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
-        "s/'/'\\\\''/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
       ;;
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
       sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
       ;;
     esac;
 } |
@@ -8925,13 +20066,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[        ]*VPATH[        ]*=/{
+  ac_vpsub='/^[         ]*VPATH[        ]*=/{
 s/:*\$(srcdir):*/:/;
 s/:*\${srcdir}:*/:/;
 s/:*@srcdir@:*/:/;
-s/^\([^=]*=[   ]*\):*/\1/;
+s/^\([^=]*=[    ]*\):*/\1/;
 s/:*$//;
-s/^[^=]*=[     ]*$//;
+s/^[^=]*=[      ]*$//;
 }'
 fi
 
@@ -8942,7 +20083,7 @@ ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_i=`echo "$ac_i" |
-         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+        sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
   # 2. Add them.
   ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
   ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
@@ -9007,9 +20148,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
+DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
 else
   as_unset=false
@@ -9028,7 +20170,7 @@ for as_var in \
   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
   LC_TELEPHONE LC_TIME
 do
-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
     $as_unset $as_var
@@ -9207,16 +20349,17 @@ rm -f conf$$ conf$$.exe conf$$.file
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
 else
+  test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
 as_executable_p="test -f"
 
 # Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
 # Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
 # IFS
@@ -9243,7 +20386,7 @@ _ASBOX
 cat >&5 <<_CSEOF
 
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57.  Invocation command line was
+generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -9287,9 +20430,9 @@ Usage: $0 [OPTIONS] [FILE]...
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
   --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
+                  instantiate the configuration file FILE
   --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
+                  instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -9306,11 +20449,10 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.57,
+configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 srcdir=$srcdir
@@ -9517,13 +20659,17 @@ s,@AUTOCONF@,$AUTOCONF,;t t
 s,@AUTOMAKE@,$AUTOMAKE,;t t
 s,@AUTOHEADER@,$AUTOHEADER,;t t
 s,@MAKEINFO@,$MAKEINFO,;t t
-s,@AMTAR@,$AMTAR,;t t
 s,@install_sh@,$install_sh,;t t
 s,@STRIP@,$STRIP,;t t
 s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
 s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
 s,@AWK@,$AWK,;t t
 s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
 s,@CXX@,$CXX,;t t
 s,@CXXFLAGS@,$CXXFLAGS,;t t
 s,@LDFLAGS@,$LDFLAGS,;t t
@@ -9554,12 +20700,18 @@ s,@ac_ct_CC@,$ac_ct_CC,;t t
 s,@CCDEPMODE@,$CCDEPMODE,;t t
 s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
 s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@EGREP@,$EGREP,;t t
 s,@LN_S@,$LN_S,;t t
 s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
 s,@RANLIB@,$RANLIB,;t t
 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
 s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
 s,@LIBTOOL@,$LIBTOOL,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
@@ -9592,9 +20744,9 @@ _ACEOF
       (echo ':t
   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
       if test -z "$ac_sed_cmds"; then
-       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
       else
-       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
       fi
       ac_sed_frag=`expr $ac_sed_frag + 1`
       ac_beg=$ac_end
@@ -9612,21 +20764,21 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
   - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+       cat >$tmp/stdin
+       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   * )   ac_file_in=$ac_file.in ;;
   esac
 
   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
   ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -9642,10 +20794,10 @@ echo X"$ac_file" |
       as_dirs="$as_dir $as_dirs"
       as_dir=`(dirname "$as_dir") 2>/dev/null ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -9683,12 +20835,45 @@ case $srcdir in
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
 
   case $INSTALL in
@@ -9710,7 +20895,7 @@ echo "$as_me: creating $ac_file" >&6;}
     configure_input="$ac_file.  "
   fi
   configure_input=$configure_input"Generated from `echo $ac_file_in |
-                                     sed 's,.*/,,'` by configure."
+                                    sed 's,.*/,,'` by configure."
 
   # First look for the input files in the build tree, otherwise in the
   # src tree.
@@ -9719,24 +20904,24 @@ echo "$as_me: creating $ac_file" >&6;}
       case $f in
       -) echo $tmp/stdin ;;
       [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+        # Absolute (can't be DOS-style, as IFS=:)
+        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         echo $f;;
+        echo "$f";;
       *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+        if test -f "$f"; then
+          # Build tree
+          echo "$f"
+        elif test -f "$srcdir/$f"; then
+          # Source tree
+          echo "$srcdir/$f"
+        else
+          # /dev/null tree
+          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         fi;;
+        fi;;
       esac
     done` || { (exit 1); exit 1; }
 _ACEOF
@@ -9778,12 +20963,12 @@ cat >>$CONFIG_STATUS <<\_ACEOF
 # NAME is the cpp macro being defined and VALUE is the value it is being given.
 #
 # ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([  ]*\)#\([        ]*define[       ][      ]*\)'
-ac_dB='[       ].*$,\1#\2'
+ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
+ac_dB='[        ].*$,\1#\2'
 ac_dC=' '
 ac_dD=',;t'
 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
 ac_uB='$,\1#\2define\3'
 ac_uC=' '
 ac_uD=',;t'
@@ -9792,11 +20977,11 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
   case $ac_file in
   - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+       cat >$tmp/stdin
+       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
   * )   ac_file_in=$ac_file.in ;;
   esac
 
@@ -9810,28 +20995,29 @@ echo "$as_me: creating $ac_file" >&6;}
       case $f in
       -) echo $tmp/stdin ;;
       [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+        # Absolute (can't be DOS-style, as IFS=:)
+        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         echo $f;;
+        # Do quote $f, to prevent DOS paths from being IFS'd.
+        echo "$f";;
       *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+        if test -f "$f"; then
+          # Build tree
+          echo "$f"
+        elif test -f "$srcdir/$f"; then
+          # Source tree
+          echo "$srcdir/$f"
+        else
+          # /dev/null tree
+          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
-         fi;;
+        fi;;
       esac
     done` || { (exit 1); exit 1; }
   # Remove the trailing spaces.
-  sed 's/[     ]*$//' $ac_file_inputs >$tmp/in
+  sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
 
 _ACEOF
 
@@ -9854,9 +21040,9 @@ s/[\\&,]/\\&/g
 s,[\\$`],\\&,g
 t clear
 : clear
-s,^[   ]*#[    ]*define[       ][      ]*\([^  (][^    (]*\)\(([^)]*)\)[       ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+s,^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*\)\(([^)]*)\)[       ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
 t end
-s,^[   ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+s,^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
 : end
 _ACEOF
 # If some macros were called several times there might be several times
@@ -9870,13 +21056,13 @@ rm -f confdef2sed.sed
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
 cat >>conftest.undefs <<\_ACEOF
-s,^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+s,^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
 _ACEOF
 
 # Break up conftest.defines because some shells have a limit on the size
 # of here documents, and old seds have small limits too (100 cmds).
 echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[    ]*#[    ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  if grep "^[     ]*#[    ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
 echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
 echo '  :' >>$CONFIG_STATUS
 rm -f conftest.tail
@@ -9885,7 +21071,7 @@ do
   # Write a limited-size here document to $tmp/defines.sed.
   echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
   # Speed up: don't consider the non `#define' lines.
-  echo '/^[    ]*#[    ]*define/!b' >>$CONFIG_STATUS
+  echo '/^[     ]*#[    ]*define/!b' >>$CONFIG_STATUS
   # Work around the forget-to-reset-the-flag bug.
   echo 't clr' >>$CONFIG_STATUS
   echo ': clr' >>$CONFIG_STATUS
@@ -9912,7 +21098,7 @@ do
   # Write a limited-size here document to $tmp/undefs.sed.
   echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
   # Speed up: don't consider the non `#undef'
-  echo '/^[    ]*#[    ]*undef/!b' >>$CONFIG_STATUS
+  echo '/^[     ]*#[    ]*undef/!b' >>$CONFIG_STATUS
   # Work around the forget-to-reset-the-flag bug.
   echo 't clr' >>$CONFIG_STATUS
   echo ': clr' >>$CONFIG_STATUS
@@ -9946,10 +21132,10 @@ echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`(dirname "$ac_file") 2>/dev/null ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -9965,10 +21151,10 @@ echo X"$ac_file" |
       as_dirs="$as_dir $as_dirs"
       as_dir=`(dirname "$as_dir") 2>/dev/null ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -9988,13 +21174,22 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
     cat $tmp/config.h
     rm -f $tmp/config.h
   fi
-_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
 echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
 $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X$ac_file : 'X\(//\)[^/]' \| \
-         X$ac_file : 'X\(//\)$' \| \
-         X$ac_file : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X$ac_file |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -10013,16 +21208,41 @@ for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
   ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
 $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_dest" : 'X\(//\)[^/]' \| \
-         X"$ac_dest" : 'X\(//\)$' \| \
-         X"$ac_dest" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$ac_dest" : 'X\(//\)[^/]' \| \
+        X"$ac_dest" : 'X\(//\)$' \| \
+        X"$ac_dest" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_dest" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
          /^X\(\/\/\)$/{ s//\1/; q; }
          /^X\(\/\).*/{ s//\1/; q; }
          s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
   ac_builddir=.
 
 if test "$ac_dir" != .; then
@@ -10048,12 +21268,45 @@ case $srcdir in
     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
     ac_top_srcdir=$ac_top_builddir$srcdir ;;
 esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
 
 
   { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
@@ -10071,10 +21324,10 @@ echo "$as_me: executing $ac_dest commands" >&6;}
   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
     dirpart=`(dirname "$mf") 2>/dev/null ||
 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$mf" : 'X\(//\)[^/]' \| \
-         X"$mf" : 'X\(//\)$' \| \
-         X"$mf" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -10084,36 +21337,30 @@ echo X"$mf" |
   else
     continue
   fi
-  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
-  # Extract the definition of DEP_FILES from the Makefile without
-  # running `make'.
-  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
   test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
   # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n -e '/^U = / s///p' < "$mf"`
-  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
-  # We invoke sed twice because it is the simplest approach to
-  # changing $(DEPDIR) to its actual value in the expansion.
-  for file in `sed -n -e '
-    /^DEP_FILES = .*\\\\$/ {
-      s/^DEP_FILES = //
-      :loop
-       s/\\\\$//
-       p
-       n
-       /\\\\$/ b loop
-      p
-    }
-    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
     # Make sure the directory exists.
     test -f "$dirpart/$file" && continue
     fdir=`(dirname "$file") 2>/dev/null ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$file" : 'X\(//\)[^/]' \| \
-         X"$file" : 'X\(//\)$' \| \
-         X"$file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -10129,10 +21376,10 @@ echo X"$file" |
       as_dirs="$as_dir $as_dirs"
       as_dir=`(dirname "$as_dir") 2>/dev/null ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$as_dir" : 'X\(//\)[^/]' \| \
-         X"$as_dir" : 'X\(//\)$' \| \
-         X"$as_dir" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| \
+        .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
          /^X\(\/\/\)[^/].*/{ s//\1/; q; }
index 3e3a6b82d4d99f91d569851ee69935b73e7c4cb3..3ce279893522cc582a88732d14e318875c9f24dd 100644 (file)
@@ -2,7 +2,10 @@
 # Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
 # COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 ##
-noinst_PROGRAMS = main
+noinst_PROGRAMS = main readSchema
 
 main_SOURCES = main.cpp
 main_LDADD = ../src/libldapcpp.la
+
+readSchema_SOURCES = readSchema.cpp
+readSchema_LDADD = ../src/libldapcpp.la
index 2c8914f3e38b75ca17dda82858b54dbdf4470d35..2920ff1e923679c729712b2c439aa77f9154eb6b 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
 # @configure_input@
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,6 +14,8 @@
 
 @SET_MAKE@
 
+SOURCES = $(main_SOURCES) $(readSchema_SOURCES)
+
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
@@ -21,7 +23,6 @@ pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 top_builddir = ..
-
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
@@ -35,11 +36,46 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 host_triplet = @host@
+noinst_PROGRAMS = main$(EXEEXT) readSchema$(EXEEXT)
+subdir = examples
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_main_OBJECTS = main.$(OBJEXT)
+main_OBJECTS = $(am_main_OBJECTS)
+main_DEPENDENCIES = ../src/libldapcpp.la
+am_readSchema_OBJECTS = readSchema.$(OBJEXT)
+readSchema_OBJECTS = $(am_readSchema_OBJECTS)
+readSchema_DEPENDENCIES = ../src/libldapcpp.la
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(main_SOURCES) $(readSchema_SOURCES)
+DIST_SOURCES = $(main_SOURCES) $(readSchema_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
+AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -50,6 +86,7 @@ CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CXX = @CXX@
+CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -61,6 +98,8 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -85,8 +124,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
 ac_ct_RANLIB = @ac_ct_RANLIB@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
@@ -94,7 +135,10 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
 am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
+am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -115,6 +159,7 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localstatedir = @localstatedir@
 mandir = @mandir@
+mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -122,50 +167,43 @@ sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-
-# Copyright 2003, OpenLDAP Foundation, All Rights Reserved.
-# COPYING RESTRICTIONS APPLY, see COPYRIGHT file
-noinst_PROGRAMS = main
-
 main_SOURCES = main.cpp
 main_LDADD = ../src/libldapcpp.la
-subdir = examples
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/src/config.h
-CONFIG_CLEAN_FILES =
-noinst_PROGRAMS = main$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
-
-am_main_OBJECTS = main.$(OBJEXT)
-main_OBJECTS = $(am_main_OBJECTS)
-main_DEPENDENCIES = ../src/libldapcpp.la
-main_LDFLAGS =
-
-DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)/src
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/main.Po
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(main_SOURCES)
-DIST_COMMON = Makefile.am Makefile.in
-SOURCES = $(main_SOURCES)
-
+readSchema_SOURCES = readSchema.cpp
+readSchema_LDADD = ../src/libldapcpp.la
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  examples/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --foreign  examples/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
 clean-noinstPROGRAMS:
        @list='$(noinst_PROGRAMS)'; for p in $$list; do \
@@ -176,50 +214,39 @@ clean-noinstPROGRAMS:
 main$(EXEEXT): $(main_OBJECTS) $(main_DEPENDENCIES) 
        @rm -f main$(EXEEXT)
        $(CXXLINK) $(main_LDFLAGS) $(main_OBJECTS) $(main_LDADD) $(LIBS)
+readSchema$(EXEEXT): $(readSchema_OBJECTS) $(readSchema_DEPENDENCIES) 
+       @rm -f readSchema$(EXEEXT)
+       $(CXXLINK) $(readSchema_LDFLAGS) $(readSchema_OBJECTS) $(readSchema_LDADD) $(LIBS)
 
 mostlyclean-compile:
-       -rm -f *.$(OBJEXT) core *.core
+       -rm -f *.$(OBJEXT)
 
 distclean-compile:
        -rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
-
-distclean-depend:
-       -rm -rf ./$(DEPDIR)
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readSchema.Po@am__quote@
 
 .cpp.o:
-@am__fastdepCXX_TRUE@  if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCXX_TRUE@    -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCXX_TRUE@  then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-@am__fastdepCXX_TRUE@  else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCXX_TRUE@  fi
+@am__fastdepCXX_TRUE@  if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@  then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
 
 .cpp.obj:
-@am__fastdepCXX_TRUE@  if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCXX_TRUE@    -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCXX_TRUE@  then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-@am__fastdepCXX_TRUE@  else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCXX_TRUE@  fi
+@am__fastdepCXX_TRUE@  if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@  then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .cpp.lo:
-@am__fastdepCXX_TRUE@  if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCXX_TRUE@    -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCXX_TRUE@  then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
-@am__fastdepCXX_TRUE@  else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCXX_TRUE@  fi
+@am__fastdepCXX_TRUE@  if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@  then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -231,14 +258,6 @@ distclean-libtool:
        -rm -f libtool
 uninstall-info-am:
 
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -247,6 +266,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
          $(AWK) '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
        mkid -fID $$unique
+tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
@@ -258,10 +278,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
          done | \
          $(AWK) '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
-       test -z "$(ETAGS_ARGS)$$tags$$unique" \
-         || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-            $$tags $$unique
-
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
@@ -284,10 +305,6 @@ GTAGS:
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
@@ -301,7 +318,7 @@ distdir: $(DISTFILES)
          dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
          if test "$$dir" != "$$file" && test "$$dir" != "."; then \
            dir="/$$dir"; \
-           $(mkinstalldirs) "$(distdir)$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
          else \
            dir=''; \
          fi; \
@@ -319,9 +336,7 @@ distdir: $(DISTFILES)
 check-am: all-am
 check: check-am
 all-am: Makefile $(PROGRAMS)
-
 installdirs:
-
 install: install-am
 install-exec: install-exec-am
 install-data: install-data-am
@@ -333,7 +348,7 @@ install-am: all-am
 installcheck: installcheck-am
 install-strip:
        $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         INSTALL_STRIP_FLAG=-s \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
@@ -341,7 +356,7 @@ mostlyclean-generic:
 clean-generic:
 
 distclean-generic:
-       -rm -f Makefile $(CONFIG_CLEAN_FILES)
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
@@ -352,14 +367,17 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
        mostlyclean-am
 
 distclean: distclean-am
-
-distclean-am: clean-am distclean-compile distclean-depend \
-       distclean-generic distclean-libtool distclean-tags
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
 
 dvi: dvi-am
 
 dvi-am:
 
+html: html-am
+
 info: info-am
 
 info-am:
@@ -375,7 +393,8 @@ install-man:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
@@ -395,15 +414,15 @@ uninstall-am: uninstall-info-am
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
        clean-libtool clean-noinstPROGRAMS ctags distclean \
-       distclean-compile distclean-depend distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am info \
-       info-am install install-am install-data install-data-am \
-       install-exec install-exec-am install-info install-info-am \
-       install-man install-strip installcheck installcheck-am \
-       installdirs maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-       uninstall-am uninstall-info-am
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-exec \
+       install-exec-am install-info install-info-am install-man \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-info-am
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/contrib/ldapc++/examples/readSchema.cpp b/contrib/ldapc++/examples/readSchema.cpp
new file mode 100644 (file)
index 0000000..483e503
--- /dev/null
@@ -0,0 +1,68 @@
+#include<iostream.h>
+#include<strstream>
+#include "LDAPConnection.h"
+#include "LDAPConstraints.h"
+#include "LDAPSearchReference.h"
+#include "LDAPSearchResults.h"
+#include "LDAPAttribute.h"
+#include "LDAPAttributeList.h"
+#include "LDAPEntry.h"
+#include "LDAPException.h"
+#include "LDAPModification.h"
+#include "LDAPReferralException.h"
+#include "LDAPSchema.h"
+
+#include"debug.h"
+
+int main(){
+    LDAPConnection *lc=new LDAPConnection("192.168.3.128",389);
+    cout << "----------------------doing bind...." <<  endl;
+    try{
+        lc->bind("uid=admin,dc=home,dc=local" , "secret");
+        cout << lc->getHost() << endl;
+        StringList tmp;
+        tmp.add("subschemasubentry");
+        LDAPSearchResults* entries = lc->search("", 
+                        LDAPConnection::SEARCH_BASE,
+                        "(objectClass=*)",
+                        tmp );
+        LDAPEntry* rootDse = entries->getNext();
+        std::string schemabase="cn=subschema";
+
+        if(rootDse){
+            const LDAPAttribute* schemaAttr = rootDse->getAttributes()->getAttributeByName("subschemaSubentry");
+            schemabase = *(schemaAttr->getValues().begin());   
+        }
+        StringList attrs;
+        attrs.add("objectClasses");
+        attrs.add("attributeTypes");
+        entries = lc->search(schemabase, LDAPConnection::SEARCH_BASE, "(objectClass=*)",
+                        attrs);
+        if (entries != 0){
+            LDAPEntry* entry = entries->getNext();
+            if(entry != 0){
+                const LDAPAttribute* oc = entry->getAttributes()->getAttributeByName("objectClasses");
+                LDAPSchema schema;
+                schema.setObjectClasses((oc->getValues()));
+                LDAPObjClass test = schema.getObjectClassByName("inetOrgPerson");
+                cout << test.getDesc() << endl;
+//                StringList mustAttr = test.getMay();
+//                for( StringList::const_iterator i = mustAttr.begin(); i != mustAttr.end(); i++ ){
+//                    cout << *i << endl;
+//                }
+                StringList sup = test.getSup();
+                for( StringList::const_iterator i = sup.begin(); i != sup.end(); i++ ){
+                    cout << *i << endl;
+                }
+            }
+        }
+        
+        lc->unbind();
+        delete lc;
+   }catch (LDAPException e){
+        cout << "------------------------- caught Exception ---------"<< endl;
+        cout << e << endl;
+    }
+
+}
+
index 47f816f2a90322b7a6a9ef02b8eca1fcfd108a45..3d0710108d7e04e74666de60bbb58914e779241a 100644 (file)
@@ -1,7 +1,7 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun configure.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
 # Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.14
+TIMESTAMP=" (1.1220.2.195 2005/02/12 12:12:33)"
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes.
+if test -n "${ZSH_VERSION+set}" ; then
+  setopt NO_GLOB_SUBST
+fi
+
 # Check that we have a working $echo.
 if test "X$1" = X--no-reexec; then
   # Discard the --no-reexec flag, and continue.
@@ -36,7 +64,7 @@ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
   :
 else
   # Restart under the correct shell, and then maybe $echo will work.
-  exec $SHELL "$0" --no-reexec ${1+"$@"}
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
 fi
 
 if test "X$1" = X--fallback-echo; then
@@ -45,19 +73,9 @@ if test "X$1" = X--fallback-echo; then
   cat <<EOF
 $*
 EOF
-  exit 0
+  exit $EXIT_SUCCESS
 fi
 
-# The name of this program.
-progname=`$echo "$0" | sed 's%^.*/%%'`
-modename="$progname"
-
-# Constants.
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=1.4.1
-TIMESTAMP=" (1.922.2.34 2001/09/03 01:22:13)"
-
 default_mode=
 help="Try \`$progname --help' for more information."
 magic="%%%MAGIC variable%%%"
@@ -67,10 +85,19 @@ rm="rm -f"
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
+Xsed="${SED}"' -e 1s/^X//'
 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-SP2NL='tr \040 \012'
-NL2SP='tr \015\012 \040\040'
+# test EBCDIC or ASCII
+case `echo A|tr A '\301'` in
+ A) # EBCDIC based system
+  SP2NL="tr '\100' '\n'"
+  NL2SP="tr '\r\n' '\100\100'"
+  ;;
+ *) # Assume ASCII based system
+  SP2NL="tr '\040' '\012'"
+  NL2SP="tr '\015\012' '\040\040'"
+  ;;
+esac
 
 # NLS nuisances.
 # Only set LANG and LC_ALL to C if already set.
@@ -84,10 +111,14 @@ if test "${LANG+set}" = set; then
   save_LANG="$LANG"; LANG=C; export LANG
 fi
 
+# Make sure IFS has a sensible default
+: ${IFS="      
+"}
+
 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-  echo "$modename: not configured to build any kind of library" 1>&2
-  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-  exit 1
+  $echo "$modename: not configured to build any kind of library" 1>&2
+  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit $EXIT_FAILURE
 fi
 
 # Global variables.
@@ -101,9 +132,250 @@ show_help=
 execute_dlfiles=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
+quote_scanset='[[~#^*{};<>?'"'"'       ]'
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 | \
+       sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+      if test "X$win32_nmres" = "Ximport" ; then
+        win32_libid_type="x86 archive import"
+      else
+        win32_libid_type="x86 archive static"
+      fi
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $echo $win32_libid_type
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+       case $arg in
+         *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+         arg="\"$arg\""
+         ;;
+       esac
+       CC_quoted="$CC_quoted $arg"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+       for z in $available_tags; do
+         if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+           # Evaluate the configuration.
+           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+           CC_quoted=
+           for arg in $CC; do
+           # Double-quote args containing other shell metacharacters.
+           case $arg in
+             *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+             arg="\"$arg\""
+             ;;
+           esac
+           CC_quoted="$CC_quoted $arg"
+         done
+           case "$@ " in
+             " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+             # The compiler in the base compile command matches
+             # the one in the tagged configuration.
+             # Assume this is the tagged configuration we want.
+             tagname=$z
+             break
+             ;;
+           esac
+         fi
+       done
+       # If $tagname still isn't set, then no tagged configuration
+       # was found and let the user know that the "--tag" command
+       # line option must be used.
+       if test -z "$tagname"; then
+         $echo "$modename: unable to infer tagged configuration"
+         $echo "$modename: specify a tag with \`--tag'" 1>&2
+         exit $EXIT_FAILURE
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+       fi
+       ;;
+      esac
+    fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    f_ex_an_ar_lib=`$echo "X$f_ex_an_ar_oldlib" | $Xsed -e 's%^.*/%%'`
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+      $show "cp $f_ex_an_ar_oldlib $f_ex_an_ar_dir/$f_ex_an_ar_lib"
+      $run eval "cp \$f_ex_an_ar_oldlib \$f_ex_an_ar_dir/\$f_ex_an_ar_lib"
+      $AR t "$f_ex_an_ar_oldlib" | sort | uniq -c \
+       | $EGREP -v '^[         ]*1[    ]' | while read count name
+      do
+       i=1
+       while test "$i" -le "$count"
+         do
+         # Put our $i before any first dot (extension)
+         # Never overwrite any file
+         name_to="$name"
+         while test "X$name_to" = "X$name" || test -f "$f_ex_an_ar_dir/$name_to"
+           do
+           name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+         done
+         $show "(cd $f_ex_an_ar_dir && $AR x  $f_ex_an_ar_lib '$name' && $mv '$name' '$name_to')"
+         $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_lib '$name' && $mv '$name' '$name_to' && $AR -d \$f_ex_an_ar_lib '$name')" || exit $?
+         i=`expr $i + 1`
+       done
+      done
+      $show "$rm $f_ex_an_ar_dir/$f_ex_an_ar_lib"
+      $run eval "$rm \$f_ex_an_ar_dir/\$f_ex_an_ar_lib"
+    fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+    my_status=""
+
+    $show "${rm}r $my_gentop"
+    $run ${rm}r "$my_gentop"
+    $show "$mkdir $my_gentop"
+    $run $mkdir "$my_gentop"
+    my_status=$?
+    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+      exit $my_status
+    fi
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+       [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+       *) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+      my_xdir="$my_gentop/$my_xlib"
+
+      $show "${rm}r $my_xdir"
+      $run ${rm}r "$my_xdir"
+      $show "$mkdir $my_xdir"
+      $run $mkdir "$my_xdir"
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
+       exit $status
+      fi
+      case $host in
+      *-darwin*)
+       $show "Extracting $my_xabs"
+       # Do not bother doing anything if just a dry run
+       if test -z "$run"; then
+         darwin_orig_dir=`pwd`
+         cd $my_xdir || exit $?
+         darwin_archive=$my_xabs
+         darwin_curdir=`pwd`
+         darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+         darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+         if test -n "$darwin_arches"; then 
+           darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+           darwin_arch=
+           $show "$darwin_base_archive has multiple architectures $darwin_arches"
+           for darwin_arch in  $darwin_arches ; do
+             mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+             cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+             cd "$darwin_curdir"
+             $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+           done # $darwin_arches
+      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+           darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+           darwin_file=
+           darwin_files=
+           for darwin_file in $darwin_filelist; do
+             darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+             lipo -create -output "$darwin_file" $darwin_files
+           done # $darwin_filelist
+           ${rm}r unfat-$$
+           cd "$darwin_orig_dir"
+         else
+           cd "$darwin_orig_dir"
+           func_extract_an_archive "$my_xdir" "$my_xabs"
+         fi # $darwin_arches
+       fi # $run
+      ;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+    func_extract_archives_result="$my_oldobjs"
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
 
 # Parse our command line options once, thoroughly.
-while test $# -gt 0
+while test "$#" -gt 0
 do
   arg="$1"
   shift
@@ -119,6 +391,34 @@ do
     execute_dlfiles)
       execute_dlfiles="$execute_dlfiles $arg"
       ;;
+    tag)
+      tagname="$arg"
+      preserve_args="${preserve_args}=$arg"
+
+      # Check whether tagname contains only valid characters
+      case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+       $echo "$progname: invalid tag name: $tagname" 1>&2
+       exit $EXIT_FAILURE
+       ;;
+      esac
+
+      case $tagname in
+      CC)
+       # Don't test for the "default" C tag, as we know, it's there, but
+       # not specially marked.
+       ;;
+      *)
+       if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+         taglist="$taglist $tagname"
+         # Evaluate the configuration.
+         eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+       else
+         $echo "$progname: ignoring unknown tag $tagname" 1>&2
+       fi
+       ;;
+      esac
+      ;;
     *)
       eval "$prev=\$arg"
       ;;
@@ -136,18 +436,27 @@ do
     ;;
 
   --version)
-    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
-    exit 0
+    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    $echo
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
+    $echo "This is free software; see the source for copying conditions.  There is NO"
+    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    exit $?
     ;;
 
   --config)
-    sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
-    exit 0
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+    done
+    exit $?
     ;;
 
   --debug)
-    echo "$progname: enabling shell trace mode"
+    $echo "$progname: enabling shell trace mode"
     set -x
+    preserve_args="$preserve_args $arg"
     ;;
 
   --dry-run | -n)
@@ -155,18 +464,18 @@ do
     ;;
 
   --features)
-    echo "host: $host"
+    $echo "host: $host"
     if test "$build_libtool_libs" = yes; then
-      echo "enable shared libraries"
+      $echo "enable shared libraries"
     else
-      echo "disable shared libraries"
+      $echo "disable shared libraries"
     fi
     if test "$build_old_libs" = yes; then
-      echo "enable static libraries"
+      $echo "enable static libraries"
     else
-      echo "disable static libraries"
+      $echo "disable static libraries"
     fi
-    exit 0
+    exit $?
     ;;
 
   --finish) mode="finish" ;;
@@ -174,8 +483,19 @@ do
   --mode) prevopt="--mode" prev=mode ;;
   --mode=*) mode="$optarg" ;;
 
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
   --quiet | --silent)
     show=:
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --tag) prevopt="--tag" prev=tag ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    preserve_args="$preserve_args --tag"
     ;;
 
   -dlopen)
@@ -186,7 +506,7 @@ do
   -*)
     $echo "$modename: unrecognized option \`$arg'" 1>&2
     $echo "$help" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
     ;;
 
   *)
@@ -199,7 +519,7 @@ done
 if test -n "$prevopt"; then
   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
   $echo "$help" 1>&2
-  exit 1
+  exit $EXIT_FAILURE
 fi
 
 # If this variable is set in any of the actions, the command in it
@@ -211,8 +531,10 @@ if test -z "$show_help"; then
 
   # Infer the operation mode.
   if test -z "$mode"; then
+    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
     case $nonopt in
-    *cc | *++ | gcc* | *-gcc*)
+    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
       mode=link
       for arg
       do
@@ -253,7 +575,7 @@ if test -z "$show_help"; then
   if test -n "$execute_dlfiles" && test "$mode" != execute; then
     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
     $echo "$help" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
   fi
 
   # Change the help message to a mode-specific one.
@@ -267,158 +589,127 @@ if test -z "$show_help"; then
     modename="$modename: compile"
     # Get the compilation command and the source file.
     base_compile=
-    prev=
-    lastarg=
-    srcfile="$nonopt"
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
     suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
 
-    user_target=no
     for arg
     do
-      case $prev in
-      "") ;;
-      xcompiler)
-       # Aesthetically quote the previous argument.
-       prev=
-       lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-
-       case $arg in
-       # Double-quote args containing other shell metacharacters.
-       # Many Bourne shells cannot handle close brackets correctly
-       # in scan sets, so we specify it separately.
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
-         arg="\"$arg\""
-         ;;
-       esac
+      case "$arg_mode" in
+      arg  )
+       # do not "continue".  Instead, add this to base_compile
+       lastarg="$arg"
+       arg_mode=normal
+       ;;
 
-       # Add the previous argument to base_compile.
-       if test -z "$base_compile"; then
-         base_compile="$lastarg"
-       else
-         base_compile="$base_compile $lastarg"
-       fi
+      target )
+       libobj="$arg"
+       arg_mode=normal
        continue
        ;;
-      esac
 
-      # Accept any command-line options.
-      case $arg in
-      -o)
-       if test "$user_target" != "no"; then
-         $echo "$modename: you cannot specify \`-o' more than once" 1>&2
-         exit 1
-       fi
-       user_target=next
-       ;;
+      normal )
+       # Accept any command-line options.
+       case $arg in
+       -o)
+         if test -n "$libobj" ; then
+           $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+           exit $EXIT_FAILURE
+         fi
+         arg_mode=target
+         continue
+         ;;
 
-      -static)
-       build_old_libs=yes
-       continue
-       ;;
+       -static | -prefer-pic | -prefer-non-pic)
+         later="$later $arg"
+         continue
+         ;;
 
-      -prefer-pic)
-       pic_mode=yes
-       continue
-       ;;
+       -no-suppress)
+         suppress_opt=no
+         continue
+         ;;
 
-      -prefer-non-pic)
-       pic_mode=no
-       continue
-       ;;
+       -Xcompiler)
+         arg_mode=arg  #  the next one goes into the "base_compile" arg list
+         continue      #  The current "srcfile" will either be retained or
+         ;;            #  replaced later.  I would guess that would be a bug.
 
-      -Xcompiler)
-       prev=xcompiler
-       continue
-       ;;
+       -Wc,*)
+         args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+         lastarg=
+         save_ifs="$IFS"; IFS=','
+         for arg in $args; do
+           IFS="$save_ifs"
 
-      -Wc,*)
-       args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
-       lastarg=
-       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
-       for arg in $args; do
+           # Double-quote args containing other shell metacharacters.
+           # Many Bourne shells cannot handle close brackets correctly
+           # in scan sets, so we specify it separately.
+           case $arg in
+             *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+             arg="\"$arg\""
+             ;;
+           esac
+           lastarg="$lastarg $arg"
+         done
          IFS="$save_ifs"
+         lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
 
-         # Double-quote args containing other shell metacharacters.
-         # Many Bourne shells cannot handle close brackets correctly
-         # in scan sets, so we specify it separately.
-         case $arg in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
-           arg="\"$arg\""
-           ;;
-         esac
-         lastarg="$lastarg $arg"
-       done
-       IFS="$save_ifs"
-       lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
-
-       # Add the arguments to base_compile.
-       if test -z "$base_compile"; then
-         base_compile="$lastarg"
-       else
+         # Add the arguments to base_compile.
          base_compile="$base_compile $lastarg"
-       fi
-       continue
-       ;;
-      esac
+         continue
+         ;;
 
-      case $user_target in
-      next)
-       # The next one is the -o target name
-       user_target=yes
-       continue
-       ;;
-      yes)
-       # We got the output file
-       user_target=set
-       libobj="$arg"
-       continue
+       * )
+         # Accept the current argument as the source file.
+         # The previous "srcfile" becomes the current argument.
+         #
+         lastarg="$srcfile"
+         srcfile="$arg"
+         ;;
+       esac  #  case $arg
        ;;
-      esac
-
-      # Accept the current argument as the source file.
-      lastarg="$srcfile"
-      srcfile="$arg"
+      esac    #  case $arg_mode
 
       # Aesthetically quote the previous argument.
-
-      # Backslashify any backslashes, double quotes, and dollar signs.
-      # These are the only characters that are still specially
-      # interpreted inside of double-quoted scrings.
       lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
 
+      case $lastarg in
       # Double-quote args containing other shell metacharacters.
       # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      case $lastarg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        lastarg="\"$lastarg\""
        ;;
       esac
 
-      # Add the previous argument to base_compile.
-      if test -z "$base_compile"; then
-       base_compile="$lastarg"
-      else
-       base_compile="$base_compile $lastarg"
-      fi
-    done
+      base_compile="$base_compile $lastarg"
+    done # for arg
 
-    case $user_target in
-    set)
+    case $arg_mode in
+    arg)
+      $echo "$modename: you must specify an argument for -Xcompile"
+      exit $EXIT_FAILURE
       ;;
-    no)
-      # Get the name of the library object.
-      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+    target)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit $EXIT_FAILURE
       ;;
     *)
-      $echo "$modename: you must specify a target with \`-o'" 1>&2
-      exit 1
+      # Get the name of the library object.
+      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
       ;;
     esac
 
     # Recognize several different file suffixes.
     # If the user specifies -o file.o, it is replaced with file.lo
-    xform='[cCFSfmso]'
+    xform='[cCFSifmso]'
     case $libobj in
     *.ada) xform=ada ;;
     *.adb) xform=adb ;;
@@ -426,10 +717,13 @@ if test -z "$show_help"; then
     *.asm) xform=asm ;;
     *.c++) xform=c++ ;;
     *.cc) xform=cc ;;
+    *.ii) xform=ii ;;
+    *.class) xform=class ;;
     *.cpp) xform=cpp ;;
     *.cxx) xform=cxx ;;
     *.f90) xform=f90 ;;
     *.for) xform=for ;;
+    *.java) xform=java ;;
     esac
 
     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@@ -438,25 +732,55 @@ if test -z "$show_help"; then
     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
     *)
       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
       ;;
     esac
 
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -static)
+       build_old_libs=yes
+       continue
+       ;;
+
+      -prefer-pic)
+       pic_mode=yes
+       continue
+       ;;
+
+      -prefer-non-pic)
+       pic_mode=no
+       continue
+       ;;
+      esac
+    done
+
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
     if test -z "$base_compile"; then
       $echo "$modename: you must specify a compilation command" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     # Delete any leftover library objects.
     if test "$build_old_libs" = yes; then
-      removelist="$obj $libobj"
+      removelist="$obj $lobj $libobj ${libobj}T"
     else
-      removelist="$libobj"
+      removelist="$lobj $libobj ${libobj}T"
     fi
 
     $run $rm $removelist
-    trap "$run $rm $removelist; exit 1" 1 2 15
+    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
 
     # On Cygwin there's no "real" PIC flag so we must build both object types
     case $host_os in
@@ -464,7 +788,7 @@ if test -z "$show_help"; then
       pic_mode=default
       ;;
     esac
-    if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
       # non-PIC code in shared libraries is not supported
       pic_mode=default
     fi
@@ -475,8 +799,9 @@ if test -z "$show_help"; then
       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
       lockfile="$output_obj.lock"
       removelist="$removelist $output_obj $lockfile"
-      trap "$run $rm $removelist; exit 1" 1 2 15
+      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
     else
+      output_obj=
       need_locks=no
       lockfile=
     fi
@@ -484,13 +809,13 @@ if test -z "$show_help"; then
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
     if test "$need_locks" = yes; then
-      until $run ln "$0" "$lockfile" 2>/dev/null; do
+      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
        $show "Waiting for $lockfile to be removed"
        sleep 2
       done
     elif test "$need_locks" = warn; then
       if test -f "$lockfile"; then
-       echo "\
+       $echo "\
 *** ERROR, $lockfile exists and contains:
 `cat $lockfile 2>/dev/null`
 
@@ -502,68 +827,67 @@ avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
        $run $rm $removelist
-       exit 1
+       exit $EXIT_FAILURE
       fi
-      echo $srcfile > "$lockfile"
+      $echo $srcfile > "$lockfile"
     fi
 
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
     fi
 
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
     # Only build a PIC object if we are building libtool libraries.
     if test "$build_libtool_libs" = yes; then
       # Without this assignment, base_compile gets emptied.
       fbsd_hideous_sh_bug=$base_compile
 
       if test "$pic_mode" != no; then
-       # All platforms use -DPIC, to notify preprocessed assembler code.
-       command="$base_compile $srcfile $pic_flag -DPIC"
+       command="$base_compile $srcfile $pic_flag"
       else
        # Don't build PIC code
        command="$base_compile $srcfile"
       fi
-      if test "$build_old_libs" = yes; then
-       lo_libobj="$libobj"
-       dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
-       if test "X$dir" = "X$libobj"; then
-         dir="$objdir"
-       else
-         dir="$dir/$objdir"
-       fi
-       libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
 
-       if test -d "$dir"; then
-         $show "$rm $libobj"
-         $run $rm $libobj
-       else
-         $show "$mkdir $dir"
-         $run $mkdir $dir
-         status=$?
-         if test $status -ne 0 && test ! -d $dir; then
-           exit $status
-         fi
+      if test ! -d "${xdir}$objdir"; then
+       $show "$mkdir ${xdir}$objdir"
+       $run $mkdir ${xdir}$objdir
+       status=$?
+       if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+         exit $status
        fi
       fi
-      if test "$compiler_o_lo" = yes; then
-       output_obj="$libobj"
-       command="$command -o $output_obj"
-      elif test "$compiler_c_o" = yes; then
-       output_obj="$obj"
-       command="$command -o $output_obj"
+
+      if test -z "$output_obj"; then
+       # Place PIC objects in $objdir
+       command="$command -o $lobj"
       fi
 
-      $run $rm "$output_obj"
+      $run $rm "$lobj" "$output_obj"
+
       $show "$command"
       if $run eval "$command"; then :
       else
        test -n "$output_obj" && $run $rm $removelist
-       exit 1
+       exit $EXIT_FAILURE
       fi
 
       if test "$need_locks" = warn &&
-        test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
-       echo "\
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $echo "\
 *** ERROR, $lockfile contains:
 `cat $lockfile 2>/dev/null`
 
@@ -578,13 +902,13 @@ avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
        $run $rm $removelist
-       exit 1
+       exit $EXIT_FAILURE
       fi
 
       # Just move the object if needed, then go on to compile the next one
-      if test x"$output_obj" != x"$libobj"; then
-       $show "$mv $output_obj $libobj"
-       if $run $mv $output_obj $libobj; then :
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+       $show "$mv $output_obj $lobj"
+       if $run $mv $output_obj $lobj; then :
        else
          error=$?
          $run $rm $removelist
@@ -592,48 +916,23 @@ compiler."
        fi
       fi
 
-      # If we have no pic_flag, then copy the object into place and finish.
-      if (test -z "$pic_flag" || test "$pic_mode" != default) &&
-        test "$build_old_libs" = yes; then
-       # Rename the .lo from within objdir to obj
-       if test -f $obj; then
-         $show $rm $obj
-         $run $rm $obj
-       fi
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
 
-       $show "$mv $libobj $obj"
-       if $run $mv $libobj $obj; then :
-       else
-         error=$?
-         $run $rm $removelist
-         exit $error
-       fi
+EOF
 
-       xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-       if test "X$xdir" = "X$obj"; then
-         xdir="."
-       else
-         xdir="$xdir"
-       fi
-       baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
-       libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
-       # Now arrange that obj and lo_libobj become the same file
-       $show "(cd $xdir && $LN_S $baseobj $libobj)"
-       if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
-         # Unlock the critical section if it was locked
-         if test "$need_locks" != no; then
-           $run $rm "$lockfile"
-         fi
-         exit 0
-       else
-         error=$?
-         $run $rm $removelist
-         exit $error
-       fi
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+        suppress_output=' >/dev/null 2>&1'
       fi
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
 
-      # Allow error messages only from the first compilation.
-      suppress_output=' >/dev/null 2>&1'
+EOF
     fi
 
     # Only build a position-dependent object if we build old libraries.
@@ -642,27 +941,25 @@ compiler."
        # Don't build PIC code
        command="$base_compile $srcfile"
       else
-       # All platforms use -DPIC, to notify preprocessed assembler code.
-       command="$base_compile $srcfile $pic_flag -DPIC"
+       command="$base_compile $srcfile $pic_flag"
       fi
       if test "$compiler_c_o" = yes; then
        command="$command -o $obj"
-       output_obj="$obj"
       fi
 
       # Suppress compiler output if we already did a PIC compilation.
       command="$command$suppress_output"
-      $run $rm "$output_obj"
+      $run $rm "$obj" "$output_obj"
       $show "$command"
       if $run eval "$command"; then :
       else
        $run $rm $removelist
-       exit 1
+       exit $EXIT_FAILURE
       fi
 
       if test "$need_locks" = warn &&
-        test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
-       echo "\
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $echo "\
 *** ERROR, $lockfile contains:
 `cat $lockfile 2>/dev/null`
 
@@ -677,11 +974,11 @@ avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
        $run $rm $removelist
-       exit 1
+       exit $EXIT_FAILURE
       fi
 
       # Just move the object if needed
-      if test x"$output_obj" != x"$obj"; then
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
        $show "$mv $output_obj $obj"
        if $run $mv $output_obj $obj; then :
        else
@@ -691,29 +988,31 @@ compiler."
        fi
       fi
 
-      # Create an invalid libtool object if no PIC, so that we do not
-      # accidentally link it into a program.
-      if test "$build_libtool_libs" != yes; then
-       $show "echo timestamp > $libobj"
-       $run eval "echo timestamp > \$libobj" || exit $?
-      else
-       # Move the .lo from within objdir
-       $show "$mv $libobj $lo_libobj"
-       if $run $mv $libobj $lo_libobj; then :
-       else
-         error=$?
-         $run $rm $removelist
-         exit $error
-       fi
-      fi
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
     fi
 
+    $run $mv "${libobj}T" "${libobj}"
+
     # Unlock the critical section if it was locked
     if test "$need_locks" != no; then
       $run $rm "$lockfile"
     fi
 
-    exit 0
+    exit $EXIT_SUCCESS
     ;;
 
   # libtool link mode
@@ -724,7 +1023,7 @@ compiler."
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
       # which system we are compiling for in order to pass an extra
-      # flag for every libtool invokation.
+      # flag for every libtool invocation.
       # allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
@@ -739,6 +1038,7 @@ compiler."
       ;;
     esac
     libtool_args="$nonopt"
+    base_compile="$nonopt $@"
     compile_command="$nonopt"
     finalize_command="$nonopt"
 
@@ -754,6 +1054,7 @@ compiler."
     linker_flags=
     dllsearchpath=
     lib_search_path=`pwd`
+    inst_prefix_dir=
 
     avoid_version=no
     dlfiles=
@@ -768,6 +1069,8 @@ compiler."
     module=no
     no_install=no
     objs=
+    non_pic_objects=
+    precious_files_regex=
     prefer_static_libs=no
     preload=no
     prev=
@@ -779,6 +1082,9 @@ compiler."
     temp_rpath=
     thread_safe=no
     vinfo=
+    vinfo_number=no
+
+    func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
     for arg
@@ -809,11 +1115,11 @@ compiler."
     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
 
     # Go through the arguments, transforming them on the way.
-    while test $# -gt 0; do
+    while test "$#" -gt 0; do
       arg="$1"
       shift
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
        ;;
       *) qarg=$arg ;;
@@ -874,7 +1180,7 @@ compiler."
          export_symbols="$arg"
          if test ! -f "$arg"; then
            $echo "$modename: symbol file \`$arg' does not exist"
-           exit 1
+           exit $EXIT_FAILURE
          fi
          prev=
          continue
@@ -884,18 +1190,135 @@ compiler."
          prev=
          continue
          ;;
+       inst_prefix)
+         inst_prefix_dir="$arg"
+         prev=
+         continue
+         ;;
+       precious_regex)
+         precious_files_regex="$arg"
+         prev=
+         continue
+         ;;
        release)
          release="-$arg"
          prev=
          continue
          ;;
+       objectlist)
+         if test -f "$arg"; then
+           save_arg=$arg
+           moreargs=
+           for fil in `cat $save_arg`
+           do
+#            moreargs="$moreargs $fil"
+             arg=$fil
+             # A libtool-controlled object.
+
+             # Check to see that this really is a libtool object.
+             if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+               pic_object=
+               non_pic_object=
+
+               # Read the .lo file
+               # If there is no directory component, then add one.
+               case $arg in
+               */* | *\\*) . $arg ;;
+               *) . ./$arg ;;
+               esac
+
+               if test -z "$pic_object" || \
+                  test -z "$non_pic_object" ||
+                  test "$pic_object" = none && \
+                  test "$non_pic_object" = none; then
+                 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+                 exit $EXIT_FAILURE
+               fi
+
+               # Extract subdirectory from the argument.
+               xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+               if test "X$xdir" = "X$arg"; then
+                 xdir=
+               else
+                 xdir="$xdir/"
+               fi
+
+               if test "$pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 pic_object="$xdir$pic_object"
+
+                 if test "$prev" = dlfiles; then
+                   if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+                     dlfiles="$dlfiles $pic_object"
+                     prev=
+                     continue
+                   else
+                     # If libtool objects are unsupported, then we need to preload.
+                     prev=dlprefiles
+                   fi
+                 fi
+
+                 # CHECK ME:  I think I busted this.  -Ossama
+                 if test "$prev" = dlprefiles; then
+                   # Preload the old-style object.
+                   dlprefiles="$dlprefiles $pic_object"
+                   prev=
+                 fi
+
+                 # A PIC object.
+                 libobjs="$libobjs $pic_object"
+                 arg="$pic_object"
+               fi
+
+               # Non-PIC object.
+               if test "$non_pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 non_pic_object="$xdir$non_pic_object"
+
+                 # A standard non-PIC object
+                 non_pic_objects="$non_pic_objects $non_pic_object"
+                 if test -z "$pic_object" || test "$pic_object" = none ; then
+                   arg="$non_pic_object"
+                 fi
+               fi
+             else
+               # Only an error if not doing a dry-run.
+               if test -z "$run"; then
+                 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+                 exit $EXIT_FAILURE
+               else
+                 # Dry-run case.
+
+                 # Extract subdirectory from the argument.
+                 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+                 if test "X$xdir" = "X$arg"; then
+                   xdir=
+                 else
+                   xdir="$xdir/"
+                 fi
+
+                 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+                 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+                 libobjs="$libobjs $pic_object"
+                 non_pic_objects="$non_pic_objects $non_pic_object"
+               fi
+             fi
+           done
+         else
+           $echo "$modename: link input file \`$save_arg' does not exist"
+           exit $EXIT_FAILURE
+         fi
+         arg=$save_arg
+         prev=
+         continue
+         ;;
        rpath | xrpath)
          # We need an absolute path.
          case $arg in
          [\\/]* | [A-Za-z]:[\\/]*) ;;
          *)
            $echo "$modename: only absolute run-paths are allowed" 1>&2
-           exit 1
+           exit $EXIT_FAILURE
            ;;
          esac
          if test "$prev" = rpath; then
@@ -927,13 +1350,31 @@ compiler."
          finalize_command="$finalize_command $wl$qarg"
          continue
          ;;
+       xcclinker)
+         linker_flags="$linker_flags $qarg"
+         compiler_flags="$compiler_flags $qarg"
+         prev=
+         compile_command="$compile_command $qarg"
+         finalize_command="$finalize_command $qarg"
+         continue
+         ;;
+       shrext)
+         shrext_cmds="$arg"
+         prev=
+         continue
+         ;;
+        darwin_framework)
+         compiler_flags="$compiler_flags $arg"
+         prev=
+         continue
+         ;;
        *)
          eval "$prev=\"\$arg\""
          prev=
          continue
          ;;
        esac
-      fi # test -n $prev
+      fi # test -n "$prev"
 
       prevarg="$arg"
 
@@ -975,7 +1416,7 @@ compiler."
       -export-symbols | -export-symbols-regex)
        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
          $echo "$modename: more than one -exported-symbols argument is not allowed"
-         exit 1
+         exit $EXIT_FAILURE
        fi
        if test "X$arg" = "X-export-symbols"; then
          prev=expsyms
@@ -985,11 +1426,22 @@ compiler."
        continue
        ;;
 
+      -framework)
+        prev=darwin_framework
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
+      -inst-prefix-dir)
+       prev=inst_prefix
+       continue
+       ;;
+
       # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
       # so, if we see these flags be careful not to treat them like -L
       -L[A-Z][A-Z]*:*)
        case $with_gcc/$host in
-       no/*-*-irix*)
+       no/*-*-irix* | /*-*-irix*)
          compile_command="$compile_command $arg"
          finalize_command="$finalize_command $arg"
          ;;
@@ -1006,7 +1458,7 @@ compiler."
          absdir=`cd "$dir" && pwd`
          if test -z "$absdir"; then
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-           exit 1
+           exit $EXIT_FAILURE
          fi
          dir="$absdir"
          ;;
@@ -1040,29 +1492,78 @@ compiler."
            # These systems don't actually have a C library (as such)
            test "X$arg" = "X-lc" && continue
            ;;
-         *-*-openbsd*)
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
            # Do not include libc due to us having libc/libc_r.
            test "X$arg" = "X-lc" && continue
            ;;
-         esac
-        fi
-        if test "X$arg" = "X-lc_r"; then
-         case $host in
-         *-*-openbsd*)
-           # Do not include libc_r directly, use -pthread flag.
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C and math libraries are in the System framework
+           deplibs="$deplibs -framework System"
            continue
-           ;;
          esac
+       elif test "X$arg" = "X-lc_r"; then
+        case $host in
+        *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+          # Do not include libc_r directly, use -pthread flag.
+          continue
+          ;;
+        esac
        fi
        deplibs="$deplibs $arg"
        continue
        ;;
 
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+       compile_command="$compile_command $arg"
+       compiler_flags="$compiler_flags $arg"
+       finalize_command="$finalize_command $arg"
+       prev=xcompiler
+       continue
+       ;;
+
+     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+       compiler_flags="$compiler_flags $arg"
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
+       continue
+       ;;
+
       -module)
        module=yes
        continue
        ;;
 
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+       case $arg in
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+         arg="\"$arg\""
+         ;;
+       esac
+        compile_command="$compile_command $arg"
+        finalize_command="$finalize_command $arg"
+        if test "$with_gcc" = "yes" ; then
+          compiler_flags="$compiler_flags $arg"
+        fi
+        continue
+        ;;
+
+      -shrext)
+       prev=shrext
+       continue
+       ;;
+
       -no-fast-install)
        fast_install=no
        continue
@@ -1087,8 +1588,18 @@ compiler."
        continue
        ;;
 
+      -objectlist)
+       prev=objectlist
+       continue
+       ;;
+
       -o) prev=output ;;
 
+      -precious-files-regex)
+       prev=precious_regex
+       continue
+       ;;
+
       -release)
        prev=release
        continue
@@ -1111,7 +1622,7 @@ compiler."
        [\\/]* | [A-Za-z]:[\\/]*) ;;
        *)
          $echo "$modename: only absolute run-paths are allowed" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
          ;;
        esac
        case "$xrpath " in
@@ -1139,15 +1650,20 @@ compiler."
        prev=vinfo
        continue
        ;;
+      -version-number)
+       prev=vinfo
+       vinfo_number=yes
+       continue
+       ;;
 
       -Wc,*)
        args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
        arg=
-       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
+       save_ifs="$IFS"; IFS=','
        for flag in $args; do
          IFS="$save_ifs"
          case $flag in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
            flag="\"$flag\""
            ;;
          esac
@@ -1161,11 +1677,11 @@ compiler."
       -Wl,*)
        args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
        arg=
-       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
+       save_ifs="$IFS"; IFS=','
        for flag in $args; do
          IFS="$save_ifs"
          case $flag in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
            flag="\"$flag\""
            ;;
          esac
@@ -1187,41 +1703,118 @@ compiler."
        continue
        ;;
 
+      -XCClinker)
+       prev=xcclinker
+       continue
+       ;;
+
       # Some other compiler flag.
       -* | +*)
        # Unknown arguments in both finalize_command and compile_command need
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case $arg in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
        ;;
 
-      *.lo | *.$objext)
-       # A library or standard object.
-       if test "$prev" = dlfiles; then
-         # This file was specified with -dlopen.
-         if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-           dlfiles="$dlfiles $arg"
-           prev=
-           continue
-         else
-           # If libtool objects are unsupported, then we need to preload.
-           prev=dlprefiles
-         fi
-       fi
+      *.$objext)
+       # A standard object.
+       objs="$objs $arg"
+       ;;
 
-       if test "$prev" = dlprefiles; then
-         # Preload the old-style object.
-         dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
-         prev=
-       else
+      *.lo)
+       # A libtool-controlled object.
+
+       # Check to see that this really is a libtool object.
+       if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+         pic_object=
+         non_pic_object=
+
+         # Read the .lo file
+         # If there is no directory component, then add one.
          case $arg in
-         *.lo) libobjs="$libobjs $arg" ;;
-         *) objs="$objs $arg" ;;
+         */* | *\\*) . $arg ;;
+         *) . ./$arg ;;
          esac
+
+         if test -z "$pic_object" || \
+            test -z "$non_pic_object" ||
+            test "$pic_object" = none && \
+            test "$non_pic_object" = none; then
+           $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+           exit $EXIT_FAILURE
+         fi
+
+         # Extract subdirectory from the argument.
+         xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+         if test "X$xdir" = "X$arg"; then
+           xdir=
+         else
+           xdir="$xdir/"
+         fi
+
+         if test "$pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           pic_object="$xdir$pic_object"
+
+           if test "$prev" = dlfiles; then
+             if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+               dlfiles="$dlfiles $pic_object"
+               prev=
+               continue
+             else
+               # If libtool objects are unsupported, then we need to preload.
+               prev=dlprefiles
+             fi
+           fi
+
+           # CHECK ME:  I think I busted this.  -Ossama
+           if test "$prev" = dlprefiles; then
+             # Preload the old-style object.
+             dlprefiles="$dlprefiles $pic_object"
+             prev=
+           fi
+
+           # A PIC object.
+           libobjs="$libobjs $pic_object"
+           arg="$pic_object"
+         fi
+
+         # Non-PIC object.
+         if test "$non_pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           non_pic_object="$xdir$non_pic_object"
+
+           # A standard non-PIC object
+           non_pic_objects="$non_pic_objects $non_pic_object"
+           if test -z "$pic_object" || test "$pic_object" = none ; then
+             arg="$non_pic_object"
+           fi
+         fi
+       else
+         # Only an error if not doing a dry-run.
+         if test -z "$run"; then
+           $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+           exit $EXIT_FAILURE
+         else
+           # Dry-run case.
+
+           # Extract subdirectory from the argument.
+           xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+           if test "X$xdir" = "X$arg"; then
+             xdir=
+           else
+             xdir="$xdir/"
+           fi
+
+           pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+           non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+           libobjs="$libobjs $pic_object"
+           non_pic_objects="$non_pic_objects $non_pic_object"
+         fi
        fi
        ;;
 
@@ -1255,7 +1848,7 @@ compiler."
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case $arg in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -1272,7 +1865,7 @@ compiler."
     if test -n "$prev"; then
       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
@@ -1281,6 +1874,7 @@ compiler."
       finalize_command="$finalize_command $arg"
     fi
 
+    oldlibs=
     # calculate the name of the file, without its directory
     outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
     libobjs_save="$libobjs"
@@ -1301,11 +1895,11 @@ compiler."
       output_objdir="$output_objdir/$objdir"
     fi
     # Create the object directory.
-    if test ! -d $output_objdir; then
+    if test ! -d "$output_objdir"; then
       $show "$mkdir $output_objdir"
       $run $mkdir $output_objdir
       status=$?
-      if test $status -ne 0 && test ! -d $output_objdir; then
+      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
        exit $status
       fi
     fi
@@ -1315,7 +1909,7 @@ compiler."
     "")
       $echo "$modename: you must specify an output file" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
       ;;
     *.$libext) linkmode=oldlib ;;
     *.lo | *.$objext) linkmode=obj ;;
@@ -1323,16 +1917,47 @@ compiler."
     *) linkmode=prog ;; # Anything else should be a program.
     esac
 
+    case $host in
+    *cygwin* | *mingw* | *pw32*)
+      # don't eliminate duplications in $postdeps and $predeps
+      duplicate_compiler_generated_deps=yes
+      ;;
+    *)
+      duplicate_compiler_generated_deps=$duplicate_deps
+      ;;
+    esac
     specialdeplibs=
+
     libs=
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      case "$libs " in
-      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-      esac
+      if test "X$duplicate_deps" = "Xyes" ; then
+       case "$libs " in
+       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+       esac
+      fi
       libs="$libs $deplib"
     done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+       for pre_post_dep in $predeps $postdeps; do
+         case "$pre_post_deps " in
+         *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+         esac
+         pre_post_deps="$pre_post_deps $pre_post_dep"
+       done
+      fi
+      pre_post_deps=
+    fi
+
     deplibs=
     newdependency_libs=
     newlib_search_path=
@@ -1347,7 +1972,7 @@ compiler."
          *.la) ;;
          *)
            $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
-           exit 1
+           exit $EXIT_FAILURE
            ;;
          esac
        done
@@ -1364,39 +1989,55 @@ compiler."
        ;;
     esac
     for pass in $passes; do
-      if test $linkmode = prog; then
-       # Determine which files to process
+      if test "$linkmode,$pass" = "lib,link" ||
+        test "$linkmode,$pass" = "prog,scan"; then
+       libs="$deplibs"
+       deplibs=
+      fi
+      if test "$linkmode" = prog; then
        case $pass in
-       dlopen)
-         libs="$dlfiles"
-         save_deplibs="$deplibs" # Collect dlpreopened libraries
-         deplibs=
-         ;;
+       dlopen) libs="$dlfiles" ;;
        dlpreopen) libs="$dlprefiles" ;;
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
        esac
       fi
+      if test "$pass" = dlopen; then
+       # Collect dlpreopened libraries
+       save_deplibs="$deplibs"
+       deplibs=
+      fi
       for deplib in $libs; do
        lib=
        found=no
        case $deplib in
-       -l*)
-         if test $linkmode = oldlib && test $linkmode = obj; then
-           $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
-           continue
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+         if test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           compiler_flags="$compiler_flags $deplib"
          fi
-         if test $pass = conv; then
-           deplibs="$deplib $deplibs"
+         continue
+         ;;
+       -l*)
+         if test "$linkmode" != lib && test "$linkmode" != prog; then
+           $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
            continue
          fi
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
-           # Search the libtool library
-           lib="$searchdir/lib${name}.la"
-           if test -f "$lib"; then
-             found=yes
-             break
-           fi
+           for search_ext in .la $std_shrext .so .a; do
+             # Search the libtool library
+             lib="$searchdir/lib${name}${search_ext}"
+             if test -f "$lib"; then
+               if test "$search_ext" = ".la"; then
+                 found=yes
+               else
+                 found=no
+               fi
+               break 2
+             fi
+           done
          done
          if test "$found" != yes; then
            # deplib doesn't seem to be a libtool library
@@ -1405,40 +2046,76 @@ compiler."
              finalize_deplibs="$deplib $finalize_deplibs"
            else
              deplibs="$deplib $deplibs"
-             test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
+             test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
            fi
            continue
+         else # deplib is a libtool library
+           # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+           # We need to do some special things here, and not later.
+           if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+             case " $predeps $postdeps " in
+             *" $deplib "*)
+               if (${SED} -e '2q' $lib |
+                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+                 library_names=
+                 old_library=
+                 case $lib in
+                 */* | *\\*) . $lib ;;
+                 *) . ./$lib ;;
+                 esac
+                 for l in $old_library $library_names; do
+                   ll="$l"
+                 done
+                 if test "X$ll" = "X$old_library" ; then # only static version available
+                   found=no
+                   ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+                   test "X$ladir" = "X$lib" && ladir="."
+                   lib=$ladir/$old_library
+                   if test "$linkmode,$pass" = "prog,link"; then
+                     compile_deplibs="$deplib $compile_deplibs"
+                     finalize_deplibs="$deplib $finalize_deplibs"
+                   else
+                     deplibs="$deplib $deplibs"
+                     test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+                   fi
+                   continue
+                 fi
+               fi
+               ;;
+             *) ;;
+             esac
+           fi
          fi
          ;; # -l
        -L*)
          case $linkmode in
          lib)
            deplibs="$deplib $deplibs"
-           test $pass = conv && continue
+           test "$pass" = conv && continue
            newdependency_libs="$deplib $newdependency_libs"
            newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
            ;;
          prog)
-           if test $pass = conv; then
+           if test "$pass" = conv; then
              deplibs="$deplib $deplibs"
              continue
            fi
-           if test $pass = scan; then
+           if test "$pass" = scan; then
              deplibs="$deplib $deplibs"
-             newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
            else
              compile_deplibs="$deplib $compile_deplibs"
              finalize_deplibs="$deplib $finalize_deplibs"
            fi
+           newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
            ;;
          *)
-           $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
+           $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
            ;;
          esac # linkmode
          continue
          ;; # -L
        -R*)
-         if test $pass = link; then
+         if test "$pass" = link; then
            dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
            # Make sure the xrpath contains only unique directories.
            case "$xrpath " in
@@ -1451,28 +2128,45 @@ compiler."
          ;;
        *.la) lib="$deplib" ;;
        *.$libext)
-         if test $pass = conv; then
+         if test "$pass" = conv; then
            deplibs="$deplib $deplibs"
            continue
          fi
          case $linkmode in
          lib)
-           if test "$deplibs_check_method" != pass_all; then
-             echo
-             echo "*** Warning: This library needs some functionality provided by $deplib."
-             echo "*** I have the capability to make that library automatically link in when"
-             echo "*** you link to this library.  But I can only do this if you have a"
-             echo "*** shared version of the library, which you do not appear to have."
+           valid_a_lib=no
+           case $deplibs_check_method in
+             match_pattern*)
+               set dummy $deplibs_check_method
+               match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+               if eval $echo \"$deplib\" 2>/dev/null \
+                   | $SED 10q \
+                   | $EGREP "$match_pattern_regex" > /dev/null; then
+                 valid_a_lib=yes
+               fi
+               ;;
+             pass_all)
+               valid_a_lib=yes
+               ;;
+            esac
+           if test "$valid_a_lib" != yes; then
+             $echo
+             $echo "*** Warning: Trying to link with static lib archive $deplib."
+             $echo "*** I have the capability to make that library automatically link in when"
+             $echo "*** you link to this library.  But I can only do this if you have a"
+             $echo "*** shared version of the library, which you do not appear to have"
+             $echo "*** because the file extensions .$libext of this argument makes me believe"
+             $echo "*** that it is just a static archive that I should not used here."
            else
-             echo
-             echo "*** Warning: Linking the shared library $output against the"
-             echo "*** static library $deplib is not portable!"
+             $echo
+             $echo "*** Warning: Linking the shared library $output against the"
+             $echo "*** static library $deplib is not portable!"
              deplibs="$deplib $deplibs"
            fi
            continue
            ;;
          prog)
-           if test $pass != link; then
+           if test "$pass" != link; then
              deplibs="$deplib $deplibs"
            else
              compile_deplibs="$deplib $compile_deplibs"
@@ -1483,14 +2177,18 @@ compiler."
          esac # linkmode
          ;; # *.$libext
        *.lo | *.$objext)
-         if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
-           # If there is no dlopen support or we're linking statically,
-           # we need to preload.
-           newdlprefiles="$newdlprefiles $deplib"
-           compile_deplibs="$deplib $compile_deplibs"
-           finalize_deplibs="$deplib $finalize_deplibs"
-         else
-           newdlfiles="$newdlfiles $deplib"
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+         elif test "$linkmode" = prog; then
+           if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+             # If there is no dlopen support or we're linking statically,
+             # we need to preload.
+             newdlprefiles="$newdlprefiles $deplib"
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             newdlfiles="$newdlfiles $deplib"
+           fi
          fi
          continue
          ;;
@@ -1499,17 +2197,17 @@ compiler."
          continue
          ;;
        esac # case $deplib
-       if test $found = yes || test -f "$lib"; then :
+       if test "$found" = yes || test -f "$lib"; then :
        else
          $echo "$modename: cannot find the library \`$lib'" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
 
        # Check to see that this really is a libtool archive.
-       if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+       if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
        else
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
 
        ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
@@ -1522,8 +2220,11 @@ compiler."
        library_names=
        old_library=
        # If the library was installed with an old release of libtool,
-       # it will not redefine variable installed.
+       # it will not redefine variables installed, or shouldnotlink
        installed=yes
+       shouldnotlink=no
+       avoidtemprpath=
+
 
        # Read the .la file
        case $lib in
@@ -1533,19 +2234,18 @@ compiler."
 
        if test "$linkmode,$pass" = "lib,link" ||
           test "$linkmode,$pass" = "prog,scan" ||
-          { test $linkmode = oldlib && test $linkmode = obj; }; then
-          # Add dl[pre]opened files of deplib
+          { test "$linkmode" != prog && test "$linkmode" != lib; }; then
          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
        fi
 
-       if test $pass = conv; then
+       if test "$pass" = conv; then
          # Only check for convenience libraries
          deplibs="$lib $deplibs"
          if test -z "$libdir"; then
            if test -z "$old_library"; then
              $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-             exit 1
+             exit $EXIT_FAILURE
            fi
            # It is a libtool convenience library, so add in its objects.
            convenience="$convenience $ladir/$objdir/$old_library"
@@ -1553,18 +2253,21 @@ compiler."
            tmp_libs=
            for deplib in $dependency_libs; do
              deplibs="$deplib $deplibs"
-             case "$tmp_libs " in
-             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-             esac
+              if test "X$duplicate_deps" = "Xyes" ; then
+               case "$tmp_libs " in
+               *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+               esac
+              fi
              tmp_libs="$tmp_libs $deplib"
            done
-         elif test $linkmode != prog && test $linkmode != lib; then
+         elif test "$linkmode" != prog && test "$linkmode" != lib; then
            $echo "$modename: \`$lib' is not a convenience library" 1>&2
-           exit 1
+           exit $EXIT_FAILURE
          fi
          continue
        fi # $pass = conv
 
+
        # Get the name of the library we link against.
        linklib=
        for l in $old_library $library_names; do
@@ -1572,19 +2275,23 @@ compiler."
        done
        if test -z "$linklib"; then
          $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
 
        # This library was specified with -dlopen.
-       if test $pass = dlopen; then
+       if test "$pass" = dlopen; then
          if test -z "$libdir"; then
            $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
-           exit 1
+           exit $EXIT_FAILURE
          fi
-         if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+         if test -z "$dlname" ||
+            test "$dlopen_support" != yes ||
+            test "$build_libtool_libs" = no; then
            # If there is no dlname, no dlopen support or we're linking
-           # statically, we need to preload.
-           dlprefiles="$dlprefiles $lib"
+           # statically, we need to preload.  We also need to preload any
+           # dependent libraries so libltdl's deplib preloader doesn't
+           # bomb out in the load deplibs phase.
+           dlprefiles="$dlprefiles $lib $dependency_libs"
          else
            newdlfiles="$newdlfiles $lib"
          fi
@@ -1616,19 +2323,27 @@ compiler."
            dir="$libdir"
            absdir="$libdir"
          fi
+         test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
        else
-         dir="$ladir/$objdir"
-         absdir="$abs_ladir/$objdir"
-         # Remove this search path later
-         notinst_path="$notinst_path $abs_ladir"
+         if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           dir="$ladir"
+           absdir="$abs_ladir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         else
+           dir="$ladir/$objdir"
+           absdir="$abs_ladir/$objdir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         fi
        fi # $installed = yes
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
 
        # This library was specified with -dlpreopen.
-       if test $pass = dlpreopen; then
+       if test "$pass" = dlpreopen; then
          if test -z "$libdir"; then
            $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
-           exit 1
+           exit $EXIT_FAILURE
          fi
          # Prefer using a static library (so that no silly _DYNAMIC symbols
          # are required to link).
@@ -1644,18 +2359,19 @@ compiler."
 
        if test -z "$libdir"; then
          # Link the convenience library
-         if test $linkmode = lib; then
+         if test "$linkmode" = lib; then
            deplibs="$dir/$old_library $deplibs"
          elif test "$linkmode,$pass" = "prog,link"; then
            compile_deplibs="$dir/$old_library $compile_deplibs"
            finalize_deplibs="$dir/$old_library $finalize_deplibs"
          else
-           deplibs="$lib $deplibs"
+           deplibs="$lib $deplibs" # used for prog,scan pass
          fi
          continue
        fi
 
-       if test $linkmode = prog && test $pass != link; then
+
+       if test "$linkmode" = prog && test "$pass" != link; then
          newlib_search_path="$newlib_search_path $ladir"
          deplibs="$lib $deplibs"
 
@@ -1671,28 +2387,36 @@ compiler."
            -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
            esac
            # Need to link against all dependency_libs?
-           if test $linkalldeplibs = yes; then
+           if test "$linkalldeplibs" = yes; then
              deplibs="$deplib $deplibs"
            else
              # Need to hardcode shared library paths
              # or/and link against static libraries
              newdependency_libs="$deplib $newdependency_libs"
            fi
-           case "$tmp_libs " in
-           *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-           esac
+           if test "X$duplicate_deps" = "Xyes" ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
            tmp_libs="$tmp_libs $deplib"
          done # for deplib
          continue
        fi # $linkmode = prog...
 
-       link_static=no # Whether the deplib will be linked statically
-       if test -n "$library_names" &&
-          { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
-         # Link against this shared library
+       if test "$linkmode,$pass" = "prog,link"; then
+         if test -n "$library_names" &&
+            { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+           # We need to hardcode the library path
+           if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+             # Make sure the rpath contains only unique directories.
+             case "$temp_rpath " in
+             *" $dir "*) ;;
+             *" $absdir "*) ;;
+             *) temp_rpath="$temp_rpath $dir" ;;
+             esac
+           fi
 
-         if test "$linkmode,$pass" = "prog,link" ||
-          { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
            # Hardcode the library path.
            # Skip directories that are in the system default run-time
            # search path.
@@ -1714,17 +2438,6 @@ compiler."
              esac
              ;;
            esac
-           if test $linkmode = prog; then
-             # We need to hardcode the library path
-             if test -n "$shlibpath_var"; then
-               # Make sure the rpath contains only unique directories.
-               case "$temp_rpath " in
-               *" $dir "*) ;;
-               *" $absdir "*) ;;
-               *) temp_rpath="$temp_rpath $dir" ;;
-               esac
-             fi
-           fi
          fi # $linkmode,$pass = prog,link...
 
          if test "$alldeplibs" = yes &&
@@ -1734,11 +2447,52 @@ compiler."
            # We only need to search for static libraries
            continue
          fi
+       fi
 
+       link_static=no # Whether the deplib will be linked statically
+       if test -n "$library_names" &&
+          { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
          if test "$installed" = no; then
            notinst_deplibs="$notinst_deplibs $lib"
            need_relink=yes
          fi
+         # This is a shared library
+
+         # Warn about portability, can't link against -module's on
+         # some systems (darwin)
+         if test "$shouldnotlink" = yes && test "$pass" = link ; then
+           $echo
+           if test "$linkmode" = prog; then
+             $echo "*** Warning: Linking the executable $output against the loadable module"
+           else
+             $echo "*** Warning: Linking the shared library $output against the loadable module"
+           fi
+           $echo "*** $linklib is not portable!"
+         fi
+         if test "$linkmode" = lib &&
+            test "$hardcode_into_libs" = yes; then
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) compile_rpath="$compile_rpath $absdir"
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) finalize_rpath="$finalize_rpath $libdir"
+             esac
+             ;;
+           esac
+         fi
 
          if test -n "$old_archive_from_expsyms_cmds"; then
            # figure out the soname
@@ -1752,7 +2506,7 @@ compiler."
            elif test -n "$soname_spec"; then
              # bleh windows
              case $host in
-             *cygwin*)
+             *cygwin* | mingw*)
                major=`expr $current - $age`
                versuffix="-$major"
                ;;
@@ -1764,17 +2518,18 @@ compiler."
 
            # Make a new name for the extract_expsyms_cmds to use
            soroot="$soname"
-           soname=`echo $soroot | sed -e 's/^.*\///'`
-           newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
+           soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+           newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
 
            # If the library has no export list, then create one now
            if test -f "$output_objdir/$soname-def"; then :
            else
              $show "extracting exported symbol list from \`$soname'"
-             IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
-             eval cmds=\"$extract_expsyms_cmds\"
+             save_ifs="$IFS"; IFS='~'
+             cmds=$extract_expsyms_cmds
              for cmd in $cmds; do
                IFS="$save_ifs"
+               eval cmd=\"$cmd\"
                $show "$cmd"
                $run eval "$cmd" || exit $?
              done
@@ -1784,10 +2539,11 @@ compiler."
            # Create $newlib
            if test -f "$output_objdir/$newlib"; then :; else
              $show "generating import library for \`$soname'"
-             IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
-             eval cmds=\"$old_archive_from_expsyms_cmds\"
+             save_ifs="$IFS"; IFS='~'
+             cmds=$old_archive_from_expsyms_cmds
              for cmd in $cmds; do
                IFS="$save_ifs"
+               eval cmd=\"$cmd\"
                $show "$cmd"
                $run eval "$cmd" || exit $?
              done
@@ -1796,9 +2552,9 @@ compiler."
            # make sure the library variables are pointing to the new library
            dir=$output_objdir
            linklib=$newlib
-         fi # test -n $old_archive_from_expsyms_cmds
+         fi # test -n "$old_archive_from_expsyms_cmds"
 
-         if test $linkmode = prog || test "$mode" != relink; then
+         if test "$linkmode" = prog || test "$mode" != relink; then
            add_shlibpath=
            add_dir=
            add=
@@ -1807,6 +2563,22 @@ compiler."
            immediate | unsupported)
              if test "$hardcode_direct" = no; then
                add="$dir/$linklib"
+               case $host in
+                 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+                 *-*-darwin* )
+                   # if the lib is a module then we can not link against
+                   # it, someone is ignoring the new warnings I added
+                   if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+                     $echo "** Warning, lib $linklib is a module, not a shared library"
+                     if test -z "$old_library" ; then
+                       $echo
+                       $echo "** And there doesn't seem to be a static archive available"
+                       $echo "** The link will probably fail, sorry"
+                     else
+                       add="$dir/$old_library"
+                     fi
+                   fi
+               esac
              elif test "$hardcode_minus_L" = no; then
                case $host in
                *-*-sunos*) add_shlibpath="$dir" ;;
@@ -1825,6 +2597,14 @@ compiler."
                add="$dir/$linklib"
              elif test "$hardcode_minus_L" = yes; then
                add_dir="-L$dir"
+               # Try looking first in the location we're being installed to.
+               if test -n "$inst_prefix_dir"; then
+                 case "$libdir" in
+                   [\\/]*)
+                     add_dir="$add_dir -L$inst_prefix_dir$libdir"
+                     ;;
+                 esac
+               fi
                add="-l$name"
              elif test "$hardcode_shlibpath_var" = yes; then
                add_shlibpath="$dir"
@@ -1838,7 +2618,7 @@ compiler."
 
            if test "$lib_linked" != yes; then
              $echo "$modename: configuration error: unsupported hardcode properties"
-             exit 1
+             exit $EXIT_FAILURE
            fi
 
            if test -n "$add_shlibpath"; then
@@ -1847,7 +2627,7 @@ compiler."
              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
              esac
            fi
-           if test $linkmode = prog; then
+           if test "$linkmode" = prog; then
              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
              test -n "$add" && compile_deplibs="$add $compile_deplibs"
            else
@@ -1864,7 +2644,7 @@ compiler."
            fi
          fi
 
-         if test $linkmode = prog || test "$mode" = relink; then
+         if test "$linkmode" = prog || test "$mode" = relink; then
            add_shlibpath=
            add_dir=
            add=
@@ -1880,13 +2660,28 @@ compiler."
              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
              esac
              add="-l$name"
+           elif test "$hardcode_automatic" = yes; then
+             if test -n "$inst_prefix_dir" &&
+                test -f "$inst_prefix_dir$libdir/$linklib" ; then
+               add="$inst_prefix_dir$libdir/$linklib"
+             else
+               add="$libdir/$linklib"
+             fi
            else
              # We cannot seem to hardcode it, guess we'll fake it.
              add_dir="-L$libdir"
+             # Try looking first in the location we're being installed to.
+             if test -n "$inst_prefix_dir"; then
+               case "$libdir" in
+                 [\\/]*)
+                   add_dir="$add_dir -L$inst_prefix_dir$libdir"
+                   ;;
+               esac
+             fi
              add="-l$name"
            fi
 
-           if test $linkmode = prog; then
+           if test "$linkmode" = prog; then
              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
            else
@@ -1894,16 +2689,7 @@ compiler."
              test -n "$add" && deplibs="$add $deplibs"
            fi
          fi
-       elif test $linkmode = prog; then
-         if test "$alldeplibs" = yes &&
-            { test "$deplibs_check_method" = pass_all ||
-              { test "$build_libtool_libs" = yes &&
-                test -n "$library_names"; }; }; then
-           # We only need to search for static libraries
-           continue
-         fi
-
-         # Try to link the static library
+       elif test "$linkmode" = prog; then
          # Here we assume that one of hardcode_direct or hardcode_minus_L
          # is not unsupported.  This is valid on all known static and
          # shared platforms.
@@ -1923,20 +2709,21 @@ compiler."
 
            # Just print a warning and add the library to dependency_libs so
            # that the program can be linked against the static library.
-           echo
-           echo "*** Warning: This library needs some functionality provided by $lib."
-           echo "*** I have the capability to make that library automatically link in when"
-           echo "*** you link to this library.  But I can only do this if you have a"
-           echo "*** shared version of the library, which you do not appear to have."
+           $echo
+           $echo "*** Warning: This system can not link to static lib archive $lib."
+           $echo "*** I have the capability to make that library automatically link in when"
+           $echo "*** you link to this library.  But I can only do this if you have a"
+           $echo "*** shared version of the library, which you do not appear to have."
            if test "$module" = yes; then
-             echo "*** Therefore, libtool will create a static module, that should work "
-             echo "*** as long as the dlopening application is linked with the -dlopen flag."
+             $echo "*** But as you try to build a module library, libtool will still create "
+             $echo "*** a static module, that should work as long as the dlopening application"
+             $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
              if test -z "$global_symbol_pipe"; then
-               echo
-               echo "*** However, this would only work if libtool was able to extract symbol"
-               echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-               echo "*** not find such a program.  So, this module is probably useless."
-               echo "*** \`nm' from GNU binutils and a full rebuild may help."
+               $echo
+               $echo "*** However, this would only work if libtool was able to extract symbol"
+               $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+               $echo "*** not find such a program.  So, this module is probably useless."
+               $echo "*** \`nm' from GNU binutils and a full rebuild may help."
              fi
              if test "$build_old_libs" = no; then
                build_libtool_libs=module
@@ -1953,10 +2740,11 @@ compiler."
          fi
        fi # link shared/static library?
 
-       if test $linkmode = lib; then
+       if test "$linkmode" = lib; then
          if test -n "$dependency_libs" &&
-            { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
-              test $link_static = yes; }; then
+            { test "$hardcode_into_libs" != yes ||
+              test "$build_old_libs" = yes ||
+              test "$link_static" = yes; }; then
            # Extract -R from dependency_libs
            temp_deplibs=
            for libdir in $dependency_libs; do
@@ -1979,13 +2767,15 @@ compiler."
          tmp_libs=
          for deplib in $dependency_libs; do
            newdependency_libs="$deplib $newdependency_libs"
-           case "$tmp_libs " in
-           *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-           esac
+           if test "X$duplicate_deps" = "Xyes" ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
            tmp_libs="$tmp_libs $deplib"
          done
 
-         if test $link_all_deplibs != no; then
+         if test "$link_all_deplibs" != no; then
            # Add the search paths of all dependency libraries
            for deplib in $dependency_libs; do
              case $deplib in
@@ -2005,22 +2795,67 @@ compiler."
                  ;;
                esac
                if grep "^installed=no" $deplib > /dev/null; then
-                 path="-L$absdir/$objdir"
+                 path="$absdir/$objdir"
                else
-                 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+                 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
                  if test -z "$libdir"; then
                    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-                   exit 1
+                   exit $EXIT_FAILURE
                  fi
                  if test "$absdir" != "$libdir"; then
                    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
                  fi
-                 path="-L$absdir"
+                 path="$absdir"
                fi
+               depdepl=
+               case $host in
+               *-*-darwin*)
+                 # we do not want to link against static libs,
+                 # but need to link against shared
+                 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+                 if test -n "$deplibrary_names" ; then
+                   for tmp in $deplibrary_names ; do
+                     depdepl=$tmp
+                   done
+                   if test -f "$path/$depdepl" ; then
+                     depdepl="$path/$depdepl"
+                   fi
+                   # do not add paths which are already there
+                   case " $newlib_search_path " in
+                   *" $path "*) ;;
+                   *) newlib_search_path="$newlib_search_path $path";;
+                   esac
+                 fi
+                 path=""
+                 ;;
+               *)
+                 path="-L$path"
+                 ;;
+               esac
+               ;;
+             -l*)
+               case $host in
+               *-*-darwin*)
+                 # Again, we only want to link against shared libraries
+                 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+                 for tmp in $newlib_search_path ; do
+                   if test -f "$tmp/lib$tmp_libs.dylib" ; then
+                     eval depdepl="$tmp/lib$tmp_libs.dylib"
+                     break
+                   fi
+                 done
+                 path=""
+                 ;;
+               *) continue ;;
+               esac
                ;;
              *) continue ;;
              esac
              case " $deplibs " in
+             *" $depdepl "*) ;;
+             *) deplibs="$depdepl $deplibs" ;;
+             esac
+             case " $deplibs " in
              *" $path "*) ;;
              *) deplibs="$deplibs $path" ;;
              esac
@@ -2028,15 +2863,15 @@ compiler."
          fi # link_all_deplibs != no
        fi # linkmode = lib
       done # for deplib in $libs
-      if test $pass = dlpreopen; then
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
        # Link the dlpreopened libraries before other libraries
        for deplib in $save_deplibs; do
          deplibs="$deplib $deplibs"
        done
       fi
-      if test $pass != dlopen; then
-       test $pass != scan && dependency_libs="$newdependency_libs"
-       if test $pass != conv; then
+      if test "$pass" != dlopen; then
+       if test "$pass" != conv; then
          # Make sure lib_search_path contains only unique directories.
          lib_search_path=
          for dir in $newlib_search_path; do
@@ -2058,9 +2893,30 @@ compiler."
          eval tmp_libs=\"\$$var\"
          new_libs=
          for deplib in $tmp_libs; do
+           # FIXME: Pedantically, this is the right thing to do, so
+           #        that some nasty dependency loop isn't accidentally
+           #        broken:
+           #new_libs="$deplib $new_libs"
+           # Pragmatically, this seems to cause very few problems in
+           # practice:
            case $deplib in
            -L*) new_libs="$deplib $new_libs" ;;
+           -R*) ;;
            *)
+             # And here is the reason: when a library appears more
+             # than once as an explicit dependence of a library, or
+             # is implicitly linked in more than once by the
+             # compiler, it is considered special, and multiple
+             # occurrences thereof are not removed.  Compare this
+             # with having the same library being listed as a
+             # dependency of multiple other libraries: in this case,
+             # we know (pedantically, we assume) the library does not
+             # need to be listed more than once, so we keep only the
+             # last copy.  This is not always right, but it is rare
+             # enough that we require users that really mean to play
+             # such unportable linking tricks to link the library
+             # using -Wl,-lname, so that libtool does not consider it
+             # for duplicate removal.
              case " $specialdeplibs " in
              *" $deplib "*) new_libs="$deplib $new_libs" ;;
              *)
@@ -2088,19 +2944,32 @@ compiler."
          eval $var=\"$tmp_libs\"
        done # for var
       fi
-      if test "$pass" = "conv" &&
-       { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
-       libs="$deplibs" # reset libs
-       deplibs=
-      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+       case " $predeps $postdeps $compiler_lib_search_path " in
+       *" $i "*)
+         i=""
+         ;;
+       esac
+       if test -n "$i" ; then
+         tmp_libs="$tmp_libs $i"
+       fi
+      done
+      dependency_libs=$tmp_libs
     done # for pass
-    if test $linkmode = prog; then
+    if test "$linkmode" = prog; then
       dlfiles="$newdlfiles"
       dlprefiles="$newdlprefiles"
     fi
 
     case $linkmode in
     oldlib)
+      if test -n "$deplibs"; then
+       $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
       fi
@@ -2114,7 +2983,7 @@ compiler."
       fi
 
       if test -n "$vinfo"; then
-       $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
+       $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
       fi
 
       if test -n "$release"; then
@@ -2136,17 +3005,19 @@ compiler."
       case $outputname in
       lib*)
        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+       eval shared_ext=\"$shrext_cmds\"
        eval libname=\"$libname_spec\"
        ;;
       *)
        if test "$module" = no; then
          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
          $echo "$help" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
        if test "$need_lib_prefix" != no; then
          # Add the "lib" prefix for modules if required
          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+         eval shared_ext=\"$shrext_cmds\"
          eval libname=\"$libname_spec\"
        else
          libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
@@ -2157,11 +3028,11 @@ compiler."
       if test -n "$objs"; then
        if test "$deplibs_check_method" != pass_all; then
          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
-         exit 1
+         exit $EXIT_FAILURE
        else
-         echo
-         echo "*** Warning: Linking the shared library $output against the non-libtool"
-         echo "*** objects $objs is not portable!"
+         $echo
+         $echo "*** Warning: Linking the shared library $output against the non-libtool"
+         $echo "*** objects $objs is not portable!"
          libobjs="$libobjs $objs"
        fi
       fi
@@ -2171,7 +3042,7 @@ compiler."
       fi
 
       set dummy $rpath
-      if test $# -gt 2; then
+      if test "$#" -gt 2; then
        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
       fi
       install_libdir="$2"
@@ -2180,14 +3051,16 @@ compiler."
       if test -z "$rpath"; then
        if test "$build_libtool_libs" = yes; then
          # Building a libtool convenience library.
-         libext=al
+         # Some compilers have problems with a `.al' extension so
+         # convenience libraries should have the same extension an
+         # archive normally would.
          oldlibs="$output_objdir/$libname.$libext $oldlibs"
          build_libtool_libs=convenience
          build_old_libs=yes
        fi
 
        if test -n "$vinfo"; then
-         $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
+         $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
        fi
 
        if test -n "$release"; then
@@ -2196,52 +3069,89 @@ compiler."
       else
 
        # Parse the version information argument.
-       IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
+       save_ifs="$IFS"; IFS=':'
        set dummy $vinfo 0 0 0
        IFS="$save_ifs"
 
        if test -n "$8"; then
          $echo "$modename: too many parameters to \`-version-info'" 1>&2
          $echo "$help" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
 
-       current="$2"
-       revision="$3"
-       age="$4"
+       # convert absolute version numbers to libtool ages
+       # this retains compatibility with .la files and attempts
+       # to make the code below a bit more comprehensible
+
+       case $vinfo_number in
+       yes)
+         number_major="$2"
+         number_minor="$3"
+         number_revision="$4"
+         #
+         # There are really only two kinds -- those that
+         # use the current revision as the major version
+         # and those that subtract age and use age as
+         # a minor version.  But, then there is irix
+         # which has an extra 1 added just for fun
+         #
+         case $version_type in
+         darwin|linux|osf|windows)
+           current=`expr $number_major + $number_minor`
+           age="$number_minor"
+           revision="$number_revision"
+           ;;
+         freebsd-aout|freebsd-elf|sunos)
+           current="$number_major"
+           revision="$number_minor"
+           age="0"
+           ;;
+         irix|nonstopux)
+           current=`expr $number_major + $number_minor - 1`
+           age="$number_minor"
+           revision="$number_minor"
+           ;;
+         esac
+         ;;
+       no)
+         current="$2"
+         revision="$3"
+         age="$4"
+         ;;
+       esac
 
        # Check that each of the things are valid numbers.
        case $current in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
          ;;
        esac
 
        case $revision in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
          ;;
        esac
 
        case $age in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
          ;;
        esac
 
-       if test $age -gt $current; then
+       if test "$age" -gt "$current"; then
          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
 
        # Calculate the version variables.
@@ -2258,7 +3168,7 @@ compiler."
          versuffix="$major.$age.$revision"
          # Darwin ld doesn't like 0 for these options...
          minor_current=`expr $current + 1`
-         verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+         verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
          ;;
 
        freebsd-aout)
@@ -2271,16 +3181,21 @@ compiler."
          versuffix=".$current";
          ;;
 
-       irix)
+       irix | nonstopux)
          major=`expr $current - $age + 1`
-         verstring="sgi$major.$revision"
+
+         case $version_type in
+           nonstopux) verstring_prefix=nonstopux ;;
+           *)         verstring_prefix=sgi ;;
+         esac
+         verstring="$verstring_prefix$major.$revision"
 
          # Add in all the interfaces that we are compatible with.
          loop=$revision
-         while test $loop != 0; do
+         while test "$loop" -ne 0; do
            iface=`expr $revision - $loop`
            loop=`expr $loop - 1`
-           verstring="sgi$major.$iface:$verstring"
+           verstring="$verstring_prefix$major.$iface:$verstring"
          done
 
          # Before this point, $major must not contain `.'.
@@ -2294,13 +3209,13 @@ compiler."
          ;;
 
        osf)
-         major=`expr $current - $age`
+         major=.`expr $current - $age`
          versuffix=".$current.$age.$revision"
          verstring="$current.$age.$revision"
 
          # Add in all the interfaces that we are compatible with.
          loop=$age
-         while test $loop != 0; do
+         while test "$loop" -ne 0; do
            iface=`expr $current - $loop`
            loop=`expr $loop - 1`
            verstring="$verstring:${iface}.0"
@@ -2324,20 +3239,19 @@ compiler."
 
        *)
          $echo "$modename: unknown library version type \`$version_type'" 1>&2
-         echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-         exit 1
+         $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+         exit $EXIT_FAILURE
          ;;
        esac
 
        # Clear the version info if we defaulted, and they specified a release.
        if test -z "$vinfo" && test -n "$release"; then
          major=
-         verstring="0.0"
          case $version_type in
          darwin)
            # we can't check for "0.0" in archive_cmds due to quoting
            # problems, so we reset it completely
-           verstring=""
+           verstring=
            ;;
          *)
            verstring="0.0"
@@ -2371,9 +3285,30 @@ compiler."
       fi
 
       if test "$mode" != relink; then
-       # Remove our outputs.
-       $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
-       $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
+       # Remove our outputs, but don't remove object files since they
+       # may have been created when compiling PIC objects.
+       removelist=
+       tempremovelist=`$echo "$output_objdir/*"`
+       for p in $tempremovelist; do
+         case $p in
+           *.$objext)
+              ;;
+           $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+              if test "X$precious_files_regex" != "X"; then
+                if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+                then
+                  continue
+                fi
+              fi
+              removelist="$removelist $p"
+              ;;
+           *) ;;
+         esac
+       done
+       if test -n "$removelist"; then
+         $show "${rm}r $removelist"
+         $run ${rm}r $removelist
+       fi
       fi
 
       # Now set the variables for building old libraries.
@@ -2386,9 +3321,9 @@ compiler."
 
       # Eliminate all temporary directories.
       for path in $notinst_path; do
-       lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
-       deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
-       dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
+       lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+       deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+       dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
       done
 
       if test -n "$xrpath"; then
@@ -2401,7 +3336,7 @@ compiler."
          *) finalize_rpath="$finalize_rpath $libdir" ;;
          esac
        done
-       if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
+       if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
          dependency_libs="$temp_xrpath $dependency_libs"
        fi
       fi
@@ -2439,12 +3374,13 @@ compiler."
          *-*-netbsd*)
            # Don't link with libc until the a.out ld.so is fixed.
            ;;
-         *-*-openbsd*)
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
            # Do not include libc due to us having libc/libc_r.
+           test "X$arg" = "X-lc" && continue
            ;;
-         *)
+         *)
            # Add libc to deplibs on all other systems if necessary.
-           if test $build_libtool_need_lc = "yes"; then
+           if test "$build_libtool_need_lc" = "yes"; then
              deplibs="$deplibs -lc"
            fi
            ;;
@@ -2471,7 +3407,7 @@ compiler."
          # This might be a little naive.  We might want to check
          # whether the library exists or not.  But this is on
          # osf3 & osf4 and I'm not really sure... Just
-         # implementing what was already the behaviour.
+         # implementing what was already the behavior.
          newdeplibs=$deplibs
          ;;
        test_compile)
@@ -2484,64 +3420,88 @@ compiler."
          int main() { return 0; }
 EOF
          $rm conftest
-         $CC -o conftest conftest.c $deplibs
-         if test $? -eq 0 ; then
+         $LTCC -o conftest conftest.c $deplibs
+         if test "$?" -eq 0 ; then
            ldd_output=`ldd conftest`
            for i in $deplibs; do
              name="`expr $i : '-l\(.*\)'`"
              # If $name is empty we are operating on a -L argument.
-             if test -n "$name" && test "$name" != "0"; then
-               libname=`eval \\$echo \"$libname_spec\"`
-               deplib_matches=`eval \\$echo \"$library_names_spec\"`
-               set dummy $deplib_matches
-               deplib_match=$2
-               if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-                 newdeplibs="$newdeplibs $i"
-               else
-                 droppeddeps=yes
-                 echo
-                 echo "*** Warning: This library needs some functionality provided by $i."
-                 echo "*** I have the capability to make that library automatically link in when"
-                 echo "*** you link to this library.  But I can only do this if you have a"
-                 echo "*** shared version of the library, which you do not appear to have."
+              if test "$name" != "" && test "$name" -ne "0"; then
+               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                 case " $predeps $postdeps " in
+                 *" $i "*)
+                   newdeplibs="$newdeplibs $i"
+                   i=""
+                   ;;
+                 esac
+               fi
+               if test -n "$i" ; then
+                 libname=`eval \\$echo \"$libname_spec\"`
+                 deplib_matches=`eval \\$echo \"$library_names_spec\"`
+                 set dummy $deplib_matches
+                 deplib_match=$2
+                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                   newdeplibs="$newdeplibs $i"
+                 else
+                   droppeddeps=yes
+                   $echo
+                   $echo "*** Warning: dynamic linker does not accept needed library $i."
+                   $echo "*** I have the capability to make that library automatically link in when"
+                   $echo "*** you link to this library.  But I can only do this if you have a"
+                   $echo "*** shared version of the library, which I believe you do not have"
+                   $echo "*** because a test_compile did reveal that the linker did not use it for"
+                   $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+                 fi
                fi
              else
                newdeplibs="$newdeplibs $i"
              fi
            done
          else
-           # Error occured in the first compile.  Let's try to salvage the situation:
-           # Compile a seperate program for each library.
+           # Error occurred in the first compile.  Let's try to salvage
+           # the situation: Compile a separate program for each library.
            for i in $deplibs; do
              name="`expr $i : '-l\(.*\)'`"
-            # If $name is empty we are operating on a -L argument.
-             if test -n "$name" && test "$name" != "0"; then
+             # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
                $rm conftest
-               $CC -o conftest conftest.c $i
+               $LTCC -o conftest conftest.c $i
                # Did it work?
-               if test $? -eq 0 ; then
+               if test "$?" -eq 0 ; then
                  ldd_output=`ldd conftest`
-                 libname=`eval \\$echo \"$libname_spec\"`
-                 deplib_matches=`eval \\$echo \"$library_names_spec\"`
-                 set dummy $deplib_matches
-                 deplib_match=$2
-                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-                   newdeplibs="$newdeplibs $i"
-                 else
-                   droppeddeps=yes
-                   echo
-                   echo "*** Warning: This library needs some functionality provided by $i."
-                   echo "*** I have the capability to make that library automatically link in when"
-                   echo "*** you link to this library.  But I can only do this if you have a"
-                   echo "*** shared version of the library, which you do not appear to have."
+                 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                   case " $predeps $postdeps " in
+                   *" $i "*)
+                     newdeplibs="$newdeplibs $i"
+                     i=""
+                     ;;
+                   esac
+                 fi
+                 if test -n "$i" ; then
+                   libname=`eval \\$echo \"$libname_spec\"`
+                   deplib_matches=`eval \\$echo \"$library_names_spec\"`
+                   set dummy $deplib_matches
+                   deplib_match=$2
+                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                     newdeplibs="$newdeplibs $i"
+                   else
+                     droppeddeps=yes
+                     $echo
+                     $echo "*** Warning: dynamic linker does not accept needed library $i."
+                     $echo "*** I have the capability to make that library automatically link in when"
+                     $echo "*** you link to this library.  But I can only do this if you have a"
+                     $echo "*** shared version of the library, which you do not appear to have"
+                     $echo "*** because a test_compile did reveal that the linker did not use this one"
+                     $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+                   fi
                  fi
                else
                  droppeddeps=yes
-                 echo
-                 echo "*** Warning!  Library $i is needed by this library but I was not able to"
-                 echo "***  make it link in!  You will probably need to install it or some"
-                 echo "*** library that it depends on before this library will be fully"
-                 echo "*** functional.  Installing it before continuing would be even better."
+                 $echo
+                 $echo "*** Warning!  Library $i is needed by this library but I was not able to"
+                 $echo "***  make it link in!  You will probably need to install it or some"
+                 $echo "*** library that it depends on before this library will be fully"
+                 $echo "*** functional.  Installing it before continuing would be even better."
                fi
              else
                newdeplibs="$newdeplibs $i"
@@ -2555,11 +3515,20 @@ EOF
          for a_deplib in $deplibs; do
            name="`expr $a_deplib : '-l\(.*\)'`"
            # If $name is empty we are operating on a -L argument.
-           if test -n "$name" && test "$name" != "0"; then
-             libname=`eval \\$echo \"$libname_spec\"`
-             for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-                   potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-                   for potent_lib in $potential_libs; do
+            if test "$name" != "" && test  "$name" != "0"; then
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 newdeplibs="$newdeplibs $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval \\$echo \"$libname_spec\"`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+                 for potent_lib in $potential_libs; do
                      # Follow soft links.
                      if ls -lLd "$potent_lib" 2>/dev/null \
                         | grep " -> " >/dev/null; then
@@ -2572,28 +3541,36 @@ EOF
                      # but so what?
                      potlib="$potent_lib"
                      while test -h "$potlib" 2>/dev/null; do
-                       potliblink=`ls -ld $potlib | sed 's/.* -> //'`
+                       potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
                        case $potliblink in
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
                        *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
                        esac
                      done
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
-                        | sed 10q \
-                        | egrep "$file_magic_regex" > /dev/null; then
+                        | ${SED} 10q \
+                        | $EGREP "$file_magic_regex" > /dev/null; then
                        newdeplibs="$newdeplibs $a_deplib"
                        a_deplib=""
                        break 2
                      fi
-                   done
-             done
+                 done
+               done
+             fi
              if test -n "$a_deplib" ; then
                droppeddeps=yes
-               echo
-               echo "*** Warning: This library needs some functionality provided by $a_deplib."
-               echo "*** I have the capability to make that library automatically link in when"
-               echo "*** you link to this library.  But I can only do this if you have a"
-               echo "*** shared version of the library, which you do not appear to have."
+               $echo
+               $echo "*** Warning: linker path does not have real file for library $a_deplib."
+               $echo "*** I have the capability to make that library automatically link in when"
+               $echo "*** you link to this library.  But I can only do this if you have a"
+               $echo "*** shared version of the library, which you do not appear to have"
+               $echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $echo "*** with $libname but no candidates were found. (...for file magic test)"
+               else
+                 $echo "*** with $libname and none of the candidates passed a file format test"
+                 $echo "*** using a file magic. Last file checked: $potlib"
+               fi
              fi
            else
              # Add a -L argument.
@@ -2608,26 +3585,44 @@ EOF
            name="`expr $a_deplib : '-l\(.*\)'`"
            # If $name is empty we are operating on a -L argument.
            if test -n "$name" && test "$name" != "0"; then
-             libname=`eval \\$echo \"$libname_spec\"`
-             for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-               potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-               for potent_lib in $potential_libs; do
-                 if eval echo \"$potent_lib\" 2>/dev/null \
-                     | sed 10q \
-                     | egrep "$match_pattern_regex" > /dev/null; then
-                   newdeplibs="$newdeplibs $a_deplib"
-                   a_deplib=""
-                   break 2
-                 fi
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 newdeplibs="$newdeplibs $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval \\$echo \"$libname_spec\"`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+                 for potent_lib in $potential_libs; do
+                   potlib="$potent_lib" # see symlink-check above in file_magic test
+                   if eval $echo \"$potent_lib\" 2>/dev/null \
+                       | ${SED} 10q \
+                       | $EGREP "$match_pattern_regex" > /dev/null; then
+                     newdeplibs="$newdeplibs $a_deplib"
+                     a_deplib=""
+                     break 2
+                   fi
+                 done
                done
-             done
+             fi
              if test -n "$a_deplib" ; then
                droppeddeps=yes
-               echo
-               echo "*** Warning: This library needs some functionality provided by $a_deplib."
-               echo "*** I have the capability to make that library automatically link in when"
-               echo "*** you link to this library.  But I can only do this if you have a"
-               echo "*** shared version of the library, which you do not appear to have."
+               $echo
+               $echo "*** Warning: linker path does not have real file for library $a_deplib."
+               $echo "*** I have the capability to make that library automatically link in when"
+               $echo "*** you link to this library.  But I can only do this if you have a"
+               $echo "*** shared version of the library, which you do not appear to have"
+               $echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+               else
+                 $echo "*** with $libname and none of the candidates passed a file format test"
+                 $echo "*** using a regex pattern. Last file checked: $potlib"
+               fi
              fi
            else
              # Add a -L argument.
@@ -2637,16 +3632,23 @@ EOF
          ;;
        none | unknown | *)
          newdeplibs=""
-         if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-              -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
-            grep . >/dev/null; then
-           echo
+         tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+           -e 's/ -[LR][^ ]*//g'`
+         if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+           for i in $predeps $postdeps ; do
+             # can't use Xsed below, because $i might contain '/'
+             tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+           done
+         fi
+         if $echo "X $tmp_deplibs" | $Xsed -e 's/[     ]//g' \
+           | grep . >/dev/null; then
+           $echo
            if test "X$deplibs_check_method" = "Xnone"; then
-             echo "*** Warning: inter-library dependencies are not supported in this platform."
+             $echo "*** Warning: inter-library dependencies are not supported in this platform."
            else
-             echo "*** Warning: inter-library dependencies are not known to be supported."
+             $echo "*** Warning: inter-library dependencies are not known to be supported."
            fi
-           echo "*** All declared inter-library dependencies are being dropped."
+           $echo "*** All declared inter-library dependencies are being dropped."
            droppeddeps=yes
          fi
          ;;
@@ -2666,17 +3668,17 @@ EOF
 
        if test "$droppeddeps" = yes; then
          if test "$module" = yes; then
-           echo
-           echo "*** Warning: libtool could not satisfy all declared inter-library"
-           echo "*** dependencies of module $libname.  Therefore, libtool will create"
-           echo "*** a static module, that should work as long as the dlopening"
-           echo "*** application is linked with the -dlopen flag."
+           $echo
+           $echo "*** Warning: libtool could not satisfy all declared inter-library"
+           $echo "*** dependencies of module $libname.  Therefore, libtool will create"
+           $echo "*** a static module, that should work as long as the dlopening"
+           $echo "*** application is linked with the -dlopen flag."
            if test -z "$global_symbol_pipe"; then
-             echo
-             echo "*** However, this would only work if libtool was able to extract symbol"
-             echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-             echo "*** not find such a program.  So, this module is probably useless."
-             echo "*** \`nm' from GNU binutils and a full rebuild may help."
+             $echo
+             $echo "*** However, this would only work if libtool was able to extract symbol"
+             $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+             $echo "*** not find such a program.  So, this module is probably useless."
+             $echo "*** \`nm' from GNU binutils and a full rebuild may help."
            fi
            if test "$build_old_libs" = no; then
              oldlibs="$output_objdir/$libname.$libext"
@@ -2686,16 +3688,16 @@ EOF
              build_libtool_libs=no
            fi
          else
-           echo "*** The inter-library dependencies that have been dropped here will be"
-           echo "*** automatically added whenever a program is linked with this library"
-           echo "*** or is declared to -dlopen it."
-
-           if test $allow_undefined = no; then
-             echo
-             echo "*** Since this library must not contain undefined symbols,"
-             echo "*** because either the platform does not support them or"
-             echo "*** it was explicitly requested with -no-undefined,"
-             echo "*** libtool will only create a static version of it."
+           $echo "*** The inter-library dependencies that have been dropped here will be"
+           $echo "*** automatically added whenever a program is linked with this library"
+           $echo "*** or is declared to -dlopen it."
+
+           if test "$allow_undefined" = no; then
+             $echo
+             $echo "*** Since this library must not contain undefined symbols,"
+             $echo "*** because either the platform does not support them or"
+             $echo "*** it was explicitly requested with -no-undefined,"
+             $echo "*** libtool will only create a static version of it."
              if test "$build_old_libs" = no; then
                oldlibs="$output_objdir/$libname.$libext"
                build_libtool_libs=module
@@ -2717,7 +3719,7 @@ EOF
 
       # Test again, we may have decided not to build it any more
       if test "$build_libtool_libs" = yes; then
-       if test $hardcode_into_libs = yes; then
+       if test "$hardcode_into_libs" = yes; then
          # Hardcode the library paths
          hardcode_libdirs=
          dep_rpath=
@@ -2753,7 +3755,11 @@ EOF
          if test -n "$hardcode_libdir_separator" &&
             test -n "$hardcode_libdirs"; then
            libdir="$hardcode_libdirs"
-           eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+           if test -n "$hardcode_libdir_flag_spec_ld"; then
+             eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+           else
+             eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+           fi
          fi
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
            # We should set the runpath_var.
@@ -2773,6 +3779,7 @@ EOF
        fi
 
        # Get the real and link names of the library.
+       eval shared_ext=\"$shrext_cmds\"
        eval library_names=\"$library_names_spec\"
        set dummy $library_names
        realname="$2"
@@ -2783,7 +3790,9 @@ EOF
        else
          soname="$realname"
        fi
-       test -z "$dlname" && dlname=$soname
+       if test -z "$dlname"; then
+         dlname=$soname
+       fi
 
        lib="$output_objdir/$realname"
        for link
@@ -2791,23 +3800,6 @@ EOF
          linknames="$linknames $link"
        done
 
-       # Ensure that we have .o objects for linkers which dislike .lo
-       # (e.g. aix) in case we are running --disable-static
-       for obj in $libobjs; do
-         xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-         if test "X$xdir" = "X$obj"; then
-           xdir="."
-         else
-           xdir="$xdir"
-         fi
-         baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-         oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
-         if test ! -f $xdir/$oldobj; then
-           $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
-           $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
-         fi
-       done
-
        # Use standard objects if they are pic
        test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
@@ -2817,17 +3809,26 @@ EOF
            $show "generating symbol list for \`$libname.la'"
            export_symbols="$output_objdir/$libname.exp"
            $run $rm $export_symbols
-           eval cmds=\"$export_symbols_cmds\"
-           IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
+           cmds=$export_symbols_cmds
+           save_ifs="$IFS"; IFS='~'
            for cmd in $cmds; do
              IFS="$save_ifs"
-             $show "$cmd"
-             $run eval "$cmd" || exit $?
+             eval cmd=\"$cmd\"
+             if len=`expr "X$cmd" : ".*"` &&
+              test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+               $show "$cmd"
+               $run eval "$cmd" || exit $?
+               skipped_export=false
+             else
+               # The command line is too long to execute in one step.
+               $show "using reloadable object file for export list..."
+               skipped_export=:
+             fi
            done
            IFS="$save_ifs"
            if test -n "$export_symbols_regex"; then
-             $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
-             $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+             $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
              $show "$mv \"${export_symbols}T\" \"$export_symbols\""
              $run eval '$mv "${export_symbols}T" "$export_symbols"'
            fi
@@ -2838,46 +3839,30 @@ EOF
          $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
        fi
 
+       tmp_deplibs=
+       for test_deplib in $deplibs; do
+               case " $convenience " in
+               *" $test_deplib "*) ;;
+               *)
+                       tmp_deplibs="$tmp_deplibs $test_deplib"
+                       ;;
+               esac
+       done
+       deplibs="$tmp_deplibs"
+
        if test -n "$convenience"; then
          if test -n "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
          else
            gentop="$output_objdir/${outputname}x"
-           $show "${rm}r $gentop"
-           $run ${rm}r "$gentop"
-           $show "mkdir $gentop"
-           $run mkdir "$gentop"
-           status=$?
-           if test $status -ne 0 && test ! -d "$gentop"; then
-             exit $status
-           fi
            generated="$generated $gentop"
 
-           for xlib in $convenience; do
-             # Extract the objects.
-             case $xlib in
-             [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-             *) xabs=`pwd`"/$xlib" ;;
-             esac
-             xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-             xdir="$gentop/$xlib"
-
-             $show "${rm}r $xdir"
-             $run ${rm}r "$xdir"
-             $show "mkdir $xdir"
-             $run mkdir "$xdir"
-             status=$?
-             if test $status -ne 0 && test ! -d "$xdir"; then
-               exit $status
-             fi
-             $show "(cd $xdir && $AR x $xabs)"
-             $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-
-             libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
-           done
+           func_extract_archives $gentop $convenience
+           libobjs="$libobjs $func_extract_archives_result"
          fi
        fi
-
+       
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
          eval flag=\"$thread_safe_flag_spec\"
          linker_flags="$linker_flags $flag"
@@ -2889,14 +3874,148 @@ EOF
        fi
 
        # Do each of the archive commands.
+       if test "$module" = yes && test -n "$module_cmds" ; then
+         if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+           eval test_cmds=\"$module_expsym_cmds\"
+           cmds=$module_expsym_cmds
+         else
+           eval test_cmds=\"$module_cmds\"
+           cmds=$module_cmds
+         fi
+       else
        if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-         eval cmds=\"$archive_expsym_cmds\"
+         eval test_cmds=\"$archive_expsym_cmds\"
+         cmds=$archive_expsym_cmds
+       else
+         eval test_cmds=\"$archive_cmds\"
+         cmds=$archive_cmds
+         fi
+       fi
+
+       if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
+          test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         :
        else
-         eval cmds=\"$archive_cmds\"
+         # The command line is too long to link in one step, link piecewise.
+         $echo "creating reloadable object files..."
+
+         # Save the value of $output and $libobjs because we want to
+         # use them later.  If we have whole_archive_flag_spec, we
+         # want to use save_libobjs as it was before
+         # whole_archive_flag_spec was expanded, because we can't
+         # assume the linker understands whole_archive_flag_spec.
+         # This may have to be revisited, in case too many
+         # convenience libraries get linked in and end up exceeding
+         # the spec.
+         if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+         fi
+         save_output=$output
+         output_la=`$echo "X$output" | $Xsed -e "$basename"`
+
+         # Clear the reloadable object creation command queue and
+         # initialize k to one.
+         test_cmds=
+         concat_cmds=
+         objlist=
+         delfiles=
+         last_robj=
+         k=1
+         output=$output_objdir/$output_la-${k}.$objext
+         # Loop over the list of objects to be linked.
+         for obj in $save_libobjs
+         do
+           eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+           if test "X$objlist" = X ||
+              { len=`expr "X$test_cmds" : ".*"` &&
+                test "$len" -le "$max_cmd_len"; }; then
+             objlist="$objlist $obj"
+           else
+             # The command $test_cmds is almost too long, add a
+             # command to the queue.
+             if test "$k" -eq 1 ; then
+               # The first file doesn't have a previous command to add.
+               eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+             else
+               # All subsequent reloadable object files will link in
+               # the last one created.
+               eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+             fi
+             last_robj=$output_objdir/$output_la-${k}.$objext
+             k=`expr $k + 1`
+             output=$output_objdir/$output_la-${k}.$objext
+             objlist=$obj
+             len=1
+           fi
+         done
+         # Handle the remaining objects by creating one last
+         # reloadable object file.  All subsequent reloadable object
+         # files will link in the last one created.
+         test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+         eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+         if ${skipped_export-false}; then
+           $show "generating symbol list for \`$libname.la'"
+           export_symbols="$output_objdir/$libname.exp"
+           $run $rm $export_symbols
+           libobjs=$output
+           # Append the command to create the export file.
+           eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
+
+         # Set up a command to remove the reloadable object files
+         # after they are used.
+         i=0
+         while test "$i" -lt "$k"
+         do
+           i=`expr $i + 1`
+           delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+         done
+
+         $echo "creating a temporary reloadable object file: $output"
+
+         # Loop through the commands generated above and execute them.
+         save_ifs="$IFS"; IFS='~'
+         for cmd in $concat_cmds; do
+           IFS="$save_ifs"
+           $show "$cmd"
+           $run eval "$cmd" || exit $?
+         done
+         IFS="$save_ifs"
+
+         libobjs=$output
+         # Restore the value of output.
+         output=$save_output
+
+         if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+         fi
+         # Expand the library linking commands again to reset the
+         # value of $libobjs for piecewise linking.
+
+         # Do each of the archive commands.
+         if test "$module" = yes && test -n "$module_cmds" ; then
+           if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+             cmds=$module_expsym_cmds
+           else
+             cmds=$module_cmds
+           fi
+         else
+         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+           cmds=$archive_expsym_cmds
+         else
+           cmds=$archive_cmds
+           fi
+         fi
+
+         # Append the command to remove the reloadable object files
+         # to the just-reset $cmds.
+         eval cmds=\"\$cmds~\$rm $delfiles\"
        fi
-       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
+       save_ifs="$IFS"; IFS='~'
        for cmd in $cmds; do
          IFS="$save_ifs"
+         eval cmd=\"$cmd\"
          $show "$cmd"
          $run eval "$cmd" || exit $?
        done
@@ -2905,7 +4024,7 @@ EOF
        # Restore the uninstalled library and exit
        if test "$mode" = relink; then
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
-         exit 0
+         exit $EXIT_SUCCESS
        fi
 
        # Create links to the real library.
@@ -2953,7 +4072,7 @@ EOF
       *.lo)
        if test -n "$objs$old_deplibs"; then
          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
        libobj="$output"
        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
@@ -2982,38 +4101,10 @@ EOF
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
        else
          gentop="$output_objdir/${obj}x"
-         $show "${rm}r $gentop"
-         $run ${rm}r "$gentop"
-         $show "mkdir $gentop"
-         $run mkdir "$gentop"
-         status=$?
-         if test $status -ne 0 && test ! -d "$gentop"; then
-           exit $status
-         fi
          generated="$generated $gentop"
 
-         for xlib in $convenience; do
-           # Extract the objects.
-           case $xlib in
-           [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-           *) xabs=`pwd`"/$xlib" ;;
-           esac
-           xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-           xdir="$gentop/$xlib"
-
-           $show "${rm}r $xdir"
-           $run ${rm}r "$xdir"
-           $show "mkdir $xdir"
-           $run mkdir "$xdir"
-           status=$?
-           if test $status -ne 0 && test ! -d "$xdir"; then
-             exit $status
-           fi
-           $show "(cd $xdir && $AR x $xabs)"
-           $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-
-           reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
-         done
+         func_extract_archives $gentop $convenience
+         reload_conv_objs="$reload_objs $func_extract_archives_result"
        fi
       fi
 
@@ -3021,10 +4112,11 @@ EOF
       reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
       output="$obj"
-      eval cmds=\"$reload_cmds\"
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
+      cmds=$reload_cmds
+      save_ifs="$IFS"; IFS='~'
       for cmd in $cmds; do
        IFS="$save_ifs"
+       eval cmd=\"$cmd\"
        $show "$cmd"
        $run eval "$cmd" || exit $?
       done
@@ -3037,7 +4129,7 @@ EOF
          $run ${rm}r $gentop
        fi
 
-       exit 0
+       exit $EXIT_SUCCESS
       fi
 
       if test "$build_libtool_libs" != yes; then
@@ -3048,37 +4140,24 @@ EOF
 
        # Create an invalid libtool object if no PIC, so that we don't
        # accidentally link it into a program.
-       $show "echo timestamp > $libobj"
-       $run eval "echo timestamp > $libobj" || exit $?
-       exit 0
+       $show "echo timestamp > $libobj"
+       $run eval "echo timestamp > $libobj" || exit $?
+       exit $EXIT_SUCCESS
       fi
 
       if test -n "$pic_flag" || test "$pic_mode" != default; then
        # Only do commands if we really have different PIC objects.
        reload_objs="$libobjs $reload_conv_objs"
        output="$libobj"
-       eval cmds=\"$reload_cmds\"
-       IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
+       cmds=$reload_cmds
+       save_ifs="$IFS"; IFS='~'
        for cmd in $cmds; do
          IFS="$save_ifs"
+         eval cmd=\"$cmd\"
          $show "$cmd"
          $run eval "$cmd" || exit $?
        done
        IFS="$save_ifs"
-      else
-       # Just create a symlink.
-       $show $rm $libobj
-       $run $rm $libobj
-       xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
-       if test "X$xdir" = "X$libobj"; then
-         xdir="."
-       else
-         xdir="$xdir"
-       fi
-       baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
-       oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
-       $show "(cd $xdir && $LN_S $oldobj $baseobj)"
-       $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
       fi
 
       if test -n "$gentop"; then
@@ -3086,12 +4165,12 @@ EOF
        $run ${rm}r $gentop
       fi
 
-      exit 0
+      exit $EXIT_SUCCESS
       ;;
 
     prog)
       case $host in
-       *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
+       *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
       esac
       if test -n "$vinfo"; then
        $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
@@ -3116,6 +4195,16 @@ EOF
        ;;
       esac
 
+      case $host in
+      *darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        if test "$tagname" = CXX ; then
+        compile_command="$compile_command ${wl}-bind_at_load"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        fi
+        ;;
+      esac
+
       compile_command="$compile_command $compile_deplibs"
       finalize_command="$finalize_command $finalize_deplibs"
 
@@ -3266,31 +4355,31 @@ extern \"C\" {
            done
 
            if test -n "$exclude_expsyms"; then
-             $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+             $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
              $run eval '$mv "$nlist"T "$nlist"'
            fi
 
            if test -n "$export_symbols_regex"; then
-             $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+             $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
              $run eval '$mv "$nlist"T "$nlist"'
            fi
 
            # Prepare the list of exported symbols
            if test -z "$export_symbols"; then
-             export_symbols="$output_objdir/$output.exp"
+             export_symbols="$output_objdir/$outputname.exp"
              $run $rm $export_symbols
-             $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+             $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
            else
-             $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
-             $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+             $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+             $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
              $run eval 'mv "$nlist"T "$nlist"'
            fi
          fi
 
          for arg in $dlprefiles; do
            $show "extracting global C symbols from \`$arg'"
-           name=`echo "$arg" | sed -e 's%^.*/%%'`
-           $run eval 'echo ": $name " >> "$nlist"'
+           name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+           $run eval '$echo ": $name " >> "$nlist"'
            $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
          done
 
@@ -3299,12 +4388,18 @@ extern \"C\" {
            test -f "$nlist" || : > "$nlist"
 
            if test -n "$exclude_expsyms"; then
-             egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+             $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
              $mv "$nlist"T "$nlist"
            fi
 
            # Try sorting and uniquifying the output.
-           if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
+           if grep -v "^: " < "$nlist" |
+               if sort -k 3 </dev/null >/dev/null 2>&1; then
+                 sort -k 3
+               else
+                 sort +2
+               fi |
+               uniq > "$nlist"S; then
              :
            else
              grep -v "^: " < "$nlist" > "$nlist"S
@@ -3313,7 +4408,7 @@ extern \"C\" {
            if test -f "$nlist"S; then
              eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
            else
-             echo '/* NONE */' >> "$output_objdir/$dlsyms"
+             $echo '/* NONE */' >> "$output_objdir/$dlsyms"
            fi
 
            $echo >> "$output_objdir/$dlsyms" "\
@@ -3328,7 +4423,26 @@ extern \"C\" {
 #endif
 
 /* The mapping between symbol names and symbols. */
+"
+
+           case $host in
+           *cygwin* | *mingw* )
+         $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+             ;;
+           * )
+         $echo >> "$output_objdir/$dlsyms" "\
 const struct {
+"
+             ;;
+           esac
+
+
+         $echo >> "$output_objdir/$dlsyms" "\
   const char *name;
   lt_ptr address;
 }
@@ -3365,18 +4479,18 @@ static const void *lt_preloaded_setup() {
          *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
            case "$compile_command " in
            *" -static "*) ;;
-           *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+           *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
            esac;;
          *-*-hpux*)
            case "$compile_command " in
            *" -static "*) ;;
-           *) pic_flag_for_symtable=" $pic_flag -DPIC";;
+           *) pic_flag_for_symtable=" $pic_flag";;
            esac
          esac
 
          # Now compile the dynamic symbol file.
-         $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-         $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+         $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+         $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
          # Clean up the generated files.
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
@@ -3388,7 +4502,7 @@ static const void *lt_preloaded_setup() {
          ;;
        *)
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
          ;;
        esac
       else
@@ -3401,7 +4515,7 @@ static const void *lt_preloaded_setup() {
        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
       fi
 
-      if test $need_relink = no || test "$build_libtool_libs" != yes; then
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
        # Replace the output file specification.
        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
        link_command="$compile_command$compile_rpath"
@@ -3476,7 +4590,7 @@ static const void *lt_preloaded_setup() {
        # Link the executable and exit
        $show "$link_command"
        $run eval "$link_command" || exit $?
-       exit 0
+       exit $EXIT_SUCCESS
       fi
 
       if test "$hardcode_action" = relink; then
@@ -3526,15 +4640,15 @@ static const void *lt_preloaded_setup() {
            relink_command="$var=\"$var_value\"; export $var; $relink_command"
          fi
        done
-       relink_command="cd `pwd`; $relink_command"
+       relink_command="(cd `pwd`; $relink_command)"
        relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       fi
 
       # Quote $echo for shipping.
-      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
-       case $0 in
-       [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
-       *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+       case $progpath in
+       [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+       *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
        esac
        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
       else
@@ -3546,15 +4660,230 @@ static const void *lt_preloaded_setup() {
        # win32 will think the script is a binary if it has
        # a .exe suffix, so we strip it off here.
        case $output in
-         *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
+         *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
        esac
        # test for cygwin because mv fails w/o .exe extensions
        case $host in
-         *cygwin*) exeext=.exe ;;
+         *cygwin*)
+           exeext=.exe
+           outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
          *) exeext= ;;
        esac
+       case $host in
+         *cygwin* | *mingw* )
+           cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
+           cwrapper=`$echo ${output}.exe`
+           $rm $cwrappersource $cwrapper
+           trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+           cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "/bin/sh $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+           cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int i;
+
+  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  newargz = XMALLOC(char *, argc+2);
+EOF
+
+           cat >> $cwrappersource <<EOF
+  newargz[0] = "$SHELL";
+EOF
+
+           cat >> $cwrappersource <<"EOF"
+  newargz[1] = fnqualify(argv[0]);
+  /* we know the script has the same name, without the .exe */
+  /* so make sure newargz[1] doesn't end in .exe */
+  strendzap(newargz[1],".exe");
+  for (i = 1; i < argc; i++)
+    newargz[i+1] = xstrdup(argv[i]);
+  newargz[argc+1] = NULL;
+EOF
+
+           cat >> $cwrappersource <<EOF
+  execv("$SHELL",newargz);
+EOF
+
+           cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void * p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha (name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return (char *) base;
+}
+
+char *
+fnqualify(const char *path)
+{
+  size_t size;
+  char *p;
+  char tmp[LT_PATHMAX + 1];
+
+  assert(path != NULL);
+
+  /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha (path[0]) && path[1] == ':')
+    return xstrdup (path);
+#endif
+  if (IS_DIR_SEPARATOR (path[0]))
+    return xstrdup (path);
+
+  /* prepend the current directory */
+  /* doesn't handle '~' */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+  p = XMALLOC(char, size);
+  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+  return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert(str != NULL);
+  assert(pat != NULL);
+
+  len = strlen(str);
+  patlen = strlen(pat);
+
+  if (patlen <= len)
+  {
+    str += len - patlen;
+    if (strcmp(str, pat) == 0)
+      *str = '\0';
+  }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+          const char * message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+EOF
+         # we should really use a build-platform specific compiler
+         # here, but OTOH, the wrappers (shell script and this C one)
+         # are only useful if you want to execute the "real" binary.
+         # Since the "real" binary is built for $host, then this
+         # wrapper might as well be built for $host, too.
+         $run $LTCC -s -o $cwrapper $cwrappersource
+         ;;
+       esac
        $rm $output
-       trap "$rm $output; exit 1" 1 2 15
+       trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
        $echo > $output "\
 #! $SHELL
@@ -3570,12 +4899,12 @@ static const void *lt_preloaded_setup() {
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
+Xsed='${SED} -e 1s/^X//'
 sed_quote_subst='$sed_quote_subst'
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 relink_command=\"$relink_command\"
 
@@ -3608,7 +4937,7 @@ else
   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
 
   # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
   while test -n \"\$file\"; do
     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
 
@@ -3621,7 +4950,7 @@ else
     fi
 
     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
   done
 
   # Try to get the absolute directory name.
@@ -3630,12 +4959,12 @@ else
 "
 
        if test "$fast_install" = yes; then
-         echo >> $output "\
+         $echo >> $output "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" || \\
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
     file=\"\$\$-\$program\"
@@ -3646,7 +4975,7 @@ else
       $rm \"\$progdir/\$file\"
     fi"
 
-         echo >> $output "\
+         $echo >> $output "\
 
     # relink executable if necessary
     if test -n \"\$relink_command\"; then
@@ -3654,7 +4983,7 @@ else
       else
        $echo \"\$relink_command_output\" >&2
        $rm \"\$progdir/\$file\"
-       exit 1
+       exit $EXIT_FAILURE
       fi
     fi
 
@@ -3664,13 +4993,13 @@ else
     $rm \"\$progdir/\$file\"
   fi"
        else
-         echo >> $output "\
+         $echo >> $output "\
   program='$outputname'
   progdir=\"\$thisdir/$objdir\"
 "
        fi
 
-       echo >> $output "\
+       $echo >> $output "\
 
   if test -f \"\$progdir/\$program\"; then"
 
@@ -3701,14 +5030,6 @@ else
       # Run the actual program with our arguments.
 "
        case $host in
-       # win32 systems need to use the prog path for dll
-       # lookup to work
-       *-*-cygwin* | *-*-pw32*)
-         $echo >> $output "\
-      exec \$progdir/\$program \${1+\"\$@\"}
-"
-         ;;
-
        # Backslashes separate directories on plain windows
        *-*-mingw | *-*-os2*)
          $echo >> $output "\
@@ -3718,30 +5039,26 @@ else
 
        *)
          $echo >> $output "\
-      # Export the path to the program.
-      PATH=\"\$progdir:\$PATH\"
-      export PATH
-
-      exec \$program \${1+\"\$@\"}
+      exec \$progdir/\$program \${1+\"\$@\"}
 "
          ;;
        esac
        $echo >> $output "\
       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
-      exit 1
+      exit $EXIT_FAILURE
     fi
   else
     # The program doesn't exist.
     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
     \$echo \"This script is just a wrapper for \$program.\" 1>&2
-    echo \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit 1
+    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit $EXIT_FAILURE
   fi
 fi\
 "
        chmod +x $output
       fi
-      exit 0
+      exit $EXIT_SUCCESS
       ;;
     esac
 
@@ -3757,74 +5074,86 @@ fi\
          oldobjs="$libobjs_save"
          build_libtool_libs=no
        else
-         oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+         oldobjs="$old_deplibs $non_pic_objects"
        fi
        addlibs="$old_convenience"
       fi
 
       if test -n "$addlibs"; then
        gentop="$output_objdir/${outputname}x"
-       $show "${rm}r $gentop"
-       $run ${rm}r "$gentop"
-       $show "mkdir $gentop"
-       $run mkdir "$gentop"
-       status=$?
-       if test $status -ne 0 && test ! -d "$gentop"; then
-         exit $status
-       fi
        generated="$generated $gentop"
 
-       # Add in members from convenience archives.
-       for xlib in $addlibs; do
-         # Extract the objects.
-         case $xlib in
-         [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-         *) xabs=`pwd`"/$xlib" ;;
-         esac
-         xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-         xdir="$gentop/$xlib"
-
-         $show "${rm}r $xdir"
-         $run ${rm}r "$xdir"
-         $show "mkdir $xdir"
-         $run mkdir "$xdir"
-         status=$?
-         if test $status -ne 0 && test ! -d "$xdir"; then
-           exit $status
-         fi
-         $show "(cd $xdir && $AR x $xabs)"
-         $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-
-         oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
-       done
+       func_extract_archives $gentop $addlibs
+       oldobjs="$oldobjs $func_extract_archives_result"
       fi
 
       # Do each command in the archive commands.
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-       eval cmds=\"$old_archive_from_new_cmds\"
+       cmds=$old_archive_from_new_cmds
       else
-       # Ensure that we have .o objects in place in case we decided
-       # not to build a shared library, and have fallen back to building
-       # static libs even though --disable-static was passed!
-       for oldobj in $oldobjs; do
-         if test ! -f $oldobj; then
-           xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
-           if test "X$xdir" = "X$oldobj"; then
-             xdir="."
+       eval cmds=\"$old_archive_cmds\"
+
+       if len=`expr "X$cmds" : ".*"` &&
+            test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         cmds=$old_archive_cmds
+       else
+         # the command line is too long to link in one step, link in parts
+         $echo "using piecewise archive linking..."
+         save_RANLIB=$RANLIB
+         RANLIB=:
+         objlist=
+         concat_cmds=
+         save_oldobjs=$oldobjs
+         # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+         # encoded into archives.  This makes 'ar r' malfunction in
+         # this piecewise linking case whenever conflicting object
+         # names appear in distinct ar calls; check, warn and compensate.
+           if (for obj in $save_oldobjs
+           do
+             $echo "X$obj" | $Xsed -e 's%^.*/%%'
+           done | sort | sort -uc >/dev/null 2>&1); then
+           :
+         else
+           $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+           $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+           AR_FLAGS=cq
+         fi
+         # Is there a better way of finding the last object in the list?
+         for obj in $save_oldobjs
+         do
+           last_oldobj=$obj
+         done
+         for obj in $save_oldobjs
+         do
+           oldobjs="$objlist $obj"
+           objlist="$objlist $obj"
+           eval test_cmds=\"$old_archive_cmds\"
+           if len=`expr "X$test_cmds" : ".*"` &&
+              test "$len" -le "$max_cmd_len"; then
+             :
            else
-             xdir="$xdir"
+             # the above command should be used before it gets too long
+             oldobjs=$objlist
+             if test "$obj" = "$last_oldobj" ; then
+               RANLIB=$save_RANLIB
+             fi
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+             objlist=
            fi
-           baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
-           obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
-           $show "(cd $xdir && ${LN_S} $obj $baseobj)"
-           $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
+         done
+         RANLIB=$save_RANLIB
+         oldobjs=$objlist
+         if test "X$oldobjs" = "X" ; then
+           eval cmds=\"\$concat_cmds\"
+         else
+           eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
          fi
-       done
-
-       eval cmds=\"$old_archive_cmds\"
+       fi
       fi
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
+      save_ifs="$IFS"; IFS='~'
       for cmd in $cmds; do
+        eval cmd=\"$cmd\"
        IFS="$save_ifs"
        $show "$cmd"
        $run eval "$cmd" || exit $?
@@ -3856,8 +5185,12 @@ fi\
        fi
       done
       # Quote the link command for shipping.
-      relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+       relink_command=
+      fi
+
 
       # Only create the output if not a dry run.
       if test -z "$run"; then
@@ -3873,10 +5206,10 @@ fi\
              case $deplib in
              *.la)
                name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
-               eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
                if test -z "$libdir"; then
                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-                 exit 1
+                 exit $EXIT_FAILURE
                fi
                newdependency_libs="$newdependency_libs $libdir/$name"
                ;;
@@ -3887,10 +5220,10 @@ fi\
            newdlfiles=
            for lib in $dlfiles; do
              name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-             eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+             eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
              if test -z "$libdir"; then
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-               exit 1
+               exit $EXIT_FAILURE
              fi
              newdlfiles="$newdlfiles $libdir/$name"
            done
@@ -3898,20 +5231,39 @@ fi\
            newdlprefiles=
            for lib in $dlprefiles; do
              name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-             eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+             eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
              if test -z "$libdir"; then
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-               exit 1
+               exit $EXIT_FAILURE
              fi
              newdlprefiles="$newdlprefiles $libdir/$name"
            done
            dlprefiles="$newdlprefiles"
+         else
+           newdlfiles=
+           for lib in $dlfiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlfiles="$newdlfiles $abs"
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlprefiles="$newdlprefiles $abs"
+           done
+           dlprefiles="$newdlprefiles"
          fi
          $rm $output
          # place dlname in correct position for cygwin
          tdlname=$dlname
          case $host,$output,$installed,$module,$dlname in
-           *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+           *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
          esac
          $echo > $output "\
 # $outputname - a libtool library file
@@ -3940,13 +5292,16 @@ revision=$revision
 # Is this an already installed library?
 installed=$installed
 
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
 # Files to dlopen/dlpreopen
 dlopen='$dlfiles'
 dlpreopen='$dlprefiles'
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-         if test "$installed" = no && test $need_relink = yes; then
+         if test "$installed" = no && test "$need_relink" = yes; then
            $echo >> $output "\
 relink_command=\"$relink_command\""
          fi
@@ -3959,7 +5314,7 @@ relink_command=\"$relink_command\""
       $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
       ;;
     esac
-    exit 0
+    exit $EXIT_SUCCESS
     ;;
 
   # libtool install mode
@@ -3974,7 +5329,7 @@ relink_command=\"$relink_command\""
       # Aesthetically quote it.
       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        arg="\"$arg\""
        ;;
       esac
@@ -3990,7 +5345,7 @@ relink_command=\"$relink_command\""
     # Aesthetically quote it.
     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
     case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \      ]*|*]*)
+    *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
       arg="\"$arg\""
       ;;
     esac
@@ -4038,7 +5393,7 @@ relink_command=\"$relink_command\""
       # Aesthetically quote the argument.
       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        arg="\"$arg\""
        ;;
       esac
@@ -4048,13 +5403,13 @@ relink_command=\"$relink_command\""
     if test -z "$install_prog"; then
       $echo "$modename: you must specify an install program" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     if test -n "$prev"; then
       $echo "$modename: the \`$prev' option requires an argument" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     if test -z "$files"; then
@@ -4064,7 +5419,7 @@ relink_command=\"$relink_command\""
        $echo "$modename: you must specify a destination" 1>&2
       fi
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     # Strip any trailing slash from the destination.
@@ -4082,10 +5437,10 @@ relink_command=\"$relink_command\""
 
       # Not a directory, so check to see that there is only one file specified.
       set dummy $files
-      if test $# -gt 2; then
+      if test "$#" -gt 2; then
        $echo "$modename: \`$dest' is not a directory" 1>&2
        $echo "$help" 1>&2
-       exit 1
+       exit $EXIT_FAILURE
       fi
     fi
     case $destdir in
@@ -4097,7 +5452,7 @@ relink_command=\"$relink_command\""
        *)
          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
          $echo "$help" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
          ;;
        esac
       done
@@ -4122,11 +5477,11 @@ relink_command=\"$relink_command\""
 
       *.la)
        # Check to see that this really is a libtool archive.
-       if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+       if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
        else
          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
          $echo "$help" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
 
        library_names=
@@ -4157,12 +5512,33 @@ relink_command=\"$relink_command\""
        dir="$dir$objdir"
 
        if test -n "$relink_command"; then
+         # Determine the prefix the user has applied to our future dir.
+         inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+         # Don't allow the user to place us outside of our expected
+         # location b/c this prevents finding dependent libraries that
+         # are installed to the same prefix.
+         # At present, this check doesn't affect windows .dll's that
+         # are installed into $libdir/../bin (currently, that works fine)
+         # but it's something to keep an eye on.
+         if test "$inst_prefix_dir" = "$destdir"; then
+           $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+           exit $EXIT_FAILURE
+         fi
+
+         if test -n "$inst_prefix_dir"; then
+           # Stick the inst_prefix_dir data into the link command.
+           relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+         else
+           relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+         fi
+
          $echo "$modename: warning: relinking \`$file'" 1>&2
          $show "$relink_command"
          if $run eval "$relink_command"; then :
          else
            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-           continue
+           exit $EXIT_FAILURE
          fi
        fi
 
@@ -4184,7 +5560,7 @@ relink_command=\"$relink_command\""
            $run eval "$striplib $destdir/$realname" || exit $?
          fi
 
-         if test $# -gt 0; then
+         if test "$#" -gt 0; then
            # Delete the old symlinks, and create new ones.
            for linkname
            do
@@ -4197,10 +5573,11 @@ relink_command=\"$relink_command\""
 
          # Do each command in the postinstall commands.
          lib="$destdir/$realname"
-         eval cmds=\"$postinstall_cmds\"
-         IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
+         cmds=$postinstall_cmds
+         save_ifs="$IFS"; IFS='~'
          for cmd in $cmds; do
            IFS="$save_ifs"
+           eval cmd=\"$cmd\"
            $show "$cmd"
            $run eval "$cmd" || exit $?
          done
@@ -4240,7 +5617,7 @@ relink_command=\"$relink_command\""
        *)
          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
          $echo "$help" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
          ;;
        esac
 
@@ -4258,7 +5635,7 @@ relink_command=\"$relink_command\""
          $show "$install_prog $staticobj $staticdest"
          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
        fi
-       exit 0
+       exit $EXIT_SUCCESS
        ;;
 
       *)
@@ -4270,21 +5647,49 @@ relink_command=\"$relink_command\""
          destfile="$destdir/$destfile"
        fi
 
+       # If the file is missing, and there is a .exe on the end, strip it
+       # because it is most likely a libtool script we actually want to
+       # install
+       stripped_ext=""
+       case $file in
+         *.exe)
+           if test ! -f "$file"; then
+             file=`$echo $file|${SED} 's,.exe$,,'`
+             stripped_ext=".exe"
+           fi
+           ;;
+       esac
+
        # Do a test to see if this is really a libtool program.
-       if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+       case $host in
+       *cygwin*|*mingw*)
+           wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+           ;;
+       *)
+           wrapper=$file
+           ;;
+       esac
+       if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
          notinst_deplibs=
          relink_command=
 
+         # To insure that "foo" is sourced, and not "foo.exe",
+         # finese the cygwin/MSYS system by explicitly sourcing "foo."
+         # which disallows the automatic-append-.exe behavior.
+         case $build in
+         *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+         *) wrapperdot=${wrapper} ;;
+         esac
          # If there is no directory component, then add one.
          case $file in
-         */* | *\\*) . $file ;;
-         *) . ./$file ;;
+         */* | *\\*) . ${wrapperdot} ;;
+         *) . ./${wrapperdot} ;;
          esac
 
          # Check the variables that should have been set.
          if test -z "$notinst_deplibs"; then
-           $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
-           exit 1
+           $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+           exit $EXIT_FAILURE
          fi
 
          finalize=yes
@@ -4306,10 +5711,17 @@ relink_command=\"$relink_command\""
          done
 
          relink_command=
+         # To insure that "foo" is sourced, and not "foo.exe",
+         # finese the cygwin/MSYS system by explicitly sourcing "foo."
+         # which disallows the automatic-append-.exe behavior.
+         case $build in
+         *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+         *) wrapperdot=${wrapper} ;;
+         esac
          # If there is no directory component, then add one.
          case $file in
-         */* | *\\*) . $file ;;
-         *) . ./$file ;;
+         */* | *\\*) . ${wrapperdot} ;;
+         *) . ./${wrapperdot} ;;
          esac
 
          outputname=
@@ -4318,12 +5730,16 @@ relink_command=\"$relink_command\""
              tmpdir="/tmp"
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
              tmpdir="$tmpdir/libtool-$$"
-             if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
+             save_umask=`umask`
+             umask 0077
+             if $mkdir "$tmpdir"; then
+               umask $save_umask
              else
+               umask $save_umask
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
                continue
              fi
-             file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+             file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
              outputname="$tmpdir/$file"
              # Replace the output file specification.
              relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
@@ -4341,14 +5757,14 @@ relink_command=\"$relink_command\""
            fi
          else
            # Install the binary that we compiled earlier.
-           file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+           file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
          fi
        fi
 
        # remove .exe since cygwin /usr/bin/install will append another
        # one anyways
        case $install_prog,$host in
-       /usr/bin/install*,*cygwin*)
+       */usr/bin/install*,*cygwin*)
          case $file:$destfile in
          *.exe:*.exe)
            # this is ok
@@ -4357,7 +5773,7 @@ relink_command=\"$relink_command\""
            destfile=$destfile.exe
            ;;
          *:*.exe)
-           destfile=`echo $destfile | sed -e 's,.exe$,,'`
+           destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
            ;;
          esac
          ;;
@@ -4378,16 +5794,17 @@ relink_command=\"$relink_command\""
       $show "$install_prog $file $oldlib"
       $run eval "$install_prog \$file \$oldlib" || exit $?
 
-      if test -n "$stripme" && test -n "$striplib"; then
+      if test -n "$stripme" && test -n "$old_striplib"; then
        $show "$old_striplib $oldlib"
        $run eval "$old_striplib $oldlib" || exit $?
       fi
 
       # Do each command in the postinstall commands.
-      eval cmds=\"$old_postinstall_cmds\"
-      IFS="${IFS=      }"; save_ifs="$IFS"; IFS='~'
+      cmds=$old_postinstall_cmds
+      save_ifs="$IFS"; IFS='~'
       for cmd in $cmds; do
        IFS="$save_ifs"
+       eval cmd=\"$cmd\"
        $show "$cmd"
        $run eval "$cmd" || exit $?
       done
@@ -4401,9 +5818,9 @@ relink_command=\"$relink_command\""
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $0 --finish$current_libdirs'
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
     else
-      exit 0
+      exit $EXIT_SUCCESS
     fi
     ;;
 
@@ -4422,10 +5839,11 @@ relink_command=\"$relink_command\""
       for libdir in $libdirs; do
        if test -n "$finish_cmds"; then
          # Do each command in the finish commands.
-         eval cmds=\"$finish_cmds\"
-         IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
+         cmds=$finish_cmds
+         save_ifs="$IFS"; IFS='~'
          for cmd in $cmds; do
            IFS="$save_ifs"
+           eval cmd=\"$cmd\"
            $show "$cmd"
            $run eval "$cmd" || admincmds="$admincmds
        $cmd"
@@ -4442,43 +5860,43 @@ relink_command=\"$relink_command\""
     fi
 
     # Exit here if they wanted silent mode.
-    test "$show" = ":" && exit 0
+    test "$show" = : && exit $EXIT_SUCCESS
 
-    echo "----------------------------------------------------------------------"
-    echo "Libraries have been installed in:"
+    $echo "----------------------------------------------------------------------"
+    $echo "Libraries have been installed in:"
     for libdir in $libdirs; do
-      echo "   $libdir"
+      $echo "   $libdir"
     done
-    echo
-    echo "If you ever happen to want to link against installed libraries"
-    echo "in a given directory, LIBDIR, you must either use libtool, and"
-    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
-    echo "flag during linking and do at least one of the following:"
+    $echo
+    $echo "If you ever happen to want to link against installed libraries"
+    $echo "in a given directory, LIBDIR, you must either use libtool, and"
+    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $echo "flag during linking and do at least one of the following:"
     if test -n "$shlibpath_var"; then
-      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      echo "     during execution"
+      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $echo "     during execution"
     fi
     if test -n "$runpath_var"; then
-      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-      echo "     during linking"
+      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $echo "     during linking"
     fi
     if test -n "$hardcode_libdir_flag_spec"; then
       libdir=LIBDIR
       eval flag=\"$hardcode_libdir_flag_spec\"
 
-      echo "   - use the \`$flag' linker flag"
+      $echo "   - use the \`$flag' linker flag"
     fi
     if test -n "$admincmds"; then
-      echo "   - have your system administrator run these commands:$admincmds"
+      $echo "   - have your system administrator run these commands:$admincmds"
     fi
     if test -f /etc/ld.so.conf; then
-      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
     fi
-    echo
-    echo "See any operating system documentation about shared libraries for"
-    echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    echo "----------------------------------------------------------------------"
-    exit 0
+    $echo
+    $echo "See any operating system documentation about shared libraries for"
+    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    $echo "----------------------------------------------------------------------"
+    exit $EXIT_SUCCESS
     ;;
 
   # libtool execute mode
@@ -4490,7 +5908,7 @@ relink_command=\"$relink_command\""
     if test -z "$cmd"; then
       $echo "$modename: you must specify a COMMAND" 1>&2
       $echo "$help"
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     # Handle -dlopen flags immediately.
@@ -4498,18 +5916,18 @@ relink_command=\"$relink_command\""
       if test ! -f "$file"; then
        $echo "$modename: \`$file' is not a file" 1>&2
        $echo "$help" 1>&2
-       exit 1
+       exit $EXIT_FAILURE
       fi
 
       dir=
       case $file in
       *.la)
        # Check to see that this really is a libtool archive.
-       if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+       if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
        else
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
          $echo "$help" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
 
        # Read the libtool library.
@@ -4536,7 +5954,7 @@ relink_command=\"$relink_command\""
          dir="$dir/$objdir"
        else
          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-         exit 1
+         exit $EXIT_FAILURE
        fi
        ;;
 
@@ -4576,7 +5994,7 @@ relink_command=\"$relink_command\""
       -*) ;;
       *)
        # Do a test to see if this is really a libtool program.
-       if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+       if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
          # If there is no directory component, then add one.
          case $file in
          */* | *\\*) . $file ;;
@@ -4599,7 +6017,7 @@ relink_command=\"$relink_command\""
        eval "export $shlibpath_var"
       fi
 
-      # Restore saved enviroment variables
+      # Restore saved environment variables
       if test "${save_LC_ALL+set}" = set; then
        LC_ALL="$save_LC_ALL"; export LC_ALL
       fi
@@ -4608,15 +6026,15 @@ relink_command=\"$relink_command\""
       fi
 
       # Now prepare to actually exec the command.
-      exec_cmd='"$cmd"$args'
+      exec_cmd="\"\$cmd\"$args"
     else
       # Display what would be done.
       if test -n "$shlibpath_var"; then
        eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
        $echo "export $shlibpath_var"
       fi
-      $echo "$cmd$args"
-      exit 0
+      eval \$echo \"\$cmd\"$args
+      exit $EXIT_SUCCESS
     fi
     ;;
 
@@ -4644,24 +6062,25 @@ relink_command=\"$relink_command\""
     if test -z "$rm"; then
       $echo "$modename: you must specify an RM program" 1>&2
       $echo "$help" 1>&2
-      exit 1
+      exit $EXIT_FAILURE
     fi
 
     rmdirs=
 
+    origobjdir="$objdir"
     for file in $files; do
       dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
       if test "X$dir" = "X$file"; then
        dir=.
-       objdir="$objdir"
+       objdir="$origobjdir"
       else
-       objdir="$dir/$objdir"
+       objdir="$dir/$origobjdir"
       fi
       name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-      test $mode = uninstall && objdir="$dir"
+      test "$mode" = uninstall && objdir="$dir"
 
       # Remember objdir for removal later, being careful to avoid duplicates
-      if test $mode = clean; then
+      if test "$mode" = clean; then
        case " $rmdirs " in
          *" $objdir "*) ;;
          *) rmdirs="$rmdirs $objdir" ;;
@@ -4685,7 +6104,7 @@ relink_command=\"$relink_command\""
       case $name in
       *.la)
        # Possibly a libtool archive, so verify it.
-       if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+       if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
          . $dir/$name
 
          # Delete the libtool libraries and symlinks.
@@ -4693,18 +6112,19 @@ relink_command=\"$relink_command\""
            rmfiles="$rmfiles $objdir/$n"
          done
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-         test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+         test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
-         if test $mode = uninstall; then
+         if test "$mode" = uninstall; then
            if test -n "$library_names"; then
              # Do each command in the postuninstall commands.
-             eval cmds=\"$postuninstall_cmds\"
-             IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
+             cmds=$postuninstall_cmds
+             save_ifs="$IFS"; IFS='~'
              for cmd in $cmds; do
                IFS="$save_ifs"
+               eval cmd=\"$cmd\"
                $show "$cmd"
                $run eval "$cmd"
-               if test $? != 0 && test "$rmforce" != yes; then
+               if test "$?" -ne 0 && test "$rmforce" != yes; then
                  exit_status=1
                fi
              done
@@ -4713,13 +6133,14 @@ relink_command=\"$relink_command\""
 
            if test -n "$old_library"; then
              # Do each command in the old_postuninstall commands.
-             eval cmds=\"$old_postuninstall_cmds\"
-             IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
+             cmds=$old_postuninstall_cmds
+             save_ifs="$IFS"; IFS='~'
              for cmd in $cmds; do
                IFS="$save_ifs"
+               eval cmd=\"$cmd\"
                $show "$cmd"
                $run eval "$cmd"
-               if test $? != 0 && test "$rmforce" != yes; then
+               if test "$?" -ne 0 && test "$rmforce" != yes; then
                  exit_status=1
                fi
              done
@@ -4731,22 +6152,52 @@ relink_command=\"$relink_command\""
        ;;
 
       *.lo)
-       if test "$build_old_libs" = yes; then
-         oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
-         rmfiles="$rmfiles $dir/$oldobj"
+       # Possibly a libtool object, so verify it.
+       if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+         # Read the .lo file
+         . $dir/$name
+
+         # Add PIC object to the list of files to remove.
+         if test -n "$pic_object" \
+            && test "$pic_object" != none; then
+           rmfiles="$rmfiles $dir/$pic_object"
+         fi
+
+         # Add non-PIC object to the list of files to remove.
+         if test -n "$non_pic_object" \
+            && test "$non_pic_object" != none; then
+           rmfiles="$rmfiles $dir/$non_pic_object"
+         fi
        fi
        ;;
 
       *)
-       # Do a test to see if this is a libtool program.
-       if test $mode = clean &&
-          (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-         relink_command=
-         . $dir/$file
+       if test "$mode" = clean ; then
+         noexename=$name
+         case $file in
+         *.exe)
+           file=`$echo $file|${SED} 's,.exe$,,'`
+           noexename=`$echo $name|${SED} 's,.exe$,,'`
+           # $file with .exe has already been added to rmfiles,
+           # add $file without .exe
+           rmfiles="$rmfiles $file"
+           ;;
+         esac
+         # Do a test to see if this is a libtool program.
+         if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+           relink_command=
+           . $dir/$noexename
 
-         rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
-         if test "$fast_install" = yes && test -n "$relink_command"; then
-           rmfiles="$rmfiles $objdir/lt-$name"
+           # note $name still contains .exe if it was in $file originally
+           # as does the version of $file that was added into $rmfiles
+           rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+           if test "$fast_install" = yes && test -n "$relink_command"; then
+             rmfiles="$rmfiles $objdir/lt-$name"
+           fi
+           if test "X$noexename" != "X$name" ; then
+             rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+           fi
          fi
        fi
        ;;
@@ -4754,6 +6205,7 @@ relink_command=\"$relink_command\""
       $show "$rm $rmfiles"
       $run $rm $rmfiles || exit_status=1
     done
+    objdir="$origobjdir"
 
     # Try to remove the ${objdir}s in the directories where we deleted files
     for dir in $rmdirs; do
@@ -4769,20 +6221,20 @@ relink_command=\"$relink_command\""
   "")
     $echo "$modename: you must specify a MODE" 1>&2
     $echo "$generic_help" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
     ;;
   esac
 
   if test -z "$exec_cmd"; then
     $echo "$modename: invalid operation mode \`$mode'" 1>&2
     $echo "$generic_help" 1>&2
-    exit 1
+    exit $EXIT_FAILURE
   fi
 fi # test -z "$show_help"
 
 if test -n "$exec_cmd"; then
   eval exec $exec_cmd
-  exit 1
+  exit $EXIT_FAILURE
 fi
 
 # We need to display help for each of the modes.
@@ -4801,6 +6253,7 @@ Provide generalized library-building support services.
     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
     --quiet           same as \`--silent'
     --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
     --version         print version information
 
 MODE must be one of the following:
@@ -4814,8 +6267,10 @@ MODE must be one of the following:
       uninstall       remove libraries from an installed directory
 
 MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE."
-  exit 0
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+  exit $EXIT_SUCCESS
   ;;
 
 clean)
@@ -4926,6 +6381,9 @@ The following components of LINK-COMMAND are treated specially:
   -no-install       link a not-installable executable
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
   -release RELEASE  specify package release information
   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
@@ -4967,14 +6425,34 @@ Otherwise, only FILE itself is deleted using RM."
 *)
   $echo "$modename: invalid operation mode \`$mode'" 1>&2
   $echo "$help" 1>&2
-  exit 1
+  exit $EXIT_FAILURE
   ;;
 esac
 
-echo
+$echo
 $echo "Try \`$modename --help' for more information about other modes."
 
-exit 0
+exit $?
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:
 # mode:shell-script
index 74011169f54b87a901b865e6d7c371aeba064f44..58b60565762aa6e3d9c8626f80ede783b71cef0d 100644 (file)
@@ -56,8 +56,11 @@ void LDAPAsynConnection::init(const string& hostname, int port){
     ldap_set_option(cur_session, LDAP_OPT_PROTOCOL_VERSION, &opt);
 }
 
-int LDAPAsynConnection::start_tls(){
-    return ldap_start_tls_s( cur_session, NULL, NULL );
+void LDAPAsynConnection::start_tls(){
+    int resCode;
+    if( ldap_start_tls_s( cur_session, NULL, NULL ) != LDAP_SUCCESS ) {
+        throw LDAPException(this);
+    }
 }
 
 LDAPMessageQueue* LDAPAsynConnection::bind(const string& dn,
index ed217d01cd78c704d6b5800795d96229af7629e0..acd8151483e1274107d44ea67043a5b7bf059f44 100644 (file)
@@ -92,10 +92,11 @@ class LDAPAsynConnection{
         /**
          * Start TLS on this connection.  This isn't in the constructor,
          * because it could fail (i.e. server doesn't have SSL cert, client
-         * api wasn't compiled against OpenSSL, etc.).  If you need TLS,
-         * then you should error if this call fails with an error code.
+         * api wasn't compiled against OpenSSL, etc.). 
+         * @throws LDAPException if the TLS Layer could not be setup 
+         * correctly
          */
-        int start_tls();
+        void start_tls();
 
         /** Simple authentication to a LDAP-Server
          *
index f10b7208cf02214412580a8f653df257eb8cd308..121f9b625018caa0831ea9f5cf5c72fc82a9654d 100644 (file)
@@ -13,8 +13,6 @@ LDAPAttrType::LDAPAttrType(){
 
     oid = string ();
     desc = string ();
-    equality = string ();
-    syntax = string ();
     names = StringList ();
     single = false;
 }
@@ -25,8 +23,6 @@ LDAPAttrType::LDAPAttrType (const LDAPAttrType &at){
 
     oid = at.oid;
     desc = at.desc;
-    equality = at.equality;
-    syntax = at.syntax;
     names = at.names;
     single = at.single;
 }
@@ -44,8 +40,6 @@ LDAPAttrType::LDAPAttrType (string at_item) {
     if (a) {
        this->setNames (a->at_names);
        this->setDesc (a->at_desc);
-        this->setEquality (a->at_equality_oid);
-        this->setSyntax (a->at_syntax_oid);
        this->setOid (a->at_oid);
        this->setSingle (a->at_single_value);
     }
@@ -70,20 +64,6 @@ void LDAPAttrType::setDesc (char *at_desc) {
        desc = at_desc;
 }
 
-void LDAPAttrType::setEquality (char *at_equality_oid) {
-    equality = string ();
-    if (at_equality_oid) {
-       equality = at_equality_oid;
-    }
-}
-
-void LDAPAttrType::setSyntax (char *at_syntax_oid) {
-    syntax = string ();
-    if (at_syntax_oid) {
-       syntax = at_syntax_oid;
-    }
-}
-
 void LDAPAttrType::setOid (char *at_oid) {
     oid = string ();
     if (at_oid)
@@ -102,14 +82,6 @@ string LDAPAttrType::getDesc () {
     return desc;
 }
 
-string LDAPAttrType::getEquality () {
-    return equality;
-}
-
-string LDAPAttrType::getSyntax () {
-    return syntax;
-}
-
 StringList LDAPAttrType::getNames () {
     return names;
 }
index cb35f4032d70c23c2cee912e444da6632e9c1b5b..3042ab5a3342869b38ae5e0625357ef26193d70f 100644 (file)
@@ -22,7 +22,7 @@ using namespace std;
 class LDAPAttrType{
     private :
        StringList names;
-       string desc, oid, equality, syntax;
+       string desc, oid;
        bool single;
        
     public :
@@ -63,16 +63,6 @@ class LDAPAttrType{
         */
        string getOid ();
 
-       /**
-         * Returns equality matching rule
-        */
-       string getEquality ();
-       
-       /**
-        * Returns attribute syntax definition
-        */
-       string getSyntax ();
-
        /**
         * Returns attribute name (first one if there are more of them)
         */
@@ -84,14 +74,12 @@ class LDAPAttrType{
        StringList getNames();
        
        /**
-        * Returns true if attribute type allows only single value
+        * Returns true if attribute type hllows only single value
         */
        bool isSingle();
        
        void setNames (char **at_names);
        void setDesc (char *at_desc);
-       void setEquality (char *at_equality_oid);
-       void setSyntax (char *at_syntax_oid);      
        void setOid (char *at_oid);
        void setSingle (int at_single_value);
        
index 3dde84589082eb34ee1a41d580dfb08ef9f8bfdf..5facda9b6f011ecb7c67daa352bffda703d032c1 100644 (file)
@@ -25,8 +25,8 @@ LDAPConnection::LDAPConnection(const string& hostname, int port,
 LDAPConnection::~LDAPConnection(){
 }
 
-int LDAPConnection::start_tls(){
-    return LDAPAsynConnection::start_tls();
+void LDAPConnection::start_tls(){
+    LDAPAsynConnection::start_tls();
 }
    
 void LDAPConnection::bind(const string& dn, const string& passwd,
@@ -50,9 +50,10 @@ void LDAPConnection::bind(const string& dn, const string& passwd,
             delete msg;
             throw LDAPReferralException(urls);
         }else{
+            string srvMsg = res->getErrMsg();
             delete res;
             delete msg;
-            throw LDAPException(resCode);
+            throw LDAPException(resCode, srvMsg);
         }
     }
     delete res;
@@ -97,9 +98,10 @@ bool LDAPConnection::compare(const string& dn, const LDAPAttribute& attr,
         }
         break;
         default :
+            string srvMsg = res->getErrMsg();
             delete res;
             delete msg;
-            throw LDAPException(resCode);
+            throw LDAPException(resCode, srvMsg);
     }
 }
 
@@ -130,9 +132,10 @@ void LDAPConnection::del(const string& dn, const LDAPConstraints* cons){
         }
         break;
         default :
+            string srvMsg = res->getErrMsg();
             delete res;
             delete msg;
-            throw LDAPException(resCode);
+            throw LDAPException(resCode, srvMsg);
     }
 
 }
@@ -164,9 +167,10 @@ void LDAPConnection::add(const LDAPEntry* le, const LDAPConstraints* cons){
         }
         break;
         default :
+            string srvMsg = res->getErrMsg();
             delete res;
             delete msg;
-            throw LDAPException(resCode);
+            throw LDAPException(resCode, srvMsg);
     }
 }
 
@@ -201,7 +205,7 @@ void LDAPConnection::modify(const string& dn, const LDAPModList* mods,
             string srvMsg = res->getErrMsg();
             delete res;
             delete msg;
-            throw LDAPException(resCode,srvMsg);
+            throw LDAPException(resCode, srvMsg);
     }
     
 }
@@ -236,9 +240,10 @@ void LDAPConnection::rename(const string& dn, const string& newRDN,
         }
         break;
         default :
+            string srvMsg = res->getErrMsg();
             delete res;
             delete msg;
-            throw LDAPException(resCode);
+            throw LDAPException(resCode, srvMsg);
     }
 }
 
@@ -278,10 +283,11 @@ LDAPSearchResults* LDAPConnection::search(const string& base, int scope,
             }
             break;
             default :
+                string srvMsg = res->getErrMsg();
                 delete results; // memcheck
                 delete res;
                 delete msgq;
-                throw LDAPException(resCode);
+                throw LDAPException(resCode, srvMsg);
         }
     }        
     return 0;
@@ -314,9 +320,10 @@ LDAPExtResult* LDAPConnection::extOperation(const string& oid,
         }
         break;
         default :
+            string srvMsg = res->getErrMsg();
             delete res;
             delete msg;
-            throw LDAPException(resCode);
+            throw LDAPException(resCode, srvMsg);
     }
 }
 
index b18842d88ef2a413c362d9a0b5198d767bd2c499..3f4d6f4a5295784b6d1d5cc60e8d87809de72bf4 100644 (file)
@@ -71,10 +71,11 @@ class LDAPConnection : private LDAPAsynConnection {
         /**
          * Start TLS on this connection.  This isn't in the constructor,
          * because it could fail (i.e. server doesn't have SSL cert, client
-         * api wasn't compiled against OpenSSL, etc.).  If you need TLS,
-         * then you should error if this call fails with an error code.
+         * api wasn't compiled against OpenSSL, etc.). 
+         * @throws LDAPException if the TLS Layer could not be setup 
+         * correctly
          */
-        int start_tls();
+        void start_tls();
 
         /** 
          * Performs a simple authentication with the server
index 26dcbe47ffd7bd00985617e391291efe64fd8939..5038df613b794eba9b005dc54c49949e0b0496dd 100644 (file)
 using namespace std;
 
 LDAPException::LDAPException(int res_code, const string& err_string){
-    m_res_code=res_code;
-    m_res_string=string(ldap_err2string(res_code));
+       m_res_code=res_code;
+       m_res_string=string(ldap_err2string(res_code));
     m_err_string=err_string;
 }
 
 LDAPException::LDAPException(const LDAPAsynConnection *lc){
-    m_err_string=string();
-    m_res_string=string();
-    LDAP *l = lc->getSessionHandle();
-    ldap_get_option(l,LDAP_OPT_ERROR_NUMBER,&m_res_code);
-    m_res_string=string(ldap_err2string(m_res_code));
+       m_err_string=string();
+       m_res_string=string();
+       LDAP *l = lc->getSessionHandle();
+       ldap_get_option(l,LDAP_OPT_ERROR_NUMBER,&m_res_code);
+       m_res_string=string(ldap_err2string(m_res_code));
     char* err_string;
-    ldap_get_option(l,LDAP_OPT_ERROR_STRING,&err_string);
+       ldap_get_option(l,LDAP_OPT_ERROR_STRING,&err_string);
     m_err_string=string(err_string);
 }
 
@@ -35,11 +35,11 @@ LDAPException::~LDAPException(){
 }
 
 int LDAPException::getResultCode() const{
-    return m_res_code;
+       return m_res_code;
 }
 
 const string& LDAPException::getResultMsg() const{
-    return m_res_string;
+       return m_res_string;
 }
 
 const string& LDAPException::getServerMsg() const{
index 30b121e4edd6064a11e5ca129eb4f06d000bb30e..f693e82fd23d5acaa7dba82ee1536f67f8e28398 100644 (file)
@@ -85,5 +85,5 @@ noinst_HEADERS = LDAPAddRequest.h \
                 LDAPSearchRequest.h 
 
 libldapcpp_la_LIBADD = -lldap -llber
-libldapcpp_la_LDFLAGS = -version-info 0:2:0
+libldapcpp_la_LDFLAGS = -version-info 0:3:0
 
index b10a3b5cdc0b4b146dc05eaf120f7a85e784eec3..c6c93a471b3ac091ca9fda516fc99709cb2b02f1 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
 # @configure_input@
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -17,6 +17,9 @@
 # Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
 # COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 
+
+SOURCES = $(libldapcpp_la_SOURCES)
+
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
@@ -24,7 +27,6 @@ pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 top_builddir = ..
-
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
@@ -38,11 +40,66 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 host_triplet = @host@
+subdir = src
+DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libldapcpp_la_DEPENDENCIES =
+am_libldapcpp_la_OBJECTS = LDAPAddRequest.lo LDAPAsynConnection.lo \
+       LDAPAttribute.lo LDAPAttributeList.lo LDAPAttrType.lo \
+       LDAPBindRequest.lo LDAPCompareRequest.lo LDAPConnection.lo \
+       LDAPConstraints.lo LDAPControl.lo LDAPControlSet.lo \
+       LDAPDeleteRequest.lo LDAPEntry.lo LDAPEntryList.lo \
+       LDAPException.lo LDAPExtRequest.lo LDAPExtResult.lo \
+       LDAPMessage.lo LDAPMessageQueue.lo LDAPModDNRequest.lo \
+       LDAPModification.lo LDAPModifyRequest.lo LDAPModList.lo \
+       LDAPObjClass.lo LDAPRebind.lo LDAPRebindAuth.lo \
+       LDAPReferralException.lo LDAPReferenceList.lo LDAPRequest.lo \
+       LDAPResult.lo LDAPSchema.lo LDAPSearchReference.lo \
+       LDAPSearchRequest.lo LDAPSearchResult.lo LDAPSearchResults.lo \
+       LDAPUrl.lo LDAPUrlList.lo StringList.lo
+libldapcpp_la_OBJECTS = $(am_libldapcpp_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libldapcpp_la_SOURCES)
+DIST_SOURCES = $(libldapcpp_la_SOURCES)
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(include_HEADERS) $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
+AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -53,6 +110,7 @@ CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CXX = @CXX@
+CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -64,6 +122,8 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -88,8 +148,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
 ac_ct_RANLIB = @ac_ct_RANLIB@
 ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
@@ -97,7 +159,10 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
 am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
+am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -118,6 +183,7 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localstatedir = @localstatedir@
 mandir = @mandir@
+mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -125,9 +191,7 @@ sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-
 lib_LTLIBRARIES = libldapcpp.la
-
 libldapcpp_la_SOURCES = LDAPAddRequest.cpp \
                         LDAPAsynConnection.cpp \
                         LDAPAttribute.cpp \
@@ -167,7 +231,6 @@ libldapcpp_la_SOURCES = LDAPAddRequest.cpp \
                         LDAPUrlList.cpp \
                         StringList.cpp 
 
-
 include_HEADERS = LDAPAsynConnection.h \
                         LDAPAttribute.h \
                         LDAPAttributeList.h \
@@ -198,7 +261,6 @@ include_HEADERS = LDAPAsynConnection.h \
                         LDAPUrlList.h \
                         StringList.h 
 
-
 noinst_HEADERS = LDAPAddRequest.h \
                 LDAPBindRequest.h \
                 LDAPCompareRequest.h \
@@ -209,96 +271,42 @@ noinst_HEADERS = LDAPAddRequest.h \
                 LDAPRequest.h \
                 LDAPSearchRequest.h 
 
-
 libldapcpp_la_LIBADD = -lldap -llber
-libldapcpp_la_LDFLAGS = -version-info 0:1:0
-subdir = src
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(lib_LTLIBRARIES)
-
-libldapcpp_la_DEPENDENCIES =
-am_libldapcpp_la_OBJECTS = LDAPAddRequest.lo LDAPAsynConnection.lo \
-       LDAPAttribute.lo LDAPAttributeList.lo LDAPAttrType.lo \
-       LDAPBindRequest.lo LDAPCompareRequest.lo LDAPConnection.lo \
-       LDAPConstraints.lo LDAPControl.lo LDAPControlSet.lo \
-       LDAPDeleteRequest.lo LDAPEntry.lo LDAPEntryList.lo \
-       LDAPException.lo LDAPExtRequest.lo LDAPExtResult.lo \
-       LDAPMessage.lo LDAPMessageQueue.lo LDAPModDNRequest.lo \
-       LDAPModification.lo LDAPModifyRequest.lo LDAPModList.lo \
-       LDAPObjClass.lo LDAPRebind.lo LDAPRebindAuth.lo \
-       LDAPReferralException.lo LDAPReferenceList.lo LDAPRequest.lo \
-       LDAPResult.lo LDAPSchema.lo LDAPSearchReference.lo \
-       LDAPSearchRequest.lo LDAPSearchResult.lo LDAPSearchResults.lo \
-       LDAPUrl.lo LDAPUrlList.lo StringList.lo
-libldapcpp_la_OBJECTS = $(am_libldapcpp_la_OBJECTS)
-
-DEFAULT_INCLUDES =  -I. -I$(srcdir) -I.
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/LDAPAddRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPAsynConnection.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPAttrType.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPAttribute.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPAttributeList.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPBindRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPCompareRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPConnection.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPConstraints.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPControl.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPControlSet.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPDeleteRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPEntry.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPEntryList.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPException.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPExtRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPExtResult.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPMessage.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPMessageQueue.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPModDNRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPModList.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPModification.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPModifyRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPObjClass.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPRebind.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPRebindAuth.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPReferenceList.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPReferralException.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPResult.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPSchema.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPSearchReference.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPSearchRequest.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPSearchResult.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPSearchResults.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/LDAPUrl.Plo ./$(DEPDIR)/LDAPUrlList.Plo \
-@AMDEP_TRUE@   ./$(DEPDIR)/StringList.Plo
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(libldapcpp_la_SOURCES)
-HEADERS = $(include_HEADERS) $(noinst_HEADERS)
-
-DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) Makefile.am \
-       Makefile.in config.h.in
-SOURCES = $(libldapcpp_la_SOURCES)
-
+libldapcpp_la_LDFLAGS = -version-info 0:3:0
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
 .SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --foreign  src/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 
 config.h: stamp-h1
        @if test ! -f $@; then \
@@ -309,38 +317,37 @@ config.h: stamp-h1
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
        @rm -f stamp-h1
        cd $(top_builddir) && $(SHELL) ./config.status src/config.h
-
-$(srcdir)/config.h.in:  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
+$(srcdir)/config.h.in:  $(am__configure_deps) $(top_srcdir)/acconfig.h
        cd $(top_srcdir) && $(AUTOHEADER)
-       touch $(srcdir)/config.h.in
+       rm -f stamp-h1
+       touch $@
 
 distclean-hdr:
        -rm -f config.h stamp-h1
-libLTLIBRARIES_INSTALL = $(INSTALL)
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(libdir)
+       test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
        @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
-           f="`echo $$p | sed -e 's|^.*/||'`"; \
-           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
-           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
          else :; fi; \
        done
 
 uninstall-libLTLIBRARIES:
        @$(NORMAL_UNINSTALL)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-           p="`echo $$p | sed -e 's|^.*/||'`"; \
-         echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
-         $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+       @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
        done
 
 clean-libLTLIBRARIES:
        -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
        @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
          dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" = "$$p" && dir=.; \
+         test "$$dir" != "$$p" || dir=.; \
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
@@ -348,7 +355,7 @@ libldapcpp.la: $(libldapcpp_la_OBJECTS) $(libldapcpp_la_DEPENDENCIES)
        $(CXXLINK) -rpath $(libdir) $(libldapcpp_la_LDFLAGS) $(libldapcpp_la_OBJECTS) $(libldapcpp_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
-       -rm -f *.$(OBJEXT) core *.core
+       -rm -f *.$(OBJEXT)
 
 distclean-compile:
        -rm -f *.tab.c
@@ -392,41 +399,26 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LDAPUrlList.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringList.Plo@am__quote@
 
-distclean-depend:
-       -rm -rf ./$(DEPDIR)
-
 .cpp.o:
-@am__fastdepCXX_TRUE@  if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCXX_TRUE@    -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCXX_TRUE@  then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-@am__fastdepCXX_TRUE@  else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCXX_TRUE@  fi
+@am__fastdepCXX_TRUE@  if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@  then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
 
 .cpp.obj:
-@am__fastdepCXX_TRUE@  if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCXX_TRUE@    -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCXX_TRUE@  then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-@am__fastdepCXX_TRUE@  else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCXX_TRUE@  fi
+@am__fastdepCXX_TRUE@  if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@  then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .cpp.lo:
-@am__fastdepCXX_TRUE@  if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCXX_TRUE@    -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCXX_TRUE@  then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
-@am__fastdepCXX_TRUE@  else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCXX_TRUE@  fi
+@am__fastdepCXX_TRUE@  if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@  then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -437,33 +429,24 @@ clean-libtool:
 distclean-libtool:
        -rm -f libtool
 uninstall-info-am:
-includeHEADERS_INSTALL = $(INSTALL_HEADER)
 install-includeHEADERS: $(include_HEADERS)
        @$(NORMAL_INSTALL)
-       $(mkinstalldirs) $(DESTDIR)$(includedir)
+       test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
        @list='$(include_HEADERS)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         f="`echo $$p | sed -e 's|^.*/||'`"; \
-         echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
-         $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
+         f=$(am__strip_dir) \
+         echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
+         $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
        done
 
 uninstall-includeHEADERS:
        @$(NORMAL_UNINSTALL)
        @list='$(include_HEADERS)'; for p in $$list; do \
-         f="`echo $$p | sed -e 's|^.*/||'`"; \
-         echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
-         rm -f $(DESTDIR)$(includedir)/$$f; \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(includedir)/$$f"; \
        done
 
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -472,6 +455,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
          $(AWK) '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
        mkid -fID $$unique
+tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
@@ -483,10 +467,11 @@ TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
          done | \
          $(AWK) '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
-       test -z "$(ETAGS_ARGS)$$tags$$unique" \
-         || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-            $$tags $$unique
-
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
                $(TAGS_FILES) $(LISP)
@@ -509,10 +494,6 @@ GTAGS:
 
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
@@ -526,7 +507,7 @@ distdir: $(DISTFILES)
          dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
          if test "$$dir" != "$$file" && test "$$dir" != "."; then \
            dir="/$$dir"; \
-           $(mkinstalldirs) "$(distdir)$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
          else \
            dir=''; \
          fi; \
@@ -544,10 +525,10 @@ distdir: $(DISTFILES)
 check-am: all-am
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h
-
 installdirs:
-       $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
-
+       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
+         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       done
 install: install-am
 install-exec: install-exec-am
 install-data: install-data-am
@@ -559,7 +540,7 @@ install-am: all-am
 installcheck: installcheck-am
 install-strip:
        $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         INSTALL_STRIP_FLAG=-s \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
@@ -567,7 +548,7 @@ mostlyclean-generic:
 clean-generic:
 
 distclean-generic:
-       -rm -f Makefile $(CONFIG_CLEAN_FILES)
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
@@ -578,15 +559,17 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
        mostlyclean-am
 
 distclean: distclean-am
-
-distclean-am: clean-am distclean-compile distclean-depend \
-       distclean-generic distclean-hdr distclean-libtool \
-       distclean-tags
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-libtool distclean-tags
 
 dvi: dvi-am
 
 dvi-am:
 
+html: html-am
+
 info: info-am
 
 info-am:
@@ -602,7 +585,8 @@ install-man:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-am
@@ -623,9 +607,9 @@ uninstall-am: uninstall-includeHEADERS uninstall-info-am \
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
        clean-libLTLIBRARIES clean-libtool ctags distclean \
-       distclean-compile distclean-depend distclean-generic \
-       distclean-hdr distclean-libtool distclean-tags distdir dvi \
-       dvi-am info info-am install install-am install-data \
+       distclean-compile distclean-generic distclean-hdr \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
        install-data-am install-exec install-exec-am \
        install-includeHEADERS install-info install-info-am \
        install-libLTLIBRARIES install-man install-strip installcheck \
index 05801d815822efdf4145ac2a952369d5408984fe..befcdd288da9d126415bd1ade0c4d29a69ecd92e 100644 (file)
 topbuilddir = ../../../../build
 topsrcdir = ../../..
 snaccdir = /usr/local/snacc
+openssldir = /usr/local/include/openssl
 
-LIBTOOL=$(topsrcdir)/libtool
+LIBTOOL=$(topbuilddir)/libtool
 OPT=-g -O2 -DLDAP_COMPONENT
 CC=gcc
 
 SNACC_INC=-I$(snaccdir) -I$(snaccdir)/c-lib/inc
-
 LDAP_INC=-I$(topsrcdir)/include -I$(topsrcdir)/servers/slapd -I$(topbuilddir)/include
-INCS=$(LDAP_INC) $(SNACC_INC)
+OPENSSL_INC=-I$(openssldir)
+INCS=$(LDAP_INC) $(SNACC_INC) $(OPENSSL_INC)
 
 SNACC_LIB=$(snaccdir)/c-lib/libcasn1.a
-SSL_LIB=-lcrypto
+SSL_LIB=/usr/local/lib/lcrypto
 #LDAP_LIB=-lldap_r -llber
 LIBS=$(LDAP_LIB) $(SNACC_LIB) $(SSL_LIB)
 
@@ -42,6 +43,9 @@ componentlib.lo:      componentlib.c
 certificate.lo:        certificate.c
        $(LIBTOOL) --mode=compile $(CC) $(OPT) $(INCS) -c $?
 
+crl.lo:        crl.c
+       $(LIBTOOL) --mode=compile $(CC) $(OPT) $(INCS) -c $?
+
 authorityKeyIdentifier.lo:     authorityKeyIdentifier.c
        $(LIBTOOL) --mode=compile $(CC) $(OPT) $(INCS) -c $?
 
@@ -51,13 +55,13 @@ asn_to_syn_mr.lo:   asn_to_syn_mr.c
 init.lo:       init.c
        $(LIBTOOL) --mode=compile $(CC) $(OPT) $(INCS) -c $?
 
-compmatch.la:  componentlib.lo init.lo certificate.lo asn_to_syn_mr.lo authorityKeyIdentifier.lo
+compmatch.la:  componentlib.lo init.lo certificate.lo asn_to_syn_mr.lo authorityKeyIdentifier.lo crl.lo
        $(LIBTOOL) --mode=link $(CC) $(OPT) $(LIBS) -version-info 0:0:0 \
        -rpath /usr/local/libexec/openldap -module -o $@ $? $(LIBS)
 
 clean:
-       \rm compmatch.la componentlib.lo certificate.lo asn_to_syn_mr.lo authorityKeyIdentifier.lo\
-               init.o init.lo componentlib.o certificate.o asn_to_syn_mr.o authorityKeyIdentifier.o
+       \rm compmatch.la componentlib.lo certificate.lo asn_to_syn_mr.lo authorityKeyIdentifier.lo crl.lo\
+               init.o init.lo componentlib.o certificate.o asn_to_syn_mr.o authorityKeyIdentifier.o crl.o
 install:
        cp -r .libs $(topsrcdir)/tests/data/comp_libs
        cp compmatch.la  $(topsrcdir)/tests/data/comp_libs
diff --git a/contrib/slapd-modules/comp_match/crl.c b/contrib/slapd-modules/comp_match/crl.c
new file mode 100644 (file)
index 0000000..6c957b3
--- /dev/null
@@ -0,0 +1,1294 @@
+/*
+ *    crl.c
+ *    "CertificateRevokationList" ASN.1 module encode/decode/extracting/matching/free C src.
+ *    This file was generated by modified eSMACC compiler Fri Jan 21 11:25:24 2005
+ *    The generated files are supposed to be compiled as a module for OpenLDAP Software
+ */
+
+#include "crl.h"
+
+BDecComponentCertificateListTop( void* mem_op, GenBuf* b, void *v, AsnLen* bytesDecoded,int mode) {
+       AsnTag tag;
+       AsnLen elmtLen;
+
+       tag = BDecTag ( b, bytesDecoded );
+       elmtLen = BDecLen ( b, bytesDecoded );
+       if ( elmtLen <= 0 ) return (-1);
+       if ( tag != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE) ) {
+               return (-1);
+       }
+               
+       return BDecComponentCertificateList( mem_op, b, tag, elmtLen, ( ComponentCertificateList**)v, (AsnLen*)bytesDecoded, mode );
+}
+
+
+void init_module_CertificateRevokationList() {
+       InstallOidDecoderMapping( "2.5.4.39", NULL,
+               GDecComponentCertificateList,
+               BDecComponentCertificateList,
+               ExtractingComponentCertificateList,
+               MatchingComponentCertificateList);
+}
+
+int
+MatchingComponentTBSCertListSeqOfSeq ( char* oid, ComponentSyntaxInfo* csi_attr, ComponentSyntaxInfo* csi_assert ) {
+       int rc;
+       MatchingRule* mr;
+
+       if ( oid ) {
+               mr = retrieve_matching_rule( oid, csi_attr->csi_comp_desc->cd_type_id);
+               if ( mr ) return component_value_match( mr, csi_attr, csi_assert );
+       }
+
+       rc = 1;
+       rc =    MatchingComponentCertificateSerialNumber ( oid, (ComponentSyntaxInfo*)&((ComponentTBSCertListSeqOfSeq*)csi_attr)->userCertificate, (ComponentSyntaxInfo*)&((ComponentTBSCertListSeqOfSeq*)csi_assert)->userCertificate );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       rc =    MatchingComponentTime ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertListSeqOfSeq*)csi_attr)->revocationDate, (ComponentSyntaxInfo*)((ComponentTBSCertListSeqOfSeq*)csi_assert)->revocationDate );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       if(COMPONENTNOT_NULL( ((ComponentTBSCertListSeqOfSeq*)csi_attr)->crlEntryExtensions ) ) {
+       rc =    MatchingComponentExtensions ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertListSeqOfSeq*)csi_attr)->crlEntryExtensions, (ComponentSyntaxInfo*)((ComponentTBSCertListSeqOfSeq*)csi_assert)->crlEntryExtensions );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       }
+       return LDAP_COMPARE_TRUE;
+}  /* BMatchingComponentTBSCertListSeqOfSeq */
+
+void*
+ExtractingComponentTBSCertListSeqOfSeq ( void* mem_op, ComponentReference* cr, ComponentTBSCertListSeqOfSeq *comp )
+{
+
+       if ( ( comp->userCertificate.identifier.bv_val && strncmp(comp->userCertificate.identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->userCertificate.id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+               return &comp->userCertificate;
+               else
+               return NULL;
+       }
+       if ( ( comp->revocationDate->identifier.bv_val && strncmp(comp->revocationDate->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->revocationDate->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->revocationDate;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentTime ( mem_op, cr, comp->revocationDate );
+               }
+       }
+       if ( ( comp->crlEntryExtensions->identifier.bv_val && strncmp(comp->crlEntryExtensions->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->crlEntryExtensions->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->crlEntryExtensions;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentExtensions ( mem_op, cr, comp->crlEntryExtensions );
+               }
+       }
+       return NULL;
+}  /* ExtractingComponentTBSCertListSeqOfSeq */
+
+int
+BDecComponentTBSCertListSeqOfSeq PARAMS ((b, tagId0, elmtLen0, v, bytesDecoded, mode),
+void* mem_op _AND_
+GenBuf * b _AND_
+AsnTag tagId0 _AND_
+AsnLen elmtLen0 _AND_
+ComponentTBSCertListSeqOfSeq **v _AND_
+AsnLen *bytesDecoded _AND_
+int mode)
+{
+       int seqDone = FALSE;
+       AsnLen totalElmtsLen1 = 0;
+       AsnLen elmtLen1;
+       AsnTag tagId1;
+       int mandatoryElmtCount1 = 0;
+       AsnLen totalElmtsLen2 = 0;
+       AsnLen elmtLen2;
+       AsnTag tagId2;
+       int old_mode = mode;
+       int rc;
+       ComponentTBSCertListSeqOfSeq *k, *t, c_temp;
+
+
+       if ( !(mode & DEC_ALLOC_MODE_1) ) {
+               memset(&c_temp,0,sizeof(c_temp));
+                k = &c_temp;
+       } else
+                k = t = *v;
+       mode = DEC_ALLOC_MODE_2;
+    tagId1 = BDecTag (b, &totalElmtsLen1 );
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, INTEGER_TAG_CODE))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentCertificateSerialNumber (mem_op, b, tagId1, elmtLen1, (&k->userCertificate), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (&k->userCertificate)->identifier.bv_val = (&k->userCertificate)->id_buf;
+               (&k->userCertificate)->identifier.bv_len = strlen("userCertificate");
+               strcpy( (&k->userCertificate)->identifier.bv_val, "userCertificate");
+    tagId1 = BDecTag (b, &totalElmtsLen1);
+    }
+    else
+        return -1;
+
+
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, UTCTIME_TAG_CODE)) ||
+(tagId1 == MAKE_TAG_ID (UNIV, CONS, UTCTIME_TAG_CODE)) ||
+     (tagId1 ==MAKE_TAG_ID (UNIV, PRIM, GENERALIZEDTIME_TAG_CODE))||
+    (tagId1 == MAKE_TAG_ID (UNIV, CONS, GENERALIZEDTIME_TAG_CODE))))
+    {
+        elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentTime (mem_op, b, tagId1, elmtLen1, (&k->revocationDate), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->revocationDate)->identifier.bv_val = (k->revocationDate)->id_buf;
+               (k->revocationDate)->identifier.bv_len = strlen("revocationDate");
+               strcpy( (k->revocationDate)->identifier.bv_val, "revocationDate");
+    if ((elmtLen0 != INDEFINITE_LEN) && (totalElmtsLen1 == elmtLen0))
+        seqDone = TRUE;
+    else
+    {
+        tagId1 = BDecTag (b, &totalElmtsLen1 );
+
+         if ((elmtLen0 == INDEFINITE_LEN) && (tagId1 == EOC_TAG_ID))
+        {
+            BDEC_2ND_EOC_OCTET (b, &totalElmtsLen1 )
+            seqDone = TRUE;
+        }
+    }
+    }
+    else
+        return -1;
+
+
+
+    if ((!seqDone) && ((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentExtensions (mem_op, b, tagId1, elmtLen1, (&k->crlEntryExtensions), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->crlEntryExtensions)->identifier.bv_val = (k->crlEntryExtensions)->id_buf;
+               (k->crlEntryExtensions)->identifier.bv_len = strlen("crlEntryExtensions");
+               strcpy( (k->crlEntryExtensions)->identifier.bv_val, "crlEntryExtensions");
+        seqDone = TRUE;
+        if (elmtLen0 == INDEFINITE_LEN)
+            BDecEoc (b, &totalElmtsLen1 );
+        else if (totalElmtsLen1 != elmtLen0)
+        return -1;
+
+    }
+
+
+    if (!seqDone)
+        return -1;
+
+       if( !(old_mode & DEC_ALLOC_MODE_1) ) {
+       *v = t = (ComponentTBSCertListSeqOfSeq*) CompAlloc( mem_op, sizeof(ComponentTBSCertListSeqOfSeq) );
+       if ( !t ) return -1;
+       *t = *k;
+       }
+       t->syntax = (Syntax*)NULL;
+       t->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+       if ( !t->comp_desc ) {
+               free ( t );
+               return -1;
+       }
+       t->comp_desc->cd_ldap_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_ber_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentTBSCertListSeqOfSeq ;
+       t->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentTBSCertListSeqOfSeq ;
+       t->comp_desc->cd_free = (comp_free_func*)NULL;
+       t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentTBSCertListSeqOfSeq;
+       t->comp_desc->cd_type = ASN_COMPOSITE;
+       t->comp_desc->cd_type_id = COMPOSITE_ASN1_TYPE;
+       t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentTBSCertListSeqOfSeq;
+    (*bytesDecoded) += totalElmtsLen1;
+       return LDAP_SUCCESS;
+}  /* BDecTBSCertListSeqOfSeq*/
+
+int
+GDecComponentTBSCertListSeqOfSeq PARAMS (( mem_op,b, v, bytesDecoded, mode),
+void* mem_op _AND_
+GenBuf * b _AND_
+ComponentTBSCertListSeqOfSeq **v _AND_
+AsnLen *bytesDecoded _AND_
+int mode)
+{
+       char* peek_head,*peek_head2;
+       int i, strLen,strLen2, rc, old_mode = mode;
+       ComponentTBSCertListSeqOfSeq *k,*t, c_temp;
+
+
+       if ( !(mode & DEC_ALLOC_MODE_1) ) {
+               memset(&c_temp,0,sizeof(c_temp));
+                k = &c_temp;
+       } else
+                k = t = *v;
+       mode = DEC_ALLOC_MODE_2;
+       *bytesDecoded = 0;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading { in encoded data");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != '{'){
+               Asn1Error("Missing { in encoded data");
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if ( strncmp( peek_head, "userCertificate", strlen("userCertificate") ) == 0 ) {
+               rc =    GDecComponentCertificateSerialNumber (mem_op, b, (&k->userCertificate), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       (&k->userCertificate)->identifier.bv_val = peek_head;
+       (&k->userCertificate)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "revocationDate", strlen("revocationDate") ) == 0 ) {
+               rc =    GDecComponentTime (mem_op, b, (&k->revocationDate), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->revocationDate)->identifier.bv_val = peek_head;
+       ( k->revocationDate)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "crlEntryExtensions", strlen("crlEntryExtensions") ) == 0 ) {
+               rc =    GDecComponentExtensions (mem_op, b, (&k->crlEntryExtensions), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->crlEntryExtensions)->identifier.bv_val = peek_head;
+       ( k->crlEntryExtensions)->identifier.bv_len = strLen;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ) {
+               Asn1Error("Error during Reading } in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != '}'){
+               Asn1Error("Missing } in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(old_mode & DEC_ALLOC_MODE_1) ) {
+       *v = t = (ComponentTBSCertListSeqOfSeq*) CompAlloc( mem_op, sizeof(ComponentTBSCertListSeqOfSeq) );
+       if ( !t ) return -1;
+       *t = *k;
+       }
+       t->syntax = (Syntax*)NULL;
+       t->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+       if ( !t->comp_desc ) {
+               free ( t );
+               return -1;
+       }
+       t->comp_desc->cd_ldap_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_ber_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentTBSCertListSeqOfSeq ;
+       t->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentTBSCertListSeqOfSeq ;
+       t->comp_desc->cd_free = (comp_free_func*)NULL;
+       t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentTBSCertListSeqOfSeq;
+       t->comp_desc->cd_type = ASN_COMPOSITE;
+       t->comp_desc->cd_type_id = COMPOSITE_ASN1_TYPE;
+       t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentTBSCertListSeqOfSeq;
+       return LDAP_SUCCESS;
+}  /* GDecTBSCertListSeqOfSeq*/
+
+
+int
+MatchingComponentTBSCertListSeqOf ( char* oid, ComponentSyntaxInfo* csi_attr, ComponentSyntaxInfo* csi_assert ) {
+       int rc;
+       MatchingRule* mr;
+       void* component1, *component2;
+       AsnList *v1, *v2, t_list;
+
+
+       if ( oid ) {
+               mr = retrieve_matching_rule( oid, csi_attr->csi_comp_desc->cd_type_id);
+               if ( mr ) return component_value_match( mr, csi_attr, csi_assert );
+       }
+
+       v1 = &((ComponentTBSCertListSeqOf*)csi_attr)->comp_list;
+       v2 = &((ComponentTBSCertListSeqOf*)csi_assert)->comp_list;
+       FOR_EACH_LIST_PAIR_ELMT(component1, component2, v1, v2)
+       {
+               if( MatchingComponentTBSCertListSeqOfSeq(oid, (ComponentSyntaxInfo*)component1, (ComponentSyntaxInfo*)component2) == LDAP_COMPARE_FALSE) {
+                       return LDAP_COMPARE_FALSE;
+               }
+       } /* end of for */
+
+       AsnListFirst( v1 );
+       AsnListFirst( v2 );
+       if( (!component1 && component2) || (component1 && !component2))
+               return LDAP_COMPARE_FALSE;
+       else
+               return LDAP_COMPARE_TRUE;
+}  /* BMatchingComponentTBSCertListSeqOfContent */
+
+void*
+ExtractingComponentTBSCertListSeqOf ( void* mem_op, ComponentReference* cr, ComponentTBSCertListSeqOf *comp )
+{
+       int count = 0;
+       int total;
+       AsnList *v = &comp->comp_list;
+       ComponentInt *k;
+       ComponentTBSCertListSeqOfSeq *component;
+
+
+       switch ( cr->cr_curr->ci_type ) {
+       case LDAP_COMPREF_FROM_BEGINNING :
+               count = cr->cr_curr->ci_val.ci_from_beginning;
+               FOR_EACH_LIST_ELMT( component , v ) {
+                       if( --count == 0 ) {
+                               if( cr->cr_curr->ci_next == NULL )
+                                       return component;
+                               else {
+                                       cr->cr_curr = cr->cr_curr->ci_next;
+                                       return  ExtractingComponentTBSCertListSeqOfSeq ( mem_op, cr, component );
+                               }
+                       }
+               }
+               break;
+       case LDAP_COMPREF_FROM_END :
+               total = AsnListCount ( v );
+               count = cr->cr_curr->ci_val.ci_from_end;
+               count = total + count +1;
+               FOR_EACH_LIST_ELMT ( component, v ) {
+                       if( --count == 0 ) {
+                               if( cr->cr_curr->ci_next == NULL ) 
+                                       return component;
+                               else {
+                                       cr->cr_curr = cr->cr_curr->ci_next;
+                                       return  ExtractingComponentTBSCertListSeqOfSeq ( mem_op, cr, component );
+                               }
+                       }
+               }
+               break;
+       case LDAP_COMPREF_ALL :
+               return comp;
+       case LDAP_COMPREF_COUNT :
+               k = (ComponentInt*)CompAlloc( mem_op, sizeof(ComponentInt));
+               k->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+               k->comp_desc->cd_tag = (-1);
+               k->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentInt;
+               k->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentInt;
+               k->comp_desc->cd_extract_i = (extract_component_from_id_func*)NULL;
+               k->comp_desc->cd_type = ASN_BASIC;
+               k->comp_desc->cd_type_id = BASICTYPE_INTEGER;
+               k->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentInt;
+               k->value = AsnListCount(v);
+               return k;
+       default :
+               return NULL;
+       }
+}  /* ExtractingComponentTBSCertListSeqOf */
+
+int
+BDecComponentTBSCertListSeqOf PARAMS ((b, tagId0, elmtLen0, v, bytesDecoded, mode),
+void* mem_op _AND_
+GenBuf * b _AND_
+AsnTag tagId0 _AND_
+AsnLen elmtLen0 _AND_
+ComponentTBSCertListSeqOf **v _AND_
+AsnLen *bytesDecoded _AND_
+int mode)
+{
+       int seqDone = FALSE;
+       AsnLen totalElmtsLen1 = 0;
+       AsnLen elmtLen1;
+       AsnTag tagId1;
+       int mandatoryElmtCount1 = 0;
+       int old_mode = mode;
+       int rc;
+       ComponentTBSCertListSeqOf *k, *t, c_temp;
+
+
+       if ( !(mode & DEC_ALLOC_MODE_1) ) {
+               memset(&c_temp,0,sizeof(c_temp));
+                k = &c_temp;
+       } else
+                k = t = *v;
+       mode = DEC_ALLOC_MODE_2;
+       AsnListInit(&k->comp_list,sizeof(ComponentTBSCertListSeqOfSeq));
+    for (totalElmtsLen1 = 0; (totalElmtsLen1 < elmtLen0) || (elmtLen0 == INDEFINITE_LEN);)
+    {
+        ComponentTBSCertListSeqOfSeq **tmpVar;
+    tagId1 = BDecTag (b, &totalElmtsLen1 );
+
+    if ((tagId1 == EOC_TAG_ID) && (elmtLen0 == INDEFINITE_LEN))
+    {
+        BDEC_2ND_EOC_OCTET (b, &totalElmtsLen1 )
+        break; /* got EOC so can exit this SET OF/SEQ OF's for loop*/
+    }
+    if ((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
+    {
+        elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+    tmpVar = (ComponentTBSCertListSeqOfSeq**) CompAsnListAppend (mem_op,&k->comp_list);
+       rc = BDecComponentTBSCertListSeqOfSeq (mem_op, b, tagId1, elmtLen1, tmpVar, &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+    }  /* end of tag check if */
+    else  /* wrong tag */
+    {
+         Asn1Error ("Unexpected Tag\n");
+         return -1;
+    }
+    } /* end of for */
+
+       if( !(old_mode & DEC_ALLOC_MODE_1) ) {
+       *v = t = (ComponentTBSCertListSeqOf*) CompAlloc( mem_op, sizeof(ComponentTBSCertListSeqOf) );
+       if ( !t ) return -1;
+       *t = *k;
+       }
+       t->syntax = (Syntax*)NULL;
+       t->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+       if ( !t->comp_desc ) {
+               free ( t );
+               return -1;
+       }
+       t->comp_desc->cd_ldap_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_ber_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentTBSCertListSeqOf ;
+       t->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentTBSCertListSeqOf ;
+       t->comp_desc->cd_free = (comp_free_func*)NULL;
+       t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentTBSCertListSeqOf;
+       t->comp_desc->cd_type = ASN_COMPOSITE;
+       t->comp_desc->cd_type_id = COMPOSITE_ASN1_TYPE;
+       t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentTBSCertListSeqOf;
+    (*bytesDecoded) += totalElmtsLen1;
+       return LDAP_SUCCESS;
+}  /* BDecTBSCertListSeqOfContent */
+
+int
+GDecComponentTBSCertListSeqOf PARAMS (( mem_op,b, v, bytesDecoded, mode),
+void* mem_op _AND_
+GenBuf * b _AND_
+ComponentTBSCertListSeqOf **v _AND_
+AsnLen *bytesDecoded _AND_
+int mode)
+{
+       char* peek_head,*peek_head2;
+       int i, strLen,strLen2, rc, old_mode = mode;
+       ComponentTBSCertListSeqOf *k,*t, c_temp;
+
+
+       int ElmtsLen1;
+       if ( !(mode & DEC_ALLOC_MODE_1) ) {
+               memset(&c_temp,0,sizeof(c_temp));
+                k = &c_temp;
+       } else
+                k = t = *v;
+       mode = DEC_ALLOC_MODE_2;
+       AsnListInit( &k->comp_list, sizeof( ComponentTBSCertListSeqOfSeq ) );
+       *bytesDecoded = 0;
+       if( !(strLen = LocateNextGSERToken(mem_op,b, &peek_head, GSER_PEEK)) ){
+               Asn1Error("Error during Reading { in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != '{'){
+               Asn1Error("Missing { in encoded data");
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       for (ElmtsLen1 = 0; ElmtsLen1 >= INDEFINITE_LEN; ElmtsLen1++)
+       {
+               ComponentTBSCertListSeqOfSeq **tmpVar;
+               if( !(strLen = LocateNextGSERToken(mem_op,b, &peek_head, GSER_NO_COPY)) ){
+                       Asn1Error("Error during Reading{ in encoding");
+                       return LDAP_PROTOCOL_ERROR;
+               }
+               if(*peek_head == '}') break;
+               if( !(*peek_head == '{' || *peek_head ==',') ) {
+                       return LDAP_PROTOCOL_ERROR;
+               }
+               tmpVar = (ComponentTBSCertListSeqOfSeq**) CompAsnListAppend (mem_op, &k->comp_list);
+               if ( tmpVar == NULL ) {
+                       Asn1Error("Error during Reading{ in encoding");
+                       return LDAP_PROTOCOL_ERROR;
+               }
+               rc =    GDecComponentTBSCertListSeqOfSeq (mem_op, b, tmpVar, bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       } /* end of for */
+
+       if( !(old_mode & DEC_ALLOC_MODE_1) ) {
+       *v = t = (ComponentTBSCertListSeqOf*) CompAlloc( mem_op, sizeof(ComponentTBSCertListSeqOf) );
+       if ( !t ) return -1;
+       *t = *k;
+       }
+       t->syntax = (Syntax*)NULL;
+       t->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+       if ( !t->comp_desc ) {
+               free ( t );
+               return -1;
+       }
+       t->comp_desc->cd_ldap_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_ber_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentTBSCertListSeqOf ;
+       t->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentTBSCertListSeqOf ;
+       t->comp_desc->cd_free = (comp_free_func*)NULL;
+       t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentTBSCertListSeqOf;
+       t->comp_desc->cd_type = ASN_COMPOSITE;
+       t->comp_desc->cd_type_id = COMPOSITE_ASN1_TYPE;
+       t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentTBSCertListSeqOf;
+       return LDAP_SUCCESS;
+}  /* GDecTBSCertListSeqOfContent */
+
+int
+MatchingComponentTBSCertList ( char* oid, ComponentSyntaxInfo* csi_attr, ComponentSyntaxInfo* csi_assert ) {
+       int rc;
+       MatchingRule* mr;
+
+       if ( oid ) {
+               mr = retrieve_matching_rule( oid, csi_attr->csi_comp_desc->cd_type_id);
+               if ( mr ) return component_value_match( mr, csi_attr, csi_assert );
+       }
+
+       rc = 1;
+       if(COMPONENTNOT_NULL( ((ComponentTBSCertList*)csi_attr)->version ) ) {
+       rc =    MatchingComponentVersion ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_attr)->version, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_assert)->version );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       }
+       rc =    MatchingComponentAlgorithmIdentifier ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_attr)->signature, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_assert)->signature );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       rc =    MatchingComponentName ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_attr)->issuer, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_assert)->issuer );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       rc =    MatchingComponentTime ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_attr)->thisUpdate, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_assert)->thisUpdate );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       if(COMPONENTNOT_NULL( ((ComponentTBSCertList*)csi_attr)->nextUpdate ) ) {
+       rc =    MatchingComponentTime ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_attr)->nextUpdate, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_assert)->nextUpdate );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       }
+       rc =    MatchingComponentTBSCertListSeqOf ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_attr)->revokedCertificates, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_assert)->revokedCertificates );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       if(COMPONENTNOT_NULL( ((ComponentTBSCertList*)csi_attr)->crlExtensions ) ) {
+       rc =    MatchingComponentExtensions ( oid, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_attr)->crlExtensions, (ComponentSyntaxInfo*)((ComponentTBSCertList*)csi_assert)->crlExtensions );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       }
+       return LDAP_COMPARE_TRUE;
+}  /* BMatchingComponentTBSCertList */
+
+void*
+ExtractingComponentTBSCertList ( void* mem_op, ComponentReference* cr, ComponentTBSCertList *comp )
+{
+
+       if ( ( comp->version->identifier.bv_val && strncmp(comp->version->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->version->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->version;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentVersion ( mem_op, cr, comp->version );
+               }
+       }
+       if ( ( comp->signature->identifier.bv_val && strncmp(comp->signature->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->signature->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->signature;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentAlgorithmIdentifier ( mem_op, cr, comp->signature );
+               }
+       }
+       if ( ( comp->issuer->identifier.bv_val && strncmp(comp->issuer->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->issuer->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->issuer;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentName ( mem_op, cr, comp->issuer );
+               }
+       }
+       if ( ( comp->thisUpdate->identifier.bv_val && strncmp(comp->thisUpdate->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->thisUpdate->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->thisUpdate;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentTime ( mem_op, cr, comp->thisUpdate );
+               }
+       }
+       if ( ( comp->nextUpdate->identifier.bv_val && strncmp(comp->nextUpdate->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->nextUpdate->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->nextUpdate;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentTime ( mem_op, cr, comp->nextUpdate );
+               }
+       }
+       if ( ( comp->revokedCertificates->identifier.bv_val && strncmp(comp->revokedCertificates->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->revokedCertificates->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->revokedCertificates;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentTBSCertListSeqOf ( mem_op, cr, comp->revokedCertificates );
+               }
+       }
+       if ( ( comp->crlExtensions->identifier.bv_val && strncmp(comp->crlExtensions->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->crlExtensions->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->crlExtensions;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentExtensions ( mem_op, cr, comp->crlExtensions );
+               }
+       }
+       return NULL;
+}  /* ExtractingComponentTBSCertList */
+
+int
+BDecComponentTBSCertList PARAMS ((b, tagId0, elmtLen0, v, bytesDecoded, mode),
+void* mem_op _AND_
+GenBuf * b _AND_
+AsnTag tagId0 _AND_
+AsnLen elmtLen0 _AND_
+ComponentTBSCertList **v _AND_
+AsnLen *bytesDecoded _AND_
+int mode)
+{
+       int seqDone = FALSE;
+       AsnLen totalElmtsLen1 = 0;
+       AsnLen elmtLen1;
+       AsnTag tagId1;
+       int mandatoryElmtCount1 = 0;
+       AsnLen totalElmtsLen2 = 0;
+       AsnLen elmtLen2;
+       AsnTag tagId2;
+       int old_mode = mode;
+       int rc;
+       ComponentTBSCertList *k, *t, c_temp;
+
+
+       if ( !(mode & DEC_ALLOC_MODE_1) ) {
+               memset(&c_temp,0,sizeof(c_temp));
+                k = &c_temp;
+       } else
+                k = t = *v;
+       mode = DEC_ALLOC_MODE_2;
+    tagId1 = BDecTag (b, &totalElmtsLen1 );
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, INTEGER_TAG_CODE))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentVersion (mem_op, b, tagId1, elmtLen1, (&k->version), &totalElmtsLen1, DEC_ALLOC_MODE_0 );
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->version)->identifier.bv_val = (k->version)->id_buf;
+               (k->version)->identifier.bv_len = strlen("version");
+               strcpy( (k->version)->identifier.bv_val, "version");
+    tagId1 = BDecTag (b, &totalElmtsLen1);
+    }
+
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentAlgorithmIdentifier (mem_op, b, tagId1, elmtLen1, (&k->signature), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->signature)->identifier.bv_val = (k->signature)->id_buf;
+               (k->signature)->identifier.bv_len = strlen("signature");
+               strcpy( (k->signature)->identifier.bv_val, "signature");
+    tagId1 = BDecTag (b, &totalElmtsLen1);
+    }
+    else
+        return -1;
+
+
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))))
+    {
+        elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentName (mem_op, b, tagId1, elmtLen1, (&k->issuer), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->issuer)->identifier.bv_val = (k->issuer)->id_buf;
+               (k->issuer)->identifier.bv_len = strlen("issuer");
+               strcpy( (k->issuer)->identifier.bv_val, "issuer");
+    tagId1 = BDecTag (b, &totalElmtsLen1);
+    }
+    else
+        return -1;
+
+
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, UTCTIME_TAG_CODE)) ||
+(tagId1 == MAKE_TAG_ID (UNIV, CONS, UTCTIME_TAG_CODE)) ||
+     (tagId1 ==MAKE_TAG_ID (UNIV, PRIM, GENERALIZEDTIME_TAG_CODE))||
+    (tagId1 == MAKE_TAG_ID (UNIV, CONS, GENERALIZEDTIME_TAG_CODE))))
+    {
+        elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentTime (mem_op, b, tagId1, elmtLen1, (&k->thisUpdate), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->thisUpdate)->identifier.bv_val = (k->thisUpdate)->id_buf;
+               (k->thisUpdate)->identifier.bv_len = strlen("thisUpdate");
+               strcpy( (k->thisUpdate)->identifier.bv_val, "thisUpdate");
+    tagId1 = BDecTag (b, &totalElmtsLen1);
+    }
+    else
+        return -1;
+
+
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, UTCTIME_TAG_CODE)) ||
+(tagId1 == MAKE_TAG_ID (UNIV, CONS, UTCTIME_TAG_CODE)) ||
+     (tagId1 ==MAKE_TAG_ID (UNIV, PRIM, GENERALIZEDTIME_TAG_CODE))||
+    (tagId1 == MAKE_TAG_ID (UNIV, CONS, GENERALIZEDTIME_TAG_CODE))))
+    {
+        elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentTime (mem_op, b, tagId1, elmtLen1, (&k->nextUpdate), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->nextUpdate)->identifier.bv_val = (k->nextUpdate)->id_buf;
+               (k->nextUpdate)->identifier.bv_len = strlen("nextUpdate");
+               strcpy( (k->nextUpdate)->identifier.bv_val, "nextUpdate");
+    tagId1 = BDecTag (b, &totalElmtsLen1);
+    }
+
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentTBSCertListSeqOf (mem_op, b, tagId1, elmtLen1, (&k->revokedCertificates), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->revokedCertificates)->identifier.bv_val = (k->revokedCertificates)->id_buf;
+               (k->revokedCertificates)->identifier.bv_len = strlen("revokedCertificates");
+               strcpy( (k->revokedCertificates)->identifier.bv_val, "revokedCertificates");
+    if ((elmtLen0 != INDEFINITE_LEN) && (totalElmtsLen1 == elmtLen0))
+        seqDone = TRUE;
+    else
+    {
+        tagId1 = BDecTag (b, &totalElmtsLen1 );
+
+         if ((elmtLen0 == INDEFINITE_LEN) && (tagId1 == EOC_TAG_ID))
+        {
+            BDEC_2ND_EOC_OCTET (b, &totalElmtsLen1 )
+            seqDone = TRUE;
+        }
+    }
+    }
+    else
+        return -1;
+
+
+
+    if ((!seqDone) && ((tagId1 == MAKE_TAG_ID (CNTX, CONS, 0))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+        tagId2 = BDecTag (b, &totalElmtsLen1 );
+
+    if (tagId2 != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
+    {
+         Asn1Error ("Unexpected Tag\n");
+         return -1;
+    }
+
+    elmtLen2 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentExtensions (mem_op, b, tagId2, elmtLen2, (&k->crlExtensions), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->crlExtensions)->identifier.bv_val = (k->crlExtensions)->id_buf;
+               (k->crlExtensions)->identifier.bv_len = strlen("crlExtensions");
+               strcpy( (k->crlExtensions)->identifier.bv_val, "crlExtensions");
+       if (elmtLen1 == INDEFINITE_LEN)
+        BDecEoc (b, &totalElmtsLen1 );
+        seqDone = TRUE;
+        if (elmtLen0 == INDEFINITE_LEN)
+            BDecEoc (b, &totalElmtsLen1 );
+        else if (totalElmtsLen1 != elmtLen0)
+        return -1;
+
+    }
+
+
+    if (!seqDone)
+        return -1;
+
+       if( !(old_mode & DEC_ALLOC_MODE_1) ) {
+       *v = t = (ComponentTBSCertList*) CompAlloc( mem_op, sizeof(ComponentTBSCertList) );
+       if ( !t ) return -1;
+       *t = *k;
+       }
+       t->syntax = (Syntax*)NULL;
+       t->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+       if ( !t->comp_desc ) {
+               free ( t );
+               return -1;
+       }
+       t->comp_desc->cd_ldap_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_ber_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentTBSCertList ;
+       t->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentTBSCertList ;
+       t->comp_desc->cd_free = (comp_free_func*)NULL;
+       t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentTBSCertList;
+       t->comp_desc->cd_type = ASN_COMPOSITE;
+       t->comp_desc->cd_type_id = COMPOSITE_ASN1_TYPE;
+       t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentTBSCertList;
+    (*bytesDecoded) += totalElmtsLen1;
+       return LDAP_SUCCESS;
+}  /* BDecTBSCertList*/
+
+int
+GDecComponentTBSCertList PARAMS (( mem_op,b, v, bytesDecoded, mode),
+void* mem_op _AND_
+GenBuf * b _AND_
+ComponentTBSCertList **v _AND_
+AsnLen *bytesDecoded _AND_
+int mode)
+{
+       char* peek_head,*peek_head2;
+       int i, strLen,strLen2, rc, old_mode = mode;
+       ComponentTBSCertList *k,*t, c_temp;
+
+
+       if ( !(mode & DEC_ALLOC_MODE_1) ) {
+               memset(&c_temp,0,sizeof(c_temp));
+                k = &c_temp;
+       } else
+                k = t = *v;
+       mode = DEC_ALLOC_MODE_2;
+       *bytesDecoded = 0;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading { in encoded data");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != '{'){
+               Asn1Error("Missing { in encoded data");
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if ( strncmp( peek_head, "version", strlen("version") ) == 0 ) {
+               rc =    GDecComponentVersion (mem_op, b, (&k->version), bytesDecoded, DEC_ALLOC_MODE_0 );
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->version)->identifier.bv_val = peek_head;
+       ( k->version)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "signature", strlen("signature") ) == 0 ) {
+               rc =    GDecComponentAlgorithmIdentifier (mem_op, b, (&k->signature), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->signature)->identifier.bv_val = peek_head;
+       ( k->signature)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "issuer", strlen("issuer") ) == 0 ) {
+               rc =    GDecComponentName (mem_op, b, (&k->issuer), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->issuer)->identifier.bv_val = peek_head;
+       ( k->issuer)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "thisUpdate", strlen("thisUpdate") ) == 0 ) {
+               rc =    GDecComponentTime (mem_op, b, (&k->thisUpdate), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->thisUpdate)->identifier.bv_val = peek_head;
+       ( k->thisUpdate)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "nextUpdate", strlen("nextUpdate") ) == 0 ) {
+               rc =    GDecComponentTime (mem_op, b, (&k->nextUpdate), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->nextUpdate)->identifier.bv_val = peek_head;
+       ( k->nextUpdate)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "revokedCertificates", strlen("revokedCertificates") ) == 0 ) {
+               rc =    GDecComponentTBSCertListSeqOf (mem_op, b, (&k->revokedCertificates), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->revokedCertificates)->identifier.bv_val = peek_head;
+       ( k->revokedCertificates)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "crlExtensions", strlen("crlExtensions") ) == 0 ) {
+               rc =    GDecComponentExtensions (mem_op, b, (&k->crlExtensions), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->crlExtensions)->identifier.bv_val = peek_head;
+       ( k->crlExtensions)->identifier.bv_len = strLen;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ) {
+               Asn1Error("Error during Reading } in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != '}'){
+               Asn1Error("Missing } in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(old_mode & DEC_ALLOC_MODE_1) ) {
+       *v = t = (ComponentTBSCertList*) CompAlloc( mem_op, sizeof(ComponentTBSCertList) );
+       if ( !t ) return -1;
+       *t = *k;
+       }
+       t->syntax = (Syntax*)NULL;
+       t->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+       if ( !t->comp_desc ) {
+               free ( t );
+               return -1;
+       }
+       t->comp_desc->cd_ldap_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_ber_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentTBSCertList ;
+       t->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentTBSCertList ;
+       t->comp_desc->cd_free = (comp_free_func*)NULL;
+       t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentTBSCertList;
+       t->comp_desc->cd_type = ASN_COMPOSITE;
+       t->comp_desc->cd_type_id = COMPOSITE_ASN1_TYPE;
+       t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentTBSCertList;
+       return LDAP_SUCCESS;
+}  /* GDecTBSCertList*/
+
+
+int
+MatchingComponentCertificateList ( char* oid, ComponentSyntaxInfo* csi_attr, ComponentSyntaxInfo* csi_assert ) {
+       int rc;
+       MatchingRule* mr;
+
+       if ( oid ) {
+               mr = retrieve_matching_rule( oid, csi_attr->csi_comp_desc->cd_type_id);
+               if ( mr ) return component_value_match( mr, csi_attr, csi_assert );
+       }
+
+       rc = 1;
+       rc =    MatchingComponentTBSCertList ( oid, (ComponentSyntaxInfo*)((ComponentCertificateList*)csi_attr)->tbsCertList, (ComponentSyntaxInfo*)((ComponentCertificateList*)csi_assert)->tbsCertList );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       rc =    MatchingComponentAlgorithmIdentifier ( oid, (ComponentSyntaxInfo*)((ComponentCertificateList*)csi_attr)->signatureAlgorithm, (ComponentSyntaxInfo*)((ComponentCertificateList*)csi_assert)->signatureAlgorithm );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       rc =    MatchingComponentBits ( oid, (ComponentSyntaxInfo*)&((ComponentCertificateList*)csi_attr)->signature, (ComponentSyntaxInfo*)&((ComponentCertificateList*)csi_assert)->signature );
+       if ( rc != LDAP_COMPARE_TRUE )
+               return rc;
+       return LDAP_COMPARE_TRUE;
+}  /* BMatchingComponentCertificateList */
+
+void*
+ExtractingComponentCertificateList ( void* mem_op, ComponentReference* cr, ComponentCertificateList *comp )
+{
+
+       if ( ( comp->tbsCertList->identifier.bv_val && strncmp(comp->tbsCertList->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->tbsCertList->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->tbsCertList;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentTBSCertList ( mem_op, cr, comp->tbsCertList );
+               }
+       }
+       if ( ( comp->signatureAlgorithm->identifier.bv_val && strncmp(comp->signatureAlgorithm->identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->signatureAlgorithm->id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+                       return comp->signatureAlgorithm;
+               else {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+                       return  ExtractingComponentAlgorithmIdentifier ( mem_op, cr, comp->signatureAlgorithm );
+               }
+       }
+       if ( ( comp->signature.identifier.bv_val && strncmp(comp->signature.identifier.bv_val, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) || ( strncmp(comp->signature.id_buf, cr->cr_curr->ci_val.ci_identifier.bv_val,cr->cr_curr->ci_val.ci_identifier.bv_len) == 0 ) ) {
+               if ( cr->cr_curr->ci_next == NULL )
+               return &comp->signature;
+       else if ( cr->cr_curr->ci_next->ci_type == LDAP_COMPREF_CONTENT) {
+                       cr->cr_curr = cr->cr_curr->ci_next;
+               return &comp->signature;
+        } else {
+               return NULL;
+               }
+       }
+       return NULL;
+}  /* ExtractingComponentCertificateList */
+
+int
+BDecComponentCertificateList PARAMS ((b, tagId0, elmtLen0, v, bytesDecoded, mode),
+void* mem_op _AND_
+GenBuf * b _AND_
+AsnTag tagId0 _AND_
+AsnLen elmtLen0 _AND_
+ComponentCertificateList **v _AND_
+AsnLen *bytesDecoded _AND_
+int mode)
+{
+       int seqDone = FALSE;
+       AsnLen totalElmtsLen1 = 0;
+       AsnLen elmtLen1;
+       AsnTag tagId1;
+       int mandatoryElmtCount1 = 0;
+       int old_mode = mode;
+       int rc;
+       ComponentCertificateList *k, *t, c_temp;
+
+
+       if ( !(mode & DEC_ALLOC_MODE_1) ) {
+               memset(&c_temp,0,sizeof(c_temp));
+                k = &c_temp;
+       } else
+                k = t = *v;
+       mode = DEC_ALLOC_MODE_2;
+    tagId1 = BDecTag (b, &totalElmtsLen1 );
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentTBSCertList (mem_op, b, tagId1, elmtLen1, (&k->tbsCertList), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->tbsCertList)->identifier.bv_val = (k->tbsCertList)->id_buf;
+               (k->tbsCertList)->identifier.bv_len = strlen("tbsCertList");
+               strcpy( (k->tbsCertList)->identifier.bv_val, "tbsCertList");
+    tagId1 = BDecTag (b, &totalElmtsLen1);
+    }
+    else
+        return -1;
+
+
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentAlgorithmIdentifier (mem_op, b, tagId1, elmtLen1, (&k->signatureAlgorithm), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (k->signatureAlgorithm)->identifier.bv_val = (k->signatureAlgorithm)->id_buf;
+               (k->signatureAlgorithm)->identifier.bv_len = strlen("signatureAlgorithm");
+               strcpy( (k->signatureAlgorithm)->identifier.bv_val, "signatureAlgorithm");
+    tagId1 = BDecTag (b, &totalElmtsLen1);
+    }
+    else
+        return -1;
+
+
+
+    if (((tagId1 == MAKE_TAG_ID (UNIV, PRIM, BITSTRING_TAG_CODE)) ||
+(tagId1 == MAKE_TAG_ID (UNIV, CONS, BITSTRING_TAG_CODE))))
+    {
+    elmtLen1 = BDecLen (b, &totalElmtsLen1 );
+       rc = BDecComponentBits (mem_op, b, tagId1, elmtLen1, (&k->signature), &totalElmtsLen1, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+               (&k->signature)->identifier.bv_val = (&k->signature)->id_buf;
+               (&k->signature)->identifier.bv_len = strlen("signature");
+               strcpy( (&k->signature)->identifier.bv_val, "signature");
+        seqDone = TRUE;
+        if (elmtLen0 == INDEFINITE_LEN)
+            BDecEoc (b, &totalElmtsLen1 );
+        else if (totalElmtsLen1 != elmtLen0)
+        return -1;
+
+    }
+    else
+        return -1;
+
+
+
+    if (!seqDone)
+        return -1;
+
+       if( !(old_mode & DEC_ALLOC_MODE_1) ) {
+       *v = t = (ComponentCertificateList*) CompAlloc( mem_op, sizeof(ComponentCertificateList) );
+       if ( !t ) return -1;
+       *t = *k;
+       }
+       t->syntax = (Syntax*)NULL;
+       t->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+       if ( !t->comp_desc ) {
+               free ( t );
+               return -1;
+       }
+       t->comp_desc->cd_ldap_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_ber_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentCertificateList ;
+       t->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentCertificateList ;
+       t->comp_desc->cd_free = (comp_free_func*)NULL;
+       t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentCertificateList;
+       t->comp_desc->cd_type = ASN_COMPOSITE;
+       t->comp_desc->cd_type_id = COMPOSITE_ASN1_TYPE;
+       t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentCertificateList;
+    (*bytesDecoded) += totalElmtsLen1;
+       return LDAP_SUCCESS;
+}  /* BDecCertificateList*/
+
+int
+GDecComponentCertificateList PARAMS (( mem_op,b, v, bytesDecoded, mode),
+void* mem_op _AND_
+GenBuf * b _AND_
+ComponentCertificateList **v _AND_
+AsnLen *bytesDecoded _AND_
+int mode)
+{
+       char* peek_head,*peek_head2;
+       int i, strLen,strLen2, rc, old_mode = mode;
+       ComponentCertificateList *k,*t, c_temp;
+
+
+       if ( !(mode & DEC_ALLOC_MODE_1) ) {
+               memset(&c_temp,0,sizeof(c_temp));
+                k = &c_temp;
+       } else
+                k = t = *v;
+       mode = DEC_ALLOC_MODE_2;
+       *bytesDecoded = 0;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading { in encoded data");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != '{'){
+               Asn1Error("Missing { in encoded data");
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if ( strncmp( peek_head, "tbsCertList", strlen("tbsCertList") ) == 0 ) {
+               rc =    GDecComponentTBSCertList (mem_op, b, (&k->tbsCertList), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->tbsCertList)->identifier.bv_val = peek_head;
+       ( k->tbsCertList)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "signatureAlgorithm", strlen("signatureAlgorithm") ) == 0 ) {
+               rc =    GDecComponentAlgorithmIdentifier (mem_op, b, (&k->signatureAlgorithm), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       ( k->signatureAlgorithm)->identifier.bv_val = peek_head;
+       ( k->signatureAlgorithm)->identifier.bv_len = strLen;
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+               Asn1Error("Error during Reading , ");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != ','){
+               Asn1Error("Missing , in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ){
+         Asn1Error("Error during Reading identifier");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       }
+       if ( strncmp( peek_head, "signature", strlen("signature") ) == 0 ) {
+               rc =    GDecComponentBits (mem_op, b, (&k->signature), bytesDecoded, mode);
+               if ( rc != LDAP_SUCCESS ) return rc;
+       (&k->signature)->identifier.bv_val = peek_head;
+       (&k->signature)->identifier.bv_len = strLen;
+       }
+       if( !(strLen = LocateNextGSERToken(mem_op,b,&peek_head,GSER_NO_COPY)) ) {
+               Asn1Error("Error during Reading } in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if(*peek_head != '}'){
+               Asn1Error("Missing } in encoding");
+               return LDAP_PROTOCOL_ERROR;
+       }
+       if( !(old_mode & DEC_ALLOC_MODE_1) ) {
+       *v = t = (ComponentCertificateList*) CompAlloc( mem_op, sizeof(ComponentCertificateList) );
+       if ( !t ) return -1;
+       *t = *k;
+       }
+       t->syntax = (Syntax*)NULL;
+       t->comp_desc = CompAlloc( mem_op, sizeof( ComponentDesc ) );
+       if ( !t->comp_desc ) {
+               free ( t );
+               return -1;
+       }
+       t->comp_desc->cd_ldap_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_ber_encoder = (encoder_func*)NULL;
+       t->comp_desc->cd_gser_decoder = (gser_decoder_func*)GDecComponentCertificateList ;
+       t->comp_desc->cd_ber_decoder = (ber_decoder_func*)BDecComponentCertificateList ;
+       t->comp_desc->cd_free = (comp_free_func*)NULL;
+       t->comp_desc->cd_extract_i = (extract_component_from_id_func*)ExtractingComponentCertificateList;
+       t->comp_desc->cd_type = ASN_COMPOSITE;
+       t->comp_desc->cd_type_id = COMPOSITE_ASN1_TYPE;
+       t->comp_desc->cd_all_match = (allcomponent_matching_func*)MatchingComponentCertificateList;
+       return LDAP_SUCCESS;
+}  /* GDecCertificateList*/
diff --git a/contrib/slapd-modules/comp_match/crl.h b/contrib/slapd-modules/comp_match/crl.h
new file mode 100644 (file)
index 0000000..f2b4a24
--- /dev/null
@@ -0,0 +1,359 @@
+
+#include "asn-incl.h"
+/*
+ *    crl.h
+ *    "CertificateRevokationList" ASN.1 module encode/decode/extracting/matching/free C src.
+ *    This file was generated by modified eSMACC compiler Fri Jan 21 11:25:24 2005
+ *    The generated files are strongly encouraged to be
+ *    compiled as a module for OpenLDAP Software
+ */
+
+#ifndef _crl_h_
+#define _crl_h_
+
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef _WIN32
+#pragma warning( disable : 4101 )
+#endif
+#include "componentlib.h"
+
+#define V1 0
+#define V2 1
+#define V3 2
+
+typedef ComponentInt ComponentVersion; /* INTEGER { V1 (0), V2 (1), V3 (2) }  */
+
+#define MatchingComponentVersion MatchingComponentInt
+
+#define ExtractingComponentVersion ExtractingComponentInt
+
+#define BDecComponentVersion BDecComponentInt
+
+#define GDecComponentVersion GDecComponentInt
+
+
+typedef ComponentInt ComponentCertificateSerialNumber; /* INTEGER */
+
+#define MatchingComponentCertificateSerialNumber MatchingComponentInt
+
+#define ExtractingComponentCertificateSerialNumber ExtractingComponentInt
+
+#define BDecComponentCertificateSerialNumber BDecComponentInt
+
+#define GDecComponentCertificateSerialNumber GDecComponentInt
+
+
+typedef ComponentOid ComponentAttributeType; /* OBJECT IDENTIFIER */
+
+#define MatchingComponentAttributeType MatchingComponentOid
+
+#define ExtractingComponentAttributeType ExtractingComponentOid
+
+#define BDecComponentAttributeType BDecComponentOid
+
+#define GDecComponentAttributeType GDecComponentOid
+
+
+typedef struct AlgorithmIdentifier /* SEQUENCE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+       ComponentOid algorithm; /* OBJECT IDENTIFIER */
+       ComponentAnyDefinedBy parameters; /* ANY DEFINED BY algorithm OPTIONAL */
+} ComponentAlgorithmIdentifier;
+
+int MatchingComponentAlgorithmIdentifier PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentAlgorithmIdentifier PROTO (( void* mem_op, ComponentReference *cr, ComponentAlgorithmIdentifier *comp ));
+
+
+int BDecComponentAlgorithmIdentifier PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentAlgorithmIdentifier **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentAlgorithmIdentifier PROTO (( void* mem_op, GenBuf * b, ComponentAlgorithmIdentifier **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef struct Time /* CHOICE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+    enum TimeChoiceId
+    {
+        TIME_UTCTIME,
+        TIME_GENERALIZEDTIME
+    } choiceId;
+    union TimeChoiceUnion
+    {
+       ComponentUTCTime* utcTime; /* < unknown type id ?! > */
+       ComponentGeneralizedTime* generalizedTime; /* < unknown type id ?! > */
+    } a;
+} ComponentTime;
+
+int MatchingComponentTime PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentTime PROTO (( void* mem_op, ComponentReference *cr, ComponentTime *comp ));
+
+
+int BDecComponentTime PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentTime **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentTime PROTO (( void* mem_op, GenBuf * b, ComponentTime **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef struct Extension /* SEQUENCE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+       ComponentOid extnID; /* OBJECT IDENTIFIER */
+       ComponentBool* critical; /* BOOLEAN DEFAULT FALSE */
+       ComponentOcts extnValue; /* OCTET STRING */
+} ComponentExtension;
+
+int MatchingComponentExtension PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentExtension PROTO (( void* mem_op, ComponentReference *cr, ComponentExtension *comp ));
+
+
+int BDecComponentExtension PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentExtension **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentExtension PROTO (( void* mem_op, GenBuf * b, ComponentExtension **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef struct AttributeTypeAndValue /* SEQUENCE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+       ComponentAttributeType type; /* AttributeType */
+       ComponentAnyDefinedBy value; /* ANY DEFINED BY type */
+} ComponentAttributeTypeAndValue;
+
+int MatchingComponentAttributeTypeAndValue PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentAttributeTypeAndValue PROTO (( void* mem_op, ComponentReference *cr, ComponentAttributeTypeAndValue *comp ));
+
+
+int BDecComponentAttributeTypeAndValue PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentAttributeTypeAndValue **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentAttributeTypeAndValue PROTO (( void* mem_op, GenBuf * b, ComponentAttributeTypeAndValue **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef ComponentList ComponentExtensions; /* SEQUENCE SIZE 1..MAX OF Extension */
+
+int MatchingComponentExtensions PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentExtensions PROTO (( void* mem_op, ComponentReference *cr, ComponentExtensions *comp ));
+
+
+int BDecComponentExtensions PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentExtensions **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentExtensions PROTO (( void* mem_op, GenBuf * b, ComponentExtensions **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef struct TBSCertListSeqOfSeq /* SEQUENCE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+       ComponentCertificateSerialNumber userCertificate; /* CertificateSerialNumber */
+       ComponentTime* revocationDate; /* Time */
+       ComponentExtensions* crlEntryExtensions; /* Extensions OPTIONAL */
+} ComponentTBSCertListSeqOfSeq;
+
+int MatchingComponentTBSCertListSeqOfSeq PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentTBSCertListSeqOfSeq PROTO (( void* mem_op, ComponentReference *cr, ComponentTBSCertListSeqOfSeq *comp ));
+
+
+int BDecComponentTBSCertListSeqOfSeq PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentTBSCertListSeqOfSeq **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentTBSCertListSeqOfSeq PROTO (( void* mem_op, GenBuf * b, ComponentTBSCertListSeqOfSeq **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef ComponentList ComponentTBSCertListSeqOf; /* SEQUENCE OF TBSCertListSeqOfSeq */
+
+int MatchingComponentTBSCertListSeqOf PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentTBSCertListSeqOf PROTO (( void* mem_op, ComponentReference *cr, ComponentTBSCertListSeqOf *comp ));
+
+
+int BDecComponentTBSCertListSeqOf PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentTBSCertListSeqOf **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentTBSCertListSeqOf PROTO (( void* mem_op, GenBuf * b, ComponentTBSCertListSeqOf **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef ComponentList ComponentRelativeDistinguishedName; /* SET OF AttributeTypeAndValue */
+
+int MatchingComponentRelativeDistinguishedName PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentRelativeDistinguishedName PROTO (( void* mem_op, ComponentReference *cr, ComponentRelativeDistinguishedName *comp ));
+
+
+int BDecComponentRelativeDistinguishedName PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentRelativeDistinguishedName **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentRelativeDistinguishedName PROTO (( void* mem_op, GenBuf * b, ComponentRelativeDistinguishedName **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef ComponentList ComponentRDNSequence; /* SEQUENCE OF RelativeDistinguishedName */
+
+int MatchingComponentRDNSequence PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentRDNSequence PROTO (( void* mem_op, ComponentReference *cr, ComponentRDNSequence *comp ));
+
+
+int BDecComponentRDNSequence PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentRDNSequence **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentRDNSequence PROTO (( void* mem_op, GenBuf * b, ComponentRDNSequence **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef struct Name /* CHOICE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+    enum NameChoiceId
+    {
+        NAME_RDNSEQUENCE
+    } choiceId;
+    union NameChoiceUnion
+    {
+       ComponentRDNSequence* rdnSequence; /* RDNSequence */
+    } a;
+} ComponentName;
+
+int MatchingComponentName PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentName PROTO (( void* mem_op, ComponentReference *cr, ComponentName *comp ));
+
+
+int BDecComponentName PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentName **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentName PROTO (( void* mem_op, GenBuf * b, ComponentName **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef struct TBSCertList /* SEQUENCE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+       ComponentVersion* version; /* Version OPTIONAL */
+       ComponentAlgorithmIdentifier* signature; /* AlgorithmIdentifier */
+       ComponentName* issuer; /* Name */
+       ComponentTime* thisUpdate; /* Time */
+       ComponentTime* nextUpdate; /* Time OPTIONAL */
+       ComponentTBSCertListSeqOf* revokedCertificates; /* TBSCertListSeqOf */
+       ComponentExtensions* crlExtensions; /* [0] EXPLICIT Extensions OPTIONAL */
+} ComponentTBSCertList;
+
+int MatchingComponentTBSCertList PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentTBSCertList PROTO (( void* mem_op, ComponentReference *cr, ComponentTBSCertList *comp ));
+
+
+int BDecComponentTBSCertList PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentTBSCertList **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentTBSCertList PROTO (( void* mem_op, GenBuf * b, ComponentTBSCertList **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef struct CertificateList /* SEQUENCE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+       ComponentTBSCertList* tbsCertList; /* TBSCertList */
+       ComponentAlgorithmIdentifier* signatureAlgorithm; /* AlgorithmIdentifier */
+       ComponentBits signature; /* BIT STRING */
+} ComponentCertificateList;
+
+int MatchingComponentCertificateList PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentCertificateList PROTO (( void* mem_op, ComponentReference *cr, ComponentCertificateList *comp ));
+
+
+int BDecComponentCertificateList PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentCertificateList **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentCertificateList PROTO (( void* mem_op, GenBuf * b, ComponentCertificateList **v, AsnLen *bytesDecoded, int mode));
+
+
+
+typedef struct Validity /* SEQUENCE */
+{
+       Syntax* syntax;
+       ComponentDesc* comp_desc;
+       struct berval identifier;
+       char id_buf[MAX_IDENTIFIER_LEN];
+       ComponentTime* notBefore; /* Time */
+       ComponentTime* notAfter; /* Time */
+} ComponentValidity;
+
+int MatchingComponentValidity PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 ));
+
+
+void* ExtractingComponentValidity PROTO (( void* mem_op, ComponentReference *cr, ComponentValidity *comp ));
+
+
+int BDecComponentValidity PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentValidity **v, AsnLen *bytesDecoded, int mode));
+
+
+int GDecComponentValidity PROTO (( void* mem_op, GenBuf * b, ComponentValidity **v, AsnLen *bytesDecoded, int mode));
+
+
+
+/* ========== Object Declarations ========== */
+
+
+/* ========== Object Set Declarations ========== */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#endif /* conditional include of crl.h */
index 4ae7710c88c804a5c1d6db3e0b41944d42ee4cb3..13879166971dd01c490a933aada064e60791fc5e 100644 (file)
@@ -70,20 +70,20 @@ static const char hex[] = "0123456789abcdef";
 
 /* From liblutil/passwd.c... */
 static void lmPasswd_to_key(
-        const unsigned char *lmPasswd,
-        des_cblock *key)
+       const unsigned char *lmPasswd,
+       des_cblock *key)
 {
-        /* make room for parity bits */
-        ((char *)key)[0] = lmPasswd[0];
-        ((char *)key)[1] = ((lmPasswd[0]&0x01)<<7) | (lmPasswd[1]>>1);
-        ((char *)key)[2] = ((lmPasswd[1]&0x03)<<6) | (lmPasswd[2]>>2);
-        ((char *)key)[3] = ((lmPasswd[2]&0x07)<<5) | (lmPasswd[3]>>3);
-        ((char *)key)[4] = ((lmPasswd[3]&0x0F)<<4) | (lmPasswd[4]>>4);
-        ((char *)key)[5] = ((lmPasswd[4]&0x1F)<<3) | (lmPasswd[5]>>5);
-        ((char *)key)[6] = ((lmPasswd[5]&0x3F)<<2) | (lmPasswd[6]>>6);
-        ((char *)key)[7] = ((lmPasswd[6]&0x7F)<<1);
-
-        des_set_odd_parity( key );
+       /* make room for parity bits */
+       ((char *)key)[0] = lmPasswd[0];
+       ((char *)key)[1] = ((lmPasswd[0]&0x01)<<7) | (lmPasswd[1]>>1);
+       ((char *)key)[2] = ((lmPasswd[1]&0x03)<<6) | (lmPasswd[2]>>2);
+       ((char *)key)[3] = ((lmPasswd[2]&0x07)<<5) | (lmPasswd[3]>>3);
+       ((char *)key)[4] = ((lmPasswd[3]&0x0F)<<4) | (lmPasswd[4]>>4);
+       ((char *)key)[5] = ((lmPasswd[4]&0x1F)<<3) | (lmPasswd[5]>>5);
+       ((char *)key)[6] = ((lmPasswd[5]&0x3F)<<2) | (lmPasswd[6]>>6);
+       ((char *)key)[7] = ((lmPasswd[6]&0x7F)<<1);
+
+       des_set_odd_parity( key );
 }
 
 #define MAX_PWLEN 256
@@ -115,23 +115,23 @@ static void lmhash(
        struct berval *hash
 )
 {
-        char UcasePassword[15];
-        des_cblock key;
-        des_key_schedule schedule;
-        des_cblock StdText = "KGS!@#$%";
+       char UcasePassword[15];
+       des_cblock key;
+       des_key_schedule schedule;
+       des_cblock StdText = "KGS!@#$%";
        des_cblock hbuf[2];
 
-        strncpy( UcasePassword, passwd->bv_val, 14 );
-        UcasePassword[14] = '\0';
-        ldap_pvt_str2upper( UcasePassword );
+       strncpy( UcasePassword, passwd->bv_val, 14 );
+       UcasePassword[14] = '\0';
+       ldap_pvt_str2upper( UcasePassword );
 
-        lmPasswd_to_key( UcasePassword, &key );
-        des_set_key_unchecked( &key, schedule );
-        des_ecb_encrypt( &StdText, &hbuf[0], schedule , DES_ENCRYPT );
+       lmPasswd_to_key( UcasePassword, &key );
+       des_set_key_unchecked( &key, schedule );
+       des_ecb_encrypt( &StdText, &hbuf[0], schedule , DES_ENCRYPT );
 
-        lmPasswd_to_key( &UcasePassword[7], &key );
-        des_set_key_unchecked( &key, schedule );
-        des_ecb_encrypt( &StdText, &hbuf[1], schedule , DES_ENCRYPT );
+       lmPasswd_to_key( &UcasePassword[7], &key );
+       des_set_key_unchecked( &key, schedule );
+       des_ecb_encrypt( &StdText, &hbuf[1], schedule , DES_ENCRYPT );
 
        hexify( (char *)hbuf, hash );
 }
@@ -141,20 +141,20 @@ static void nthash(
        struct berval *hash
 )
 {
-        /* Windows currently only allows 14 character passwords, but
-         * may support up to 256 in the future. We assume this means
+       /* Windows currently only allows 14 character passwords, but
+        * may support up to 256 in the future. We assume this means
         * 256 UCS2 characters, not 256 bytes...
-         */
+        */
        char hbuf[HASHLEN];
-        int i;
-        MD4_CTX ctx;
+       int i;
+       MD4_CTX ctx;
 
        if (passwd->bv_len > MAX_PWLEN*2)
                passwd->bv_len = MAX_PWLEN*2;
                
-        MD4_Init( &ctx );
-        MD4_Update( &ctx, passwd->bv_val, passwd->bv_len );
-        MD4_Final( hbuf, &ctx );
+       MD4_Init( &ctx );
+       MD4_Update( &ctx, passwd->bv_val, passwd->bv_len );
+       MD4_Final( hbuf, &ctx );
 
        hexify( hbuf, hash );
 }
@@ -440,6 +440,8 @@ static int smbk5pwd_exop_passwd(
                        *c++ = *d++;
                        d++;
                }
+               pwd.bv_len /= 2;
+               pwd.bv_val[pwd.bv_len] = '\0';
 
                ml = ch_malloc(sizeof(Modifications));
                ml->sml_next = qpw->rs_mods;
index a9dd91ebf7fe6e3e23f15bde33df568130acd581..cc7385bdc5ee14cbca38db2e4712fabd9570815a 100644 (file)
@@ -1,11 +1,11 @@
 Tools           ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-ldapcompare             * DE**HI*K M*OPQR  UVWXYZ   de *h**k *n*p*    vwxyz
+ldapcompare      * DE**HI*K M*OPQR  UVWXYZ   de *h**k *n*p*    vwxyz
 ldapdelete       *CDE**HI*K M*OPQR  UVWXYZ  cdef*h**k *n*p*    vwxy
 ldapmodify       *CDE**HI*K M*OPQRS UVWXYZabcde *h**k *n*p*r t vwxy
 ldapmodrdn       *CDE**HI*K M*OPQR  UVWXYZ  cdef*h**k *n*p*rs  vwxy
 ldappasswd      A*CDE**HI*   *O QRS UVWXYZa  def*h**  * * * s  vwxy  
-ldapsearch      A*CDE**HI*KLM*OPQRSTUVWXYZab*def*h**kl*n*p* stuvwxyz
-ldapwhoami              * DE**HI*   *O QR  UVWXYZ   def*h**  *n*p*    vwxy 
+ldapsearch      A*CDE**HI*KLM*OPQRSTUVWXYZab def*h**kl*n*p* stuvwxyz
+ldapwhoami       * DE**HI*   *O QR  UVWXYZ   def*h**  *n*p*    vwxy 
 
 
 * reserved
index 0efc98068e1c8b16bac954e9aa73e3b290739d5c..b7e6bca01821d63480fac37512bbe3114ff1d98e 100644 (file)
@@ -37,22 +37,22 @@ Implement LDAP sorted search results control (RFC 2891)
 
 Medium projects
 ---------------
-Add DSML capabilities to command line tools
+Add syncrepl "turn" support
 Implement DIT Structure Rules and Name Forms
+Implement LDAPprep
 Implement native support for simple SASL mechanisms
        (e.g. EXTERNAL and PLAIN)
-Redesign slapd to use poll(2) instead of select(2)
 Redesign slapd memory allocation fault handling
 Localize tools
 
 
 Small projects
 --------------
-Implement authPassword (RFC 3112)
+Add DSML capabilities to command line tools
 Add LDIFv2 (XML) support to command line tools
-Implement LDAPprep and SASLprep
+Implement authPassword (RFC 3112)
+Implement SASLprep
 Implement additional matching rules (RFC 3698)
-Add syncrepl "turn" support
 Add dumpasn1 logging support
 Add tests to test suite
 Add jail(2) support
index 8ad047c5a426234e685c86f2c410c947ff5b3904..4ba466e918b6b35f6281deb98988ba3987ae2a01 100644 (file)
@@ -125,7 +125,9 @@ Use complete contents of \fIpasswdfile\fP as the password for
 simple authentication.
 .TP
 .BI \-H \ ldapuri
-Specify URI(s) referring to the ldap server(s).
+Specify URI(s) referring to the ldap server(s); only the protocol/host/port
+fields are allowed; a list of URI, separated by whitespace or commas
+is expected.
 .TP
 .BI \-h \ ldaphost
 Specify an alternate host on which the ldap server is running.
index d7063687ad73503c2a0a31b932be4cff0fb03444..71f04ff8ea21b19138d5bc324d89482302c74dfd 100644 (file)
@@ -133,7 +133,9 @@ Use complete contents of \fIpasswdfile\fP as the password for
 simple authentication.
 .TP
 .BI \-H \ ldapuri
-Specify URI(s) referring to the ldap server(s).
+Specify URI(s) referring to the ldap server(s); only the protocol/host/port
+fields are allowed; a list of URI, separated by whitespace or commas
+is expected.
 .TP
 .BI \-h \ ldaphost
 Specify an alternate host on which the ldap server is running.
index 5f36dbe79eef75591956276a765f48edce1d9b9b..b91241def35cbde4b734332c8058538c1d1d2288 100644 (file)
@@ -204,7 +204,9 @@ Use complete contents of \fIpasswdfile\fP as the password for
 simple authentication.
 .TP
 .BI \-H \ ldapuri
-Specify URI(s) referring to the ldap server(s).
+Specify URI(s) referring to the ldap server(s); only the protocol/host/port
+fields are allowed; a list of URI, separated by whitespace or commas
+is expected.
 .TP
 .BI \-h \ ldaphost
 Specify an alternate host on which the ldap server is running.
index b00d6da60c6247da91f350b362232b038051e854..0ec4a7489720f5833197cdc59b7c28cc315e66be 100644 (file)
@@ -134,7 +134,9 @@ Use complete contents of \fIpasswdfile\fP as the password for
 simple authentication.
 .TP
 .BI \-H \ ldapuri
-Specify URI(s) referring to the ldap server(s).
+Specify URI(s) referring to the ldap server(s); only the protocol/host/port
+fields are allowed; a list of URI, separated by whitespace or commas
+is expected.
 .TP
 .BI \-h \ ldaphost
 Specify an alternate host on which the ldap server is running.
index c770a01caba6bdc0992fdbb7b5e3236d694e6a68..a50fa9bb10512e8b69865518ed23e1454e1f708b 100644 (file)
@@ -103,7 +103,9 @@ Set the LDAP debugging level to \fIdebuglevel\fP.
 must be compiled with LDAP_DEBUG defined for this option to have any effect.
 .TP
 .BI \-H \ ldapuri
-Specify URI(s) referring to the ldap server(s).
+Specify URI(s) referring to the ldap server(s); only the protocol/host/port
+fields are allowed; a list of URI, separated by whitespace or commas
+is expected.
 .TP
 .BI \-h \ ldaphost
 Specify an alternate host on which the ldap server is running.
index f6bcb26bd003f87e7388ad225af175b6a2101a84..cdb952bb675f67c8c96eed848494bc05501fee33 100644 (file)
@@ -182,7 +182,9 @@ Use complete contents of \fIpasswdfile\fP as the password for
 simple authentication.
 .TP
 .BI \-H \ ldapuri
-Specify URI(s) referring to the ldap server(s).
+Specify URI(s) referring to the ldap server(s); only the protocol/host/port
+fields are allowed; a list of URI, separated by whitespace or commas
+is expected.
 .TP
 .BI \-h \ ldaphost
 Specify an alternate host on which the ldap server is running.
index 89c3d9d41239160bad354f92c727787768b8e992..eb0f2f2f4c197136270203317f555148b966896d 100644 (file)
@@ -86,7 +86,9 @@ Use complete contents of \fIpasswdfile\fP as the password for
 simple authentication.
 .TP
 .BI \-H \ ldapuri
-Specify URI(s) referring to the ldap server(s).
+Specify URI(s) referring to the ldap server(s); only the protocol/host/port
+fields are allowed; a list of URI, separated by whitespace or commas
+is expected.
 .TP
 .BI \-h \ ldaphost
 Specify an alternate host on which the ldap server is running.
index e59660a8589bc512b133c73f998d19c86c69c994..bccb72d0fe6fa5eb9004e62c1958bd38d37800fa 100644 (file)
@@ -3,7 +3,7 @@
 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
 .\" $OpenLDAP$
 .SH NAME
-slapd-bdb, slapd-hdb \- BDB backends to slapd
+slapd-bdb, slapd-hdb \- Berkeley DB backends to slapd
 .SH SYNOPSIS
 ETCDIR/slapd.conf
 .SH DESCRIPTION
@@ -54,6 +54,27 @@ the <min> argument is non-zero, an internal task will run every <min>
 minutes to perform the checkpoint.
 See the Berkeley DB reference guide for more details.
 .TP
+.B dbconfig <Berkeley DB setting>
+Specify a configuration directive to be placed in the
+.B DB_CONFIG
+file of the database directory. The
+.B dbconfig
+directive is just a convenience
+to allow all necessary configuration to be set in the
+.B slapd.conf
+file.
+The options set using this directive will only be written to the DB_CONFIG
+file if no such file existed at server startup time. This allows one
+to set initial values without overwriting/destroying a DB_CONFIG file
+that was already customized through other means. This directive may
+be specified multiple times, as needed. For example
+.RS
+.nf
+       dbconfig set_cachesize 0 1048576 0
+       dbconfig set_lg_bsize 2097152
+.fi
+.RE
+.TP
 .B dbnosync
 Specify that on-disk database contents should not be immediately
 synchronized with in memory changes.
@@ -154,7 +175,13 @@ Specify a key for a shared memory BDB environment. By default the
 BDB environment uses memory mapped files. If a non-zero value is
 specified, it will be used as the key to identify a shared memory
 region that will house the environment.
-.B
+.SH ACCESS CONTROL
+The 
+.B bdb
+and
+.B hdb
+backends honor access control semantics as indicated in
+.BR slapd.access (5).
 .SH FILES
 .TP
 ETCDIR/slapd.conf
index c4afb8590878520bc6f316f7baad8be7c0bbda7e..f5b29d37ad8eaa2b66c32c484645b88424873822 100644 (file)
@@ -17,6 +17,23 @@ This backend is experimental.
 The DNSSRV backend has no backend nor database specific options.
 It is configured simply by "database dnssrv" followed a suffix
 directive, e.g. suffix "".
+.SH ACCESS CONTROL
+The
+.B dnssrv
+backend does not honor all ACL semantics as described in
+.BR slapd.access (5).
+In fact, this backend only implements the
+.B search
+operation when the
+.B manageDSAit
+control (RFC3296) is used, otherwise for every operation a referral,
+whenever appropriate, or an error is returned.
+Currently, there is no means to condition the returning of the referral
+by means of ACLs; no access control is implemented, except for 
+.B read (=r)
+access to the returned entries, which is actually provided by the frontend.
+Note, however, that the information returned by this backend is collected
+through the DNS, so it is public by definition.
 .SH FILES
 .TP
 ETCDIR/slapd.conf
index 9c5c5b0b1ef012be7230bb140f4ee9a6c0da092b..cd7c81314cb642d1e0b4f0e8246dadb361530a38 100644 (file)
@@ -267,33 +267,6 @@ connection did.
 if start TLS failed.
 .RE
 
-
-
-
-.TP
-.\".B suffixmassage <suffix> <massaged (remote) suffix>
-.\"DNs ending with <suffix> in a request are changed to end with <remote
-.\"suffix> before sending the request to the remote server, and <remote
-.\"suffix> in the results are changed back to <suffix> before returning
-.\"them to the client.
-.\"The <suffix> field must be defined as a valid suffix
-.\"for the current database.
-.\".TP
-.\".B map "{attribute | objectclass} [<local name> | *] {<foreign name> | *}"
-.\"Map attribute names and object classes from the foreign server to
-.\"different values on the local slapd.
-.\"The reason is that some attributes might not be part of the local
-.\"slapd's schema, some attribute names might be different but serve the
-.\"same purpose, etc.
-.\"If local or foreign name is `*', the name is preserved.
-.\"If local name is omitted, the foreign name is removed.
-.\"Unmapped names are preseved if both local and foreign name are `*',
-.\"and removed if local name is omitted and foreign name is `*'.
-.\".TP
-.\".B rewrite*
-.\"The rewrite options are described in the "REWRITING" section of the
-.\".BR slapd-meta (5)
-.\"manual page.
 .TP
 .B suffixmassage, map, rewrite*
 These directives are no longer supported by back-ldap; their 
@@ -307,35 +280,22 @@ recognizes them and automatically instantiates the
 .B rwm
 overlay if available and not instantiated yet.
 This behavior may change in the future.
-.\".SH EXAMPLES
-.\"The following directives map the object class `groupOfNames' to
-.\"the object class `groupOfUniqueNames' and the attribute type
-.\"`member' to the attribute type `uniqueMember':
-.\".LP
-.\".RS
-.\".nf
-.\"map objectclass groupOfNames groupOfUniqueNames
-.\"map attribute uniqueMember member
-.\".fi
-.\".RE
-.\".LP
-.\"This presents a limited attribute set from the foreign
-.\"server:
-.\".LP
-.\".RS
-.\".nf
-.\"map attribute cn *
-.\"map attribute sn *
-.\"map attribute manager *
-.\"map attribute description *
-.\"map attribute *
-.\".fi
-.\".RE
-.\".LP
-.\"These lines map cn, sn, manager, and description to themselves, and 
-.\"any other attribute gets "removed" from the object before it is sent 
-.\"to the client (or sent up to the LDAP server).  This is obviously a 
-.\"simplistic example, but you get the point.
+
+.SH ACCESS CONTROL
+The
+.B ldap
+backend does not honor all ACL semantics as described in
+.BR slapd.access (5).
+In general, access checking is delegated to the remote server(s).
+Only
+.B read (=r)
+access to the
+.B entry
+pseudo-attribute and to the other attribute values of the entries
+returned by the
+.B search
+operation is honored, which is performed by the frontend.
+
 .SH PROXY CACHE OVERLAY
 The proxy cache overlay 
 allows caching of LDAP search requests (queries) in a local database.
index f62d2e6cdcfa2b002cab8f8245156110464c9739..3bff2270e26fb872ce62cb11c036bcd0d20eba03 100644 (file)
@@ -123,6 +123,11 @@ Note: changing index settings requires rebuilding indices, see
 Specify the file protection mode that newly created database 
 index files should have.
 The default is 0600.
+.SH ACCESS CONTROL
+The 
+.B ldbm
+backend honors access control semantics as indicated in
+.BR slapd.access (5).
 .SH FILES
 .TP
 ETCDIR/slapd.conf
diff --git a/doc/man/man5/slapd-ldif.5 b/doc/man/man5/slapd-ldif.5
new file mode 100644 (file)
index 0000000..8360fd9
--- /dev/null
@@ -0,0 +1,53 @@
+.TH SLAPD-LDIF 5 "RELEASEDATE" "OpenLDAP LDVERSION"
+.\" Copyright 1998-2005 The OpenLDAP Foundation All Rights Reserved.
+.\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
+.\" $OpenLDAP$
+.SH NAME
+slapd-ldif \- LDIF backend to slapd
+.SH SYNOPSIS
+ETCDIR/slapd.conf
+.SH DESCRIPTION
+The LDIF backend to
+.BR slapd (8)
+is a basic storage backend that stores entries in text files in LDIF format,
+and exploits the filesystem to create the tree structure of the database.
+It is intended as a cheap, low performance easy to use backend, and it is
+exploited by higher-level internal structures to provide a permanent
+storage.
+.SH CONFIGURATION
+These
+.B slapd.conf
+options apply to the LDIF backend database.
+That is, they must follow a "database ldif" line and come before
+any subsequent "backend" or "database" lines.
+Other database options are described in the
+.BR slapd.conf (5)
+manual page.
+.TP
+.B directory <dir>
+Specify the directory where the database tree starts.  The directory
+must exist and grant appropriate permissions (rwx) to the identity slapd
+is running with.
+.SH ACCESS CONTROL
+The
+.B LDIF
+backend does not honor any of the access control semantics described in
+.BR slapd.access (5).
+Only
+.B read (=r)
+access to the
+.B entry
+pseudo-attribute and to the other attribute values of the entries
+returned by the
+.B search
+operation is honored, which is performed by the frontend.
+.SH FILES
+.TP
+ETCDIR/slapd.conf
+default slapd configuration file
+.SH SEE ALSO
+.BR slapd.conf (5),
+.BR slapd (8),
+.BR LDIF (5).
+.SH AUTHOR
+Eric Stokes
index 4b796d3760480e662e5da873f4a43319e0af9663..316c49ac480fb7fd6a1add67a137106bb17675e1 100644 (file)
@@ -93,6 +93,14 @@ This caches the target that holds a given DN to speed up target
 selection in case multiple targets would result from an uncached
 search; forever means cache never expires; disabled means no DN
 caching; otherwise a valid ( > 0 ) ttl in seconds is required.
+.TP
+.B nretries {forever|never|<nretries>}
+This directive defines how many times a bind should be retried
+in case of temporary failure in contacting a target.  If defined
+before any target specification, it applies to all targets (by default,
+.BR never );
+the global value can be overridden by redefinitions inside each target
+specification.
 .SH TARGET SPECIFICATION
 Target specification starts with a "uri" directive:
 .TP
@@ -740,6 +748,22 @@ been written:
 .fi
 .LP
 with the advantage of saving one rewrite pass ...)
+
+.SH ACCESS CONTROL
+The
+.B meta
+backend does not honor all ACL semantics as described in
+.BR slapd.access (5).
+In general, access checking is delegated to the remote server(s).
+Only
+.B read (=r)
+access to the
+.B entry
+pseudo-attribute and to the other attribute values of the entries
+returned by the
+.B search
+operation is honored, which is performed by the frontend.
+
 .SH PROXY CACHE OVERLAY
 The proxy cache overlay 
 allows caching of LDAP search requests (queries) in a local database.
index 7ecc06a282cbad2a8440ee9eed360a136764d097..a677426a78dc6500c4f522b1eb74f05974cf0b5b 100644 (file)
@@ -89,6 +89,14 @@ access to dn.subtree="cn=Monitor"
 4) ensure that the \fBcore.schema\fP file is loaded.
 The monitor backend relies on some standard track attributeTypes
 that must be already defined when the backend is started.
+.SH ACCESS CONTROL
+The 
+.B monitor
+backend honors access control semantics as indicated in
+.BR slapd.access (5),
+including the 
+.B disclose
+access privilege, on all currently implemented operations.
 .SH KNOWN LIMITATIONS
 The monitor backend does not honor size/time limits in search operations.
 .SH FILES
index ee4272f38e513577131f8ad1c8bbdeb2b5ff6e8e..5164a7c4599f2447c4c44c42aa0dd4d41f7d5f91 100644 (file)
@@ -42,6 +42,11 @@ suffix   "cn=Nothing"
 bind     on
 .fi
 .RE
+.SH ACCESS CONTROL
+The
+.B null
+backend does not honor any of the access control semantics described in
+.BR slapd.access (5).
 .SH FILES
 .TP
 ETCDIR/slapd.conf
index 25eb2c9faec9bf62cadb2c0007f4ce5ff1e390a2..43400b52dae87ab286bb05978931157cf9fe0421 100644 (file)
@@ -29,6 +29,20 @@ manual page.
 Specifies an alternate passwd file to use.
 The default is
 .BR /etc/passwd .
+.SH ACCESS CONTROL
+The
+.B passwd
+backend does not honor any of the access control semantics described in
+.BR slapd.access (5).
+Only
+.B read (=r)
+access to the
+.B entry
+pseudo-attribute and to the other attribute values of the entries
+returned by the
+.B search
+operation is honored, which is performed by the frontend.
+
 .SH FILES
 .TP
 ETCDIR/slapd.conf
index d0627c03eef28f244a8bf79d9ed7c9482fff9427..91d00776ef17d7e7c225040bcd5d2af056ac6d59 100644 (file)
@@ -162,6 +162,20 @@ returned directly to the client.
 .SH EXAMPLE
 There is an example Perl module `SampleLDAP' in the slapd/back-perl/
 direcetory in the OpenLDAP source tree.
+.SH ACCESS CONTROL
+The
+.B passwd
+backend does not honor any of the access control semantics described in
+.BR slapd.access (5);
+all access control is delegated to the underlying PERL scripting.
+Only
+.B read (=r)
+access to the
+.B entry
+pseudo-attribute and to the other attribute values of the entries
+returned by the
+.B search
+operation is honored, which is performed by the frontend.
 .SH WARNING
 The interface of this backend to the perl module MAY change.
 Any suggestions would greatly be appreciated.
index 5a165f3b5ba156baef4a1eb033b47cd312b38209..8aeead99c29e819cf2798fdfb3b11c15bd3010a8 100644 (file)
@@ -52,7 +52,7 @@ directives described in
 One important issue is that access rules are based on the identity
 that issued the operation.
 After massaging from the virtual to the real naming context, the
-frontend sees the operation as performed by the identty in the
+frontend sees the operation as performed by the identity in the
 real naming context.
 Moreover, since
 .B back-relay
@@ -110,8 +110,7 @@ that looks up the real naming context for each operation, use
   database        relay
   suffix          "dc=virtual,dc=naming,dc=context"
   overlay         rwm
-  suffixmassage   "dc=virtual,dc=naming,dc=context"
-          "dc=real,dc=naming,dc=context"
+  suffixmassage   "dc=real,dc=naming,dc=context"
 .fi
 .LP
 This is useful, for instance, to relay different databases that
@@ -176,6 +175,20 @@ clause) are in the
 and in the
 .BR "virtual naming context" ,
 respectively.
+.SH ACCESS CONTROL
+The
+.B relay
+backend does not honor any of the access control semantics described in
+.BR slapd.access (5);
+all access control is delegated to the relayed database(s).
+Only
+.B read (=r)
+access to the
+.B entry
+pseudo-attribute and to the other attribute values of the entries
+returned by the
+.B search
+operation is honored, which is performed by the frontend.
 .SH FILES
 .TP
 ETCDIR/slapd.conf
index c265616dc21ed182914f9ccfc80c905f610fc941..7be316ff333531872d6657a31028d3d0f0f8382f 100644 (file)
@@ -134,6 +134,89 @@ where only RESULT is mandatory.
 The \fBsearch\fP RESULT should be preceded by the entries in LDIF
 format, each entry followed by a blank line.
 Lines starting with `#' or `DEBUG:' are ignored.
+.SH ACCESS CONTROL
+The
+.B shell
+backend does not honor all ACL semantics as described in
+.BR slapd.access (5).
+In general, access to objects is checked by using a dummy object
+that contains only the DN, so access rules that rely on the contents
+of the object are not honored.
+In detail:
+.LP
+The
+.B add
+operation does not require
+.B write (=w)
+access to the 
+.B children
+pseudo-attribute of the parent entry.
+.LP
+The
+.B bind
+operation requires 
+.B auth (=x)
+access to the 
+.B entry
+pseudo-attribute of the entry whose identity is being assessed;
+.B auth (=x)
+access to the credentials is not checked, but rather delegated 
+to the underlying shell script.
+.LP
+The
+.B compare
+operation requires 
+.B read (=r)
+access (FIXME: wouldn't 
+.B compare (=c)
+be a more appropriate choice?)
+to the 
+.B entry
+pseudo-attribute
+of the object whose value is being asserted;
+.B compare (=c)
+access to the attribute whose value is being asserted is not checked.
+.LP
+The
+.B delete
+operation does not require
+.B write (=w)
+access to the 
+.B children
+pseudo-attribute of the parent entry.
+.LP
+The
+.B modify
+operation requires
+.B write (=w)
+access to the 
+.B entry 
+pseudo-attribute;
+.B write (=w)
+access to the specific attributes that are modified is not checked.
+.LP
+The
+.B modrdn
+operation does not require
+.B write (=w)
+access to the 
+.B children
+pseudo-attribute of the parent entry, nor to that of the new parent,
+if different;
+.B write (=w)
+access to the distinguished values of the naming attributes
+is not checked.
+.LP
+The
+.B search 
+operation does not require
+.B search (=s)
+access to the 
+.B entry
+pseudo_attribute of the searchBase;
+.B search (=s)
+access to the attributes and values used in the filter is not checked.
+
 .SH EXAMPLE
 There is an example search script in the slapd/back-shell/ directory
 in the OpenLDAP source tree.
index 03d31c381f08efa9c4a45f0f5a38e17944bbfe00..aedf2de34048f79e3b1f43a6097e08436001ed3e 100644 (file)
@@ -649,6 +649,14 @@ for details.
 .SH EXAMPLES
 There are example SQL modules in the slapd/back-sql/rdbms_depend/
 directory in the OpenLDAP source tree.
+.SH ACCESS CONTROL
+The 
+.B sql
+backend honors access control semantics as indicated in
+.BR slapd.access (5)
+(including the 
+.B disclose
+access privilege when enabled at compile time).
 .SH FILES
 
 .TP
index be14cf19fb9e821de9c067370c9d3b71cfcc11d1..c4189526b5182f2d5095bdfaaad1abca468c1f56 100644 (file)
@@ -229,10 +229,18 @@ It can have the forms
        *
        anonymous
        users
-       self
+       self[.<selfstyle>]
 
        dn[.<dnstyle>[,<modifier>]]=<DN>
        dnattr=<attrname>
+
+       realanonymous
+       realusers
+       realself[.<selfstyle>]
+
+       realdn[.<dnstyle>[,<modifier>]]=<DN>
+       realdnattr=<attrname>
+
        group[/<objectclass>[/<attrname>]]
                [.<groupstyle>]=<group>
        peername[.<peernamestyle>]=<peername>
@@ -246,15 +254,17 @@ It can have the forms
        tls_ssf=<n>
        sasl_ssf=<n>
 
-       aci=<attrname>
+       aci[=<attrname>]
+       dynacl/name[.<dynstyle>][=<pattern>]
 .fi
 .LP
 with
 .LP
 .nf
        <style>={exact|regex|expand}
+       <selfstyle>={level{<n>}}
        <dnstyle>={{exact|base(object)}|regex
-               |one(level)|sub(tree)|children}
+               |one(level)|sub(tree)|children|level{<n>}}
        <groupstyle>={exact|expand}
        <peernamestyle>={<style>|ip|path}
        <domainstyle>={exact|regex|sub(tree)}
@@ -271,6 +281,11 @@ The wildcard
 .B *
 refers to everybody.
 .LP
+The keywords prefixed by
+.B real
+act as their counterparts without prefix; the checking respectively occurs
+with the \fIauthentication\fP DN and the \fIauthorization\fP DN.
+.LP
 The keyword
 .B anonymous
 means access is granted to unauthenticated clients; it is mostly used 
@@ -286,6 +301,18 @@ The keyword
 .B self
 means access to an entry is allowed to the entry itself (e.g. the entry
 being accessed and the requesting entry must be the same).
+It allows the 
+.B level{<n>}
+style, where \fI<n>\fP indicates what ancestor of the DN 
+is to be used in matches.
+A positive value indicates that the <n>-th ancestor of the user's DN
+is to be considered; a negative value indicates that the <n>-th ancestor
+of the target is to be considered.
+For example, a "\fIby self.level{1} ...\fP" clause would match
+when the object "\fIdc=example,dc=com\fP" is accessed
+by "\fIcn=User,dc=example,dc=com\fP".
+A "\fIby self.level{-1} ...\fP" clause would match when the same user
+accesses the object "\fIou=Address Book,cn=User,dc=example,dc=com\fP".
 .LP
 The statement
 .B dn=<DN>
@@ -360,7 +387,7 @@ the
 the
 .BR one(level) ,
 and the
-.B children
+.BR children
 forms provide
 .B $0
 as the match of the entire string.
@@ -369,7 +396,7 @@ The
 the
 .BR one(level) ,
 and the
-.B children
+.BR children
 forms also provide
 .B $1
 as the match of the rightmost part of the DN as defined in the
@@ -387,6 +414,14 @@ which means that only access to entries that appear in the DN of the
 .B <by>
 clause is allowed.
 .LP
+The 
+.BR level{<n>}
+form is an extension and a generalization of the
+.BR onelevel
+form, which matches all DNs whose <n>-th ancestor is the pattern.
+So, \fIlevel{1}\fP is equivalent to \fIonelevel\fP, 
+and \fIlevel{0}\fP is equivalent to \fIbase\fP.
+.LP
 It is perfectly useless to give any access privileges to a DN 
 that exactly matches the
 .B rootdn
@@ -413,6 +448,11 @@ The optional parameters
 and
 .B <attrname>
 define the objectClass and the member attributeType of the group entry.
+The defaults are
+.B groupOfNames
+and
+.BR member ,
+respectively.
 The optional style qualifier
 .B <style>
 can be
@@ -580,12 +620,39 @@ The statement
 is undocumented yet.
 .LP
 The statement
-.B aci=<attrname>
+.B aci[=<attrname>]
 means that the access control is determined by the values in the
 .B attrname
 of the entry itself.
+The optional
+.B <attrname>
+indicates what attributeType holds the ACI information in the entry.
+By default, the 
+.B OpenLDAPaci
+operational attribute is used.
 ACIs are experimental; they must be enabled at compile time.
 .LP
+The statement
+.B dynacl/<name>[.<dynstyle>][=<pattern>]
+means that access checking is delegated to the admin-defined method
+indicated by
+.BR <name> ,
+which can be registered at run-time by means of the
+.B moduleload
+statement.
+The fields
+.B <dynstyle>
+and
+.B <pattern>
+are optional, and are directly passed to the registered parsing routine.
+Dynacl is experimental; it must be enabled at compile time.
+If dynacl and ACIs are both enabled, ACIs are cast into the dynacl scheme,
+where 
+.B <name>=aci
+and, optionally,
+.BR <patten>=<attrname> .
+However, the original ACI syntax is preserved for backward compatibility.
+.LP
 The statements
 .BR ssf=<n> ,
 .BR transport_ssf=<n> ,
@@ -596,15 +663,15 @@ set the minimum required Security Strength Factor (ssf) needed
 to grant access.  The value should be positive integer.
 .SH THE <ACCESS> FIELD
 The field
-.B <access> ::= [self]{<level>|<priv>}
+.B <access> ::= [[real]self]{<level>|<priv>}
 determines the access level or the specific access privileges the
 .B who 
 field will have.
 Its component are defined as
 .LP
 .nf
-       <level> ::= none|auth|compare|search|read|write
-       <priv> ::= {=|+|-}{w|r|s|c|x|0}+
+       <level> ::= none|disclose|auth|compare|search|read|write
+       <priv> ::= {=|+|-}{w|r|s|c|x|d|0}+
 .fi
 .LP
 The modifier
@@ -612,7 +679,12 @@ The modifier
 allows special operations like having a certain access level or privilege
 only in case the operation involves the name of the user that's requesting
 the access.
-It implies the user that requests access is bound.
+It implies the user that requests access is authorized.
+The modifier
+.B realself
+refers to the authenticated DN as opposed to the authorized DN of the
+.B self
+modifier.
 An example is the
 .B selfwrite
 access to the member attribute of a group, which allows one to add/delete
@@ -624,6 +696,7 @@ access model relies on an incremental interpretation of the access
 privileges.
 The possible levels are
 .BR none ,
+.BR disclose ,
 .BR auth ,
 .BR compare ,
 .BR search ,
@@ -633,11 +706,18 @@ and
 Each access level implies all the preceding ones, thus 
 .B write
 access will imply all accesses.
-While
-.B none
-is trivial, 
+.LP
+The
+.B none 
+access level disallows all access including disclosure on error.
+.LP
+The
+.B disclose
+access level allows disclosure of information on error.
+.LP
+The 
 .B auth
-access means that one is allowed access to an attribute to perform
+access level means that one is allowed access to an attribute to perform
 authentication/authorization operations (e.g.
 .BR bind )
 with no other access.
@@ -665,9 +745,11 @@ for read,
 .B s 
 for search,
 .B c 
-for compare, and
+for compare,
 .B x
-for authentication.
+for authentication, and
+.B d
+for disclose.
 More than one of the above privileges can be added in one statement.
 .B 0
 indicates no privileges and is used only by itself (e.g., +0).
@@ -794,10 +876,15 @@ is set to 1.
 .LP
 The
 .B search
-operation, for each entry, requires
+operation, requires 
+.B search (=s)
+privileges on the 
+.B entry
+pseudo-attribute of the searchBase (NOTE: this was introduced with 2.3).
+Then, for each entry, it requires
 .B search (=s)
 privileges on the attributes that are defined in the filter.
-Then, the resulting entries are tested for 
+The resulting entries are finally tested for 
 .B read (=r)
 privileges on the pseudo-attribute
 .B entry
@@ -838,6 +925,23 @@ privileges are also required on the
 attribute of the authorizing identity and/or on the 
 .B authzFrom
 attribute of the authorized identity.
+
+.LP
+Access control to search entries is checked by the frontend,
+so it is fully honored by all backends; for all other operations
+and for the discovery phase of the search operation,
+full ACL semantics is only supported by the primary backends, i.e.
+.BR back-bdb (5),
+.BR back-hdb (5),
+and
+.BR back-ldbm (5).
+
+Some other backend, like
+.BR back-sql (5),
+may fully support them; others may only support a portion of the 
+described semantics, or even differ in some aspects.
+The relevant details are described in the backend-specific man pages.
+
 .SH CAVEATS
 It is strongly recommended to explicitly use the most appropriate
 .B <dnstyle>
@@ -916,6 +1020,7 @@ ETCDIR/slapd.conf
 default slapd configuration file
 .SH SEE ALSO
 .BR slapd (8),
+.BR slapd-* (5),
 .BR slapacl (8),
 .BR regex (7),
 .BR re_format (7)
index 8f8a4dab003a4f2375c3fc6506bc03bb2eef121a..287caa9b9fceae9cedfc996f5c9291905ee96761 100644 (file)
@@ -55,8 +55,8 @@ file is used).
 .LP
 If a line begins with white space, it is considered a continuation
 of the previous line.  Blank lines and comment lines beginning with
-a `#' character are ignored.  (Note: continuation lines are unwrapped
-before comment processing is applied.)
+a `#' character are ignored.  Note: continuation lines are unwrapped
+before comment processing is applied.
 .LP
 Arguments on configuration lines are separated by white space. If an
 argument contains white space, the argument should be enclosed in
@@ -1679,7 +1679,6 @@ default slapd configuration file
 .BR slapd\-relay (5),
 .BR slapd\-shell (5),
 .BR slapd\-sql (5),
-.BR slapd\-tcl (5),
 .BR slapd.access (5),
 .BR slapd.plugin (5),
 .BR slapd.replog (5),
diff --git a/doc/man/man5/slapo-dynlist.5 b/doc/man/man5/slapo-dynlist.5
new file mode 100644 (file)
index 0000000..f967d96
--- /dev/null
@@ -0,0 +1,110 @@
+.TH SLAPO-DYNLIST 5 "RELEASEDATE" "OpenLDAP LDVERSION"
+.\" Copyright 1998-2005 The OpenLDAP Foundation, All Rights Reserved.
+.\" Copying restrictions apply.  See the COPYRIGHT file.
+.\" $OpenLDAP$
+.SH NAME
+slapo-dynlist \- dynnamic list overlay
+.SH SYNOPSIS
+ETCDIR/slapd.conf
+.SH DESCRIPTION
+The
+.B dynlist
+overlay to
+.BR slapd (8)
+allows expansion of dynamic groups and more.
+Any time an entry with a specific objectClass is being returned,
+the LDAP URI-valued occurrences of a specific attribute are
+expanded into the corresponding entries, and the values
+of the attributes listed in the URI are added to the original
+entry.
+No recursion is currently allowed, to avoid potential infinite loops.
+
+.SH CONFIGURATION
+The config directives that are specific to the
+.B dynlist
+overlay must be prefixed by
+.BR dynlist\- ,
+to avoid potential conflicts with directives specific to the underlying 
+database or to other stacked overlays.
+
+.TP
+.B overlay dynlist
+This directive adds the dynlist overlay to the current database,
+or to the frontend, if used before any database instantiation; see
+.BR slapd.conf (5)
+for details.
+
+.LP
+These 
+.B slapd.conf
+configuration options apply to the dynlist overlay. They must appear
+after the
+.B overlay
+directive.
+.TP
+.B dynlist-oc <objectClass>
+The name of the objectClass that triggers the dynamic expansion of the
+data.  This statement is required.
+.TP
+.B dynlist-ad <attributeName>
+The name of the attributeDescription that holds the LDAP URI values that
+will expand; if none is present, no expansion occurs.  If the intersection
+of the attributes requested by the search operation (or the asserted attribute
+for compares) and the attributes listed in the URI is empty, no expansion 
+occurs for that specific URI.  This statement is required.
+.TP
+.B dynlist-member-ad <attributeName>
+The name of the attributeDescription that will list the DN of the entries
+resulting from the internal search.  This statement is optional and, if
+present, changes the behvior of the overlay into that of a dynamic group.
+The <attrs> portion of the URI is ignored, and the DNs of all the entries 
+resulting from the expansion of the URI are listed as values of this 
+attribute.
+
+.LP
+The dynlist overlay may be used with any backend, but it is mainly 
+intended for use with local storage backends.
+In case the URI expansion is very resource-intensive and occurs frequently
+with well-defined patterns, one should consider adding a proxycache
+later on in the overlay stack.
+
+.SH EXAMPLE
+This example collects all the email addresses of a database into a single
+entry; first of all, make sure that slapd.conf contains the directives:
+
+.LP
+.nf
+    include /path/to/dyngroup.schema
+    # ...
+
+    database <database>
+    # ...
+
+    overlay dynlist
+    dynlist-oc groupOfURLs
+    dynlist-ad memberURL
+.fi
+.LP
+and that slapd loads dynlist.la, if compiled as a run-time module;
+then add to the database an entry like
+.LP
+.nf
+    dn: cn=Dynamic List,ou=Groups,dc=example,dc=com
+    objectClass: groupOfURLs
+    cn: Dynamic List
+    memberURL: ldap:///ou=People,dc=example,dc=com?mail?sub?(objectClass=person)
+.fi
+
+If no <attrs> are provided in the URI, all (non-operational) attributes are
+collected.
+
+
+.SH FILES
+.TP
+ETCDIR/slapd.conf
+default slapd configuration file
+.SH SEE ALSO
+.BR slapd.conf (5),
+.BR slapd (8).
+.SH AUTHOR
+Originally implemented by Pierangelo Masarati.
index e925554d7125dff75cf7ccef670bfcbfd54146c3..2fb88ae57a532052578795e0bb93f2148df489c4 100644 (file)
@@ -78,6 +78,21 @@ used by the \fBproxytemplate\fP directive to define cacheable templates.
 Specifies a cacheable template and "time to live" (in sec) <ttl> of queries 
 belonging to the template. 
 
+.TP
+.B response-callback { head | tail }
+Specifies whether the response callback should be placed at the
+.B tail
+(the default) or at the 
+.B head
+(actually, wherever the stacking sequence would make it appear) 
+of the callback list.  This affects how the overlay interacts with other
+overlays, since the proxycache overlay should be executed as early 
+as possible (and thus configured as late as possible), to get 
+a chance to return the cached results; however, if executed early
+at response, it would cache entries that may be later "massaged"
+by other databases and thus returned \fIafter\fP massaging the first
+time, and \fIbefore\fP massaging when cached.
+
 .LP
 The following adds a template with filter string \fB((&sn=)(givenName=))\fP 
 and attributes mail, postaladdress, telephonenumber and a TTL of 1 hour. 
index 4df428e853fcf87bd5c25c2f285f4945f74b9234..929a6e4ce20b224efa184450c7fd404ce00e8f6f 100644 (file)
@@ -75,7 +75,7 @@ object class.  The definition of that class is as follows:
     MAY (
         pwdMinAge $ pwdMaxAge $ pwdInHistory $
         pwdCheckSyntax $ pwdMinLength $
-        pwdExpireWarning $ pwdGraceLoginLimit $
+        pwdExpireWarning $ pwdGraceAuthnLimit $
         pwdLockout $ pwdLockoutDuration $
         pwdMaxFailure $ pwdFailureCountInterval $
         pwdMustChange $ pwdAllowUserChange $
@@ -247,7 +247,7 @@ present, or if the value is zero (0), no warnings will be sent.
    SINGLE-VALUE )
 .RE
 
-.B pwdGraceLoginLimit
+.B pwdGraceAuthnLimit
 .P
 This attribute contains the number of times that an expired password
 may be used to authenticate a user to the directory. If this
@@ -257,7 +257,7 @@ directory.
 .LP
 .RS 4
 (  1.3.6.1.4.1.42.2.27.8.1.8
-   NAME 'pwdGraceLoginLimit'
+   NAME 'pwdGraceAuthnLimit'
    EQUALITY integerMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
    SINGLE-VALUE )
@@ -560,28 +560,6 @@ and may only be unlocked by an administrator.
    USAGE directoryOperation)
 .RE
 
-.B pwdExpirationWarned
-.P
-This attribute denotes the time when the first password
-expiration warning was sent to the client regarding this account.
-The amount of time between when this warning is sent and when
-the password actually expires is the amount of time stored in
-the
-.B pwdExpireWarning
-password policy attribute.
-.LP
-.RS 4
-(  1.3.6.1.4.1.42.2.27.8.1.18
-   NAME 'pwdExpirationWarned'
-   DESC 'The time the user was first warned about the
-       coming expiration of their password'
-   SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
-   EQUALITY generalizedTimeMatch
-   ORDERING generalizedTimeOrderingMatch
-   SINGLE-VALUE
-   USAGE directoryOperation )
-.RE
-
 .B pwdFailureTime
 .P
 This attribute contains the timestamps of each of the consecutive
@@ -734,7 +712,7 @@ ppolicy_default "cn=Standard,ou=Policies,dc=example,dc=com"
 .LP
 IETF LDAP password policy proposal by P. Behera, L.  Poitou and J.
 Sermersheim:  documented in IETF document
-"draft-behera-ldap-password-policy-07.txt".
+"draft-behera-ldap-password-policy-08.txt".
 
 .SH BUGS
 The LDAP Password Policy specification is not yet an approved standard,
@@ -753,8 +731,8 @@ IETF LDAP password policy proposal by P. Behera, L.
 Poitou and J. Sermersheim.
 The proposal is fully documented in
 the
-IETF document named draft-behera-ldap-password-policy-07.txt,
-written in February of 2004.
+IETF document named draft-behera-ldap-password-policy-08.txt,
+written in October of 2004.
 .P
 .B OpenLDAP
 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
index a1be578dcf0433ec1b045ac24f07d83f807baf1b..fc369a3b989c52ed27bc88aa6fc07f2e438dea6e 100644 (file)
@@ -10,6 +10,8 @@ slapacl \- Check access to a list of attributes.
 .B [\-f slapd.conf]
 .B [\-D authcDN | \-U authcID]
 .B \-b DN
+.B [\-u]
+.B [\-X authzID | \-o authzDN=DN]
 .B [attr[/access][:value]] [...]
 .LP
 .SH DESCRIPTION
@@ -62,13 +64,59 @@ rules (see
 for details); mutually exclusive with
 .BR \-D .
 .TP
+.BI \-X " authzID"
+specify an authorization ID to be mapped to a
+.B DN
+as by means of
+.B authz-regexp
+or
+.B authz-rewrite
+rules (see
+.BR slapd.conf (5)
+for details); mutually exclusive with \fB\-o\fP \fIauthzDN=DN\fP.
+.TP
+.BI \-o " option[=value]"
+Specify an
+.BR option
+with a(n optional)
+.BR value .
+Possible options/values are:
+.LP
+.nf
+              sockurl
+              domain
+              peername
+              sockname
+              ssf
+              transport_ssf
+              tls_ssf
+              sasl_ssf
+              authzDN
+.fi
+.TP
 .BI \-b " DN"
 specify the 
 .B DN 
-access to is requested; the corresponding entry is not fetched 
-from the database, and thus it must not exist.
-However, a database must be selected to determine what rules 
-apply; thus, it must be in the naming context of a configured database.
+which access is requested to; the corresponding entry is fetched 
+from the database, and thus it must exist.
+The DN is also used to determine what rules apply; thus, it must be
+in the naming context of a configured database.  See also
+.BR \-u .
+.TP
+.BI \-u
+do not fetch the entry from the database.
+In this case, if the entry does not exist, a fake entry with the DN
+given with the
+.B \-b
+option is used, with no attributes.
+As a consequence, those rules that depend on the contents 
+of the target object will not behave as with the real object.
+The DN given with the
+.B \-b
+option is still used to select what rules apply; thus, it must be
+in the naming context of a configured database.
+See also
+.BR \-b .
 .SH EXAMPLES
 The command
 .LP
index 694c7bcaeec2af3102ac287d9cc335c32839e06f..fd629920f54214778b2508be9273bd04efea6dcc 100644 (file)
@@ -7,7 +7,7 @@ slapd \- Stand-alone LDAP Daemon
 .SH SYNOPSIS
 .B LIBEXECDIR/slapd 
 .B [\-[4|6]]
-.B [\-T {add|auth|cat|dn|index|passwd|test}]
+.B [\-T {acl|add|auth|cat|dn|index|passwd|test}]
 .B [\-d debug\-level]
 .B [\-f slapd\-config\-file]
 .B [\-h URLs]
@@ -66,11 +66,16 @@ Listen on IPv6 addresses only.
 .TP
 .B \-T {a|c|d|i|p|t}
 Run in Tool mode. The additional argument selects whether to run as
-slapadd, slapcat, slapdn, slapindex, slappasswd, or slatest. This option 
-should be the first option specified when it is used. Any remaining options 
-will be interpreted by the corresponding slap tool program. Note that these 
-tool programs will usually be symbolic links to slapd. This option is provided 
-for situations where symbolic links are not provided or not usable.
+slapadd, slapcat, slapdn, slapindex, slappasswd, or slaptest
+(slapacl and slapauth need the entire "\fIacl\fP" and "\fIauth\fP"
+option value to be spelled out, as "\fIa\fP" is reserved to
+.BR slapadd ).
+This option should be the first option specified when it is used;
+any remaining options will be interpreted by the corresponding 
+slap tool program, according to the respective man pages.
+Note that these tool programs will usually be symbolic links to slapd.
+This option is provided for situations where symbolic links 
+are not provided or not usable.
 .TP
 .BI \-d " debug\-level"
 Turn on debugging as defined by
@@ -174,7 +179,7 @@ is also changed to this user's gid, unless the -g option is used to
 override.  Note when used with
 .BR -r ,
 slapd will use the user database in the change root environment.
-.LP
+
 Note that on some systems, running as a non-privileged user will prevent
 passwd back-ends from accessing the encrypted passwords.  Note also that
 any shell back-ends will run as the specified non-privileged user.
@@ -189,23 +194,20 @@ slapd will use the group database in the change root environment.
 This option provides a cookie for the syncrepl replication consumer.
 The cookie is a comma separated list of name=value pairs.
 Currently supported syncrepl cookie fields are
-.B csn,
-.B sid,
+.B rid
 and
-.B rid.
-.B csn
-is the commit sequence number received by a previous synchronization
-and represents the state of the consumer replica content which the
-syncrepl engine will synchronize to the current provider content.
-.B sid
-is the identity of the per-scope session log with which the 
-provider server can process this syncrepl request to reduce
-synchronization traffic.
+.B csn.
 .B rid
 identifies a replication thread within the consumer server
 and is used to find the syncrepl specification in 
 .BR slapd.conf (5)
-having the matching replication identifier in its definition.
+having the matching replication identifier in its definition. The
+.B rid
+must be provided in order for any other specified values to be used.
+.B csn
+is the commit sequence number received by a previous synchronization
+and represents the state of the consumer replica content which the
+syncrepl engine will synchronize to the current provider content.
 .SH EXAMPLES
 To start 
 .I slapd
@@ -241,7 +243,9 @@ To test whether the configuration file is correct or not, type:
 .BR ldap (3),
 .BR slapd.conf (5),
 .BR slapd.access (5),
+.BR slapacl (8),
 .BR slapadd (8),
+.BR slapauth (8),
 .BR slapcat (8),
 .BR slapdn (8),
 .BR slapindex (8),
index 25a54e284a4485a8341dd65348eb93d93a89add7..c2a54649caa560164450e6be793799870c42dcef 100644 (file)
@@ -8,6 +8,8 @@ slapdn \- Check a list of string-represented DNs based on schema syntax.
 .B [\-v]
 .B [\-d level]
 .B [\-f slapd.conf]
+.B [\-F confdir]
+.B [\-N | \-P]
 .B DN [...]
 .LP
 .SH DESCRIPTION
@@ -38,6 +40,16 @@ enable debugging messages as defined by the specified
 specify an alternative
 .BR slapd.conf (5)
 file.
+.TP
+.BI \-N
+only output a normalized form of the DN, suitable to be used
+in a normalization tool; incompatible with
+.BR \-P .
+.TP
+.BI \-P
+only output a prettified form of the DN, suitable to be used
+in a check and beautification tool; incompatible with
+.BR \-N .
 .SH EXAMPLES
 To check a
 .B DN
index 168cef275ba15bc3b44bfb66118f7fbff66e909e..50d30a67899e01540b317b18699d4031e04c29c5 100644 (file)
@@ -5,9 +5,11 @@
 slaptest \- Check the suitability of the slapd.conf file.
 .SH SYNOPSIS
 .B SBINDIR/slaptest
-.B [\-v]
 .B [\-d level]
 .B [\-f slapd.conf]
+.B [\-F confdir]
+.B [\-u]
+.B [\-v]
 .LP
 .SH DESCRIPTION
 .LP
@@ -22,9 +24,6 @@ and the backend-specific rules, checking its sanity.
 .LP
 .SH OPTIONS
 .TP
-.B \-v
-enable verbose mode.
-.TP
 .BI \-d " level"
 enable debugging messages as defined by the specified
 .IR level .
@@ -33,6 +32,16 @@ enable debugging messages as defined by the specified
 specify an alternative
 .BR slapd.conf (5)
 file.
+.TP
+.BI \-F " confdir"
+specify a config directory.
+.TP
+.B \-u
+enable dryrun mode (i.e. don't fail if databases cannot be opened,
+but config is fine).
+.TP
+.B \-v
+enable verbose mode.
 .SH EXAMPLES
 To check a 
 .BR slapd.conf (5)
index c3c0da6485cabd1187b6984c22e9b0d6198ae4db..93eebc3e486495895ddc3e0c5aca34baab5ca57d 100644 (file)
@@ -597,6 +597,10 @@ LBER_F( char * )
 ber_strdup LDAP_P((
        LDAP_CONST char * ));
 
+LBER_F( struct berval * )
+ber_bvreplace LDAP_P((
+       struct berval *dst, LDAP_CONST struct berval *src ));
+
 LBER_F( void )
 ber_bvarray_free LDAP_P(( BerVarray p ));
 
index a23f33f9c322d4e5127a5144312b7351d6e51f7f..6fd557d230497e242c06fc231f715e93d30d083e 100644 (file)
@@ -135,6 +135,10 @@ LBER_F( char * )
 ber_strdup_x LDAP_P((
        LDAP_CONST char *, void *ctx ));
 
+LBER_F( struct berval * )
+ber_bvreplace_x LDAP_P((
+       struct berval *dst, LDAP_CONST struct berval *src, void *ctx ));
+
 LBER_F( void )
 ber_bvarray_free_x LDAP_P(( BerVarray p, void *ctx ));
 
index 45b8dfb18950ee4fe497b54466632cc8ffebab87..849f054b252d13c25d01822a7b11c86884b355dc 100644 (file)
@@ -221,13 +221,20 @@ typedef struct ldapcontrol {
 #define LDAP_CONTROL_PRE_READ                  "1.3.6.1.4.1.4203.666.5.10.1"
 #define LDAP_CONTROL_POST_READ                 "1.3.6.1.4.1.4203.666.5.10.2"
 
-#if 0
 /* LDAP Duplicated Entry Control Extension *//* not implemented in slapd(8) */
 #define LDAP_CONTROL_DUPENT_REQUEST            "2.16.840.1.113719.1.27.101.1"
 #define LDAP_CONTROL_DUPENT_RESPONSE   "2.16.840.1.113719.1.27.101.2"
 #define LDAP_CONTROL_DUPENT_ENTRY              "2.16.840.1.113719.1.27.101.3"
 #define LDAP_CONTROL_DUPENT    LDAP_CONTROL_DUPENT_REQUEST
-#endif
+
+/* LDAP Persistent Search Control *//* not implemented in slapd(8) */
+/* draft-ietf-ldapext-psearch-03.txt (expired) */
+#define LDAP_CONTROL_PERSIST_REQUEST                           "2.16.840.1.113730.3.4.3"
+#define LDAP_CONTROL_PERSIST_ENTRY_CHANGE_NOTICE       "2.16.840.1.113730.3.4.7"
+#define LDAP_CONTROL_PERSSIT_ENTRY_CHANGE_ADD          0x1
+#define LDAP_CONTROL_PERSSIT_ENTRY_CHANGE_DELETE       0x2
+#define LDAP_CONTROL_PERSSIT_ENTRY_CHANGE_MODIFY       0x4
+#define LDAP_CONTROL_PERSSIT_ENTRY_CHANGE_RENAME       0x8
 
 /* LDAP VLV *//* not implemented in slapd(8) */
 #define LDAP_CONTROL_VLVREQUEST        "2.16.840.1.113730.3.4.9"
index 3ec464a093fc45f1ffac8434c4af0df141c47920..1ca300bd9861fd79a1d9d0d80c35ca2148cd7dcd 100644 (file)
@@ -44,9 +44,13 @@ ldap_pvt_thread_set_concurrency LDAP_P(( int ));
 #define LDAP_PVT_THREAD_CREATE_JOINABLE 0
 #define LDAP_PVT_THREAD_CREATE_DETACHED 1
 
+#define        LDAP_PVT_THREAD_SET_STACK_SIZE
 #ifndef LDAP_PVT_THREAD_STACK_SIZE
-       /* LARGE stack */
-#define LDAP_PVT_THREAD_STACK_SIZE     (4*1024*1024)
+       /* LARGE stack. Will be twice as large on 64 bit machine. */
+#define LDAP_PVT_THREAD_STACK_SIZE     ( 1 * 1024 * 1024 * sizeof(void *) )
+/* May be explicitly defined to zero to disable it */
+#elif LDAP_PVT_THREAD_STACK_SIZE == 0
+#undef LDAP_PVT_THREAD_SET_STACK_SIZE
 #endif
 
 LDAP_F( int )
@@ -198,6 +202,9 @@ ldap_pvt_thread_pool_setkey LDAP_P((
        void *data,
        ldap_pvt_thread_pool_keyfree_t *kfree ));
 
+LDAP_F( void )
+ldap_pvt_thread_pool_purgekey LDAP_P(( void *key ));
+
 LDAP_F( void *)
 ldap_pvt_thread_pool_context LDAP_P(( void ));
 
index d23c1d2535b2bea66a7d8859512e5e6ca32a5871..4d3923b26e527b599e5cfe98396d2915fc0d7b8c 100644 (file)
@@ -27,6 +27,8 @@ typedef struct re_s {
        LDAP_STAILQ_ENTRY(re_s) rnext;
        ldap_pvt_thread_start_t *routine;
        void *arg;
+       char *tname;
+       char *tspec;
 } re_t;
 
 typedef struct runqueue_s {
@@ -35,11 +37,20 @@ typedef struct runqueue_s {
        ldap_pvt_thread_mutex_t rq_mutex;
 } runqueue_t;
 
-LDAP_F( void )
+LDAP_F( struct re_s* )
 ldap_pvt_runqueue_insert(
        struct runqueue_s* rq,
        time_t interval,
        ldap_pvt_thread_start_t* routine,
+       void *arg,
+       char *tname,
+       char *tspec
+);
+
+LDAP_F( struct re_s* )
+ldap_pvt_runqueue_find(
+       struct runqueue_s* rq,
+       ldap_pvt_thread_start_t* routine,
        void *arg
 );
 
index fec4b65ae910cb8ce79087660f420316fd0124e3..a51e1cf4d3a0315f43c15d903dd023345b45b7c0 100644 (file)
@@ -85,6 +85,13 @@ ldif_read_record LDAP_P((
        char **bufp,
        int *buflen ));
 
+LDAP_LDIF_F( int )
+ldif_must_b64_encode_register LDAP_P((
+       LDAP_CONST char *name,
+       LDAP_CONST char *oid ));
+
+LDAP_LDIF_F( void )
+ldif_must_b64_encode_release LDAP_P(( void ));
 
 #define LDIF_PUT_NOVALUE       0x0000  /* no value */
 #define LDIF_PUT_VALUE         0x0001  /* value w/ auto detection */
index abfc595867683e87cc83915179e5f9da863b51a0..c8e8430d51c9817696d14e1d098e760757e3ea2b 100644 (file)
@@ -150,7 +150,7 @@ lutil_progname LDAP_P((
        int argc,
        char *argv[] ));
 
-struct lutil_tm {
+typedef struct lutil_tm {
        int tm_sec;     /* seconds 0-60 (1 leap second) */
        int tm_min;     /* minutes 0-59 */
        int tm_hour;    /* hours 0-23 */
@@ -160,7 +160,7 @@ struct lutil_tm {
        int tm_usec;    /* microseconds */
 } lutil_tm;
 
-struct lutil_timet {
+typedef struct lutil_timet {
        unsigned int tt_sec;    /* seconds since 1900 */
        int tt_gsec;            /* seconds since 1900, high 7 bits */
        unsigned int tt_usec;   /* microseconds */
index 2f3ba70348014107c02afbabfec4750ef54d5ebc..3e66dd0f0a3087a18f6576e0b6db193c71b55d48 100644 (file)
 /* Define if you have the V3 library (-lV3).  */
 #undef HAVE_LIBV3
 
-/* Define if you have the bind library (-lbind).  */
-#undef HAVE_LIBBIND
-
 /* Define if you have the gen library (-lgen).  */
 #undef HAVE_LIBGEN
 
 /* Define if you have the nsl_s library (-lnsl_s).  */
 #undef HAVE_LIBNSL_S
 
-/* Define if you have the resolv library (-lresolv).  */
-#undef HAVE_LIBRESOLV
-
 /* Define if you have the socket library (-lsocket).  */
 #undef HAVE_LIBSOCKET
 
 /* define for Dynamic Group overlay */
 #undef SLAPD_OVER_DYNGROUP
 
+/* define for Dynamic List overlay */
+#undef SLAPD_OVER_DYNLIST
+
 /* define for Backend Glue overlay */
 #undef SLAPD_OVER_GLUE
 
index ea96e2d6ce745a4ab13fb1a5e5ec9ef996675591..904630fd30393328a26464eecf920786fc92a5a8 100644 (file)
@@ -713,6 +713,32 @@ ber_strndup( LDAP_CONST char *s, ber_len_t l )
        return ber_strndup_x( s, l, NULL );
 }
 
+/*
+ * dst is resized as required by src and the value of src is copied into dst
+ * dst->bv_val must be NULL (and dst->bv_len must be 0), or it must be
+ * alloc'ed with the context ctx
+ */
+struct berval *
+ber_bvreplace_x( struct berval *dst, LDAP_CONST struct berval *src, void *ctx )
+{
+       assert( dst != NULL );
+
+       if ( dst->bv_len < src->bv_len ) {
+               dst->bv_val = ber_memrealloc_x( dst->bv_val, src->bv_len + 1, ctx );
+       }
+
+       AC_MEMCPY( dst->bv_val, src->bv_val, src->bv_len + 1 );
+       dst->bv_len = src->bv_len;
+
+       return dst;
+}
+
+struct berval *
+ber_bvreplace( struct berval *dst, LDAP_CONST struct berval *src )
+{
+       return ber_bvreplace_x( dst, src, NULL );
+}
+
 void
 ber_bvarray_free_x( BerVarray a, void *ctx )
 {
index ef686fae643a806122422e432b264a1581a6f2ae..c88ad94cc28d7e4681edf457c19a89cebcaade34 100644 (file)
 #include <ac/ctype.h>
 #include <ac/unistd.h>
 
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
 #include "ldap-int.h"
 
 #ifdef HAVE_CYRUS_SASL
 
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifndef INT_MAX
+#define        INT_MAX 2147483647      /* 32 bit signed max */
+#endif
+
 #ifdef LDAP_R_COMPILE
 ldap_pvt_thread_mutex_t ldap_int_sasl_mutex;
 #endif
index 8ecda40f41e026ce9d92153a51176825f1e5755d..89d5db8a0db7400b8faf71b32b7a12d7be4a712d 100644 (file)
@@ -23,7 +23,9 @@
 #include <ac/ctype.h>
 #include <ac/time.h>
 
+#ifdef HAVE_LIMITS_H
 #include <limits.h>
+#endif
 
 #include "ldap-int.h"
 #include "ldap_defaults.h"
index 407c1a3f99e8b15984288e146c7b6a069141e9fd..dd97afa22f5eb57c7c44356bc92a42e4e4b6c012 100644 (file)
@@ -19,7 +19,9 @@
 #include "portable.h"
 
 #include <stdio.h>
+#ifdef HAVE_LIMITS_H
 #include <limits.h>
+#endif
 
 #include <ac/stdlib.h>
 
index ae5225ca00cccec0054dced619f1f8ffd985b8d8..407f5ebad2c1030371bc870cfb6f91fa7b8cade6 100644 (file)
@@ -283,7 +283,7 @@ ldap_pvt_connect(LDAP *ld, ber_socket_t s,
                fd_set          efds;
 #endif
 
-#ifdef FD_SETSIZE
+#if defined( FD_SETSIZE ) && !defined( HAVE_WINSOCK )
                if ( s >= FD_SETSIZE ) {
                        rc = AC_SOCKET_ERROR;
                        tcp_close( s );
@@ -871,14 +871,14 @@ int ldap_int_tblsize = 0;
 void
 ldap_int_ip_init( void )
 {
-       int tblsize;
-
 #if defined( HAVE_SYSCONF )
-       tblsize = sysconf( _SC_OPEN_MAX );
+       long tblsize = sysconf( _SC_OPEN_MAX );
+       if( tblsize > INT_MAX ) tblsize = INT_MAX;
+
 #elif defined( HAVE_GETDTABLESIZE )
-       tblsize = getdtablesize();
+       int tblsize = getdtablesize();
 #else
-       tblsize = FD_SETSIZE;
+       int tblsize = FD_SETSIZE;
 #endif /* !USE_SYSCONF */
 
 #ifdef FD_SETSIZE
index 85ae1aa2db99e810132c88174e5e37ad83bdcac1..7b775f61f1898f646f4b4ffbbd30716a7bf57652 100644 (file)
 #include "ldap_queue.h"
 #include "ldap_rq.h"
 
-void
+struct re_s *
 ldap_pvt_runqueue_insert(
        struct runqueue_s* rq,
        time_t interval,
        ldap_pvt_thread_start_t *routine,
-       void *arg
+       void *arg,
+       char *tname,
+       char *tspec
 )
 {
        struct re_s* entry;
 
        entry = (struct re_s *) LDAP_CALLOC( 1, sizeof( struct re_s ));
-       entry->interval.tv_sec = interval;
-       entry->interval.tv_usec = 0;
-       entry->next_sched.tv_sec = time( NULL );
-       entry->next_sched.tv_usec = 0;
-       entry->routine = routine;
-       entry->arg = arg;
-       LDAP_STAILQ_INSERT_TAIL( &rq->task_list, entry, tnext );
+       if ( entry ) {
+               entry->interval.tv_sec = interval;
+               entry->interval.tv_usec = 0;
+               entry->next_sched.tv_sec = time( NULL );
+               entry->next_sched.tv_usec = 0;
+               entry->routine = routine;
+               entry->arg = arg;
+               entry->tname = tname;
+               entry->tspec = tspec;
+               LDAP_STAILQ_INSERT_HEAD( &rq->task_list, entry, tnext );
+       }
+       return entry;
+}
+
+struct re_s *
+ldap_pvt_runqueue_find(
+       struct runqueue_s *rq,
+       ldap_pvt_thread_start_t *routine,
+       void *arg
+)
+{
+       struct re_s* e;
+
+       LDAP_STAILQ_FOREACH( e, &rq->task_list, tnext ) {
+               if ( e->routine == routine && e->arg == arg )
+                       return e;
+       }
+       return NULL;
 }
 
 void
index 176cd55215349e34ffaa0c1903748dc1c7e6f3a4..0d353206fafca11a6cd67ebbad8ba16288c1d20a 100644 (file)
@@ -110,7 +110,7 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
        pthread_attr_create(&attr);
 #endif
 
-#if defined(LDAP_PVT_THREAD_STACK_SIZE) && LDAP_PVT_THREAD_STACK_SIZE > 0
+#ifdef LDAP_PVT_THREAD_SET_STACK_SIZE
        /* this should be tunable */
        pthread_attr_setstacksize( &attr, LDAP_PVT_THREAD_STACK_SIZE );
 #endif
index 82dee868c78e9c9f12c00256b840a196cf7bc7ba..9b413ebd1519353cb0ce914b99822517885d7b26 100644 (file)
@@ -38,7 +38,7 @@ ldap_int_thread_initialize( void )
        }
        detach_attr = pth_attr_new();
        joined_attr = pth_attr_new();
-#if LDAP_PVT_THREAD_STACK_SIZE
+#ifdef LDAP_PVT_THREAD_SET_STACK_SIZE
        pth_attr_set( joined_attr, PTH_ATTR_STACK_SIZE, LDAP_PVT_THREAD_STACK_SIZE );
        pth_attr_set( detach_attr, PTH_ATTR_STACK_SIZE, LDAP_PVT_THREAD_STACK_SIZE );
 #endif
index 31fa541cb8d96aa44dbba1f3303c41e59215bd4a..50bac8d2c1c06c75011ccf80d79404f0c50b5225 100644 (file)
@@ -616,6 +616,30 @@ int ldap_pvt_thread_pool_setkey(
        return ENOMEM;
 }
 
+/* Free all elements with this key, no matter which thread they're in.
+ * May only be called while the pool is paused.
+ */
+void ldap_pvt_thread_pool_purgekey( void *key )
+{
+       int i, j;
+       ldap_int_thread_key_t *ctx;
+
+       for ( i=0; i<LDAP_MAXTHR; i++ ) {
+               if ( thread_keys[i].ctx ) {
+                       ctx = thread_keys[i].ctx;
+                       for ( j=0; j<MAXKEYS; j++ ) {
+                               if ( ctx[j].ltk_key == key ) {
+                                       if (ctx[j].ltk_free)
+                                               ctx[j].ltk_free( ctx[j].ltk_key, ctx[j].ltk_data );
+                                       ctx[j].ltk_key = NULL;
+                                       ctx[j].ltk_free = NULL;
+                                       break;
+                               }
+                       }
+               }
+       }
+}
+
 /*
  * This is necessary if the caller does not have access to the
  * thread context handle (for example, a slapd plugin calling
index e0412b2ae903be75121a7a7deed3ee4d413065bf..cc0225c090652ed26e749a2d9af42228f1f958fc 100644 (file)
@@ -147,7 +147,7 @@ ldif_parse_line2(
        if ( s == NULL ) {
                ber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
                        _("ldif_parse_line: missing ':' after %s\n"),
-                       type );
+                       type->bv_val );
                if ( !freeval ) ber_memfree( line );
                return( -1 );
        }
@@ -190,7 +190,8 @@ ldif_parse_line2(
                if ( *s == '\0' ) {
                        /* no value is present, error out */
                        ber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
-                               _("ldif_parse_line: %s missing base64 value\n"), type );
+                               _("ldif_parse_line: %s missing base64 value\n"),
+                               type->bv_val );
                        if ( !freeval ) ber_memfree( line );
                        return( -1 );
                }
@@ -205,7 +206,7 @@ ldif_parse_line2(
                                        ber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug,
                                                _("ldif_parse_line: %s: invalid base64 encoding"
                                                " char (%c) 0x%x\n"),
-                                           type, p[i], p[i] );
+                                           type->bv_val, p[i], p[i] );
                                        if ( !freeval ) ber_memfree( line );
                                        return( -1 );
                                }
@@ -242,7 +243,8 @@ ldif_parse_line2(
                if ( *s == '\0' ) {
                        /* no value is present, error out */
                        ber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
-                               _("ldif_parse_line: %s missing URL value\n"), type );
+                               _("ldif_parse_line: %s missing URL value\n"),
+                               type->bv_val );
                        if ( !freeval ) ber_memfree( line );
                        return( -1 );
                }
@@ -250,7 +252,7 @@ ldif_parse_line2(
                if( ldif_fetch_url( s, &value->bv_val, &value->bv_len ) ) {
                        ber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug,
                                _("ldif_parse_line: %s: URL \"%s\" fetch failed\n"),
-                               type, s );
+                               type->bv_val, s );
                        if ( !freeval ) ber_memfree( line );
                        return( -1 );
                }
@@ -359,6 +361,131 @@ ldif_getline( char **next )
        return( line );
 }
 
+/*
+ * name and OID of attributeTypes that must be base64 encoded in any case
+ */
+typedef struct must_b64_encode_s {
+       struct berval   name;
+       struct berval   oid;
+} must_b64_encode_s;
+
+static must_b64_encode_s       default_must_b64_encode[] = {
+       { BER_BVC( "userPassword" ), BER_BVC( "2.5.4.35" ) },
+       { BER_BVNULL, BER_BVNULL }
+};
+
+static must_b64_encode_s       *must_b64_encode = default_must_b64_encode;
+
+/*
+ * register name and OID of attributeTypes that must always be base64 
+ * encoded
+ *
+ * NOTE: this routine mallocs memory in a static struct which must 
+ * be explicitly freed when no longer required
+ */
+int
+ldif_must_b64_encode_register( LDAP_CONST char *name, LDAP_CONST char *oid )
+{
+       int             i;
+       ber_len_t       len;
+
+       assert( must_b64_encode );
+       assert( name );
+       assert( oid );
+
+       len = strlen( name );
+
+       for ( i = 0; !BER_BVISNULL( &must_b64_encode[i].name ); i++ ) {
+               if ( len != must_b64_encode[i].name.bv_len ) {
+                       continue;
+               }
+
+               if ( strcasecmp( name, must_b64_encode[i].name.bv_val ) == 0 ) {
+                       break;
+               }
+       }
+
+       if ( !BER_BVISNULL( &must_b64_encode[i].name ) ) {
+               return 1;
+       }
+
+       for ( i = 0; !BER_BVISNULL( &must_b64_encode[i].name ); i++ )
+               /* just count */ ;
+
+       if ( must_b64_encode == default_must_b64_encode ) {
+               must_b64_encode = ber_memalloc( sizeof( must_b64_encode_s ) * ( i + 2 ) );
+
+               for ( i = 0; !BER_BVISNULL( &default_must_b64_encode[i].name ); i++ ) {
+                       ber_dupbv( &must_b64_encode[i].name, &default_must_b64_encode[i].name );
+                       ber_dupbv( &must_b64_encode[i].oid, &default_must_b64_encode[i].oid );
+               }
+
+       } else {
+               must_b64_encode_s       *tmp;
+
+               tmp = ber_memrealloc( must_b64_encode,
+                       sizeof( must_b64_encode_s ) * ( i + 2 ) );
+               if ( tmp == NULL ) {
+                       return 1;
+               }
+               must_b64_encode = tmp;
+       }
+
+       ber_str2bv( name, len, 1, &must_b64_encode[i].name );
+       ber_str2bv( oid, 0, 1, &must_b64_encode[i].oid );
+
+       BER_BVZERO( &must_b64_encode[i + 1].name );
+
+       return 0;
+}
+
+void
+ldif_must_b64_encode_release( void )
+{
+       int     i;
+
+       assert( must_b64_encode );
+
+       if ( must_b64_encode == default_must_b64_encode ) {
+               return;
+       }
+
+       for ( i = 0; !BER_BVISNULL( &must_b64_encode[i].name ); i++ ) {
+               ber_memfree( must_b64_encode[i].name.bv_val );
+               ber_memfree( must_b64_encode[i].oid.bv_val );
+       }
+
+       ber_memfree( must_b64_encode );
+
+       must_b64_encode = default_must_b64_encode;
+}
+
+/*
+ * returns 1 iff the string corresponds to the name or the OID of any 
+ * of the attributeTypes listed in must_b64_encode
+ */
+static int
+ldif_must_b64_encode( LDAP_CONST char *s )
+{
+       int             i;
+       struct berval   bv;
+
+       assert( must_b64_encode );
+       assert( s );
+
+       ber_str2bv( s, 0, 0, &bv );
+
+       for ( i = 0; !BER_BVISNULL( &must_b64_encode[i].name ); i++ ) {
+               if ( ber_bvstrcasecmp( &must_b64_encode[i].name, &bv ) == 0
+                       || ber_bvcmp( &must_b64_encode[i].oid, &bv ) == 0 )
+               {
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
 /* compatibility with U-Mich off by one bug */
 #define LDIF_KLUDGE 1
 
@@ -479,10 +606,7 @@ ldif_sput(
                && strstr( name, ";binary" ) == NULL
 #endif
 #ifndef LDAP_PASSWD_DEBUG
-               && (namelen != (sizeof("userPassword")-1)
-               || strcasecmp( name, "userPassword" ) != 0)     /* encode userPassword */
-               && (namelen != (sizeof("2.5.4.35")-1) 
-               || strcasecmp( name, "2.5.4.35" ) != 0)         /* encode userPassword */
+               && !ldif_must_b64_encode( name )
 #endif
        ) {
                int b64 = 0;
index 465e26f7056e4f4e4046895d3a917863700a6486..79751ec1e468ab307779821a6b508ff7a52031e4 100644 (file)
@@ -17,6 +17,7 @@ SLAPTOOLS=slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl
 PROGRAMS=slapd $(SLAPTOOLS)
 XPROGRAMS=sslapd libbackends.a .backend liboverlays.a
 XSRCS=version.c
+STRIP=-s
 
 SUBDIRS=back-* shell-backends slapi overlays
 
@@ -361,7 +362,7 @@ install-local-srv: install-slapd install-tools \
 install-slapd: FORCE
        -$(MKDIR) $(DESTDIR)$(libexecdir)
        -$(MKDIR) $(DESTDIR)$(localstatedir)/run
-       $(LTINSTALL) $(INSTALLFLAGS) -s -m 755 \
+       $(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 \
                slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
        @for i in $(SUBDIRS); do \
            if test -d $$i -a -f $$i/Makefile ; then \
index efc3ba7c8e88c9ad69b7f480b30c484ef87d3973..95df80c2a59acc708742e04a7f7d029c6d032478 100644 (file)
@@ -108,10 +108,7 @@ do_abandon( Operation *op, SlapReply *rs )
 int
 fe_op_abandon( Operation *op, SlapReply *rs )
 {
-       int i;
-
-       for ( i = 0; i < nbackends; i++ ) {
-               op->o_bd = &backends[i];
+       LDAP_STAILQ_FOREACH( op->o_bd, &backendDB, be_next ) {
                if ( op->o_bd->be_abandon ) {
                        (void)op->o_bd->be_abandon( op, rs );
                }
index fdb2b9156f6781f49d9bba493699b5dbcfb2c2b7..d51ffa37d2aa4db425f7d98ceab7c04e2e39a34b 100644 (file)
@@ -35,6 +35,7 @@
 #include "slap.h"
 #include "sets.h"
 #include "lber_pvt.h"
+#include "lutil.h"
 
 #ifdef LDAP_SLAPI
 #include "slapi/slapi.h"
@@ -53,7 +54,9 @@ static struct berval
        aci_bv_br_entry         = BER_BVC("[entry]"),
        aci_bv_br_all           = BER_BVC("[all]"),
        aci_bv_access_id        = BER_BVC("access-id"),
+#if 0
        aci_bv_anonymous        = BER_BVC("anonymous"),
+#endif
        aci_bv_public           = BER_BVC("public"),
        aci_bv_users            = BER_BVC("users"),
        aci_bv_self             = BER_BVC("self"),
@@ -68,7 +71,9 @@ static struct berval
        aci_bv_ip_eq            = BER_BVC("IP="),
 #ifdef LDAP_PF_LOCAL
        aci_bv_path_eq          = BER_BVC("PATH="),
+#if 0
        aci_bv_dirsep           = BER_BVC(LDAP_DIRSEP),
+#endif
 #endif /* LDAP_PF_LOCAL */
        
        aci_bv_group_class      = BER_BVC(SLAPD_GROUP_CLASS),
@@ -112,7 +117,7 @@ static int aci_mask(
        slap_access_t *grant,
        slap_access_t *deny,
        slap_aci_scope_t scope);
-#endif
+#endif /* SLAPD_ACI_ENABLED */
 
 static int     regex_matches(
        struct berval *pat, char *str, char *buf,
@@ -150,6 +155,340 @@ static int aci_match_set ( struct berval *subj, Operation *op,
  * - can be legally called with op->o_bd == NULL
  */
 
+#ifdef SLAP_OVERLAY_ACCESS
+int
+slap_access_always_allowed(
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp )
+{
+       assert( maskp );
+
+       ACL_PRIV_SET( *maskp, ACL_ACCESS2PRIV( access ) );
+
+       return 1;
+}
+
+int
+slap_access_allowed(
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp )
+{
+       int                             ret = 1;
+       int                             count;
+       AccessControl                   *a = NULL;
+
+#ifdef LDAP_DEBUG
+       char                            accessmaskbuf[ACCESSMASK_MAXLEN];
+#endif
+       slap_mask_t                     mask;
+       slap_control_t                  control;
+       slap_access_t                   access_level;
+       const char                      *attr;
+       regmatch_t                      matches[MAXREMATCHES];
+       int                             st_same_attr = 0;
+
+       assert( op != NULL );
+       assert( e != NULL );
+       assert( desc != NULL );
+       assert( maskp != NULL );
+
+       access_level = ACL_LEVEL( access );
+       attr = desc->ad_cname.bv_val;
+
+       assert( attr != NULL );
+
+#ifdef LDAP_SLAPI
+       if ( op->o_pb != NULL ) {
+               ret = slapi_int_access_allowed( op, e, desc, val, access, state );
+               if ( ret == 0 ) {
+                       /* ACL plugin denied access */
+                       goto done;
+               }
+       }
+#endif /* LDAP_SLAPI */
+
+       /* grant database root access */
+       if ( be_isroot( op ) ) {
+               Debug( LDAP_DEBUG_ACL, "<= root access granted\n", 0, 0, 0 );
+               mask = ACL_LVL_MANAGE;
+               goto done;
+       }
+
+       /*
+        * no-user-modification operational attributes are ignored
+        * by ACL_WRITE checking as any found here are not provided
+        * by the user
+        */
+       if ( access_level >= ACL_WRITE && is_at_no_user_mod( desc->ad_type )
+               && desc != slap_schema.si_ad_entry
+               && desc != slap_schema.si_ad_children )
+       {
+               Debug( LDAP_DEBUG_ACL, "NoUserMod Operational attribute:"
+                       " %s access granted\n",
+                       attr, 0, 0 );
+               goto done;
+       }
+
+       /* use backend default access if no backend acls */
+       if ( op->o_bd->be_acl == NULL ) {
+               int     i;
+
+               Debug( LDAP_DEBUG_ACL,
+                       "=> slap_access_allowed: backend default %s "
+                       "access %s to \"%s\"\n",
+                       access2str( access ),
+                       op->o_bd->be_dfltaccess >= access_level ? "granted" : "denied",
+                       op->o_dn.bv_val ? op->o_dn.bv_val : "(anonymous)" );
+               ret = op->o_bd->be_dfltaccess >= access_level;
+
+               mask = ACL_PRIV_LEVEL;
+               for ( i = ACL_NONE; i <= op->o_bd->be_dfltaccess; i++ ) {
+                       ACL_PRIV_SET( mask, ACL_ACCESS2PRIV( i ) );
+               }
+
+               goto done;
+       }
+
+       ret = 0;
+       control = ACL_BREAK;
+
+       if ( st_same_attr ) {
+               assert( state->as_vd_acl != NULL );
+
+               a = state->as_vd_acl;
+               count = state->as_vd_acl_count;
+               if ( !ACL_IS_INVALID( state->as_vd_acl_mask ) ) {
+                       mask = state->as_vd_acl_mask;
+                       AC_MEMCPY( matches, state->as_vd_acl_matches, sizeof(matches) );
+                       goto vd_access;
+               }
+
+       } else {
+               if ( state ) state->as_vi_acl = NULL;
+               a = NULL;
+               ACL_PRIV_ASSIGN( mask, *maskp );
+               count = 0;
+               memset( matches, '\0', sizeof( matches ) );
+       }
+
+       while ( ( a = acl_get( a, &count, op, e, desc, val,
+               MAXREMATCHES, matches, state ) ) != NULL )
+       {
+               int i;
+
+               for ( i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++ ) {
+                       Debug( LDAP_DEBUG_ACL, "=> match[%d]: %d %d ", i,
+                               (int)matches[i].rm_so, (int)matches[i].rm_eo );
+                       if ( matches[i].rm_so <= matches[0].rm_eo ) {
+                               int n;
+                               for ( n = matches[i].rm_so; n < matches[i].rm_eo; n++ ) {
+                                       Debug( LDAP_DEBUG_ACL, "%c", e->e_ndn[n], 0, 0 );
+                               }
+                       }
+                       Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
+               }
+
+               if ( state ) {
+                       if ( state->as_vi_acl == a &&
+                               ( state->as_recorded & ACL_STATE_RECORDED_NV ) )
+                       {
+                               Debug( LDAP_DEBUG_ACL,
+                                       "=> slap_access_allowed: result from state (%s)\n",
+                                       attr, 0, 0 );
+                               ret = state->as_result;
+                               goto done;
+                       } else {
+                               Debug( LDAP_DEBUG_ACL,
+                                       "=> slap_access_allowed: no res from state (%s)\n",
+                                       attr, 0, 0 );
+                       }
+               }
+
+vd_access:
+               control = acl_mask( a, &mask, op,
+                       e, desc, val, MAXREMATCHES, matches, count, state );
+
+               if ( control != ACL_BREAK ) {
+                       break;
+               }
+
+               memset( matches, '\0', sizeof( matches ) );
+       }
+
+       if ( ACL_IS_INVALID( mask ) ) {
+               Debug( LDAP_DEBUG_ACL,
+                       "=> slap_access_allowed: \"%s\" (%s) invalid!\n",
+                       e->e_dn, attr, 0 );
+               ACL_PRIV_ASSIGN( mask, *maskp );
+
+       } else if ( control == ACL_BREAK ) {
+               Debug( LDAP_DEBUG_ACL,
+                       "=> slap_access_allowed: no more rules\n", 0, 0, 0 );
+
+               goto done;
+       }
+
+       ret = ACL_GRANT( mask, access );
+
+       Debug( LDAP_DEBUG_ACL,
+               "=> slap_access_allowed: %s access %s by %s\n",
+               access2str( access ), ret ? "granted" : "denied",
+               accessmask2str( mask, accessmaskbuf, 1 ) );
+
+done:
+       ACL_PRIV_ASSIGN( *maskp, mask );
+       return ret;
+}
+
+int
+access_allowed_mask(
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp )
+{
+       int                             ret = 1;
+       AccessControl                   *a = NULL;
+       int                             be_null = 0;
+
+#ifdef LDAP_DEBUG
+       char                            accessmaskbuf[ACCESSMASK_MAXLEN];
+#endif
+       slap_mask_t                     mask;
+       slap_control_t                  control;
+       slap_access_t                   access_level;
+       const char                      *attr;
+       int                             st_same_attr = 0;
+       static AccessControlState       state_init = ACL_STATE_INIT;
+       BI_access_allowed               *bi_access_allowed = NULL;
+
+       assert( e != NULL );
+       assert( desc != NULL );
+
+       access_level = ACL_LEVEL( access );
+
+       assert( access_level > ACL_NONE );
+
+       ACL_INIT( mask );
+       if ( maskp ) ACL_INVALIDATE( *maskp );
+
+       attr = desc->ad_cname.bv_val;
+
+       assert( attr != NULL );
+
+       if ( op && op->o_is_auth_check &&
+               ( access_level == ACL_SEARCH || access_level == ACL_READ ) )
+       {
+               access = ACL_AUTH;
+       }
+
+       if ( state ) {
+               if ( state->as_vd_ad == desc ) {
+                       if ( state->as_recorded ) {
+                               if ( ( state->as_recorded & ACL_STATE_RECORDED_NV ) &&
+                                       val == NULL )
+                               {
+                                       return state->as_result;
+
+                               } else if ( ( state->as_recorded & ACL_STATE_RECORDED_VD ) &&
+                                       val != NULL && state->as_vd_acl == NULL )
+                               {
+                                       return state->as_result;
+                               }
+                       }
+                       st_same_attr = 1;
+               } else {
+                       *state = state_init;
+               }
+
+               state->as_vd_ad = desc;
+       }
+
+       Debug( LDAP_DEBUG_ACL,
+               "=> access_allowed: %s access to \"%s\" \"%s\" requested\n",
+               access2str( access ), e->e_dn, attr );
+
+       if ( op == NULL ) {
+               /* no-op call */
+               goto done;
+       }
+
+       if ( op->o_bd == NULL ) {
+               op->o_bd = LDAP_STAILQ_FIRST( &backendDB );
+               be_null = 1;
+
+#ifdef LDAP_DEVEL
+               /*
+                * FIXME: experimental; use first backend rules
+                * iff there is no global_acl (ITS#3100) */
+               if ( frontendDB->be_acl != NULL ) {
+                       op->o_bd = frontendDB;
+               }
+#endif /* LDAP_DEVEL */
+       }
+       assert( op->o_bd != NULL );
+
+       /* this is enforced in backend_add() */
+       if ( op->o_bd->bd_info->bi_access_allowed ) {
+               /* delegate to backend */
+               ret = op->o_bd->bd_info->bi_access_allowed( op, e, desc, val, access, state, &mask );
+
+       } else {
+               /* use default */
+               ret = slap_access_allowed( op, e, desc, val, access, state, &mask );
+       }
+
+       if ( !ret ) {
+               if ( ACL_IS_INVALID( mask ) ) {
+                       Debug( LDAP_DEBUG_ACL,
+                               "=> access_allowed: \"%s\" (%s) invalid!\n",
+                               e->e_dn, attr, 0 );
+                       ACL_INIT( mask );
+
+               } else if ( control == ACL_BREAK ) {
+                       Debug( LDAP_DEBUG_ACL,
+                               "=> access_allowed: no more rules\n", 0, 0, 0 );
+
+                       goto done;
+               }
+
+               ret = ACL_GRANT( mask, access );
+       }
+
+       Debug( LDAP_DEBUG_ACL,
+               "=> access_allowed: %s access %s by %s\n",
+               access2str( access ), ret ? "granted" : "denied",
+               accessmask2str( mask, accessmaskbuf, 1 ) );
+
+done:
+       if ( state != NULL ) {
+               /* If not value-dependent, save ACL in case of more attrs */
+               if ( !( state->as_recorded & ACL_STATE_RECORDED_VD ) ) {
+                       state->as_vi_acl = a;
+                       state->as_result = ret;
+               }
+               state->as_recorded |= ACL_STATE_RECORDED;
+       }
+       if ( be_null ) op->o_bd = NULL;
+       if ( maskp ) ACL_PRIV_ASSIGN( *maskp, mask );
+       return ret;
+}
+
+#else /* !SLAP_OVERLAY_ACCESS */
+
 int
 access_allowed_mask(
        Operation               *op,
@@ -163,42 +502,47 @@ access_allowed_mask(
        int                             ret = 1;
        int                             count;
        AccessControl                   *a = NULL;
-       Backend *be;
-       int     be_null = 0;
+       Backend                         *be;
+       int                             be_null = 0;
 
 #ifdef LDAP_DEBUG
-       char accessmaskbuf[ACCESSMASK_MAXLEN];
+       char                            accessmaskbuf[ACCESSMASK_MAXLEN];
 #endif
-       slap_mask_t mask;
-       slap_control_t control;
-       const char *attr;
-       regmatch_t matches[MAXREMATCHES];
-       int        st_same_attr = 0;
-       static AccessControlState state_init = ACL_STATE_INIT;
+       slap_mask_t                     mask;
+       slap_control_t                  control;
+       slap_access_t                   access_level;
+       const char                      *attr;
+       regmatch_t                      matches[MAXREMATCHES];
+       int                             st_same_attr = 0;
+       static AccessControlState       state_init = ACL_STATE_INIT;
 
        assert( e != NULL );
        assert( desc != NULL );
-       assert( access > ACL_NONE );
+
+       access_level = ACL_LEVEL( access );
+
+       assert( access_level > ACL_NONE );
        if ( maskp ) ACL_INVALIDATE( *maskp );
 
        attr = desc->ad_cname.bv_val;
 
        assert( attr != NULL );
 
-       if( op && op->o_is_auth_check &&
-               ( access == ACL_SEARCH || access == ACL_READ ))
+       if ( op && op->o_is_auth_check &&
+               ( access_level == ACL_SEARCH || access_level == ACL_READ ) )
        {
                access = ACL_AUTH;
        }
 
-       if( state ) {
-               if ( state->as_vd_ad==desc) {
+       if ( state ) {
+               if ( state->as_vd_ad == desc ) {
                        if ( state->as_recorded ) {
-                               if( state->as_recorded & ACL_STATE_RECORDED_NV &&
+                               if ( ( state->as_recorded & ACL_STATE_RECORDED_NV ) &&
                                        val == NULL )
                                {
                                        return state->as_result;
-                               } else if ( state->as_recorded & ACL_STATE_RECORDED_VD &&
+
+                               } else if ( ( state->as_recorded & ACL_STATE_RECORDED_VD ) &&
                                        val != NULL && state->as_vd_acl == NULL )
                                {
                                        return state->as_result;
@@ -214,7 +558,7 @@ access_allowed_mask(
 
        Debug( LDAP_DEBUG_ACL,
                "=> access_allowed: %s access to \"%s\" \"%s\" requested\n",
-           access2str( access ), e->e_dn, attr );
+               access2str( access ), e->e_dn, attr );
 
        if ( op == NULL ) {
                /* no-op call */
@@ -223,7 +567,7 @@ access_allowed_mask(
 
        be = op->o_bd;
        if ( be == NULL ) {
-               be = &backends[0];
+               be = LDAP_STAILQ_FIRST(&backendDB);
                be_null = 1;
 #ifdef LDAP_DEVEL
                /*
@@ -248,10 +592,8 @@ access_allowed_mask(
 #endif /* LDAP_SLAPI */
 
        /* grant database root access */
-       if ( be != NULL && be_isroot( op ) ) {
-               Debug( LDAP_DEBUG_ACL,
-                   "<= root access granted\n",
-                       0, 0, 0 );
+       if ( be_isroot( op ) ) {
+               Debug( LDAP_DEBUG_ACL, "<= root access granted\n", 0, 0, 0 );
                if ( maskp ) {
                        mask = ACL_LVL_MANAGE;
                }
@@ -264,7 +606,7 @@ access_allowed_mask(
         * by ACL_WRITE checking as any found here are not provided
         * by the user
         */
-       if ( access >= ACL_WRITE && is_at_no_user_mod( desc->ad_type )
+       if ( access_level >= ACL_WRITE && is_at_no_user_mod( desc->ad_type )
                && desc != slap_schema.si_ad_entry
                && desc != slap_schema.si_ad_children )
        {
@@ -275,13 +617,14 @@ access_allowed_mask(
        }
 
        /* use backend default access if no backend acls */
-       if( be != NULL && be->be_acl == NULL ) {
+       if ( be->be_acl == NULL ) {
                Debug( LDAP_DEBUG_ACL,
-                       "=> access_allowed: backend default %s access %s to \"%s\"\n",
+                       "=> access_allowed: backend default %s "
+                       "access %s to \"%s\"\n",
                        access2str( access ),
-                       be->be_dfltaccess >= access ? "granted" : "denied",
+                       be->be_dfltaccess >= access_level ? "granted" : "denied",
                        op->o_dn.bv_val ? op->o_dn.bv_val : "(anonymous)" );
-               ret = be->be_dfltaccess >= access;
+               ret = be->be_dfltaccess >= access_level;
 
                if ( maskp ) {
                        int     i;
@@ -301,8 +644,9 @@ access_allowed_mask(
                Debug( LDAP_DEBUG_ACL,
                        "=> access_allowed: global default %s access %s to \"%s\"\n",
                        access2str( access ),
-                       frontendDB->be_dfltaccess >= access ? "granted" : "denied", op->o_dn.bv_val );
-               ret = frontendDB->be_dfltaccess >= access;
+                       frontendDB->be_dfltaccess >= access_level ?
+                               "granted" : "denied", op->o_dn.bv_val );
+               ret = frontendDB->be_dfltaccess >= access_level;
 
                if ( maskp ) {
                        int     i;
@@ -320,12 +664,12 @@ access_allowed_mask(
        ret = 0;
        control = ACL_BREAK;
 
-       if( st_same_attr ) {
+       if ( st_same_attr ) {
                assert( state->as_vd_acl != NULL );
 
                a = state->as_vd_acl;
                count = state->as_vd_acl_count;
-               if ( !ACL_IS_INVALID( state->as_vd_acl_mask )) {
+               if ( !ACL_IS_INVALID( state->as_vd_acl_mask ) ) {
                        mask = state->as_vd_acl_mask;
                        AC_MEMCPY( matches, state->as_vd_acl_matches, sizeof(matches) );
                        goto vd_access;
@@ -336,33 +680,39 @@ access_allowed_mask(
                a = NULL;
                ACL_INIT(mask);
                count = 0;
-               memset(matches, '\0', sizeof(matches));
+               memset( matches, '\0', sizeof(matches) );
        }
 
-       while((a = acl_get( a, &count, op, e, desc, val,
-               MAXREMATCHES, matches, state )) != NULL)
+       while ( ( a = acl_get( a, &count, op, e, desc, val,
+               MAXREMATCHES, matches, state ) ) != NULL )
        {
                int i;
 
-               for (i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++) {
+               for ( i = 0; i < MAXREMATCHES && matches[i].rm_so > 0; i++ ) {
                        Debug( LDAP_DEBUG_ACL, "=> match[%d]: %d %d ", i,
-                           (int)matches[i].rm_so, (int)matches[i].rm_eo );
-                       if( matches[i].rm_so <= matches[0].rm_eo ) {
+                               (int)matches[i].rm_so, (int)matches[i].rm_eo );
+                       if ( matches[i].rm_so <= matches[0].rm_eo ) {
                                int n;
-                               for ( n = matches[i].rm_so; n < matches[i].rm_eo; n++) {
+                               for ( n = matches[i].rm_so; n < matches[i].rm_eo; n++ ) {
                                        Debug( LDAP_DEBUG_ACL, "%c", e->e_ndn[n], 0, 0 );
                                }
                        }
                        Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
                }
 
-               if (state) {
-                       if (state->as_vi_acl == a && (state->as_recorded & ACL_STATE_RECORDED_NV)) {
-                               Debug( LDAP_DEBUG_ACL, "access_allowed: result from state (%s)\n", attr, 0, 0 );
+               if ( state ) {
+                       if ( state->as_vi_acl == a &&
+                               ( state->as_recorded & ACL_STATE_RECORDED_NV ) )
+                       {
+                               Debug( LDAP_DEBUG_ACL,
+                                       "access_allowed: result from state (%s)\n",
+                                       attr, 0, 0 );
                                ret = state->as_result;
                                goto done;
                        } else {
-                               Debug( LDAP_DEBUG_ACL, "access_allowed: no res from state (%s)\n", attr, 0, 0);
+                               Debug( LDAP_DEBUG_ACL,
+                                       "access_allowed: no res from state (%s)\n",
+                                       attr, 0, 0 );
                        }
                }
 
@@ -374,7 +724,7 @@ vd_access:
                        break;
                }
 
-               memset(matches, '\0', sizeof(matches));
+               memset( matches, '\0', sizeof(matches) );
        }
 
        if ( ACL_IS_INVALID( mask ) ) {
@@ -385,7 +735,7 @@ vd_access:
 
        } else if ( control == ACL_BREAK ) {
                Debug( LDAP_DEBUG_ACL,
-                       "=> access_allowed: no more rules\n", 0, 0, 0);
+                       "=> access_allowed: no more rules\n", 0, 0, 0 );
 
                goto done;
        }
@@ -399,19 +749,20 @@ vd_access:
        ret = ACL_GRANT(mask, access);
 
 done:
-       if( state != NULL ) {
+       if ( state != NULL ) {
                /* If not value-dependent, save ACL in case of more attrs */
-               if ( !(state->as_recorded & ACL_STATE_RECORDED_VD) ) {
+               if ( !( state->as_recorded & ACL_STATE_RECORDED_VD ) ) {
                        state->as_vi_acl = a;
                        state->as_result = ret;
                }
                state->as_recorded |= ACL_STATE_RECORDED;
        }
-       if (be_null) op->o_bd = NULL;
+       if ( be_null ) op->o_bd = NULL;
        if ( maskp ) *maskp = mask;
        return ret;
 }
 
+#endif /* SLAP_OVERLAY_ACCESS */
 
 /*
  * acl_get - return the acl applicable to entry e, attribute
@@ -601,20 +952,295 @@ acl_get(
                        }
                }
 
-               if ( a->acl_filter != NULL ) {
-                       ber_int_t rc = test_filter( NULL, e, a->acl_filter );
-                       if ( rc != LDAP_COMPARE_TRUE ) {
-                               continue;
+               if ( a->acl_filter != NULL ) {
+                       ber_int_t rc = test_filter( NULL, e, a->acl_filter );
+                       if ( rc != LDAP_COMPARE_TRUE ) {
+                               continue;
+                       }
+               }
+
+               Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] attr %s\n",
+                      *count, attr, 0);
+               return a;
+       }
+
+       Debug( LDAP_DEBUG_ACL, "<= acl_get: done.\n", 0, 0, 0 );
+       return( NULL );
+}
+
+static int
+acl_mask_dn(
+       Operation               *op,
+       Entry                   *e,
+       AccessControl           *a,
+       int                     nmatch,
+       regmatch_t              *matches,
+       slap_dn_access          *b,
+       struct berval           *opndn )
+{
+       /*
+        * if access applies to the entry itself, and the
+        * user is bound as somebody in the same namespace as
+        * the entry, OR the given dn matches the dn pattern
+        */
+       /*
+        * NOTE: styles "anonymous", "users" and "self" 
+        * have been moved to enum slap_style_t, whose 
+        * value is set in a_dn_style; however, the string
+        * is maintaned in a_dn_pat.
+        */
+       if ( b->a_style == ACL_STYLE_ANONYMOUS ) {
+               if ( !BER_BVISEMPTY( opndn ) ) {
+                       return 1;
+               }
+
+       } else if ( b->a_style == ACL_STYLE_USERS ) {
+               if ( BER_BVISEMPTY( opndn ) ) {
+                       return 1;
+               }
+
+       } else if ( b->a_style == ACL_STYLE_SELF ) {
+               struct berval   ndn, selfndn;
+               int             level;
+
+               if ( BER_BVISEMPTY( opndn ) || BER_BVISNULL( &e->e_nname ) ) {
+                       return 1;
+               }
+
+               level = b->a_self_level;
+               if ( level < 0 ) {
+                       selfndn = *opndn;
+                       ndn = e->e_nname;
+                       level = -level;
+
+               } else {
+                       ndn = *opndn;
+                       selfndn = e->e_nname;
+               }
+
+               for ( ; level > 0; level-- ) {
+                       if ( BER_BVISEMPTY( &ndn ) ) {
+                               break;
+                       }
+                       dnParent( &ndn, &ndn );
+               }
+                       
+               if ( BER_BVISEMPTY( &ndn ) || !dn_match( &ndn, &selfndn ) )
+               {
+                       return 1;
+               }
+
+       } else if ( b->a_style == ACL_STYLE_REGEX ) {
+               if ( !ber_bvccmp( &b->a_pat, '*' ) ) {
+                       int             tmp_nmatch;
+                       regmatch_t      tmp_matches[2],
+                                       *tmp_matchesp = tmp_matches;
+
+                       int             rc = 0;
+
+                       switch ( a->acl_dn_style ) {
+                       case ACL_STYLE_REGEX:
+                               if ( !BER_BVISNULL( &a->acl_dn_pat ) ) {
+                                       tmp_matchesp = matches;
+                                       tmp_nmatch = nmatch;
+                                       break;
+                               }
+                       /* FALLTHRU: applies also to ACL_STYLE_REGEX when pattern is "*" */
+
+                       case ACL_STYLE_BASE:
+                               tmp_matches[0].rm_so = 0;
+                               tmp_matches[0].rm_eo = e->e_nname.bv_len;
+                               tmp_nmatch = 1;
+                               break;
+
+                       case ACL_STYLE_ONE:
+                       case ACL_STYLE_SUBTREE:
+                       case ACL_STYLE_CHILDREN:
+                               tmp_matches[0].rm_so = 0;
+                               tmp_matches[0].rm_eo = e->e_nname.bv_len;
+                               tmp_matches[1].rm_so = e->e_nname.bv_len - a->acl_dn_pat.bv_len;
+                               tmp_matches[1].rm_eo = e->e_nname.bv_len;
+                               tmp_nmatch = 2;
+                               break;
+
+                       default:
+                               /* error */
+                               rc = 1;
+                               break;
+                       }
+
+                       if ( rc ) {
+                               return 1;
+                       }
+
+                       if ( !regex_matches( &b->a_pat, opndn->bv_val,
+                               e->e_ndn, tmp_nmatch, tmp_matchesp ) )
+                       {
+                               return 1;
+                       }
+               }
+
+       } else {
+               struct berval   pat;
+               ber_len_t       patlen, odnlen;
+               int             got_match = 0;
+
+               if ( e->e_dn == NULL )
+                       return 1;
+
+               if ( b->a_expand ) {
+                       struct berval   bv;
+                       char            buf[ACL_BUF_SIZE];
+                       
+                       int             tmp_nmatch;
+                       regmatch_t      tmp_matches[2],
+                                       *tmp_matchesp = tmp_matches;
+
+                       int             rc = 0;
+
+                       bv.bv_len = sizeof( buf ) - 1;
+                       bv.bv_val = buf;
+
+                       switch ( a->acl_dn_style ) {
+                       case ACL_STYLE_REGEX:
+                               if ( !BER_BVISNULL( &a->acl_dn_pat ) ) {
+                                       tmp_matchesp = matches;
+                                       tmp_nmatch = nmatch;
+                                       break;
+                               }
+                       /* FALLTHRU: applies also to ACL_STYLE_REGEX when pattern is "*" */
+
+                       case ACL_STYLE_BASE:
+                               tmp_matches[0].rm_so = 0;
+                               tmp_matches[0].rm_eo = e->e_nname.bv_len;
+                               tmp_nmatch = 1;
+                               break;
+
+                       case ACL_STYLE_ONE:
+                       case ACL_STYLE_SUBTREE:
+                       case ACL_STYLE_CHILDREN:
+                               tmp_matches[0].rm_so = 0;
+                               tmp_matches[0].rm_eo = e->e_nname.bv_len;
+                               tmp_matches[1].rm_so = e->e_nname.bv_len - a->acl_dn_pat.bv_len;
+                               tmp_matches[1].rm_eo = e->e_nname.bv_len;
+                               tmp_nmatch = 2;
+                               break;
+
+                       default:
+                               /* error */
+                               rc = 1;
+                               break;
+                       }
+
+                       if ( rc ) {
+                               return 1;
+                       }
+
+                       if ( string_expand( &bv, &b->a_pat, 
+                                       e->e_nname.bv_val,
+                                       tmp_nmatch, tmp_matchesp ) )
+                       {
+                               return 1;
+                       }
+                       
+                       if ( dnNormalize(0, NULL, NULL, &bv,
+                                       &pat, op->o_tmpmemctx )
+                                       != LDAP_SUCCESS )
+                       {
+                               /* did not expand to a valid dn */
+                               return 1;
+                       }
+
+               } else {
+                       pat = b->a_pat;
+               }
+
+               patlen = pat.bv_len;
+               odnlen = opndn->bv_len;
+               if ( odnlen < patlen ) {
+                       goto dn_match_cleanup;
+
+               }
+
+               if ( b->a_style == ACL_STYLE_BASE ) {
+                       /* base dn -- entire object DN must match */
+                       if ( odnlen != patlen ) {
+                               goto dn_match_cleanup;
+                       }
+
+               } else if ( b->a_style == ACL_STYLE_ONE ) {
+                       int rdnlen = -1;
+
+                       if ( odnlen <= patlen ) {
+                               goto dn_match_cleanup;
+                       }
+
+                       if ( !DN_SEPARATOR( opndn->bv_val[odnlen - patlen - 1] ) ) {
+                               goto dn_match_cleanup;
+                       }
+
+                       rdnlen = dn_rdnlen( NULL, opndn );
+                       if ( rdnlen != odnlen - patlen - 1 ) {
+                               goto dn_match_cleanup;
+                       }
+
+               } else if ( b->a_style == ACL_STYLE_SUBTREE ) {
+                       if ( odnlen > patlen && !DN_SEPARATOR( opndn->bv_val[odnlen - patlen - 1] ) ) {
+                               goto dn_match_cleanup;
+                       }
+
+               } else if ( b->a_style == ACL_STYLE_CHILDREN ) {
+                       if ( odnlen <= patlen ) {
+                               goto dn_match_cleanup;
+                       }
+
+                       if ( !DN_SEPARATOR( opndn->bv_val[odnlen - patlen - 1] ) ) {
+                               goto dn_match_cleanup;
+                       }
+
+               } else if ( b->a_style == ACL_STYLE_LEVEL ) {
+                       int level;
+                       struct berval ndn;
+
+                       if ( odnlen <= patlen ) {
+                               goto dn_match_cleanup;
+                       }
+
+                       if ( level > 0 && !DN_SEPARATOR( opndn->bv_val[odnlen - patlen - 1] ) )
+                       {
+                               goto dn_match_cleanup;
+                       }
+                       
+                       level = b->a_level;
+                       ndn = *opndn;
+                       for ( ; level > 0; level-- ) {
+                               if ( BER_BVISEMPTY( &ndn ) ) {
+                                       goto dn_match_cleanup;
+                               }
+                               dnParent( &ndn, &ndn );
+                               if ( ndn.bv_len < patlen ) {
+                                       goto dn_match_cleanup;
+                               }
+                       }
+                       
+                       if ( ndn.bv_len != patlen ) {
+                               goto dn_match_cleanup;
                        }
                }
 
-               Debug( LDAP_DEBUG_ACL, "=> acl_get: [%d] attr %s\n",
-                      *count, attr, 0);
-               return a;
+               got_match = !strcmp( pat.bv_val, &opndn->bv_val[ odnlen - patlen ] );
+
+dn_match_cleanup:;
+               if ( pat.bv_val != b->a_pat.bv_val ) {
+                       slap_sl_free( pat.bv_val, op->o_tmpmemctx );
+               }
+
+               if ( !got_match ) {
+                       return 1;
+               }
        }
 
-       Debug( LDAP_DEBUG_ACL, "<= acl_get: done.\n", 0, 0, 0 );
-       return( NULL );
+       return 0;
 }
 
 /*
@@ -632,6 +1258,100 @@ acl_get(
                } \
        } while( 0 )
 
+static int
+acl_mask_dnattr(
+       Operation               *op,
+       Entry                   *e,
+       struct berval           *val,
+       AccessControl           *a,
+       Access                  *b,
+       int                     i,
+       regmatch_t              *matches,
+       int                     count,
+       AccessControlState      *state,
+       slap_dn_access          *bdn,
+       struct berval           *opndn )
+{
+       Attribute       *at;
+       struct berval   bv;
+       int             rc, match = 0;
+       const char      *text;
+       const char      *attr = bdn->a_at->ad_cname.bv_val;
+
+       assert( attr != NULL );
+
+       if ( BER_BVISEMPTY( opndn ) ) {
+               return 1;
+       }
+
+       Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n", attr, 0, 0 );
+       bv = *opndn;
+
+       /* see if asker is listed in dnattr */
+       for ( at = attrs_find( e->e_attrs, bdn->a_at );
+               at != NULL;
+               at = attrs_find( at->a_next, bdn->a_at ) )
+       {
+               if ( value_find_ex( bdn->a_at,
+                       SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
+                               SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
+                       at->a_nvals,
+                       &bv, op->o_tmpmemctx ) == 0 )
+               {
+                       /* found it */
+                       match = 1;
+                       break;
+               }
+       }
+
+       if ( match ) {
+               /* have a dnattr match. if this is a self clause then
+                * the target must also match the op dn.
+                */
+               if ( bdn->a_self ) {
+                       /* check if the target is an attribute. */
+                       if ( val == NULL ) return 1;
+
+                       /* target is attribute, check if the attribute value
+                        * is the op dn.
+                        */
+                       rc = value_match( &match, bdn->a_at,
+                               bdn->a_at->ad_type->sat_equality, 0,
+                               val, &bv, &text );
+                       /* on match error or no match, fail the ACL clause */
+                       if ( rc != LDAP_SUCCESS || match != 0 )
+                               return 1;
+               }
+
+       } else {
+               /* no dnattr match, check if this is a self clause */
+               if ( ! bdn->a_self )
+                       return 1;
+
+               ACL_RECORD_VALUE_STATE;
+               
+               /* this is a self clause, check if the target is an
+                * attribute.
+                */
+               if ( val == NULL )
+                       return 1;
+
+               /* target is attribute, check if the attribute value
+                * is the op dn.
+                */
+               rc = value_match( &match, bdn->a_at,
+                       bdn->a_at->ad_type->sat_equality, 0,
+                       val, &bv, &text );
+
+               /* on match error or no match, fail the ACL clause */
+               if ( rc != LDAP_SUCCESS || match != 0 )
+                       return 1;
+       }
+
+       return 0;
+}
+
+
 /*
  * acl_mask - modifies mask based upon the given acl and the
  * requested access to entry e, attribute attr, value val.  if val
@@ -654,12 +1374,14 @@ acl_mask(
        int                     count,
        AccessControlState      *state )
 {
-       int             i, odnlen, patlen;
+       int             i;
        Access  *b;
 #ifdef LDAP_DEBUG
        char accessmaskbuf[ACCESSMASK_MAXLEN];
+#if !defined( SLAP_DYNACL ) && defined( SLAPD_ACI_ENABLED )
        char accessmaskbuf1[ACCESSMASK_MAXLEN];
-#endif
+#endif /* !SLAP_DYNACL && SLAPD_ACI_ENABLED */
+#endif /* DEBUG */
        const char *attr;
 
        assert( a != NULL );
@@ -678,7 +1400,7 @@ acl_mask(
                "=> acl_mask: to %s by \"%s\", (%s) \n",
                val ? "value" : "all values",
                op->o_ndn.bv_val ?  op->o_ndn.bv_val : "",
-               accessmask2str( *mask, accessmaskbuf, 1) );
+               accessmask2str( *mask, accessmaskbuf, 1 ) );
 
 
        if( state && ( state->as_recorded & ACL_STATE_RECORDED_VD )
@@ -712,204 +1434,42 @@ acl_mask(
                         * value is set in a_dn_style; however, the string
                         * is maintaned in a_dn_pat.
                         */
-                       if ( b->a_dn_style == ACL_STYLE_ANONYMOUS ) {
-                               if ( op->o_ndn.bv_len != 0 ) {
-                                       continue;
-                               }
-
-                       } else if ( b->a_dn_style == ACL_STYLE_USERS ) {
-                               if ( op->o_ndn.bv_len == 0 ) {
-                                       continue;
-                               }
-
-                       } else if ( b->a_dn_style == ACL_STYLE_SELF ) {
-                               if ( op->o_ndn.bv_len == 0 ) {
-                                       continue;
-                               }
-                               
-                               if ( e->e_dn == NULL || !dn_match( &e->e_nname, &op->o_ndn ) ) {
-                                       continue;
-                               }
-
-                       } else if ( b->a_dn_style == ACL_STYLE_REGEX ) {
-                               if ( !ber_bvccmp( &b->a_dn_pat, '*' ) ) {
-                                       int             tmp_nmatch;
-                                       regmatch_t      tmp_matches[2],
-                                                       *tmp_matchesp = tmp_matches;
-
-                                       int             rc = 0;
 
-                                       switch ( a->acl_dn_style ) {
-                                       case ACL_STYLE_REGEX:
-                                               if ( !BER_BVISNULL( &a->acl_dn_pat ) ) {
-                                                       tmp_matchesp = matches;
-                                                       tmp_nmatch = nmatch;
-                                                       break;
-                                               }
-                                       /* FALLTHRU: applies also to ACL_STYLE_REGEX when pattern is "*" */
-
-                                       case ACL_STYLE_BASE:
-                                               tmp_matches[0].rm_so = 0;
-                                               tmp_matches[0].rm_eo = e->e_nname.bv_len;
-                                               tmp_nmatch = 1;
-                                               break;
-
-                                       case ACL_STYLE_ONE:
-                                       case ACL_STYLE_SUBTREE:
-                                       case ACL_STYLE_CHILDREN:
-                                               tmp_matches[0].rm_so = 0;
-                                               tmp_matches[0].rm_eo = e->e_nname.bv_len;
-                                               tmp_matches[1].rm_so = e->e_nname.bv_len - a->acl_dn_pat.bv_len;
-                                               tmp_matches[1].rm_eo = e->e_nname.bv_len;
-                                               tmp_nmatch = 2;
-                                               break;
-
-                                       default:
-                                               /* error */
-                                               rc = 1;
-                                               break;
-                                       }
+                       if ( acl_mask_dn( op, e, a, nmatch, matches,
+                               &b->a_dn, &op->o_ndn ) )
+                       {
+                               continue;
+                       }
+               }
 
-                                       if ( rc ) {
-                                               continue;
-                                       }
+               if ( !BER_BVISEMPTY( &b->a_realdn_pat ) ) {
+                       struct berval   ndn;
 
-                                       if ( !regex_matches( &b->a_dn_pat,
-                                               op->o_ndn.bv_val, e->e_ndn,
-                                               tmp_nmatch, tmp_matchesp ) )
-                                       {
-                                               continue;
-                                       }
-                               }
+                       Debug( LDAP_DEBUG_ACL, "<= check a_realdn_pat: %s\n",
+                               b->a_realdn_pat.bv_val, 0, 0);
+                       /*
+                        * if access applies to the entry itself, and the
+                        * user is bound as somebody in the same namespace as
+                        * the entry, OR the given dn matches the dn pattern
+                        */
+                       /*
+                        * NOTE: styles "anonymous", "users" and "self" 
+                        * have been moved to enum slap_style_t, whose 
+                        * value is set in a_dn_style; however, the string
+                        * is maintaned in a_dn_pat.
+                        */
 
+                       if ( op->o_conn && !BER_BVISNULL( &op->o_conn->c_ndn ) )
+                       {
+                               ndn = op->o_conn->c_ndn;
                        } else {
-                               struct berval pat;
-                               int got_match = 0;
-
-                               if ( e->e_dn == NULL )
-                                       continue;
-
-                               if ( b->a_dn_expand ) {
-                                       struct berval   bv;
-                                       char            buf[ACL_BUF_SIZE];
-                                       
-                                       int             tmp_nmatch;
-                                       regmatch_t      tmp_matches[2],
-                                                       *tmp_matchesp = tmp_matches;
-
-                                       int             rc = 0;
-
-                                       bv.bv_len = sizeof( buf ) - 1;
-                                       bv.bv_val = buf;
-
-                                       switch ( a->acl_dn_style ) {
-                                       case ACL_STYLE_REGEX:
-                                               if ( !BER_BVISNULL( &a->acl_dn_pat ) ) {
-                                                       tmp_matchesp = matches;
-                                                       tmp_nmatch = nmatch;
-                                                       break;
-                                               }
-                                       /* FALLTHRU: applies also to ACL_STYLE_REGEX when pattern is "*" */
-
-                                       case ACL_STYLE_BASE:
-                                               tmp_matches[0].rm_so = 0;
-                                               tmp_matches[0].rm_eo = e->e_nname.bv_len;
-                                               tmp_nmatch = 1;
-                                               break;
-
-                                       case ACL_STYLE_ONE:
-                                       case ACL_STYLE_SUBTREE:
-                                       case ACL_STYLE_CHILDREN:
-                                               tmp_matches[0].rm_so = 0;
-                                               tmp_matches[0].rm_eo = e->e_nname.bv_len;
-                                               tmp_matches[1].rm_so = e->e_nname.bv_len - a->acl_dn_pat.bv_len;
-                                               tmp_matches[1].rm_eo = e->e_nname.bv_len;
-                                               tmp_nmatch = 2;
-                                               break;
-
-                                       default:
-                                               /* error */
-                                               rc = 1;
-                                               break;
-                                       }
-
-                                       if ( rc ) {
-                                               continue;
-                                       }
-
-                                       if ( string_expand( &bv, &b->a_dn_pat, 
-                                                       e->e_nname.bv_val,
-                                                       tmp_nmatch, tmp_matchesp ) )
-                                       {
-                                               continue;
-                                       }
-                                       
-                                       if ( dnNormalize(0, NULL, NULL, &bv,
-                                                       &pat, op->o_tmpmemctx )
-                                                       != LDAP_SUCCESS )
-                                       {
-                                               /* did not expand to a valid dn */
-                                               continue;
-                                       }
-
-                               } else {
-                                       pat = b->a_dn_pat;
-                               }
-
-                               patlen = pat.bv_len;
-                               odnlen = op->o_ndn.bv_len;
-                               if ( odnlen < patlen ) {
-                                       goto dn_match_cleanup;
-
-                               }
-
-                               if ( b->a_dn_style == ACL_STYLE_BASE ) {
-                                       /* base dn -- entire object DN must match */
-                                       if ( odnlen != patlen ) {
-                                               goto dn_match_cleanup;
-                                       }
-
-                               } else if ( b->a_dn_style == ACL_STYLE_ONE ) {
-                                       int rdnlen = -1;
-
-                                       if ( odnlen <= patlen ) {
-                                               goto dn_match_cleanup;
-                                       }
-
-                                       if ( !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) ) {
-                                               goto dn_match_cleanup;
-                                       }
-
-                                       rdnlen = dn_rdnlen( NULL, &op->o_ndn );
-                                       if ( rdnlen != odnlen - patlen - 1 ) {
-                                               goto dn_match_cleanup;
-                                       }
-
-                               } else if ( b->a_dn_style == ACL_STYLE_SUBTREE ) {
-                                       if ( odnlen > patlen && !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) ) {
-                                               goto dn_match_cleanup;
-                                       }
-
-                               } else if ( b->a_dn_style == ACL_STYLE_CHILDREN ) {
-                                       if ( odnlen <= patlen ) {
-                                               goto dn_match_cleanup;
-                                       }
-
-                                       if ( !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) ) {
-                                               goto dn_match_cleanup;
-                                       }
-                               }
-
-                               got_match = !strcmp( pat.bv_val, op->o_ndn.bv_val + odnlen - patlen );
-
-dn_match_cleanup:;
-                               if ( pat.bv_val != b->a_dn_pat.bv_val ) {
-                                       slap_sl_free( pat.bv_val, op->o_tmpmemctx );
-                               }
+                               ndn = op->o_ndn;
+                       }
 
-                               if ( !got_match ) {
-                                       continue;
-                               }
+                       if ( acl_mask_dn( op, e, a, nmatch, matches,
+                               &b->a_realdn, &ndn ) )
+                       {
+                               continue;
                        }
                }
 
@@ -1156,80 +1716,29 @@ dn_match_cleanup:;
                }
 
                if ( b->a_dn_at != NULL ) {
-                       Attribute       *at;
-                       struct berval   bv;
-                       int rc, match = 0;
-                       const char *text;
-                       const char *attr = b->a_dn_at->ad_cname.bv_val;
-
-                       assert( attr != NULL );
-
-                       if ( op->o_ndn.bv_len == 0 ) {
+                       if ( acl_mask_dnattr( op, e, val, a, b, i,
+                                       matches, count, state,
+                                       &b->a_dn, &op->o_ndn ) )
+                       {
                                continue;
                        }
+               }
 
-                       Debug( LDAP_DEBUG_ACL, "<= check a_dn_at: %s\n",
-                               attr, 0, 0);
-                       bv = op->o_ndn;
+               if ( b->a_realdn_at != NULL ) {
+                       struct berval   ndn;
 
-                       /* see if asker is listed in dnattr */
-                       for( at = attrs_find( e->e_attrs, b->a_dn_at );
-                               at != NULL;
-                               at = attrs_find( at->a_next, b->a_dn_at ) )
+                       if ( op->o_conn && !BER_BVISNULL( &op->o_conn->c_ndn ) )
                        {
-                               if( value_find_ex( b->a_dn_at,
-                                       SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
-                                               SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
-                                       at->a_nvals,
-                                       &bv, op->o_tmpmemctx ) == 0 )
-                               {
-                                       /* found it */
-                                       match = 1;
-                                       break;
-                               }
-                       }
-
-                       if( match ) {
-                               /* have a dnattr match. if this is a self clause then
-                                * the target must also match the op dn.
-                                */
-                               if ( b->a_dn_self ) {
-                                       /* check if the target is an attribute. */
-                                       if ( val == NULL ) continue;
-
-                                       /* target is attribute, check if the attribute value
-                                        * is the op dn.
-                                        */
-                                       rc = value_match( &match, b->a_dn_at,
-                                               b->a_dn_at->ad_type->sat_equality, 0,
-                                               val, &bv, &text );
-                                       /* on match error or no match, fail the ACL clause */
-                                       if (rc != LDAP_SUCCESS || match != 0 )
-                                               continue;
-                               }
+                               ndn = op->o_conn->c_ndn;
                        } else {
-                               /* no dnattr match, check if this is a self clause */
-                               if ( ! b->a_dn_self )
-                                       continue;
-
-                               ACL_RECORD_VALUE_STATE;
-                               
-                               /* this is a self clause, check if the target is an
-                                * attribute.
-                                */
-                               if ( val == NULL )
-                                       continue;
-
-                               /* target is attribute, check if the attribute value
-                                * is the op dn.
-                                */
-                               rc = value_match( &match, b->a_dn_at,
-                                       b->a_dn_at->ad_type->sat_equality, 0,
-                                       val, &bv, &text );
+                               ndn = op->o_ndn;
+                       }
 
-                               /* on match error or no match, fail the ACL clause */
-                               if (rc != LDAP_SUCCESS || match != 0 )
-                                       continue;
+                       if ( acl_mask_dnattr( op, e, val, a, b, i,
+                                       matches, count, state,
+                                       &b->a_realdn, &ndn ) )
+                       {
+                               continue;
                        }
                }
 
@@ -1494,8 +2003,7 @@ dn_match_cleanup:;
                if ( b->a_aci_at != NULL ) {
                        Attribute       *at;
                        slap_access_t   grant, deny, tgrant, tdeny;
-                       struct berval   parent_ndn,
-                                       old_parent_ndn = BER_BVNULL;
+                       struct berval   parent_ndn;
                        BerVarray       bvals = NULL;
                        int             ret, stop;
 
@@ -1543,7 +2051,7 @@ dn_match_cleanup:;
                                        }
                                }
                                Debug(LDAP_DEBUG_ACL, "<= aci_mask grant %s deny %s\n",
-                                         accessmask2str(tgrant,accessmaskbuf, 1), 
+                                         accessmask2str(tgrant, accessmaskbuf, 1), 
                                          accessmask2str(tdeny, accessmaskbuf1, 1), 0);
 
                        }
@@ -1552,9 +2060,8 @@ dn_match_cleanup:;
                         * acis with scope set to subtree
                         */
                        if ( (tgrant == ACL_PRIV_NONE) && (tdeny == ACL_PRIV_NONE) ) {
-                               dnParent(&(e->e_nname), &parent_ndn);
-                               while ( parent_ndn.bv_val != old_parent_ndn.bv_val ) {
-                                       old_parent_ndn = parent_ndn;
+                               dnParent( &e->e_nname, &parent_ndn );
+                               while ( !BER_BVISEMPTY( &parent_ndn ) ) {
                                        Debug(LDAP_DEBUG_ACL, "checking ACI of %s\n", parent_ndn.bv_val, 0, 0);
                                        ret = backend_attribute(op, NULL, &parent_ndn, b->a_aci_at, &bvals, ACL_AUTH);
                                        switch(ret){
@@ -1584,7 +2091,7 @@ dn_match_cleanup:;
                                                                }
                                                        }
                                                        Debug(LDAP_DEBUG_ACL, "<= aci_mask grant %s deny %s\n", 
-                                                               accessmask2str(tgrant,accessmaskbuf, 1),
+                                                               accessmask2str(tgrant, accessmaskbuf, 1),
                                                                accessmask2str(tdeny, accessmaskbuf1, 1), 0);
                                                }
                                                break;
@@ -1610,7 +2117,7 @@ dn_match_cleanup:;
                                        if (stop){
                                                break;
                                        }
-                                       dnParent(&old_parent_ndn, &parent_ndn);
+                                       dnParent( &parent_ndn, &parent_ndn );
                                }
                        }
 
@@ -1725,7 +2232,7 @@ acl_check_modlist(
 
        be = op->o_bd;
        if ( be == NULL ) {
-               be = &backends[0];
+               be = LDAP_STAILQ_FIRST(&backendDB);
                be_null = 1;
                op->o_bd = be;
        }
@@ -1772,7 +2279,7 @@ acl_check_modlist(
                         * This prevents abuse from selfwriters.
                         */
                        if ( ! access_allowed( op, e,
-                               mlist->sml_desc, NULL, ACL_WRITE, &state ) )
+                               mlist->sml_desc, NULL, ACL_WDEL, &state ) )
                        {
                                ret = 0;
                                goto done;
@@ -1790,7 +2297,7 @@ acl_check_modlist(
                                bv->bv_val != NULL; bv++ )
                        {
                                if ( ! access_allowed( op, e,
-                                       mlist->sml_desc, bv, ACL_WRITE, &state ) )
+                                       mlist->sml_desc, bv, ACL_WADD, &state ) )
                                {
                                        ret = 0;
                                        goto done;
@@ -1801,7 +2308,7 @@ acl_check_modlist(
                case LDAP_MOD_DELETE:
                        if ( mlist->sml_values == NULL ) {
                                if ( ! access_allowed( op, e,
-                                       mlist->sml_desc, NULL, ACL_WRITE, NULL ) )
+                                       mlist->sml_desc, NULL, ACL_WDEL, NULL ) )
                                {
                                        ret = 0;
                                        goto done;
@@ -1813,7 +2320,7 @@ acl_check_modlist(
                                bv->bv_val != NULL; bv++ )
                        {
                                if ( ! access_allowed( op, e,
-                                       mlist->sml_desc, bv, ACL_WRITE, &state ) )
+                                       mlist->sml_desc, bv, ACL_WDEL, &state ) )
                                {
                                        ret = 0;
                                        goto done;
@@ -2642,6 +3149,11 @@ aci_mask(
 }
 
 #ifdef SLAP_DYNACL
+/*
+ * FIXME: there is a silly dependence that makes it difficult
+ * to move ACIs in a run-time loadable module under the "dynacl" 
+ * umbrella, because sets share some helpers with ACIs.
+ */
 static int
 dynacl_aci_parse( const char *fname, int lineno, slap_style_t sty, const char *right, void **privp )
 {
@@ -2751,7 +3263,6 @@ dynacl_aci_mask(
         */
        if ( tgrant == ACL_PRIV_NONE && tdeny == ACL_PRIV_NONE ) {
                struct berval   parent_ndn;
-               struct berval   old_parent_ndn = BER_BVNULL;
 
 #if 1
                /* to solve the chicken'n'egg problem of accessing
@@ -2775,12 +3286,11 @@ dynacl_aci_mask(
 #endif
 
                dnParent( &e->e_nname, &parent_ndn );
-               while ( parent_ndn.bv_val != old_parent_ndn.bv_val ){
+               while ( !BER_BVISEMPTY( &parent_ndn ) ){
                        int             i;
                        BerVarray       bvals = NULL;
                        int             ret, stop;
 
-                       old_parent_ndn = parent_ndn;
                        Debug( LDAP_DEBUG_ACL, "checking ACI of \"%s\"\n", parent_ndn.bv_val, 0, 0 );
                        ret = backend_attribute( &op2, NULL, &parent_ndn, ad, &bvals, ACL_AUTH );
 
@@ -2835,7 +3345,7 @@ dynacl_aci_mask(
                        if ( stop ) {
                                break;
                        }
-                       dnParent( &old_parent_ndn, &parent_ndn );
+                       dnParent( &parent_ndn, &parent_ndn );
                }
        }
 
index 064267970b66caffaf95d96479398d2e29cdd3f2..b0bed6579c37a9b1d8ce67321f21bda835f5bf30 100644 (file)
@@ -45,7 +45,11 @@ static char *style_strings[] = {
        "one",
        "subtree",
        "children",
+       "level",
        "attrof",
+       "anonymous",
+       "users",
+       "self",
        "ip",
        "path",
        NULL
@@ -59,7 +63,6 @@ static void           acl_regex_normalized_dn(const char *src, struct berval *pat);
 
 #ifdef LDAP_DEBUG
 static void            print_acl(Backend *be, AccessControl *a);
-static void            print_access(Access *b);
 #endif
 
 static int             check_scope( BackendDB *be, AccessControl *a );
@@ -302,7 +305,8 @@ parse_acl(
     const char *fname,
     int                lineno,
     int                argc,
-    char       **argv )
+    char       **argv,
+       int             pos )
 {
        int             i;
        char            *left, *right, *style, *next;
@@ -585,14 +589,39 @@ parse_acl(
 
                        /* get <who> */
                        for ( ; i < argc; i++ ) {
-                               slap_style_t sty = ACL_STYLE_REGEX;
-                               char *style_modifier = NULL;
-                               int expand = 0;
+                               slap_style_t    sty = ACL_STYLE_REGEX;
+                               char            *style_modifier = NULL;
+                               char            *style_level = NULL;
+                               int             level = 0;
+                               int             expand = 0;
+                               slap_dn_access  *bdn = &b->a_dn;
+                               int             is_realdn = 0;
 
                                split( argv[i], '=', &left, &right );
                                split( left, '.', &left, &style );
                                if ( style ) {
-                                       split( style, ',', &style, &style_modifier);
+                                       split( style, ',', &style, &style_modifier );
+
+                                       if ( strncasecmp( style, "level", STRLENOF( "level" ) ) == 0 ) {
+                                               split( style, '{', &style, &style_level );
+                                               if ( style_level != NULL ) {
+                                                       char *p = strchr( style_level, '}' );
+                                                       if ( p == NULL ) {
+                                                               fprintf( stderr,
+                                                                       "%s: line %d: premature eol: "
+                                                                       "expecting closing '}' in \"level{n}\"\n",
+                                                                       fname, lineno );
+                                                               acl_usage();
+                                                       } else if ( p == style_level ) {
+                                                               fprintf( stderr,
+                                                                       "%s: line %d: empty level "
+                                                                       "in \"level{n}\"\n",
+                                                                       fname, lineno );
+                                                               acl_usage();
+                                                       }
+                                                       p[0] = '\0';
+                                               }
+                                       }
                                }
 
                                if ( style == NULL || *style == '\0' ||
@@ -615,6 +644,21 @@ parse_acl(
                                } else if ( strcasecmp( style, "children" ) == 0 ) {
                                        sty = ACL_STYLE_CHILDREN;
 
+                               } else if ( strcasecmp( style, "level" ) == 0 )
+                               {
+                                       char    *next;
+
+                                       level = strtol( style_level, &next, 10 );
+                                       if ( next[0] != '\0' ) {
+                                               fprintf( stderr,
+                                                       "%s: line %d: unable to parse level "
+                                                       "in \"level{n}\"\n",
+                                                       fname, lineno );
+                                               acl_usage();
+                                       }
+
+                                       sty = ACL_STYLE_LEVEL;
+
                                } else if ( strcasecmp( style, "regex" ) == 0 ) {
                                        sty = ACL_STYLE_REGEX;
 
@@ -679,38 +723,48 @@ parse_acl(
                                                fname, lineno );
                                }
 
-                               if ( strcasecmp( argv[i], "*" ) == 0 ) {
+                               if ( strncasecmp( left, "real", STRLENOF( "real" ) ) == 0 ) {
+                                       is_realdn = 1;
+                                       bdn = &b->a_realdn;
+                                       left += STRLENOF( "real" );
+                               }
+
+                               if ( strcasecmp( left, "*" ) == 0 ) {
+                                       if ( is_realdn ) {
+                                               acl_usage();
+                                       }
+
                                        ber_str2bv( "*", STRLENOF( "*" ), 1, &bv );
                                        sty = ACL_STYLE_REGEX;
 
-                               } else if ( strcasecmp( argv[i], "anonymous" ) == 0 ) {
+                               } else if ( strcasecmp( left, "anonymous" ) == 0 ) {
                                        ber_str2bv("anonymous", STRLENOF( "anonymous" ), 1, &bv);
                                        sty = ACL_STYLE_ANONYMOUS;
 
-                               } else if ( strcasecmp( argv[i], "users" ) == 0 ) {
+                               } else if ( strcasecmp( left, "users" ) == 0 ) {
                                        ber_str2bv("users", STRLENOF( "users" ), 1, &bv);
                                        sty = ACL_STYLE_USERS;
 
-                               } else if ( strcasecmp( argv[i], "self" ) == 0 ) {
+                               } else if ( strcasecmp( left, "self" ) == 0 ) {
                                        ber_str2bv("self", STRLENOF( "self" ), 1, &bv);
                                        sty = ACL_STYLE_SELF;
 
                                } else if ( strcasecmp( left, "dn" ) == 0 ) {
                                        if ( sty == ACL_STYLE_REGEX ) {
-                                               b->a_dn_style = ACL_STYLE_REGEX;
+                                               bdn->a_style = ACL_STYLE_REGEX;
                                                if ( right == NULL ) {
                                                        /* no '=' */
                                                        ber_str2bv("users",
                                                                STRLENOF( "users" ),
                                                                1, &bv);
-                                                       b->a_dn_style = ACL_STYLE_USERS;
+                                                       bdn->a_style = ACL_STYLE_USERS;
 
                                                } else if (*right == '\0' ) {
                                                        /* dn="" */
                                                        ber_str2bv("anonymous",
                                                                STRLENOF( "anonymous" ),
                                                                1, &bv);
-                                                       b->a_dn_style = ACL_STYLE_ANONYMOUS;
+                                                       bdn->a_style = ACL_STYLE_ANONYMOUS;
 
                                                } else if ( strcmp( right, "*" ) == 0 ) {
                                                        /* dn=* */
@@ -718,7 +772,7 @@ parse_acl(
                                                        ber_str2bv("users",
                                                                STRLENOF( "users" ),
                                                                1, &bv);
-                                                       b->a_dn_style = ACL_STYLE_USERS;
+                                                       bdn->a_style = ACL_STYLE_USERS;
 
                                                } else if ( strcmp( right, ".+" ) == 0
                                                        || strcmp( right, "^.+" ) == 0
@@ -730,7 +784,7 @@ parse_acl(
                                                        ber_str2bv("users",
                                                                STRLENOF( "users" ),
                                                                1, &bv);
-                                                       b->a_dn_style = ACL_STYLE_USERS;
+                                                       bdn->a_style = ACL_STYLE_USERS;
 
                                                } else if ( strcmp( right, ".*" ) == 0
                                                        || strcmp( right, "^.*" ) == 0
@@ -766,7 +820,7 @@ parse_acl(
                                }
 
                                if ( !BER_BVISNULL( &bv ) ) {
-                                       if ( !BER_BVISEMPTY( &b->a_dn_pat ) ) {
+                                       if ( !BER_BVISEMPTY( &bdn->a_pat ) ) {
                                                fprintf( stderr,
                                                    "%s: line %d: dn pattern already specified.\n",
                                                    fname, lineno );
@@ -780,7 +834,7 @@ parse_acl(
                                                        expand == 0 )
                                        {
                                                rc = dnNormalize(0, NULL, NULL,
-                                                       &bv, &b->a_dn_pat, NULL);
+                                                       &bv, &bdn->a_pat, NULL);
                                                if ( rc != LDAP_SUCCESS ) {
                                                        fprintf( stderr,
                                                                "%s: line %d: bad DN \"%s\" in by DN clause\n",
@@ -790,10 +844,34 @@ parse_acl(
                                                free( bv.bv_val );
 
                                        } else {
-                                               b->a_dn_pat = bv;
+                                               bdn->a_pat = bv;
+                                       }
+                                       bdn->a_style = sty;
+                                       bdn->a_expand = expand;
+                                       if ( sty == ACL_STYLE_SELF ) {
+                                               bdn->a_self_level = level;
+
+                                       } else {
+                                               if ( level < 0 ) {
+                                                       fprintf( stderr,
+                                                               "%s: line %d: bad negative level \"%d\" "
+                                                               "in by DN clause\n",
+                                                               fname, lineno, level );
+                                                       acl_usage();
+                                               } else if ( level == 1 ) {
+                                                       fprintf( stderr,
+                                                               "%s: line %d: \"onelevel\" should be used "
+                                                               "instead of \"level{1}\" in by DN clause\n",
+                                                               fname, lineno, 0 );
+                                               } else if ( level == 0 && sty == ACL_STYLE_LEVEL ) {
+                                                       fprintf( stderr,
+                                                               "%s: line %d: \"base\" should be used "
+                                                               "instead of \"level{0}\" in by DN clause\n",
+                                                               fname, lineno, 0 );
+                                               }
+
+                                               bdn->a_level = level;
                                        }
-                                       b->a_dn_style = sty;
-                                       b->a_dn_expand = expand;
                                        continue;
                                }
 
@@ -806,14 +884,14 @@ parse_acl(
                                                acl_usage();
                                        }
 
-                                       if( b->a_dn_at != NULL ) {
+                                       if( bdn->a_at != NULL ) {
                                                fprintf( stderr,
                                                        "%s: line %d: dnattr already specified.\n",
                                                        fname, lineno );
                                                acl_usage();
                                        }
 
-                                       rc = slap_str2ad( right, &b->a_dn_at, &text );
+                                       rc = slap_str2ad( right, &bdn->a_at, &text );
 
                                        if( rc != LDAP_SUCCESS ) {
                                                fprintf( stderr,
@@ -823,20 +901,20 @@ parse_acl(
                                        }
 
 
-                                       if( !is_at_syntax( b->a_dn_at->ad_type,
+                                       if( !is_at_syntax( bdn->a_at->ad_type,
                                                SLAPD_DN_SYNTAX ) &&
-                                               !is_at_syntax( b->a_dn_at->ad_type,
+                                               !is_at_syntax( bdn->a_at->ad_type,
                                                SLAPD_NAMEUID_SYNTAX ))
                                        {
                                                fprintf( stderr,
                                                        "%s: line %d: dnattr \"%s\": "
                                                        "inappropriate syntax: %s\n",
                                                        fname, lineno, right,
-                                                       b->a_dn_at->ad_type->sat_syntax_oid );
+                                                       bdn->a_at->ad_type->sat_syntax_oid );
                                                acl_usage();
                                        }
 
-                                       if( b->a_dn_at->ad_type->sat_equality == NULL ) {
+                                       if( bdn->a_at->ad_type->sat_equality == NULL ) {
                                                fprintf( stderr,
                                                        "%s: line %d: dnattr \"%s\": "
                                                        "inappropriate matching (no EQUALITY)\n",
@@ -1584,9 +1662,13 @@ parse_acl(
                        }
 
                        /* get <access> */
-                       if ( strncasecmp( left, "self", 4 ) == 0 ) {
+                       if ( strncasecmp( left, "self", STRLENOF( "self" ) ) == 0 ) {
                                b->a_dn_self = 1;
-                               ACL_PRIV_ASSIGN( b->a_access_mask, str2accessmask( &left[4] ) );
+                               ACL_PRIV_ASSIGN( b->a_access_mask, str2accessmask( &left[ STRLENOF( "self" ) ] ) );
+
+                       } else if ( strncasecmp( left, "realself", STRLENOF( "realself" ) ) == 0 ) {
+                               b->a_realdn_self = 1;
+                               ACL_PRIV_ASSIGN( b->a_access_mask, str2accessmask( &left[ STRLENOF( "realself" ) ] ) );
 
                        } else {
                                ACL_PRIV_ASSIGN( b->a_access_mask, str2accessmask( left ) );
@@ -1690,10 +1772,10 @@ parse_acl(
                        default:
                                break;
                        }
-                       acl_append( &be->be_acl, a );
+                       acl_append( &be->be_acl, a, pos );
 
                } else {
-                       acl_append( &frontendDB->be_acl, a );
+                       acl_append( &frontendDB->be_acl, a, pos );
                }
        }
 }
@@ -1734,6 +1816,12 @@ accessmask2str( slap_mask_t mask, char *buf, int debug )
                } else if ( ACL_LVL_IS_WRITE(mask) ) {
                        ptr = lutil_strcopy( ptr, "write" );
 
+               } else if ( ACL_LVL_IS_WADD(mask) ) {
+                       ptr = lutil_strcopy( ptr, "add" );
+
+               } else if ( ACL_LVL_IS_WDEL(mask) ) {
+                       ptr = lutil_strcopy( ptr, "delete" );
+
                } else if ( ACL_LVL_IS_MANAGE(mask) ) {
                        ptr = lutil_strcopy( ptr, "manage" );
 
@@ -1766,6 +1854,14 @@ accessmask2str( slap_mask_t mask, char *buf, int debug )
        if ( ACL_PRIV_ISSET(mask, ACL_PRIV_WRITE) ) {
                none = 0;
                *ptr++ = 'w';
+
+       } else if ( ACL_PRIV_ISSET(mask, ACL_PRIV_WADD) ) {
+               none = 0;
+               *ptr++ = 'a';
+
+       } else if ( ACL_PRIV_ISSET(mask, ACL_PRIV_WDEL) ) {
+               none = 0;
+               *ptr++ = 'z';
        } 
 
        if ( ACL_PRIV_ISSET(mask, ACL_PRIV_READ) ) {
@@ -1795,7 +1891,7 @@ accessmask2str( slap_mask_t mask, char *buf, int debug )
 
        if ( none && ACL_PRIV_ISSET(mask, ACL_PRIV_NONE) ) {
                none = 0;
-               *ptr++ = 'n';
+               *ptr++ = '0';
        } 
 
        if ( none ) {
@@ -1840,6 +1936,12 @@ str2accessmask( const char *str )
                        } else if( TOLOWER((unsigned char) str[i]) == 'w' ) {
                                ACL_PRIV_SET(mask, ACL_PRIV_WRITE);
 
+                       } else if( TOLOWER((unsigned char) str[i]) == 'a' ) {
+                               ACL_PRIV_SET(mask, ACL_PRIV_WADD);
+
+                       } else if( TOLOWER((unsigned char) str[i]) == 'z' ) {
+                               ACL_PRIV_SET(mask, ACL_PRIV_WDEL);
+
                        } else if( TOLOWER((unsigned char) str[i]) == 'r' ) {
                                ACL_PRIV_SET(mask, ACL_PRIV_READ);
 
@@ -1882,6 +1984,12 @@ str2accessmask( const char *str )
        } else if ( strcasecmp( str, "read" ) == 0 ) {
                ACL_LVL_ASSIGN_READ(mask);
 
+       } else if ( strcasecmp( str, "add" ) == 0 ) {
+               ACL_LVL_ASSIGN_WADD(mask);
+
+       } else if ( strcasecmp( str, "delete" ) == 0 ) {
+               ACL_LVL_ASSIGN_WDEL(mask);
+
        } else if ( strcasecmp( str, "write" ) == 0 ) {
                ACL_LVL_ASSIGN_WRITE(mask);
 
@@ -1905,13 +2013,18 @@ acl_usage( void )
                "<attrlist> ::= <attr> [val[.<attrstyle>]=<value>] | <attr> , <attrlist>\n"
                "<attr> ::= <attrname> | entry | children\n",
                "<who> ::= [ * | anonymous | users | self | dn[.<dnstyle>]=<DN> ]\n"
+                       "\t[ realanonymous | realusers | realself | realdn[.<dnstyle>]=<DN> ]\n"
                        "\t[dnattr=<attrname>]\n"
+                       "\t[realdnattr=<attrname>]\n"
                        "\t[group[/<objectclass>[/<attrname>]][.<style>]=<group>]\n"
                        "\t[peername[.<peernamestyle>]=<peer>] [sockname[.<style>]=<name>]\n"
                        "\t[domain[.<domainstyle>]=<domain>] [sockurl[.<style>]=<url>]\n"
 #ifdef SLAPD_ACI_ENABLED
-                       "\t[aci=<attrname>]\n"
+                       "\t[aci=[<attrname>]]\n"
 #endif
+#ifdef SLAP_DYNACL
+                       "\t[dynacl/<name>[.<dynstyle>][=<pattern>]]\n"
+#endif /* SLAP_DYNACL */
                        "\t[ssf=<n>] [transport_ssf=<n>] [tls_ssf=<n>] [sasl_ssf=<n>]\n",
                "<style> ::= exact | regex | base(Object)\n"
                "<dnstyle> ::= base(Object) | one(level) | sub(tree) | children | "
@@ -1920,9 +2033,9 @@ acl_usage( void )
                        "sub(tree) | children\n"
                "<peernamestyle> ::= exact | regex | ip | path\n"
                "<domainstyle> ::= exact | regex | base(Object) | sub(tree)\n"
-               "<access> ::= [self]{<level>|<priv>}\n"
-               "<level> ::= none|disclose|auth|compare|search|read|write|manage\n"
-               "<priv> ::= {=|+|-}{0|d|x|c|s|r|w|m}+\n"
+               "<access> ::= [[real]self]{<level>|<priv>}\n"
+               "<level> ::= none|disclose|auth|compare|search|read|{write|add|delete}|manage\n"
+               "<priv> ::= {=|+|-}{0|d|x|c|s|r|{w|a|z}|m}+\n"
                "<control> ::= [ stop | continue | break ]\n"
        );
        exit( EXIT_FAILURE );
@@ -1999,12 +2112,15 @@ access_append( Access **l, Access *a )
 }
 
 void
-acl_append( AccessControl **l, AccessControl *a )
+acl_append( AccessControl **l, AccessControl *a, int pos )
 {
-       for ( ; *l != NULL; l = &(*l)->acl_next ) {
+       int i;
+
+       for (i=0 ; i != pos && *l != NULL; l = &(*l)->acl_next, i++ ) {
                ;       /* Empty */
        }
-
+       if ( *l && a )
+               a->acl_next = *l;
        *l = a;
 }
 
@@ -2014,6 +2130,9 @@ access_free( Access *a )
        if ( !BER_BVISNULL( &a->a_dn_pat ) ) {
                free( a->a_dn_pat.bv_val );
        }
+       if ( !BER_BVISNULL( &a->a_realdn_pat ) ) {
+               free( a->a_realdn_pat.bv_val );
+       }
        if ( !BER_BVISNULL( &a->a_peername_pat ) ) {
                free( a->a_peername_pat.bv_val );
        }
@@ -2102,6 +2221,12 @@ access2str( slap_access_t access )
        } else if ( access == ACL_WRITE ) {
                return "write";
 
+       } else if ( access == ACL_WADD ) {
+               return "add";
+
+       } else if ( access == ACL_WDEL ) {
+               return "delete";
+
        } else if ( access == ACL_MANAGE ) {
                return "manage";
 
@@ -2117,6 +2242,10 @@ str2access( const char *str )
                return ACL_NONE;
 
        } else if ( strcasecmp( str, "disclose" ) == 0 ) {
+#ifndef SLAP_ACL_HONOR_DISCLOSE
+               fprintf( stderr, "str2access: warning, "
+                       "\"disclose\" privilege disabled.\n" );
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
                return ACL_DISCLOSE;
 
        } else if ( strcasecmp( str, "auth" ) == 0 ) {
@@ -2134,6 +2263,12 @@ str2access( const char *str )
        } else if ( strcasecmp( str, "write" ) == 0 ) {
                return ACL_WRITE;
 
+       } else if ( strcasecmp( str, "add" ) == 0 ) {
+               return ACL_WADD;
+
+       } else if ( strcasecmp( str, "delete" ) == 0 ) {
+               return ACL_WDEL;
+
        } else if ( strcasecmp( str, "manage" ) == 0 ) {
                return ACL_MANAGE;
        }
@@ -2145,6 +2280,52 @@ str2access( const char *str )
 
 static char aclbuf[ACLBUF_MAXLEN];
 
+static char *
+dnaccess2text( slap_dn_access *bdn, char *ptr, int is_realdn )
+{
+       *ptr++ = ' ';
+
+       if ( is_realdn ) {
+               ptr = lutil_strcopy( ptr, "real" );
+       }
+
+       if ( ber_bvccmp( &bdn->a_pat, '*' ) ||
+               bdn->a_style == ACL_STYLE_ANONYMOUS ||
+               bdn->a_style == ACL_STYLE_USERS ||
+               bdn->a_style == ACL_STYLE_SELF )
+       {
+               if ( is_realdn ) {
+                       assert( ! ber_bvccmp( &bdn->a_pat, '*' ) );
+               }
+                       
+               ptr = lutil_strcopy( ptr, bdn->a_pat.bv_val );
+               if ( bdn->a_style == ACL_STYLE_SELF && bdn->a_self_level != 0 ) {
+                       int n = sprintf( ptr, ".level{%d}", bdn->a_self_level );
+                       if ( n > 0 ) {
+                               ptr += n;
+                       } /* else ? */
+               }
+
+       } else {
+               ptr = lutil_strcopy( ptr, "dn." );
+               ptr = lutil_strcopy( ptr, style_strings[bdn->a_style] );
+               if ( bdn->a_style == ACL_STYLE_LEVEL ) {
+                       int n = sprintf( ptr, "{%d}", bdn->a_level );
+                       if ( n > 0 ) {
+                               ptr += n;
+                       } /* else ? */
+               }
+               if ( bdn->a_expand ) {
+                       ptr = lutil_strcopy( ptr, ",expand" );
+               }
+               *ptr++ = '=';
+               *ptr++ = '"';
+               ptr = lutil_strcopy( ptr, bdn->a_pat.bv_val );
+               *ptr++ = '"';
+       }
+       return ptr;
+}
+
 static char *
 access2text( Access *b, char *ptr )
 {
@@ -2153,29 +2334,21 @@ access2text( Access *b, char *ptr )
        ptr = lutil_strcopy( ptr, "\tby" );
 
        if ( !BER_BVISEMPTY( &b->a_dn_pat ) ) {
-               *ptr++ = ' ';
-               if ( ber_bvccmp( &b->a_dn_pat, '*' ) ||
-                       b->a_dn_style == ACL_STYLE_ANONYMOUS ||
-                       b->a_dn_style == ACL_STYLE_USERS ||
-                       b->a_dn_style == ACL_STYLE_SELF )
-               {
-                       ptr = lutil_strcopy( ptr, b->a_dn_pat.bv_val );
-
-               } else {
-                       ptr = lutil_strcopy( ptr, "dn." );
-                       ptr = lutil_strcopy( ptr, style_strings[b->a_dn_style] );
-                       *ptr++ = '=';
-                       *ptr++ = '"';
-                       ptr = lutil_strcopy( ptr, b->a_dn_pat.bv_val );
-                       *ptr++ = '"';
-               }
+               ptr = dnaccess2text( &b->a_dn, ptr, 0 );
        }
-
-       if ( b->a_dn_at != NULL ) {
+       if ( b->a_dn_at ) {
                ptr = lutil_strcopy( ptr, " dnattr=" );
                ptr = lutil_strcopy( ptr, b->a_dn_at->ad_cname.bv_val );
        }
 
+       if ( !BER_BVISEMPTY( &b->a_realdn_pat ) ) {
+               ptr = dnaccess2text( &b->a_realdn, ptr, 1 );
+       }
+       if ( b->a_realdn_at ) {
+               ptr = lutil_strcopy( ptr, " realdnattr=" );
+               ptr = lutil_strcopy( ptr, b->a_realdn_at->ad_cname.bv_val );
+       }
+
        if ( !BER_BVISEMPTY( &b->a_group_pat ) ) {
                ptr = lutil_strcopy( ptr, " group/" );
                ptr = lutil_strcopy( ptr, b->a_group_oc ?
@@ -2261,7 +2434,11 @@ access2text( Access *b, char *ptr )
        }
 
        *ptr++ = ' ';
-       if ( b->a_dn_self ) ptr = lutil_strcopy( ptr, "self" );
+       if ( b->a_dn_self ) {
+               ptr = lutil_strcopy( ptr, "self" );
+       } else if ( b->a_realdn_self ) {
+               ptr = lutil_strcopy( ptr, "realself" );
+       }
        ptr = lutil_strcopy( ptr, accessmask2str( b->a_access_mask, maskbuf, 0 ));
        if ( !maskbuf[0] ) ptr--;
 
@@ -2284,10 +2461,9 @@ access2text( Access *b, char *ptr )
 void
 acl_unparse( AccessControl *a, struct berval *bv )
 {
-       Access *b;
-       char *ptr;
-       int             to = 0;
-       struct berval abv;
+       Access  *b;
+       char    *ptr;
+       int     to = 0;
 
        bv->bv_val = aclbuf;
        bv->bv_len = 0;
@@ -2364,8 +2540,6 @@ acl_unparse( AccessControl *a, struct berval *bv )
 static void
 print_acl( Backend *be, AccessControl *a )
 {
-       int             to = 0;
-       Access  *b;
        struct berval bv;
 
        acl_unparse( a, &bv );
index d15fb7f3fcf34b4eb2de16fa7cf6ec623a235fbf..ada140c384376dfa99773559e47136840404144a 100644 (file)
@@ -49,7 +49,6 @@ do_add( Operation *op, SlapReply *rs )
        struct berval   dn = BER_BVNULL;
        ber_len_t       len;
        ber_tag_t       tag;
-       Entry           *e;
        Modifications   *modlist = NULL;
        Modifications   **modtail = &modlist;
        Modifications   tmp;
@@ -77,7 +76,7 @@ do_add( Operation *op, SlapReply *rs )
                return SLAPD_DISCONNECT;
        }
 
-       e = (Entry *) ch_calloc( 1, sizeof(Entry) );
+       op->ora_e = (Entry *) ch_calloc( 1, sizeof(Entry) );
 
        rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
                op->o_tmpmemctx );
@@ -88,10 +87,10 @@ do_add( Operation *op, SlapReply *rs )
                goto done;
        }
 
-       ber_dupbv( &e->e_name, &op->o_req_dn );
-       ber_dupbv( &e->e_nname, &op->o_req_ndn );
+       ber_dupbv( &op->ora_e->e_name, &op->o_req_dn );
+       ber_dupbv( &op->ora_e->e_nname, &op->o_req_ndn );
 
-       Debug( LDAP_DEBUG_ARGS, "do_add: dn (%s)\n", e->e_dn, 0, 0 );
+       Debug( LDAP_DEBUG_ARGS, "do_add: dn (%s)\n", op->ora_e->e_dn, 0, 0 );
 
        /* get the attrs */
        for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
@@ -150,22 +149,22 @@ do_add( Operation *op, SlapReply *rs )
        }
 
        Statslog( LDAP_DEBUG_STATS, "%s ADD dn=\"%s\"\n",
-           op->o_log_prefix, e->e_name.bv_val, 0, 0, 0 );
+           op->o_log_prefix, op->ora_e->e_name.bv_val, 0, 0, 0 );
 
-       if ( dn_match( &e->e_nname, &slap_empty_bv ) ) {
+       if ( dn_match( &op->ora_e->e_nname, &slap_empty_bv ) ) {
                /* protocolError may be a more appropriate error */
                send_ldap_error( op, rs, LDAP_ALREADY_EXISTS,
                        "root DSE already exists" );
                goto done;
 
-       } else if ( dn_match( &e->e_nname, &frontendDB->be_schemandn ) ) {
+       } else if ( dn_match( &op->ora_e->e_nname, &frontendDB->be_schemandn ) ) {
                send_ldap_error( op, rs, LDAP_ALREADY_EXISTS,
                        "subschema subentry already exists" );
                goto done;
        }
 
        rs->sr_err = slap_mods_check( modlist, &rs->sr_text,
-                         textbuf, textlen, NULL );
+               textbuf, textlen, NULL );
 
        if ( rs->sr_err != LDAP_SUCCESS ) {
                send_ldap_result( op, rs );
@@ -173,13 +172,23 @@ do_add( Operation *op, SlapReply *rs )
        }
 
        /* temporary; remove if not invoking backend function */
-       op->ora_e = e;
        op->ora_modlist = modlist;
 
        op->o_bd = frontendDB;
        rc = frontendDB->be_add( op, rs );
        if ( rc == 0 ) {
-               e = NULL;
+               if ( op->ora_e != NULL && op->o_private != NULL ) {
+                       BackendDB       *bd = op->o_bd;
+
+                       op->o_bd = (BackendDB *)op->o_private;
+                       op->o_private = NULL;
+
+                       be_entry_release_w( op, op->ora_e );
+
+                       op->ora_e = NULL;
+                       op->o_bd = bd;
+                       op->o_private = NULL;
+               }
        }
 
 done:;
@@ -188,8 +197,8 @@ done:;
        if ( modlist != NULL ) {
                slap_mods_free( modlist );
        }
-       if ( e != NULL ) {
-               entry_free( e );
+       if ( op->ora_e != NULL ) {
+               entry_free( op->ora_e );
        }
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
        op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
@@ -201,7 +210,6 @@ int
 fe_op_add( Operation *op, SlapReply *rs )
 {
        int             manageDSAit;
-       Entry           *e = op->ora_e;
        Modifications   *modlist = op->ora_modlist;
        Modifications   **modtail = &modlist;
        int             rc = 0;
@@ -214,10 +222,10 @@ fe_op_add( Operation *op, SlapReply *rs )
         * appropriate one, or send a referral to our "referral server"
         * if we don't hold it.
         */
-       op->o_bd = select_backend( &e->e_nname, manageDSAit, 1 );
+       op->o_bd = select_backend( &op->ora_e->e_nname, manageDSAit, 1 );
        if ( op->o_bd == NULL ) {
                rs->sr_ref = referral_rewrite( default_referral,
-                       NULL, &e->e_name, LDAP_SCOPE_DEFAULT );
+                       NULL, &op->ora_e->e_name, LDAP_SCOPE_DEFAULT );
                if ( !rs->sr_ref ) rs->sr_ref = default_referral;
                if ( rs->sr_ref ) {
                        rs->sr_err = LDAP_REFERRAL;
@@ -240,7 +248,7 @@ fe_op_add( Operation *op, SlapReply *rs )
        /* If we've got a glued backend, check the real backend */
        op_be = op->o_bd;
        if ( SLAP_GLUE_INSTANCE( op->o_bd )) {
-               op->o_bd = select_backend( &e->e_nname, manageDSAit, 0 );
+               op->o_bd = select_backend( &op->ora_e->e_nname, manageDSAit, 0 );
        }
 
        /* check restrictions */
@@ -255,7 +263,7 @@ fe_op_add( Operation *op, SlapReply *rs )
        }
 
 #ifdef LDAP_SLAPI
-       if ( op->o_pb ) init_add_pblock( op, &op->o_req_dn, e, manageDSAit );
+       if ( op->o_pb ) init_add_pblock( op, &op->o_req_dn, op->ora_e, manageDSAit );
 #endif /* LDAP_SLAPI */
 
        /*
@@ -308,8 +316,8 @@ fe_op_add( Operation *op, SlapReply *rs )
                                }
                        }
 
-                       rs->sr_err = slap_mods2entry( modlist, &e, repl_user, 0,
-                               &rs->sr_text, textbuf, textlen );
+                       rs->sr_err = slap_mods2entry( modlist, &op->ora_e,
+                               repl_user, 0, &rs->sr_text, textbuf, textlen );
                        if ( rs->sr_err != LDAP_SUCCESS ) {
                                send_ldap_result( op, rs );
                                goto done;
@@ -329,7 +337,6 @@ fe_op_add( Operation *op, SlapReply *rs )
                        }
 #endif /* LDAP_SLAPI */
 
-                       op->ora_e = e;
 #ifdef SLAPD_MULTIMASTER
                        if ( !repl_user )
 #endif
@@ -337,16 +344,14 @@ fe_op_add( Operation *op, SlapReply *rs )
                                cb.sc_next = op->o_callback;
                                op->o_callback = &cb;
                        }
-                       rc = (op->o_bd->be_add)( op, rs );
-                       if ( rc == 0 ) {
-                               /* FIXME: be_entry_release_w() should be
+                       rc = op->o_bd->be_add( op, rs );
+                       if ( rc == LDAP_SUCCESS ) {
+                               /* NOTE: be_entry_release_w() is
                                 * called by do_add(), so that global
                                 * overlays on the way back can
                                 * at least read the entry */
-                               be_entry_release_w( op, e );
-                               e = NULL;
+                               op->o_private = op->o_bd;
                        }
-                       op->ora_e = NULL;
 
 #ifndef SLAPD_MULTIMASTER
                } else {
@@ -370,7 +375,7 @@ fe_op_add( Operation *op, SlapReply *rs )
 
                        if ( defref != NULL ) {
                                rs->sr_ref = referral_rewrite( defref,
-                                       NULL, &e->e_name, LDAP_SCOPE_DEFAULT );
+                                       NULL, &op->ora_e->e_name, LDAP_SCOPE_DEFAULT );
                                if ( rs->sr_ref == NULL ) rs->sr_ref = defref;
                                rs->sr_err = LDAP_REFERRAL;
                                if (!rs->sr_ref) rs->sr_ref = default_referral;
@@ -499,56 +504,34 @@ slap_mods2entry(
 
                if( mods->sml_values[1].bv_val != NULL ) {
                        /* check for duplicates */
-                       int             i, j;
+                       int             i, j, rc, match;
                        MatchingRule *mr = mods->sml_desc->ad_type->sat_equality;
 
-                       /* check if the values we're adding already exist */
-                       if( mr == NULL || !mr->smr_match ) {
-                               for ( i = 1; mods->sml_values[i].bv_val != NULL; i++ ) {
-                                       /* test asserted values against themselves */
-                                       for( j = 0; j < i; j++ ) {
-                                               if ( bvmatch( &mods->sml_values[i],
-                                                       &mods->sml_values[j] ) )
-                                               {
-                                                       /* value exists already */
-                                                       snprintf( textbuf, textlen,
-                                                               "%s: value #%d provided more than once",
-                                                               mods->sml_desc->ad_cname.bv_val, j );
-                                                       return LDAP_TYPE_OR_VALUE_EXISTS;
-                                               }
-                                       }
-                               }
-
-                       } else {
-                               int     rc;
-                               int match;
-
-                               for ( i = 1; mods->sml_values[i].bv_val != NULL; i++ ) {
-                                       /* test asserted values against themselves */
-                                       for( j = 0; j < i; j++ ) {
-                                               rc = value_match( &match, mods->sml_desc, mr,
-                                                       SLAP_MR_EQUALITY
-                                                       | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
-                                                       | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
-                                                       | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
-                                                       mods->sml_nvalues
-                                                               ? &mods->sml_nvalues[i]
-                                                               : &mods->sml_values[i],
-                                                       mods->sml_nvalues
-                                                               ? &mods->sml_nvalues[j]
-                                                               : &mods->sml_values[j],
-                                                       text );
-
-                                               if ( rc == LDAP_SUCCESS && match == 0 ) {
-                                                       /* value exists already */
-                                                       snprintf( textbuf, textlen,
-                                                               "%s: value #%d provided more than once",
-                                                               mods->sml_desc->ad_cname.bv_val, j );
-                                                       return LDAP_TYPE_OR_VALUE_EXISTS;
-
-                                               } else if ( rc != LDAP_SUCCESS ) {
-                                                       return rc;
-                                               }
+                       for ( i = 1; mods->sml_values[i].bv_val != NULL; i++ ) {
+                               /* test asserted values against themselves */
+                               for( j = 0; j < i; j++ ) {
+                                       rc = ordered_value_match( &match, mods->sml_desc, mr,
+                                               SLAP_MR_EQUALITY
+                                               | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
+                                               | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
+                                               | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
+                                               mods->sml_nvalues
+                                                       ? &mods->sml_nvalues[i]
+                                                       : &mods->sml_values[i],
+                                               mods->sml_nvalues
+                                                       ? &mods->sml_nvalues[j]
+                                                       : &mods->sml_values[j],
+                                               text );
+
+                                       if ( rc == LDAP_SUCCESS && match == 0 ) {
+                                               /* value exists already */
+                                               snprintf( textbuf, textlen,
+                                                       "%s: value #%d provided more than once",
+                                                       mods->sml_desc->ad_cname.bv_val, j );
+                                               return LDAP_TYPE_OR_VALUE_EXISTS;
+
+                                       } else if ( rc != LDAP_SUCCESS ) {
+                                               return rc;
                                        }
                                }
                        }
index 7958a1ec3987b154c4916f71742ddcd80ab56656..14ed55b749c779902a5ddbb20865fefa50fc3e8b 100644 (file)
@@ -58,8 +58,8 @@ struct aindexrec {
 
 static Avlnode *attr_index = NULL;
 static Avlnode *attr_cache = NULL;
-static LDAP_SLIST_HEAD(ATList, slap_attribute_type) attr_list
-       = LDAP_SLIST_HEAD_INITIALIZER(&attr_list);
+static LDAP_STAILQ_HEAD(ATList, slap_attribute_type) attr_list
+       = LDAP_STAILQ_HEAD_INITIALIZER(attr_list);
 
 int at_oc_cache;
 
@@ -210,9 +210,9 @@ at_destroy( void )
        AttributeType *a;
        avl_free(attr_index, ldap_memfree);
 
-       while( !LDAP_SLIST_EMPTY(&attr_list) ) {
-               a = LDAP_SLIST_FIRST(&attr_list);
-               LDAP_SLIST_REMOVE_HEAD(&attr_list, sat_next);
+       while( !LDAP_STAILQ_EMPTY(&attr_list) ) {
+               a = LDAP_STAILQ_FIRST(&attr_list);
+               LDAP_STAILQ_REMOVE_HEAD(&attr_list, sat_next);
 
                if (a->sat_subtypes) ldap_memfree(a->sat_subtypes);
                ad_destroy(a->sat_ad);
@@ -230,7 +230,7 @@ at_start( AttributeType **at )
 {
        assert( at );
 
-       *at = LDAP_SLIST_FIRST(&attr_list);
+       *at = LDAP_STAILQ_FIRST(&attr_list);
 
        return (*at != NULL);
 }
@@ -244,7 +244,7 @@ at_next( AttributeType **at )
        {
                AttributeType *tmp = NULL;
 
-               LDAP_SLIST_FOREACH(tmp,&attr_list,sat_next) {
+               LDAP_STAILQ_FOREACH(tmp,&attr_list,sat_next) {
                        if ( tmp == *at ) {
                                break;
                        }
@@ -254,11 +254,61 @@ at_next( AttributeType **at )
        }
 #endif
 
-       *at = LDAP_SLIST_NEXT(*at,sat_next);
+       *at = LDAP_STAILQ_NEXT(*at,sat_next);
 
        return (*at != NULL);
 }
-       
+
+/*
+ * check whether the two attributeTypes actually __are__ identical,
+ * or rather inconsistent
+ */
+static int
+at_check_dup(
+       AttributeType           *sat,
+       AttributeType           *new_sat )
+{
+       if ( new_sat->sat_oid != NULL ) {
+               if ( sat->sat_oid == NULL ) {
+                       return SLAP_SCHERR_ATTR_INCONSISTENT;
+               }
+
+               if ( strcmp( sat->sat_oid, new_sat->sat_oid ) != 0 ) {
+                       return SLAP_SCHERR_ATTR_INCONSISTENT;
+               }
+
+       } else {
+               if ( sat->sat_oid != NULL ) {
+                       return SLAP_SCHERR_ATTR_INCONSISTENT;
+               }
+       }
+
+       if ( new_sat->sat_names ) {
+               int     i;
+
+               if ( sat->sat_names == NULL ) {
+                       return SLAP_SCHERR_ATTR_INCONSISTENT;
+               }
+
+               for ( i = 0; new_sat->sat_names[ i ]; i++ ) {
+                       if ( sat->sat_names[ i ] == NULL ) {
+                               return SLAP_SCHERR_ATTR_INCONSISTENT;
+                       }
+                       
+                       if ( strcasecmp( sat->sat_names[ i ],
+                                       new_sat->sat_names[ i ] ) != 0 )
+                       {
+                               return SLAP_SCHERR_ATTR_INCONSISTENT;
+                       }
+               }
+       } else {
+               if ( sat->sat_names != NULL ) {
+                       return SLAP_SCHERR_ATTR_INCONSISTENT;
+               }
+       }
+
+       return SLAP_SCHERR_ATTR_DUP;
+}
 
 
 static int
@@ -269,8 +319,6 @@ at_insert(
        struct aindexrec        *air;
        char                    **names;
 
-       LDAP_SLIST_NEXT( sat, sat_next ) = NULL;
-       LDAP_SLIST_INSERT_HEAD( &attr_list, sat, sat_next );
 
        if ( sat->sat_oid ) {
                air = (struct aindexrec *)
@@ -279,16 +327,27 @@ at_insert(
                air->air_name.bv_len = strlen(sat->sat_oid);
                air->air_at = sat;
                if ( avl_insert( &attr_index, (caddr_t) air,
-                                attr_index_cmp, avl_dup_error ) ) {
+                                attr_index_cmp, avl_dup_error ) )
+               {
+                       AttributeType   *old_sat;
+                       int             rc;
+
                        *err = sat->sat_oid;
-                       ldap_memfree(air);
-                       return SLAP_SCHERR_ATTR_DUP;
+
+                       old_sat = at_bvfind( &air->air_name );
+                       assert( old_sat != NULL );
+                       rc = at_check_dup( old_sat, sat );
+
+                       ldap_memfree( air );
+
+                       return rc;
                }
                /* FIX: temporal consistency check */
-               at_bvfind(&air->air_name);
+               at_bvfind( &air->air_name );
        }
 
-       if ( (names = sat->sat_names) ) {
+       names = sat->sat_names;
+       if ( names ) {
                while ( *names ) {
                        air = (struct aindexrec *)
                                ch_calloc( 1, sizeof(struct aindexrec) );
@@ -296,10 +355,20 @@ at_insert(
                        air->air_name.bv_len = strlen(*names);
                        air->air_at = sat;
                        if ( avl_insert( &attr_index, (caddr_t) air,
-                                        attr_index_cmp, avl_dup_error ) ) {
+                                        attr_index_cmp, avl_dup_error ) )
+                       {
+                               AttributeType   *old_sat;
+                               int             rc;
+
                                *err = *names;
+
+                               old_sat = at_bvfind( &air->air_name );
+                               assert( old_sat != NULL );
+                               rc = at_check_dup( old_sat, sat );
+
                                ldap_memfree(air);
-                               return SLAP_SCHERR_ATTR_DUP;
+
+                               return rc;
                        }
                        /* FIX: temporal consistency check */
                        at_bvfind(&air->air_name);
@@ -307,12 +376,16 @@ at_insert(
                }
        }
 
+       LDAP_STAILQ_INSERT_TAIL( &attr_list, sat, sat_next );
+
        return 0;
 }
 
 int
 at_add(
     LDAPAttributeType  *at,
+       int                             user,
+       AttributeType   **rsat,
     const char         **err )
 {
        AttributeType   *sat;
@@ -322,6 +395,7 @@ at_add(
        int             code;
        char    *cname;
        char    *oid;
+       char    *oidm = NULL;
 
        if ( !OID_LEADCHAR( at->at_oid[0] )) {
                /* Expand OID macros */
@@ -331,7 +405,7 @@ at_add(
                        return SLAP_SCHERR_OIDM;
                }
                if ( oid != at->at_oid ) {
-                       ldap_memfree( at->at_oid );
+                       oidm = at->at_oid;
                        at->at_oid = oid;
                }
        }
@@ -393,6 +467,7 @@ at_add(
 
        sat->sat_cname.bv_val = cname;
        sat->sat_cname.bv_len = strlen( cname );
+       sat->sat_oidmacro = oidm;
        ldap_pvt_thread_mutex_init(&sat->sat_ad_mutex);
 
        if ( at->at_sup_oid ) {
@@ -438,6 +513,29 @@ at_add(
                sat->sat_substr = sat->sat_sup->sat_substr;
        }
 
+       /*
+        * check for X-ORDERED attributes
+        */
+       if ( sat->sat_extensions ) {
+               for (i=0; sat->sat_extensions[i]; i++) {
+                       if (!strcasecmp( sat->sat_extensions[i]->lsei_name,
+                               "X-ORDERED" ) && sat->sat_extensions[i]->lsei_values ) {
+                               if ( !strcasecmp( sat->sat_extensions[i]->lsei_values[0],
+                                       "VALUES" )) {
+                                       sat->sat_flags |= SLAP_AT_ORDERED_VAL;
+                                       break;
+                               } else if ( !strcasecmp( sat->sat_extensions[i]->lsei_values[0],
+                                       "SIBLINGS" )) {
+                                       sat->sat_flags |= SLAP_AT_ORDERED_SIB;
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       if ( !user )
+               sat->sat_flags |= SLAP_AT_HARDCODE;
+
        if ( at->at_syntax_oid ) {
                syn = syn_find(sat->sat_syntax_oid);
                if ( syn == NULL ) {
@@ -578,7 +676,9 @@ at_add(
                sat->sat_substr = mr;
        }
 
-       code = at_insert(sat,err);
+       code = at_insert( sat, err );
+       if ( code == 0 && rsat )
+               *rsat = sat;
        return code;
 }
 
@@ -601,6 +701,63 @@ at_index_print( void )
 }
 #endif
 
+void
+at_unparse( BerVarray *res, AttributeType *start, AttributeType *end, int sys )
+{
+       AttributeType *at;
+       int i, num;
+       struct berval bv, *bva = NULL, idx;
+       char ibuf[32];
+
+       if ( !start )
+               start = LDAP_STAILQ_FIRST( &attr_list );
+
+       /* count the result size */
+       i = 0;
+       for ( at=start; at; at=LDAP_STAILQ_NEXT(at, sat_next)) {
+               if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) continue;
+               i++;
+               if ( at == end ) break;
+       }
+       if (!i) return;
+
+       num = i;
+       bva = ch_malloc( (num+1) * sizeof(struct berval) );
+       BER_BVZERO( bva );
+       idx.bv_val = ibuf;
+       if ( sys ) {
+               idx.bv_len = 0;
+               ibuf[0] = '\0';
+       }
+       i = 0;
+       for ( at=start; at; at=LDAP_STAILQ_NEXT(at, sat_next)) {
+               LDAPAttributeType lat, *latp;
+               if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) continue;
+               if ( at->sat_oidmacro ) {
+                       lat = at->sat_atype;
+                       lat.at_oid = at->sat_oidmacro;
+                       latp = &lat;
+               } else {
+                       latp = &at->sat_atype;
+               }
+               if ( ldap_attributetype2bv( latp, &bv ) == NULL ) {
+                       ber_bvarray_free( bva );
+               }
+               if ( !sys ) {
+                       idx.bv_len = sprintf(idx.bv_val, "{%d}", i);
+               }
+               bva[i].bv_len = idx.bv_len + bv.bv_len;
+               bva[i].bv_val = ch_malloc( bva[i].bv_len + 1 );
+               strcpy( bva[i].bv_val, ibuf );
+               strcpy( bva[i].bv_val + idx.bv_len, bv.bv_val );
+               i++;
+               bva[i].bv_val = NULL;
+               ldap_memfree( bv.bv_val );
+               if ( at == end ) break;
+       }
+       *res = bva;
+}
+
 int
 at_schema_info( Entry *e )
 {
@@ -609,15 +766,14 @@ at_schema_info( Entry *e )
        struct berval   val;
        struct berval   nval;
 
-       LDAP_SLIST_FOREACH(at,&attr_list,sat_next) {
+       LDAP_STAILQ_FOREACH(at,&attr_list,sat_next) {
                if( at->sat_flags & SLAP_AT_HIDE ) continue;
 
                if ( ldap_attributetype2bv( &at->sat_atype, &val ) == NULL ) {
                        return -1;
                }
 
-               nval.bv_val = at->sat_oid;
-               nval.bv_len = strlen(at->sat_oid);
+               ber_str2bv( at->sat_oid, 0, 0, &nval );
 
                if( attr_merge_one( e, ad_attributeTypes, &val, &nval ) )
                {
index ee0f46daabc5d87fc631f06bb2c5f13295a6d49c..5e0b3e6e99191e816289e5f568e885213f7f71eb 100644 (file)
@@ -192,6 +192,13 @@ attr_merge(
 #ifdef LDAP_COMP_MATCH
                (*a)->a_comp_data = NULL;
 #endif
+       } else {
+               /*
+                * FIXME: if the attribute already exists, the presence
+                * of nvals and the value of (*a)->a_nvals must be consistent
+                */
+               assert( ( nvals == NULL && (*a)->a_nvals == (*a)->a_vals )
+                               || ( nvals != NULL && (*a)->a_nvals != (*a)->a_vals ) );
        }
 
        rc = value_add( &(*a)->a_vals, vals );
index d0df3d7c263547e18036666bcf53ecd57060b575..48c9b5a03f8c2516c91e9b39db324e721bfe6ac6 100644 (file)
@@ -43,6 +43,10 @@ ava_free(
        AttributeAssertion *ava,
        int     freeit )
 {
+#ifdef LDAP_COMP_MATCH
+       if ( ava->aa_cf && ava->aa_cf->cf_ca->ca_comp_data.cd_mem_op )
+               nibble_mem_free ( ava->aa_cf->cf_ca->ca_comp_data.cd_mem_op );
+#endif
        op->o_tmpfree( ava->aa_value.bv_val, op->o_tmpmemctx );
        if ( freeit ) op->o_tmpfree( (char *) ava, op->o_tmpmemctx );
 }
index f439138a523a89bcc42706659835b1ac117fd1eb..0eeb6a75cd56ceaba58e2bc303a7943c5ebc3f24 100644 (file)
@@ -18,14 +18,14 @@ SRCS = init.c tools.c config.c \
        extended.c referral.c operational.c \
        attr.c index.c key.c dbcache.c filterindex.c \
        dn2entry.c dn2id.c error.c id2entry.c idl.c \
-       nextid.c cache.c trans.c
+       nextid.c cache.c trans.c alock.c
 
 OBJS = init.lo tools.lo config.lo \
        add.lo bind.lo compare.lo delete.lo modify.lo modrdn.lo search.lo \
        extended.lo referral.lo operational.lo \
        attr.lo index.lo key.lo dbcache.lo filterindex.lo \
        dn2entry.lo dn2id.lo error.lo id2entry.lo idl.lo \
-       nextid.lo cache.lo trans.lo
+       nextid.lo cache.lo trans.lo alock.lo
 
 LDAP_INCDIR= ../../../include       
 LDAP_LIBDIR= ../../../libraries
index f94448412c549af4b33443f1abd7ea23d3fc433a..7db122d5bf4e25e72b60bf8ada3e431ce232f040 100644 (file)
@@ -95,6 +95,10 @@ retry:       /* transaction retry */
                        rs->sr_text = "internal error";
                        goto return_results;
                }
+               if ( op->o_abandon ) {
+                       rs->sr_err = SLAPD_ABANDON;
+                       goto return_results;
+               }
                ldap_pvt_thread_yield();
                bdb_trans_backoff( ++num_retries );
        }
@@ -177,7 +181,7 @@ retry:      /* transaction retry */
                }
 
                rs->sr_err = access_allowed( op, p,
-                       children, NULL, ACL_WRITE, NULL );
+                       children, NULL, ACL_WADD, NULL );
 
                if ( ! rs->sr_err ) {
                        switch( opinfo.boi_err ) {
@@ -272,7 +276,7 @@ retry:      /* transaction retry */
        }
 
        rs->sr_err = access_allowed( op, op->oq_add.rs_e,
-               entry, NULL, ACL_WRITE, NULL );
+               entry, NULL, ACL_WADD, NULL );
 
        if ( ! rs->sr_err ) {
                switch( opinfo.boi_err ) {
diff --git a/servers/slapd/back-bdb/alock.c b/servers/slapd/back-bdb/alock.c
new file mode 100644 (file)
index 0000000..897cda3
--- /dev/null
@@ -0,0 +1,623 @@
+/* alock.c - access lock library */
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2005 The OpenLDAP Foundation.
+ * Portions Copyright 2004-2005 Symas Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Matthew Backes at Symas
+ * Corporation for inclusion in OpenLDAP Software.
+ */
+
+#include "portable.h"
+#include "alock.h"
+
+#include <ac/stdlib.h>
+#include <ac/string.h>
+#include <ac/unistd.h>
+#include <ac/errno.h>
+#include <ac/assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/file.h>
+#include <fcntl.h>
+
+#ifdef _WIN32
+#include <stdio.h>
+#include <io.h>
+#include <sys/locking.h>
+#endif
+
+
+static int
+alock_grab_lock ( int fd, int slot )
+{
+       int res;
+       
+#if defined( HAVE_LOCKF )
+       res = lseek (fd, (off_t) (ALOCK_SLOT_SIZE * slot), SEEK_SET);
+       if (res == -1) return -1;
+       res = lockf (fd, F_LOCK, (off_t) ALOCK_SLOT_SIZE);
+#elif defined( HAVE_FCNTL )
+       struct flock lock_info;
+       (void) memset ((void *) &lock_info, 0, sizeof (struct flock));
+
+       lock_info.l_type = F_WRLCK;
+       lock_info.l_whence = SEEK_SET;
+       lock_info.l_start = (off_t) (ALOCK_SLOT_SIZE * slot);
+       lock_info.l_len = (off_t) ALOCK_SLOT_SIZE;
+
+       res = fcntl (fd, F_SETLKW, &lock_info);
+#elif defined( _WIN32 )
+       if( _lseek( fd, (ALOCK_SLOT_SIZE * slot), SEEK_SET ) < 0 )
+               return -1;
+       /*
+        * _lock will try for the lock once per second, returning EDEADLOCK
+        * after ten tries. We just loop until we either get the lock
+        * or some other error is returned.
+        */
+       while((res = _locking( fd, _LK_LOCK, ALOCK_SLOT_SIZE )) < 0 ) {
+               if( errno != EDEADLOCK )
+                       break;
+       }
+#else
+#   error alock needs lockf, fcntl, or _locking
+#endif
+       if (res == -1) {
+               assert (errno != EDEADLK);
+               return -1;
+       }
+       return 0;
+}
+
+static int
+alock_release_lock ( int fd, int slot )
+{
+       int res;
+       
+#if defined( HAVE_LOCKF )
+       res = lseek (fd, (off_t) (ALOCK_SLOT_SIZE * slot), SEEK_SET);
+       if (res == -1) return -1;
+       res = lockf (fd, F_ULOCK, (off_t) ALOCK_SLOT_SIZE);
+       if (res == -1) return -1;
+#elif defined ( HAVE_FCNTL )
+       struct flock lock_info;
+       (void) memset ((void *) &lock_info, 0, sizeof (struct flock));
+
+       lock_info.l_type = F_UNLCK;
+       lock_info.l_whence = SEEK_SET;
+       lock_info.l_start = (off_t) (ALOCK_SLOT_SIZE * slot);
+       lock_info.l_len = (off_t) ALOCK_SLOT_SIZE;
+
+       res = fcntl (fd, F_SETLKW, &lock_info);
+       if (res == -1) return -1;
+#elif defined( _WIN32 )
+       res = _lseek (fd, (ALOCK_SLOT_SIZE * slot), SEEK_SET);
+       if (res == -1) return -1;
+       res = _locking( fd, _LK_UNLCK, ALOCK_SLOT_SIZE );
+       if (res == -1) return -1;
+#else
+#   error alock needs lockf, fcntl, or _locking
+#endif
+
+       return 0;
+}
+
+static int
+alock_test_lock ( int fd, int slot )
+{
+       int res;
+
+#if defined( HAVE_LOCKF )
+       res = lseek (fd, (off_t) (ALOCK_SLOT_SIZE * slot), SEEK_SET);
+       if (res == -1) return -1;
+
+       res = lockf (fd, F_TEST, (off_t) ALOCK_SLOT_SIZE);
+       if (res == -1) {
+               if (errno == EACCES) { 
+                       return ALOCK_LOCKED;
+               } else {
+                       return -1;
+               }
+       }
+#elif defined( HAVE_FCNTL )
+       struct flock lock_info;
+       (void) memset ((void *) &lock_info, 0, sizeof (struct flock));
+
+       lock_info.l_type = F_WRLCK;
+       lock_info.l_whence = SEEK_SET;
+       lock_info.l_start = (off_t) (ALOCK_SLOT_SIZE * slot);
+       lock_info.l_len = (off_t) ALOCK_SLOT_SIZE;
+
+       res = fcntl (fd, F_GETLK, &lock_info);
+       if (res == -1) return -1;
+
+       if (lock_info.l_type != F_UNLCK) return ALOCK_LOCKED;
+#elif defined( _WIN32 )
+       res = _lseek (fd, (ALOCK_SLOT_SIZE * slot), SEEK_SET);
+       if (res == -1) return -1;
+       res = _locking( fd, _LK_NBLCK, ALOCK_SLOT_SIZE );
+       _locking( fd, _LK_UNLCK, ALOCK_SLOT_SIZE );
+       if (res == -1) {
+          if( errno == EACCES ) {
+                  return ALOCK_LOCKED;
+          } else {
+                  return -1;
+          }
+       }
+#else
+#   error alock needs lockf, fcntl, or _locking
+#endif
+       
+       return 0;
+}
+
+/* Read a 64bit LE value */
+static unsigned long int
+alock_read_iattr ( unsigned char * bufptr )
+{
+       unsigned long int val = 0;
+       int count;
+
+       assert (bufptr != NULL);
+
+       bufptr += sizeof (unsigned long int);
+       for (count=0; count <= sizeof (unsigned long int); ++count) {
+               val <<= 8;
+               val += (unsigned long int) *bufptr--;
+       }
+
+       return val;
+}
+
+/* Write a 64bit LE value */
+static void
+alock_write_iattr ( unsigned char * bufptr,
+                   unsigned long int val )
+{
+       int count;
+
+       assert (bufptr != NULL);
+
+       for (count=0; count < 8; ++count) {
+               *bufptr++ = (unsigned char) (val & 0xff);
+               val >>= 8;
+       }
+}
+
+static int
+alock_read_slot ( alock_info_t * info,
+                 alock_slot_t * slot_data )
+{
+       unsigned char slotbuf [ALOCK_SLOT_SIZE];
+       int res, size, size_total, err;
+
+       assert (info != NULL);
+       assert (slot_data != NULL);
+       assert (info->al_slot > 0);
+
+       res = lseek (info->al_fd, 
+                    (off_t) (ALOCK_SLOT_SIZE * info->al_slot), 
+                    SEEK_SET);
+       if (res == -1) return -1;
+
+       size_total = 0;
+       while (size_total < ALOCK_SLOT_SIZE) {
+               size = read (info->al_fd, 
+                            slotbuf + size_total, 
+                            ALOCK_SLOT_SIZE - size_total);
+               if (size == 0) return -1;
+               if (size < 0) {
+                       err = errno;
+                       if (err != EINTR && err != EAGAIN) return -1;
+               } else {
+                       size_total += size;
+               }
+       }
+       
+       if (alock_read_iattr (slotbuf) != ALOCK_MAGIC) {
+               return 1;
+       }
+       slot_data->al_lock  = alock_read_iattr (slotbuf+8);
+       slot_data->al_stamp = alock_read_iattr (slotbuf+16);
+       slot_data->al_pid   = alock_read_iattr (slotbuf+24);
+
+       if (slot_data->al_appname) free (slot_data->al_appname);
+       slot_data->al_appname = calloc (1, ALOCK_MAX_APPNAME);
+       strncpy (slot_data->al_appname, slotbuf+32, ALOCK_MAX_APPNAME-1);
+       (slot_data->al_appname) [ALOCK_MAX_APPNAME-1] = '\0';
+
+       return 0;
+}
+
+static int
+alock_write_slot ( alock_info_t * info,
+                  alock_slot_t * slot_data )
+{
+       unsigned char slotbuf [ALOCK_SLOT_SIZE];
+       int res, size, size_total, err;
+
+       assert (info != NULL);
+       assert (slot_data != NULL);
+       assert (info->al_slot > 0);
+
+       (void) memset ((void *) slotbuf, 0, ALOCK_SLOT_SIZE);
+       
+       alock_write_iattr (slotbuf,    ALOCK_MAGIC);
+       assert (alock_read_iattr (slotbuf) == ALOCK_MAGIC);
+       alock_write_iattr (slotbuf+8,  slot_data->al_lock);
+       alock_write_iattr (slotbuf+16, slot_data->al_stamp);
+       alock_write_iattr (slotbuf+24, slot_data->al_pid);
+
+       strncpy (slotbuf+32, slot_data->al_appname, ALOCK_MAX_APPNAME-1);
+       slotbuf[ALOCK_SLOT_SIZE-1] = '\0';
+
+       res = lseek (info->al_fd, 
+                    (off_t) (ALOCK_SLOT_SIZE * info->al_slot),
+                    SEEK_SET);
+       if (res == -1) return -1;
+
+       size_total = 0;
+       while (size_total < ALOCK_SLOT_SIZE) {
+               size = write (info->al_fd, 
+                             slotbuf + size_total, 
+                             ALOCK_SLOT_SIZE - size_total);
+               if (size == 0) return -1;
+               if (size < 0) {
+                       err = errno;
+                       if (err != EINTR && err != EAGAIN) return -1;
+               } else {
+                       size_total += size;
+               }
+       }
+       
+       return 0;
+}
+
+static int
+alock_query_slot ( alock_info_t * info )
+{
+       int res;
+       alock_slot_t slot_data;
+
+       assert (info != NULL);
+       assert (info->al_slot > 0);
+       
+       (void) memset ((void *) &slot_data, 0, sizeof (alock_slot_t));
+       alock_read_slot (info, &slot_data);
+       if (slot_data.al_lock == ALOCK_UNLOCKED) return ALOCK_UNLOCKED;
+
+       if (slot_data.al_appname != NULL) free (slot_data.al_appname);
+       slot_data.al_appname = NULL;
+
+       res = alock_test_lock (info->al_fd, info->al_slot);
+       if (res < 0) return -1;
+       if (res > 0) {
+               if (slot_data.al_lock == ALOCK_UNIQUE) {
+                       return ALOCK_UNIQUE;
+               } else {
+                       return ALOCK_LOCKED;
+               }
+       }
+       
+       return ALOCK_DIRTY;
+}
+
+int 
+alock_open ( alock_info_t * info,
+            const char * appname,
+            const char * envdir,
+            int locktype )
+{
+       struct stat statbuf;
+       alock_info_t scan_info;
+       alock_slot_t slot_data;
+       char * filename;
+       int res, max_slot;
+       int dirty_count, live_count;
+
+       assert (info != NULL);
+       assert (appname != NULL);
+       assert (envdir != NULL);
+       assert (locktype >= 1 && locktype <= 2);
+
+       slot_data.al_lock = locktype;
+       slot_data.al_stamp = time(NULL);
+       slot_data.al_pid = getpid();
+       slot_data.al_appname = calloc (1, ALOCK_MAX_APPNAME);
+       strncpy (slot_data.al_appname, appname, ALOCK_MAX_APPNAME-1);
+       slot_data.al_appname [ALOCK_MAX_APPNAME-1] = '\0';
+
+       filename = calloc (1, strlen (envdir) + strlen ("/alock") + 1);
+       strcpy (filename, envdir);
+       strcat (filename, "/alock");
+       info->al_fd = open (filename, O_CREAT|O_RDWR, 0666);
+       free (filename);
+       if (info->al_fd < 0) {
+               free (slot_data.al_appname);
+               return ALOCK_UNSTABLE;
+       }
+       info->al_slot = 0;
+
+       res = alock_grab_lock (info->al_fd, 0);
+       if (res == -1) { 
+               close (info->al_fd);
+               free (slot_data.al_appname);
+               return ALOCK_UNSTABLE;
+       }
+
+       res = fstat (info->al_fd, &statbuf);
+       if (res == -1) { 
+               close (info->al_fd);
+               free (slot_data.al_appname);
+               return ALOCK_UNSTABLE;
+       }
+
+       max_slot = (statbuf.st_size + ALOCK_SLOT_SIZE - 1) / ALOCK_SLOT_SIZE;
+       dirty_count = 0;
+       live_count = 0;
+       scan_info.al_fd = info->al_fd;
+       for (scan_info.al_slot = 1; 
+            scan_info.al_slot < max_slot;
+            ++ scan_info.al_slot) {
+               if (scan_info.al_slot != info->al_slot) {
+                       res = alock_query_slot (&scan_info);
+
+                       if (res == ALOCK_UNLOCKED
+                           && info->al_slot == 0) {
+                               info->al_slot = scan_info.al_slot;
+
+                       } else if (res == ALOCK_LOCKED) {
+                               ++live_count;
+
+                       } else if (res == ALOCK_UNIQUE
+                               && locktype == ALOCK_UNIQUE) {
+                               close (info->al_fd);
+                               free (slot_data.al_appname);
+                               return ALOCK_BUSY;
+
+                       } else if (res == ALOCK_DIRTY) {
+                               ++dirty_count;
+
+                       } else if (res == -1) {
+                               close (info->al_fd);
+                               free (slot_data.al_appname);
+                               return ALOCK_UNSTABLE;
+
+                       }
+               }
+       }
+
+       if (dirty_count && live_count) {
+               close (info->al_fd);
+               free (slot_data.al_appname);
+               return ALOCK_UNSTABLE;
+       }
+       
+       if (info->al_slot == 0) info->al_slot = max_slot + 1;
+       res = alock_grab_lock (info->al_fd,
+                              info->al_slot);
+       if (res == -1) { 
+               close (info->al_fd);
+               free (slot_data.al_appname);
+               return ALOCK_UNSTABLE;
+       }
+       res = alock_write_slot (info, &slot_data);
+       free (slot_data.al_appname);
+       if (res == -1) { 
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       res = alock_release_lock (info->al_fd, 0);
+       if (res == -1) { 
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+       
+       if (dirty_count) return ALOCK_RECOVER;
+       return ALOCK_CLEAN;
+}
+
+int 
+alock_scan ( alock_info_t * info )
+{
+       struct stat statbuf;
+       alock_info_t scan_info;
+       int res, max_slot;
+       int dirty_count, live_count;
+
+       assert (info != NULL);
+
+       scan_info.al_fd = info->al_fd;
+
+       res = alock_grab_lock (info->al_fd, 0);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       res = fstat (info->al_fd, &statbuf);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       max_slot = (statbuf.st_size + ALOCK_SLOT_SIZE - 1) / ALOCK_SLOT_SIZE;
+       dirty_count = 0;
+       live_count = 0;
+       for (scan_info.al_slot = 1; 
+            scan_info.al_slot < max_slot;
+            ++ scan_info.al_slot) {
+               if (scan_info.al_slot != info->al_slot) {
+                       res = alock_query_slot (&scan_info);
+
+                       if (res == ALOCK_LOCKED) {
+                               ++live_count;
+                               
+                       } else if (res == ALOCK_DIRTY) {
+                               ++dirty_count;
+
+                       } else if (res == -1) {
+                               close (info->al_fd);
+                               return ALOCK_UNSTABLE;
+
+                       }
+               }
+       }
+
+       res = alock_release_lock (info->al_fd, 0);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       if (dirty_count) {
+               if (live_count) {
+                       close (info->al_fd);
+                       return ALOCK_UNSTABLE;
+               } else {
+                       return ALOCK_RECOVER;
+               }
+       }
+       
+       return ALOCK_CLEAN;
+}
+
+int
+alock_close ( alock_info_t * info )
+{
+       alock_slot_t slot_data;
+       int res;
+
+       (void) memset ((void *) &slot_data, 0, sizeof(alock_slot_t));
+
+       res = alock_grab_lock (info->al_fd, 0);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       /* mark our slot as clean */
+       res = alock_read_slot (info, &slot_data);
+       if (res == -1) {
+               close (info->al_fd);
+               if (slot_data.al_appname != NULL) 
+                       free (slot_data.al_appname);
+               return ALOCK_UNSTABLE;
+       }
+       slot_data.al_lock = ALOCK_UNLOCKED;
+       res = alock_write_slot (info, &slot_data);
+       if (res == -1) {
+               close (info->al_fd);
+               if (slot_data.al_appname != NULL) 
+                       free (slot_data.al_appname);
+               return ALOCK_UNSTABLE;
+       }
+       if (slot_data.al_appname != NULL) {
+               free (slot_data.al_appname);
+               slot_data.al_appname = NULL;
+       }
+
+       res = alock_release_lock (info->al_fd, info->al_slot);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+       res = alock_release_lock (info->al_fd, 0);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       res = close (info->al_fd);
+       if (res == -1) return ALOCK_UNSTABLE;
+       
+       return ALOCK_CLEAN;
+}
+
+int 
+alock_recover ( alock_info_t * info )
+{
+       struct stat statbuf;
+       alock_slot_t slot_data;
+       alock_info_t scan_info;
+       int res, max_slot;
+
+       assert (info != NULL);
+
+       scan_info.al_fd = info->al_fd;
+
+       (void) memset ((void *) &slot_data, 0, sizeof(alock_slot_t));
+
+       res = alock_grab_lock (info->al_fd, 0);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       res = fstat (info->al_fd, &statbuf);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       max_slot = (statbuf.st_size + ALOCK_SLOT_SIZE - 1) / ALOCK_SLOT_SIZE;
+       for (scan_info.al_slot = 1; 
+            scan_info.al_slot < max_slot;
+            ++ scan_info.al_slot) {
+               if (scan_info.al_slot != info->al_slot) {
+                       res = alock_query_slot (&scan_info);
+
+                       if (res == ALOCK_LOCKED
+                           || res == ALOCK_UNIQUE) {
+                               /* recovery attempt on an active db? */
+                               close (info->al_fd);
+                               return ALOCK_UNSTABLE;
+                               
+                       } else if (res == ALOCK_DIRTY) {
+                               /* mark it clean */
+                               res = alock_read_slot (&scan_info, &slot_data);
+                               if (res == -1) {
+                                       close (info->al_fd);
+                                       return ALOCK_UNSTABLE;
+                               }
+                               slot_data.al_lock = ALOCK_UNLOCKED;
+                               res = alock_write_slot (&scan_info, &slot_data);
+                               if (res == -1) {
+                                       close (info->al_fd);
+                                       if (slot_data.al_appname != NULL) 
+                                               free (slot_data.al_appname);
+                                       return ALOCK_UNSTABLE;
+                               }
+                               if (slot_data.al_appname != NULL) {
+                                       free (slot_data.al_appname);
+                                       slot_data.al_appname = NULL;
+                               }
+                               
+                       } else if (res == -1) {
+                               close (info->al_fd);
+                               return ALOCK_UNSTABLE;
+
+                       }
+               }
+       }
+
+       res = alock_release_lock (info->al_fd, 0);
+       if (res == -1) {
+               close (info->al_fd);
+               return ALOCK_UNSTABLE;
+       }
+
+       return ALOCK_CLEAN;
+}
diff --git a/servers/slapd/back-bdb/alock.h b/servers/slapd/back-bdb/alock.h
new file mode 100644 (file)
index 0000000..902077d
--- /dev/null
@@ -0,0 +1,69 @@
+/* alock.h - access lock header */
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2005 The OpenLDAP Foundation.
+ * Portions Copyright 2004-2005 Symas Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Matthew Backes at Symas
+ * Corporation for inclusion in OpenLDAP Software.
+ */
+
+#ifndef _ALOCK_H_
+#define _ALOCK_H_
+
+#include "portable.h"
+#include <ac/time.h>
+#include <ac/unistd.h>
+
+/* environment states (all the slots together) */
+#define ALOCK_CLEAN            (0)
+#define ALOCK_RECOVER  (1)
+#define ALOCK_BUSY             (2)
+#define ALOCK_UNSTABLE (3)
+
+/* lock user types and states */
+#define ALOCK_UNLOCKED (0)
+#define ALOCK_LOCKED   (1)
+#define ALOCK_UNIQUE   (2)
+#define ALOCK_DIRTY            (3)
+
+/* constants */
+#define ALOCK_SLOT_SIZE                (1024)
+#define ALOCK_SLOT_IATTRS      (4)
+#define ALOCK_MAX_APPNAME      (ALOCK_SLOT_SIZE - 8 * ALOCK_SLOT_IATTRS)
+#define ALOCK_MAGIC                    (0x12345678)
+
+LDAP_BEGIN_DECL
+
+typedef struct alock_info {
+       int al_fd;
+       int al_slot;
+} alock_info_t;
+
+typedef struct alock_slot {
+       unsigned int al_lock;
+       time_t al_stamp;
+       pid_t al_pid;
+       char * al_appname;
+} alock_slot_t;
+
+extern int alock_open LDAP_P(( alock_info_t * info, const char * appname,
+       const char * envdir, int locktype ));
+extern int alock_scan LDAP_P(( alock_info_t * info ));
+extern int alock_close LDAP_P(( alock_info_t * info ));
+extern int alock_recover LDAP_P(( alock_info_t * info ));
+
+LDAP_END_DECL
+
+#endif
index 50182015cce4b6d854d3b11089b3ce8f0d43c505..562048413b9a74d26dad2178063353e1c0ce4356 100644 (file)
 #include "back-bdb.h"
 #include "lutil.h"
 
-/* for the cache of attribute information (which are indexed, etc.) */
-typedef struct bdb_attrinfo {
-       AttributeDescription *ai_desc; /* attribute description cn;lang-en */
-       slap_mask_t ai_indexmask;       /* how the attr is indexed      */
-#ifdef LDAP_COMP_MATCH
-       ComponentReference* ai_cr; /*component indexing*/
-#endif
-} AttrInfo;
 
 static int
 ainfo_type_cmp(
@@ -55,50 +47,13 @@ ainfo_cmp(
        return SLAP_PTRCMP(a->ai_desc, b->ai_desc);
 }
 
-#ifdef LDAP_COMP_MATCH
-void
-bdb_attr_comp_ref(
-       struct bdb_info *bdb,
-       AttributeDescription *desc,
-       ComponentReference** cr )
-{
-       AttrInfo        *a;
-
-       a = (AttrInfo *) avl_find( bdb->bi_attrs, desc, ainfo_type_cmp );
-       
-       *cr = a != NULL ? a->ai_cr : 0 ;
-}
-void
-bdb_attr_mask_cr(
-       struct bdb_info *bdb,
-       AttributeDescription *desc,
-       slap_mask_t *indexmask,
-       ComponentReference** cr )
-{
-       AttrInfo        *a;
-
-       a = (AttrInfo *) avl_find( bdb->bi_attrs, desc, ainfo_type_cmp );
-       if ( a ) {
-               *indexmask = a->ai_indexmask;
-               *cr = a->ai_cr;
-       } else {
-               *indexmask = 0;
-               *cr = NULL;
-       }
-}
-#endif
-
-void
+AttrInfo *
 bdb_attr_mask(
        struct bdb_info *bdb,
-       AttributeDescription *desc,
-       slap_mask_t *indexmask )
+       AttributeDescription *desc )
 {
-       AttrInfo        *a;
 
-       a = (AttrInfo *) avl_find( bdb->bi_attrs, desc, ainfo_type_cmp );
-       
-       *indexmask = a != NULL ? a->ai_indexmask : 0;
+       return avl_find( bdb->bi_attrs, desc, ainfo_type_cmp );
 }
 
 int
@@ -254,7 +209,15 @@ bdb_attr_index_config(
                        ad->ad_cname.bv_val, mask, 0 ); 
 
                a->ai_desc = ad;
-               a->ai_indexmask = mask;
+
+               if ( bdb->bi_flags & BDB_IS_OPEN ) {
+                       a->ai_indexmask = 0;
+                       a->ai_newmask = mask;
+               } else {
+                       a->ai_indexmask = mask;
+                       a->ai_newmask = 0;
+               }
+
 #ifdef LDAP_COMP_MATCH
                if ( cr ) {
                        a_cr = avl_find( bdb->bi_attrs, ad, ainfo_type_cmp );
@@ -283,6 +246,17 @@ bdb_attr_index_config(
                                 ainfo_cmp, avl_dup_error );
 
                if( rc ) {
+                       if ( bdb->bi_flags & BDB_IS_OPEN ) {
+                               AttrInfo *b = avl_find( bdb->bi_attrs, ad, ainfo_type_cmp );
+                               /* If we were editing this attr, reset it */
+                               b->ai_indexmask &= ~BDB_INDEX_DELETING;
+                               /* If this is leftover from a previous add, commit it */
+                               if ( b->ai_newmask )
+                                       b->ai_indexmask = b->ai_newmask;
+                               b->ai_newmask = a->ai_newmask;
+                               ch_free( a );
+                               continue;
+                       }
                        fprintf( stderr, "%s: line %d: duplicate index definition "
                                "for attr \"%s\" (ignored)\n",
                                fname, lineno, attrs[i] );
@@ -330,9 +304,63 @@ bdb_attr_index_unparse( struct bdb_info *bdb, BerVarray *bva )
        avl_apply( bdb->bi_attrs, bdb_attr_index_unparser, bva, -1, AVL_INORDER );
 }
 
+static void
+bdb_attrinfo_free( void *v )
+{
+       AttrInfo *ai = v;
+#ifdef LDAP_COMP_MATCH
+       free( ai->ai_cr );
+#endif
+       free( ai );
+}
+
 void
 bdb_attr_index_destroy( Avlnode *tree )
 {
-       avl_free( tree, free );
+       avl_free( tree, bdb_attrinfo_free );
+}
+
+void bdb_attr_index_free( struct bdb_info *bdb, AttributeDescription *ad )
+{
+       AttrInfo *ai;
+
+       ai = avl_delete( &bdb->bi_attrs, ad, ainfo_type_cmp );
+       if ( ai )
+               bdb_attrinfo_free( ai );
+}
+
+/* Get a list of AttrInfo's to delete */
+
+typedef struct Alist {
+       struct Alist *next;
+       AttrInfo *ptr;
+} Alist;
+
+static int
+bdb_attrinfo_flush( void *v1, void *arg )
+{
+       AttrInfo *ai = v1;
+
+       if ( ai->ai_indexmask & BDB_INDEX_DELETING ) {
+               Alist **al = arg;
+               Alist *a = ch_malloc( sizeof( Alist ));
+               a->ptr = ai;
+               a->next = *al;
+               *al = a;
+       }
+       return 0;
 }
 
+void bdb_attr_flush( struct bdb_info *bdb )
+{
+       Alist *al = NULL, *a2;
+
+       avl_apply( bdb->bi_attrs, bdb_attrinfo_flush, &al, -1, AVL_INORDER );
+
+       while (( a2 = al )) {
+               al = al->next;
+               avl_delete( &bdb->bi_attrs, a2->ptr, ainfo_cmp );
+               bdb_attrinfo_free( a2->ptr );
+               ch_free( a2 );
+       }
+}
index 44517010fbf96dc4a03df63506efe0e59928b83e..dea33f671d294c8a4f917c6afd1d2deae0fc374c 100644 (file)
@@ -20,6 +20,7 @@
 #include <portable.h>
 #include "slap.h"
 #include <db.h>
+#include "alock.h"
 
 LDAP_BEGIN_DECL
 
@@ -41,12 +42,6 @@ LDAP_BEGIN_DECL
 
 #define BDB_MAX_ADD_LOOP       30
 
-#ifdef BDB_SUBDIRS
-#define BDB_TMP_SUBDIR "tmp"
-#define BDB_LG_SUBDIR  "log"
-#define BDB_DATA_SUBDIR        "data"
-#endif
-
 #define BDB_SUFFIX             ".bdb"
 #define BDB_ID2ENTRY   0
 #define BDB_DN2ID              1
@@ -176,6 +171,8 @@ struct bdb_info {
        int                     bi_txn_cp;
        u_int32_t       bi_txn_cp_min;
        u_int32_t       bi_txn_cp_kbyte;
+       void            *bi_txn_cp_task;
+       void            *bi_index_task;
 
        int                     bi_lock_detect;
        long            bi_shm_key;
@@ -189,6 +186,15 @@ struct bdb_info {
        bdb_idl_cache_entry_t   *bi_idl_lru_tail;
        ldap_pvt_thread_rdwr_t bi_idl_tree_rwlock;
        ldap_pvt_thread_mutex_t bi_idl_tree_lrulock;
+       alock_info_t    bi_alock_info;
+       char            *bi_db_config_path;
+       BerVarray       bi_db_config;
+       int             bi_flags;
+#define        BDB_IS_OPEN             0x01
+#define        BDB_HAS_CONFIG  0x02
+#define        BDB_UPD_CONFIG  0x04
+#define        BDB_DEL_INDEX   0x08
+#define        BDB_RE_OPEN             0x10
 };
 
 #define bi_id2entry    bi_databases[BDB_ID2ENTRY]
@@ -272,6 +278,20 @@ struct bdb_op_info {
 
 LDAP_END_DECL
 
+/* for the cache of attribute information (which are indexed, etc.) */
+typedef struct bdb_attrinfo {
+       AttributeDescription *ai_desc; /* attribute description cn;lang-en */
+       slap_mask_t ai_indexmask;       /* how the attr is indexed      */
+       slap_mask_t ai_newmask; /* new settings to replace old mask */
+#ifdef LDAP_COMP_MATCH
+       ComponentReference* ai_cr; /*component indexing*/
+#endif
+} AttrInfo;
+
+/* These flags must not clash with SLAP_INDEX flags or ops in slap.h! */
+#define        BDB_INDEX_DELETING      0x8000U /* index is being modified */
+#define        BDB_INDEX_UPDATE_OP     0x03    /* performing an index update */
+
 #include "proto-bdb.h"
 
 #endif /* _BACK_BDB_H_ */
index 7965cf8e6907132506ecaab15c7db48dbefbb50e..126e3e615271fc9f0d6f1184559d37685e32f348 100644 (file)
@@ -37,6 +37,14 @@ static void  bdb_lru_print(Cache *cache);
 
 static int bdb_txn_get( Operation *op, DB_ENV *env, DB_TXN **txn, int reset );
 
+/* 4.2.52 */
+#if DB_VERSION_FULL == 0x04020034
+#define        READ_TXN_FLAG   ReadFlag
+static int ReadFlag = DB_TXN_NOT_DURABLE;
+#else
+#define READ_TXN_FLAG  0
+#endif
+
 static EntryInfo *
 bdb_cache_entryinfo_new( Cache *cache )
 {
@@ -308,6 +316,11 @@ bdb_cache_find_ndn(
                if ( !ei2 ) {
                        int len = ei.bei_nrdn.bv_len;
                                
+                       if ( BER_BVISEMPTY( ndn )) {
+                               *res = eip;
+                               return LDAP_SUCCESS;
+                       }
+
                        ei.bei_nrdn.bv_len = ndn->bv_len -
                                (ei.bei_nrdn.bv_val - ndn->bv_val);
                        bdb_cache_entryinfo_unlock( eip );
@@ -1194,8 +1207,12 @@ bdb_cache_release_all( Cache *cache )
                cache->c_lruhead = cache->c_eifree->bei_lrunext;
                bdb_cache_entryinfo_destroy(cache->c_eifree);
        }
+       cache->c_cursize = 0;
+       cache->c_eiused = 0;
+       cache->c_idtree = NULL;
        cache->c_lruhead = NULL;
        cache->c_lrutail = NULL;
+       cache->c_dntree.bei_kids = NULL;
 
        /* free lru mutex */
        ldap_pvt_thread_mutex_unlock( &cache->lru_mutex );
@@ -1237,6 +1254,11 @@ bdb_txn_get( Operation *op, DB_ENV *env, DB_TXN **txn, int reset )
        int i, rc;
        void *ctx, *data = NULL;
 
+       if ( slapMode & SLAP_TOOL_MODE ) {
+               *txn = NULL;
+               return 0;
+       }
+
        /* If no op was provided, try to find the ctx anyway... */
        if ( op ) {
                ctx = op->o_threadctx;
@@ -1258,7 +1280,17 @@ bdb_txn_get( Operation *op, DB_ENV *env, DB_TXN **txn, int reset )
        if ( ldap_pvt_thread_pool_getkey( ctx, ((char *)env)+1, &data, NULL ) ||
                data == NULL ) {
                for ( i=0, rc=1; rc != 0 && i<4; i++ ) {
-                       rc = TXN_BEGIN( env, NULL, txn, 0 );
+                       rc = TXN_BEGIN( env, NULL, txn, READ_TXN_FLAG );
+#if DB_VERSION_FULL == 0x04020034
+                       if ( rc == EINVAL && READ_TXN_FLAG ) {
+                               READ_TXN_FLAG = 0;
+                               Debug( LDAP_DEBUG_ANY,
+                                       "bdb_txn_get: BerkeleyDB 4.2.52 library needs TXN patch!\n",
+                                       0, 0, 0 );
+                               i--;
+                               continue;
+                       }
+#endif
                        if (rc) ldap_pvt_thread_yield();
                }
                if ( rc != 0) {
index 9565a3ab62e2e492e747a955a2c4b21413676fc7..aa2326337c03271e9d88bec41cd5ca64b5236e84 100644 (file)
@@ -44,7 +44,8 @@ bdb_compare( Operation *op, SlapReply *rs )
 
 dn2entry_retry:
        /* get entry */
-       rs->sr_err = bdb_dn2entry( op, NULL, &op->o_req_ndn, &ei, 1, locker, &lock );
+       rs->sr_err = bdb_dn2entry( op, NULL, &op->o_req_ndn, &ei, 1,
+               locker, &lock );
 
        switch( rs->sr_err ) {
        case DB_NOTFOUND:
@@ -66,10 +67,9 @@ dn2entry_retry:
        if ( rs->sr_err == DB_NOTFOUND ) {
                if ( e != NULL ) {
 #ifdef SLAP_ACL_HONOR_DISCLOSE
-                       /* return referral only if "disclose"
-                        * is granted on the object */
+                       /* return referral only if "disclose" is granted on the object */
                        if ( ! access_allowed( op, e, slap_schema.si_ad_entry,
-                                               NULL, ACL_DISCLOSE, NULL ) )
+                               NULL, ACL_DISCLOSE, NULL ) )
                        {
                                rs->sr_err = LDAP_NO_SUCH_OBJECT;
 
@@ -104,10 +104,9 @@ dn2entry_retry:
 
        if (!manageDSAit && is_entry_referral( e ) ) {
 #ifdef SLAP_ACL_HONOR_DISCLOSE
-               /* return referral only if "disclose"
-                * is granted on the object */
+               /* return referral only if "disclose" is granted on the object */
                if ( !access_allowed( op, e, slap_schema.si_ad_entry,
-                                       NULL, ACL_DISCLOSE, NULL ) )
+                       NULL, ACL_DISCLOSE, NULL ) )
                {
                        rs->sr_err = LDAP_NO_SUCH_OBJECT;
                } else
@@ -119,8 +118,7 @@ dn2entry_retry:
                        rs->sr_matched = e->e_name.bv_val;
                }
 
-               Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
-                       0, 0 );
+               Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, 0, 0 );
 
                send_ldap_result( op, rs );
 
@@ -133,7 +131,16 @@ dn2entry_retry:
        if ( get_assert( op ) &&
                ( test_filter( op, e, get_assertion( op )) != LDAP_COMPARE_TRUE ))
        {
-               rs->sr_err = LDAP_ASSERTION_FAILED;
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+               if ( !access_allowed( op, e, slap_schema.si_ad_entry,
+                       NULL, ACL_DISCLOSE, NULL ) )
+               {
+                       rs->sr_err = LDAP_NO_SUCH_OBJECT;
+               } else
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+               {
+                       rs->sr_err = LDAP_ASSERTION_FAILED;
+               }
                goto return_results;
        }
 
@@ -166,7 +173,8 @@ dn2entry_retry:
                if ( value_find_ex( op->oq_compare.rs_ava->aa_desc,
                        SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
                                SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
-                       a->a_nvals, &op->oq_compare.rs_ava->aa_value, op->o_tmpmemctx ) == 0 )
+                       a->a_nvals, &op->oq_compare.rs_ava->aa_value,
+                       op->o_tmpmemctx ) == 0 )
                {
                        rs->sr_err = LDAP_COMPARE_TRUE;
                        break;
@@ -191,6 +199,5 @@ done:
        }
 
        LOCK_ID_FREE ( bdb->bi_dbenv, locker );
-
        return rs->sr_err;
 }
index a70fbb3e8f0c1b1af1e65fa8fa29d27bf559f2ae..ad242744c711080189e22380e6e8e55a11408350 100644 (file)
 
 #include "config.h"
 
+#include "lutil.h"
+#include "ldap_rq.h"
+
 #ifdef DB_DIRTY_READ
 #      define  SLAP_BDB_ALLOW_DIRTY_READ
 #endif
 
+#define bdb_cf_oc                      BDB_SYMBOL(cf_oc)
+#define bdb_cf_gen                     BDB_SYMBOL(cf_gen)
+#define        bdb_cf_cleanup          BDB_SYMBOL(cf_cleanup)
+#define bdb_checkpoint         BDB_SYMBOL(checkpoint)
+#define bdb_online_index       BDB_SYMBOL(online_index)
+
 static ObjectClass *bdb_oc;
 
 static ConfigDriver bdb_cf_oc, bdb_cf_gen;
 
 enum {
        BDB_CHKPT = 1,
+       BDB_CONFIG,
+       BDB_DIRECTORY,
        BDB_NOSYNC,
        BDB_DIRTYR,
        BDB_INDEX,
@@ -43,80 +54,86 @@ enum {
 static ConfigTable bdbcfg[] = {
        { "", "", 0, 0, 0, ARG_MAGIC,
                bdb_cf_oc, NULL, NULL, NULL },
-       { "directory", "dir", 2, 2, 0, ARG_STRING|ARG_OFFSET,
-               (void *)offsetof(struct bdb_info, bi_dbenv_home),
-               "( OLcfgAt:1.1 NAME 'dbDirectory' "
+       { "directory", "dir", 2, 2, 0, ARG_STRING|ARG_MAGIC|BDB_DIRECTORY,
+               bdb_cf_gen, "( OLcfgDbAt:0.1 NAME 'olcDbDirectory' "
                        "DESC 'Directory for database content' "
                        "EQUALITY caseIgnoreMatch "
-                       "SYNTAX OMsDirectoryString )", NULL, NULL },
+                       "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "cachesize", "size", 2, 2, 0, ARG_INT|ARG_OFFSET,
                (void *)offsetof(struct bdb_info, bi_cache.c_maxsize),
-               "( OLcfgAt:1.2 NAME 'dbCacheSize' "
+               "( OLcfgDbAt:1.1 NAME 'olcDbCacheSize' "
                        "DESC 'Entry cache size in entries' "
-                       "SYNTAX OMsInteger )", NULL, NULL },
+                       "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "checkpoint", "kbyte> <min", 3, 3, 0, ARG_MAGIC|BDB_CHKPT,
-               bdb_cf_gen, "( OLcfgAt:1.3 NAME 'dbCheckpoint' "
+               bdb_cf_gen, "( OLcfgDbAt:1.2 NAME 'olcDbCheckpoint' "
                        "DESC 'Database checkpoint interval in kbytes and minutes' "
+                       "SYNTAX OMsDirectoryString SINGLE-VALUE )",NULL, NULL },
+       { "dbconfig", "DB_CONFIG setting", 3, 0, 0, ARG_MAGIC|BDB_CONFIG,
+               bdb_cf_gen, "( OLcfgDbAt:1.3 NAME 'olcDbConfig' "
+                       "DESC 'BerkeleyDB DB_CONFIG configuration directives' "
                        "SYNTAX OMsDirectoryString )",NULL, NULL },
        { "dbnosync", NULL, 1, 2, 0, ARG_ON_OFF|ARG_MAGIC|BDB_NOSYNC,
-               bdb_cf_gen, "( OLcfgAt:1.4 NAME 'dbNoSync' "
+               bdb_cf_gen, "( OLcfgDbAt:1.4 NAME 'olcDbNoSync' "
                        "DESC 'Disable synchronous database writes' "
-                       "SYNTAX OMsBoolean )", NULL, NULL },
+                       "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "dirtyread", NULL, 1, 2, 0,
 #ifdef SLAP_BDB_ALLOW_DIRTY_READ
                ARG_ON_OFF|ARG_MAGIC|BDB_DIRTYR, bdb_cf_gen,
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:1.5 NAME 'dbDirtyRead' "
+               "( OLcfgDbAt:1.5 NAME 'olcDbDirtyRead' "
                "DESC 'Allow reads of uncommitted data' "
-               "SYNTAX OMsBoolean )", NULL, NULL },
+               "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "idlcachesize", "size", 2, 2, 0, ARG_INT|ARG_OFFSET,
                (void *)offsetof(struct bdb_info,bi_idl_cache_max_size),
-               "( OLcfgAt:1.6 NAME 'dbIDLcacheSize' "
+               "( OLcfgDbAt:1.6 NAME 'olcDbIDLcacheSize' "
                "DESC 'IDL cache size in IDLs' "
-               "SYNTAX OMsInteger )", NULL, NULL },
-       { "index", "attr> <[pres,eq,approx,sub]", 3, 3, 0, ARG_MAGIC|BDB_INDEX,
-               bdb_cf_gen, "( OLcfgAt:1.7 NAME 'dbIndex' "
+               "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
+       { "index", "attr> <[pres,eq,approx,sub]", 2, 3, 0, ARG_MAGIC|BDB_INDEX,
+               bdb_cf_gen, "( OLcfgDbAt:0.2 NAME 'olcDbIndex' "
                "DESC 'Attribute index parameters' "
+               "EQUALITY caseIgnoreMatch "
                "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "linearindex", NULL, 1, 2, 0, ARG_ON_OFF|ARG_OFFSET,
                (void *)offsetof(struct bdb_info, bi_linear_index), 
-               "( OLcfgAt:1.8 NAME 'dbLinearIndex' "
+               "( OLcfgDbAt:1.7 NAME 'olcDbLinearIndex' "
                "DESC 'Index attributes one at a time' "
-               "SYNTAX OMsBoolean )", NULL, NULL },
+               "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "lockdetect", "policy", 2, 2, 0, ARG_MAGIC|BDB_LOCKD,
-               bdb_cf_gen, "( OLcfgAt:1.9 NAME 'dbLockDetect' "
+               bdb_cf_gen, "( OLcfgDbAt:1.8 NAME 'olcDbLockDetect' "
                "DESC 'Deadlock detection algorithm' "
-               "SYNTAX OMsDirectoryString )", NULL, NULL },
-       { "mode", "mode", 2, 2, 0, ARG_LONG|ARG_OFFSET,
+               "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
+       { "mode", "mode", 2, 2, 0, ARG_INT|ARG_OFFSET,
                (void *)offsetof(struct bdb_info, bi_dbenv_mode),
-               "( OLcfgAt:1.10 NAME 'dbMode' "
+               "( OLcfgDbAt:0.3 NAME 'olcDbMode' "
                "DESC 'Unix permissions of database files' "
-               "SYNTAX OMsInteger )", NULL, NULL },
+               "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "searchstack", "depth", 2, 2, 0, ARG_INT|ARG_MAGIC|BDB_SSTACK,
-               bdb_cf_gen, "( OLcfgAt:1.11 NAME 'dbSearchStack' "
+               bdb_cf_gen, "( OLcfgDbAt:1.9 NAME 'olcDbSearchStack' "
                "DESC 'Depth of search stack in IDLs' "
-               "SYNTAX OMsInteger )", NULL, NULL },
-       { "shm_key", "key", 2, 2, 0, ARG_INT|ARG_NONZERO|ARG_OFFSET,
+               "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
+       { "shm_key", "key", 2, 2, 0, ARG_INT|ARG_OFFSET,
                (void *)offsetof(struct bdb_info, bi_shm_key), 
-               "( OLcfgAt:1.12 NAME 'dbShmKey' "
+               "( OLcfgDbAt:1.10 NAME 'olcDbShmKey' "
                "DESC 'Key for shared memory region' "
-               "SYNTAX OMsInteger )", NULL, NULL },
+               "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { NULL, NULL, 0, 0, 0, ARG_IGNORED,
                NULL, NULL, NULL, NULL }
 };
 
 static ConfigOCs bdbocs[] = {
-       { "( OLcfgOc:1.1 "
-               "NAME 'bdbConfig' "
+       { "( OLcfgDbOc:1.1 "
+               "NAME 'olcBdbConfig' "
                "DESC 'BDB backend configuration' "
-               "AUXILIARY "
-               "MAY ( dbDirectory $ dbCacheSize $ dbCheckpoint $ dbNoSync $ "
-                "dbDirtyRead $ dbIDLcacheSize $ dbIndex $ dbLinearIndex $ "
-                "dbLockDetect $ dbMode $ dbSearchStack $ dbShmKey ) )",
-                       &bdb_oc },
-       { NULL, NULL }
+               "SUP olcDatabaseConfig "
+               "MUST olcDbDirectory "
+               "MAY ( olcDbCacheSize $ olcDbCheckpoint $ olcDbConfig $ "
+               "olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ "
+               "olcDbIndex $ olcDbLinearIndex $ olcDbLockDetect $ "
+               "olcDbMode $ olcDbSearchStack $ olcDbShmKey ) )",
+                       Cft_Database, &bdb_oc },
+       { NULL, 0, NULL }
 };
 
 static int
@@ -138,6 +155,173 @@ static slap_verbmasks bdb_lockd[] = {
        { BER_BVNULL, 0 }
 };
 
+/* perform periodic checkpoints */
+static void *
+bdb_checkpoint( void *ctx, void *arg )
+{
+       struct re_s *rtask = arg;
+       struct bdb_info *bdb = rtask->arg;
+       
+       TXN_CHECKPOINT( bdb->bi_dbenv, bdb->bi_txn_cp_kbyte,
+               bdb->bi_txn_cp_min, 0 );
+       ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+       ldap_pvt_runqueue_stoptask( &slapd_rq, rtask );
+       ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+       return NULL;
+}
+
+/* reindex entries on the fly */
+static void *
+bdb_online_index( void *ctx, void *arg )
+{
+       struct re_s *rtask = arg;
+       BackendDB *be = rtask->arg;
+       struct bdb_info *bdb = be->be_private;
+
+       Connection conn = {0};
+       char opbuf[OPERATION_BUFFER_SIZE];
+       Operation *op = (Operation *)opbuf;
+
+       DBC *curs;
+       DBT key, data;
+       DB_TXN *txn;
+       DB_LOCK lock;
+       u_int32_t locker;
+       ID id, nid;
+       EntryInfo *ei;
+       int rc, getnext = 1;
+
+       connection_fake_init( &conn, op, ctx );
+
+       op->o_bd = be;
+
+       DBTzero( &key );
+       DBTzero( &data );
+       
+       id = 1;
+       key.data = &nid;
+       key.size = key.ulen = sizeof(ID);
+       key.flags = DB_DBT_USERMEM;
+
+       data.flags = DB_DBT_USERMEM | DB_DBT_PARTIAL;
+       data.dlen = data.ulen = 0;
+
+       while ( 1 ) {
+               if ( slapd_shutdown )
+                       break;
+
+               rc = TXN_BEGIN( bdb->bi_dbenv, NULL, &txn, bdb->bi_db_opflags );
+               if ( rc ) 
+                       break;
+               locker = TXN_ID( txn );
+               if ( getnext ) {
+                       getnext = 0;
+                       BDB_ID2DISK( id, &nid );
+                       rc = bdb->bi_id2entry->bdi_db->cursor(
+                               bdb->bi_id2entry->bdi_db, txn, &curs, bdb->bi_db_opflags );
+                       if ( rc ) {
+                               TXN_ABORT( txn );
+                               break;
+                       }
+                       rc = curs->c_get( curs, &key, &data, DB_SET_RANGE );
+                       curs->c_close( curs );
+                       if ( rc ) {
+                               TXN_ABORT( txn );
+                               if ( rc == DB_NOTFOUND )
+                                       rc = 0;
+                               if ( rc == DB_LOCK_DEADLOCK ) {
+                                       ldap_pvt_thread_yield();
+                                       continue;
+                               }
+                               break;
+                       }
+                       BDB_DISK2ID( &nid, &id );
+               }
+
+               ei = NULL;
+               rc = bdb_cache_find_id( op, txn, id, &ei, 0, locker, &lock );
+               if ( rc ) {
+                       TXN_ABORT( txn );
+                       if ( rc == DB_LOCK_DEADLOCK ) {
+                               ldap_pvt_thread_yield();
+                               continue;
+                       }
+                       if ( rc == DB_NOTFOUND ) {
+                               id++;
+                               getnext = 1;
+                               continue;
+                       }
+                       break;
+               }
+               if ( ei->bei_e ) {
+                       rc = bdb_index_entry( op, txn, BDB_INDEX_UPDATE_OP, ei->bei_e );
+                       if ( rc == DB_LOCK_DEADLOCK ) {
+                               TXN_ABORT( txn );
+                               ldap_pvt_thread_yield();
+                               continue;
+                       }
+                       if ( rc == 0 ) {
+                               rc = TXN_COMMIT( txn, 0 );
+                               txn = NULL;
+                       }
+                       if ( rc )
+                               break;
+               }
+               id++;
+               getnext = 1;
+       }
+out:
+       ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+       ldap_pvt_runqueue_stoptask( &slapd_rq, rtask );
+       bdb->bi_index_task = NULL;
+       ldap_pvt_runqueue_remove( &slapd_rq, rtask );
+       ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+
+       return NULL;
+}
+
+/* Cleanup loose ends after Modify completes */
+static int
+bdb_cf_cleanup( ConfigArgs *c )
+{
+       struct bdb_info *bdb = c->be->be_private;
+       int rc = 0;
+
+       if ( bdb->bi_flags & BDB_UPD_CONFIG ) {
+               if ( bdb->bi_db_config ) {
+                       int i;
+                       FILE *f = fopen( bdb->bi_db_config_path, "w" );
+                       if ( f ) {
+                               for (i=0; bdb->bi_db_config[i].bv_val; i++)
+                                       fprintf( f, "%s\n", bdb->bi_db_config[i].bv_val );
+                               fclose( f );
+                       }
+               } else {
+                       unlink( bdb->bi_db_config_path );
+               }
+               bdb->bi_flags ^= BDB_UPD_CONFIG;
+       }
+
+       if ( bdb->bi_flags & BDB_DEL_INDEX ) {
+               bdb_attr_flush( bdb );
+               bdb->bi_flags ^= BDB_DEL_INDEX;
+       }
+       
+       if ( bdb->bi_flags & BDB_RE_OPEN ) {
+               bdb->bi_flags ^= BDB_RE_OPEN;
+               rc = c->be->bd_info->bi_db_close( c->be );
+               if ( rc == 0 )
+                       rc = c->be->bd_info->bi_db_open( c->be );
+               /* If this fails, we need to restart */
+               if ( rc ) {
+                       slapd_shutdown = 2;
+                       Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_cf_cleanup)
+                               ": failed to reopen database, rc=%d", rc, 0, 0 );
+               }
+       }
+       return rc;
+}
+
 static int
 bdb_cf_gen(ConfigArgs *c)
 {
@@ -160,6 +344,53 @@ bdb_cf_gen(ConfigArgs *c)
                        }
                        break;
 
+               case BDB_DIRECTORY:
+                       if ( bdb->bi_dbenv_home ) {
+                               c->value_string = ch_strdup( bdb->bi_dbenv_home );
+                       } else {
+                               rc = 1;
+                       }
+                       break;
+
+               case BDB_CONFIG:
+                       if (( slapMode&SLAP_SERVER_MODE ) && !( bdb->bi_flags&BDB_IS_OPEN )
+                               && !bdb->bi_db_config ) {
+                               char    buf[SLAP_TEXT_BUFLEN];
+                               FILE *f = fopen( bdb->bi_db_config_path, "r" );
+                               struct berval bv;
+
+                               if ( f ) {
+                                       bdb->bi_flags |= BDB_HAS_CONFIG;
+                                       while ( fgets( buf, sizeof(buf), f )) {
+                                               ber_str2bv( buf, 0, 1, &bv );
+                                               if ( bv.bv_val[bv.bv_len-1] == '\n' ) {
+                                                       bv.bv_len--;
+                                                       bv.bv_val[bv.bv_len] = '\0';
+                                               }
+                                               /* shouldn't need this, but ... */
+                                               if ( bv.bv_val[bv.bv_len-1] == '\r' ) {
+                                                       bv.bv_len--;
+                                                       bv.bv_val[bv.bv_len] = '\0';
+                                               }
+                                               ber_bvarray_add( &bdb->bi_db_config, &bv );
+                                       }
+                                       fclose( f );
+                               }
+                       }
+                       if ( bdb->bi_db_config ) {
+                               int i;
+                               struct berval bv;
+
+                               bv.bv_val = c->log;
+                               for (i=0; !BER_BVISNULL(&bdb->bi_db_config[i]); i++) {
+                                       bv.bv_len = sprintf( bv.bv_val, "{%d}%s", i,
+                                               bdb->bi_db_config[i].bv_val );
+                                       value_add_one( &c->rvalue_vals, &bv );
+                               }
+                       }
+                       if ( !c->rvalue_vals ) rc = 1;
+                       break;
+
                case BDB_NOSYNC:
                        if ( bdb->bi_dbenv_xflags & DB_TXN_NOSYNC )
                                c->value_int = 1;
@@ -189,12 +420,148 @@ bdb_cf_gen(ConfigArgs *c)
                        break;
                }
                return rc;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               rc = 0;
+               switch( c->type ) {
+               /* single-valued no-ops */
+               case BDB_LOCKD:
+               case BDB_SSTACK:
+                       break;
+
+               case BDB_CHKPT:
+                       if ( bdb->bi_txn_cp_task ) {
+                               struct re_s *re = bdb->bi_txn_cp_task;
+                               bdb->bi_txn_cp_task = NULL;
+                               if ( ldap_pvt_runqueue_isrunning( &slapd_rq, re ))
+                                       ldap_pvt_runqueue_stoptask( &slapd_rq, re );
+                               ldap_pvt_runqueue_remove( &slapd_rq, re );
+                       }
+                       bdb->bi_txn_cp = 0;
+                       break;
+               case BDB_CONFIG:
+                       if ( c->valx < 0 ) {
+                               ber_bvarray_free( bdb->bi_db_config );
+                               bdb->bi_db_config = NULL;
+                       } else {
+                               int i = c->valx;
+                               ch_free( bdb->bi_db_config[i].bv_val );
+                               for (; bdb->bi_db_config[i].bv_val; i++)
+                                       bdb->bi_db_config[i] = bdb->bi_db_config[i+1];
+                       }
+                       bdb->bi_flags |= BDB_UPD_CONFIG;
+                       c->cleanup = bdb_cf_cleanup;
+                       break;
+               case BDB_DIRECTORY:
+                       bdb->bi_flags |= BDB_RE_OPEN;
+                       bdb->bi_flags ^= BDB_HAS_CONFIG;
+                       ch_free( bdb->bi_dbenv_home );
+                       bdb->bi_dbenv_home = NULL;
+                       ch_free( bdb->bi_db_config_path );
+                       bdb->bi_db_config_path = NULL;
+                       c->cleanup = bdb_cf_cleanup;
+                       ldap_pvt_thread_pool_purgekey( bdb->bi_dbenv );
+                       ldap_pvt_thread_pool_purgekey( ((char *)bdb->bi_dbenv) + 1 );
+                       break;
+               case BDB_NOSYNC:
+                       bdb->bi_dbenv->set_flags( bdb->bi_dbenv, DB_TXN_NOSYNC, 0 );
+                       break;
+               case BDB_INDEX: {
+                       AttributeDescription *ad = NULL;
+                       struct berval bv, def = BER_BVC("default");
+                       char *ptr;
+                       const char *text;
+                       for (ptr = c->line; !isspace( *ptr ); ptr++);
+                       bv.bv_val = c->line;
+                       bv.bv_len = ptr - bv.bv_val;
+                       if ( bvmatch( &bv, &def )) {
+                               bdb->bi_defaultmask = 0;
+                       } else {
+                               slap_bv2ad( &bv, &ad, &text );
+                               if ( ad ) {
+                                       AttrInfo *ai = bdb_attr_mask( bdb, ad );
+                                       ai->ai_indexmask |= BDB_INDEX_DELETING;
+                                       bdb->bi_flags |= BDB_DEL_INDEX;
+                                       c->cleanup = bdb_cf_cleanup;
+                               }
+                       }
+                       }
+                       break;
+               }
+               return rc;
        }
+
        switch( c->type ) {
        case BDB_CHKPT:
                bdb->bi_txn_cp = 1;
                bdb->bi_txn_cp_kbyte = strtol( c->argv[1], NULL, 0 );
                bdb->bi_txn_cp_min = strtol( c->argv[2], NULL, 0 );
+               /* If we're in server mode and time-based checkpointing is enabled,
+                * submit a task to perform periodic checkpoints.
+                */
+               if ((slapMode & SLAP_SERVER_MODE) && bdb->bi_txn_cp_min ) {
+                       struct re_s *re = bdb->bi_txn_cp_task;
+                       if ( re )
+                               re->interval.tv_sec = bdb->bi_txn_cp_min * 60;
+                       else
+                               bdb->bi_txn_cp_task = ldap_pvt_runqueue_insert( &slapd_rq,
+                                       bdb->bi_txn_cp_min * 60, bdb_checkpoint, bdb,
+                                       LDAP_XSTRING(bdb_checkpoint), c->be->be_suffix[0].bv_val );
+               }
+               break;
+
+       case BDB_CONFIG: {
+               char *ptr = c->line + STRLENOF("dbconfig");
+               struct berval bv;
+               while (!isspace(*ptr)) ptr++;
+               while (isspace(*ptr)) ptr++;
+               
+               if ( bdb->bi_flags & BDB_IS_OPEN ) {
+                       bdb->bi_flags |= BDB_UPD_CONFIG;
+                       c->cleanup = bdb_cf_cleanup;
+               } else {
+               /* If we're just starting up...
+                */
+                       FILE *f;
+                       /* If a DB_CONFIG file exists, or we don't know the path
+                        * to the DB_CONFIG file, ignore these directives
+                        */
+                       if (( bdb->bi_flags & BDB_HAS_CONFIG ) || !bdb->bi_db_config_path )
+                               break;
+                       f = fopen( bdb->bi_db_config_path, "a" );
+                       if ( f ) {
+                               /* FIXME: EBCDIC probably needs special handling */
+                               fprintf( f, "%s\n", ptr );
+                               fclose( f );
+                       }
+               }
+               ber_str2bv( ptr, 0, 1, &bv );
+               ber_bvarray_add( &bdb->bi_db_config, &bv );
+               }
+               break;
+
+       case BDB_DIRECTORY: {
+               FILE *f;
+               char *ptr;
+
+               if ( bdb->bi_dbenv_home )
+                       ch_free( bdb->bi_dbenv_home );
+               bdb->bi_dbenv_home = c->value_string;
+
+               /* See if a DB_CONFIG file already exists here */
+               if ( bdb->bi_db_config_path )
+                       ch_free( bdb->bi_db_config_path );
+               bdb->bi_db_config_path = ch_malloc( strlen( bdb->bi_dbenv_home ) +
+                       STRLENOF(LDAP_DIRSEP) + STRLENOF("DB_CONFIG") + 1 );
+               ptr = lutil_strcopy( bdb->bi_db_config_path, bdb->bi_dbenv_home );
+               *ptr++ = LDAP_DIRSEP[0];
+               strcpy( ptr, "DB_CONFIG" );
+
+               f = fopen( bdb->bi_db_config_path, "r" );
+               if ( f ) {
+                       bdb->bi_flags |= BDB_HAS_CONFIG;
+                       fclose(f);
+               }
+               }
                break;
 
        case BDB_NOSYNC:
@@ -202,6 +569,10 @@ bdb_cf_gen(ConfigArgs *c)
                        bdb->bi_dbenv_xflags |= DB_TXN_NOSYNC;
                else
                        bdb->bi_dbenv_xflags &= ~DB_TXN_NOSYNC;
+               if ( bdb->bi_flags & BDB_IS_OPEN ) {
+                       bdb->bi_dbenv->set_flags( bdb->bi_dbenv, DB_TXN_NOSYNC,
+                               c->value_int );
+               }
                break;
 
        case BDB_INDEX:
@@ -209,6 +580,14 @@ bdb_cf_gen(ConfigArgs *c)
                        c->argc - 1, &c->argv[1] );
 
                if( rc != LDAP_SUCCESS ) return 1;
+               if (( bdb->bi_flags & BDB_IS_OPEN ) && !bdb->bi_index_task ) {
+                       /* Start the task as soon as we finish here. Set a long
+                        * interval (10 hours) so that it only gets scheduled once.
+                        */
+                       bdb->bi_index_task = ldap_pvt_runqueue_insert( &slapd_rq, 36000,
+                               bdb_online_index, c->be,
+                               LDAP_XSTRING(bdb_online_index), c->be->be_suffix[0].bv_val );
+               }
                break;
 
        case BDB_LOCKD:
index 3885b4c09a0e828db6ffc86cd776deacec7e95b5..faf1d3d1594872a31aef4b2baad1144ecef2a318 100644 (file)
@@ -124,6 +124,11 @@ bdb_db_cache(
        if ( !( slapMode & SLAP_TOOL_QUICK ))
                flags |= DB_AUTO_COMMIT;
 #endif
+       /* Cannot Truncate when Transactions are in use */
+       if ( (slapMode & (SLAP_TOOL_QUICK|SLAP_TRUNCATE_MODE)) ==
+               (SLAP_TOOL_QUICK|SLAP_TRUNCATE_MODE))
+                       flags |= DB_TRUNCATE;
+
        rc = DB_OPEN( db->bdi_db,
                file, NULL /* name */,
                BDB_INDEXTYPE, bdb->bi_db_opflags | flags, bdb->bi_dbenv_mode );
index 142e698781075de17cb638248eab340f9c2d5e22..a0dcce5669ff1af4971d92c4069f8dc56b4ca313 100644 (file)
@@ -83,6 +83,10 @@ retry:       /* transaction retry */
                        rs->sr_text = "internal error";
                        goto return_results;
                }
+               if ( op->o_abandon ) {
+                       rs->sr_err = SLAPD_ABANDON;
+                       goto return_results;
+               }
                parent_is_glue = 0;
                parent_is_leaf = 0;
                ldap_pvt_thread_yield();
@@ -202,7 +206,7 @@ retry:      /* transaction retry */
 
                /* check parent for "children" acl */
                rs->sr_err = access_allowed( op, p,
-                       children, NULL, ACL_WRITE, NULL );
+                       children, NULL, ACL_WDEL, NULL );
 
                if ( !rs->sr_err  ) {
                        switch( opinfo.boi_err ) {
@@ -228,7 +232,7 @@ retry:      /* transaction retry */
 
                                /* check parent for "children" acl */
                                rs->sr_err = access_allowed( op, p,
-                                       children, NULL, ACL_WRITE, NULL );
+                                       children, NULL, ACL_WDEL, NULL );
 
                                p = NULL;
 
@@ -266,7 +270,7 @@ retry:      /* transaction retry */
        }
 
        rs->sr_err = access_allowed( op, e,
-               entry, NULL, ACL_WRITE, NULL );
+               entry, NULL, ACL_WDEL, NULL );
 
        if ( !rs->sr_err  ) {
                switch( opinfo.boi_err ) {
@@ -345,7 +349,7 @@ retry:      /* transaction retry */
                                ": non-leaf %s\n",
                                op->o_req_dn.bv_val, 0, 0);
                        rs->sr_err = LDAP_NOT_ALLOWED_ON_NONLEAF;
-                       rs->sr_text = "subtree delete not supported";
+                       rs->sr_text = "subordinate objects must be deleted first";
                        break;
                default:
                        Debug(LDAP_DEBUG_ARGS,
index d6f9470c135fd6cd853ff1a1a849e5a8c8efb160..5bdfd915b3a52a56e033593ed27e0accf615d2bf 100644 (file)
@@ -68,10 +68,12 @@ bdb_dn2entry(
                        *e = ei;
                } else if ( matched && rc == DB_NOTFOUND ) {
                        /* always return EntryInfo */
-                       ei = ei->bei_parent;
-                       rc2 = bdb_cache_find_id( op, tid, ei->bei_id, &ei, 1,
-                               locker, lock );
-                       if ( rc2 ) rc = rc2;
+                       if ( ei->bei_parent ) {
+                               ei = ei->bei_parent;
+                               rc2 = bdb_cache_find_id( op, tid, ei->bei_id, &ei, 1,
+                                       locker, lock );
+                               if ( rc2 ) rc = rc2;
+                       }
                        *e = ei;
                }
        }
index c76c8ea613288a9eac2353b30ca83e39d3d48e01..a2719a5dbc92c22ab1c84f04b41af3e676b6536f 100644 (file)
@@ -361,6 +361,7 @@ bdb_dn2idl(
        ((char *)key.data)[0] = prefix;
        AC_MEMCPY( &((char *)key.data)[1], e->e_nname.bv_val, key.size - 1 );
 
+       BDB_IDL_ZERO( ids );
        rc = bdb_idl_fetch_key( op->o_bd, db, NULL, &key, ids, NULL, 0 );
 
        if( rc != 0 ) {
@@ -417,6 +418,9 @@ int hdb_fix_dn(
        char *ptr, *nptr;
        int max = 0;
 
+       if ( !e->e_id )
+               return 0;
+
        /* count length of all DN components */
        for ( ei = BEI(e); ei && ei->bei_id; ei=ei->bei_parent ) {
                rlen += ei->bei_rdn.bv_len + 1;
@@ -497,11 +501,17 @@ hdb_dn2id_add(
 
        DBTzero(&key);
        DBTzero(&data);
-       key.data = &nid;
        key.size = sizeof(ID);
        key.flags = DB_DBT_USERMEM;
        BDB_ID2DISK( eip->bei_id, &nid );
 
+       /* Delete parent's IDL cache entry */
+       if ( bdb->bi_idl_cache_size ) {
+               key.data = &eip->bei_id;
+               bdb_idl_cache_del( bdb, db, &key );
+       }
+       key.data = &nid;
+
        /* Need to make dummy root node once. Subsequent attempts
         * will fail harmlessly.
         */
@@ -514,9 +524,6 @@ hdb_dn2id_add(
                db->put( db, txn, &key, &data, DB_NODUPDATA );
        }
 
-       if ( bdb->bi_idl_cache_size ) {
-               bdb_idl_cache_del( bdb, db, &key );
-       }
        data.data = d;
        data.size = sizeof(diskNode) + rlen + nrlen;
        data.flags = DB_DBT_USERMEM;
@@ -554,7 +561,6 @@ hdb_dn2id_delete(
        DBTzero(&key);
        key.size = sizeof(ID);
        key.ulen = key.size;
-       key.data = &nid;
        key.flags = DB_DBT_USERMEM;
        BDB_ID2DISK( eip->bei_id, &nid );
 
@@ -564,9 +570,16 @@ hdb_dn2id_delete(
        data.dlen = data.size;
        data.flags = DB_DBT_USERMEM | DB_DBT_PARTIAL;
 
+       /* Delete IDL cache entries */
        if ( bdb->bi_idl_cache_size ) {
+               /* Ours */
+               key.data = &e->e_id;
+               bdb_idl_cache_del( bdb, db, &key );
+               /* Parent's */
+               key.data = &eip->bei_id;
                bdb_idl_cache_del( bdb, db, &key );
        }
+       key.data = &nid;
        rc = db->cursor( db, txn, &cursor, bdb->bi_db_opflags );
        if ( rc ) return rc;
 
@@ -800,7 +813,7 @@ struct dn2id_cookie {
        ID dbuf;
        ID *ids;
        void *ptr;
-       ID tmp[BDB_IDL_DB_SIZE];
+       ID tmp[BDB_IDL_UM_SIZE];
        ID *buf;
        DBT key;
        DBT data;
@@ -816,7 +829,7 @@ apply_func(
        EntryInfo *ei = data;
        ID *idl = arg;
 
-       bdb_idl_insert( idl, ei->bei_id );
+       bdb_idl_append_one( idl, ei->bei_id );
        return 0;
 }
 
@@ -911,7 +924,7 @@ hdb_dn2idl_internal(
                                        ei.bei_rdn.bv_len = len - sizeof(diskNode)
                                                - ei.bei_nrdn.bv_len;
                                        ei.bei_rdn.bv_val = d->nrdn + ei.bei_nrdn.bv_len + 1;
-                                       bdb_idl_insert( cx->tmp, ei.bei_id );
+                                       bdb_idl_append_one( cx->tmp, ei.bei_id );
                                        hdb_cache_load( cx->bdb, &ei, &ei2 );
                                }
                        }
@@ -941,16 +954,14 @@ saveit:
 gotit:
        if ( !BDB_IDL_IS_ZERO( cx->tmp )) {
                if ( cx->prefix == DN_SUBTREE_PREFIX ) {
-                       if (cx->ei->bei_state & CACHE_ENTRY_NO_GRANDKIDS) {
-                               bdb_idl_union( cx->ids, cx->tmp );
-                       } else {
+                       bdb_idl_append( cx->ids, cx->tmp );
+                       if ( !(cx->ei->bei_state & CACHE_ENTRY_NO_GRANDKIDS)) {
                                ID *save, idcurs;
                                EntryInfo *ei = cx->ei;
                                int nokids = 1;
                                save = cx->op->o_tmpalloc( BDB_IDL_SIZEOF( cx->tmp ),
                                        cx->op->o_tmpmemctx );
                                BDB_IDL_CPY( save, cx->tmp );
-                               bdb_idl_union( cx->ids, cx->tmp );
 
                                idcurs = 0;
                                for ( cx->id = bdb_idl_first( save, &idcurs );
@@ -1003,8 +1014,8 @@ hdb_dn2idl(
        cx.ei = e->e_id ? BEI(e) : &bdb->bi_cache.c_dntree;
        cx.bdb = bdb;
        cx.db = cx.bdb->bi_dn2id->bdi_db;
-       cx.prefix = op->ors_scope == LDAP_SCOPE_ONELEVEL
-               DN_ONE_PREFIX : DN_SUBTREE_PREFIX;
+       cx.prefix = (op->ors_scope == LDAP_SCOPE_ONELEVEL) ?
+               DN_ONE_PREFIX : DN_SUBTREE_PREFIX;
        cx.ids = ids;
        cx.buf = stack;
        cx.op = op;
@@ -1021,6 +1032,10 @@ hdb_dn2idl(
 
        DBTzero(&cx.data);
 
-       return hdb_dn2idl_internal(&cx);
+       hdb_dn2idl_internal(&cx);
+       if ( !BDB_IDL_IS_ZERO( ids ) && !BDB_IDL_IS_RANGE( ids ))
+               bdb_idl_sort( ids );
+
+       return cx.rc;
 }
 #endif /* BDB_HIER */
index ea1db3215eaa399be728203b160416ee609ad86f..9a9885e3af57a94fd85c91c769a37ccf31f48f21 100644 (file)
@@ -35,6 +35,17 @@ void bdb_errcall( const DB_ENV *env, const char *pfx, const char * msg )
        Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
 }
 
+#if DB_VERSION_FULL >= 0x04030000
+void bdb_msgcall( const DB_ENV *env, const char *msg )
+{
+#ifdef HAVE_EBCDIC
+       if ( msg[0] > 0x7f )
+               __etoa( msg );
+#endif
+       Debug( LDAP_DEBUG_TRACE, "bdb: %s\n", msg, 0, 0 );
+}
+#endif
+
 #ifdef HAVE_EBCDIC
 
 #undef db_strerror
index ea997d1b35bca9bac560ced2e892e1bf2624e263..a8961d1bee925d1c7834e95bc4bf87241bdf1d66 100644 (file)
@@ -297,12 +297,20 @@ comp_equality_candidates (
         MatchingRule *mr = mra->ma_rule;
         Syntax *sat_syntax;
        ComponentReference* cr_list, *cr;
+       AttrInfo *ai;
 
         BDB_IDL_ALL( bdb, ids );
 
-       bdb_attr_comp_ref ( op->o_bd->be_private, mra->ma_desc, &cr_list );
-       if( !cr_list || !ca->ca_comp_ref )
+       if ( !ca->ca_comp_ref )
                return 0;
+
+       ai = bdb_attr_mask( op->o_bd->be_private, mra->ma_desc );
+       if( ai ) {
+               cr_list = ai->ai_cr;
+       }
+       else {
+               return 0;
+       }
        /* find a component reference to be indexed */
        sat_syntax = ca->ca_ma_rule->smr_syntax;
        for ( cr = cr_list ; cr ; cr = cr->cr_next ) {
index cfd60ad3a881c5b7fa5acb0106e9c26b70bfeed2..5a08b4db51943e257ced618e21c9a1e2758089c9 100644 (file)
@@ -399,8 +399,8 @@ dn2entry_retry:
 
        if ( oc && !is_entry_objectclass( e, oc, 0 )) {
                Debug( LDAP_DEBUG_ACL,
-                       "<= bdb_entry_get: failed to find objectClass\n",
-                       0, 0, 0 ); 
+                       "<= bdb_entry_get: failed to find objectClass %s\n",
+                       oc->soc_cname, 0, 0 ); 
                rc = LDAP_NO_SUCH_ATTRIBUTE;
                goto return_results;
        }
index b6d0208fad1bf21105f695641d3bcaeeab2a2231..e3a2f26c49bc0ccf19dddf7edb4529f05fd16a53 100644 (file)
@@ -1207,3 +1207,135 @@ ID bdb_idl_next( ID *ids, ID *cursor )
        return NOID;
 }
 
+/* Add one ID to an unsorted list. We still maintain a lo/hi reference
+ * for fast range compaction.
+ */
+int bdb_idl_append_one( ID *ids, ID id )
+{
+       unsigned x;
+
+       if (BDB_IDL_IS_RANGE( ids )) {
+               /* if already in range, treat as a dup */
+               if (id >= BDB_IDL_FIRST(ids) && id <= BDB_IDL_LAST(ids))
+                       return -1;
+               if (id < BDB_IDL_FIRST(ids))
+                       ids[1] = id;
+               else if (id > BDB_IDL_LAST(ids))
+                       ids[2] = id;
+               return 0;
+       }
+       if ( ids[0] ) {
+               ID tmp;
+
+               if (id < ids[1]) {
+                       tmp = ids[1];
+                       ids[1] = id;
+                       id = tmp;
+               } else if ( ids[0] > 1 && id > ids[2] ) {
+                       tmp = ids[2];
+                       ids[2] = id;
+                       id = tmp;
+               }
+       }
+       ids[0]++;
+       if ( ids[0] >= BDB_IDL_UM_MAX ) {
+               ids[0] = NOID;
+       } else {
+               ids[ids[0]] = id;
+       }
+       return 0;
+}
+
+/* Append unsorted list b to unsorted list a. Both lists must have their
+ * lowest value in slot 1 and highest value in slot 2.
+ */
+int bdb_idl_append( ID *a, ID *b )
+{
+       ID ida, idb;
+
+       if ( BDB_IDL_IS_ZERO( b ) ) {
+               return 0;
+       }
+
+       if ( BDB_IDL_IS_ZERO( a ) ) {
+               BDB_IDL_CPY( a, b );
+               return 0;
+       }
+
+       if ( BDB_IDL_IS_RANGE( a ) || BDB_IDL_IS_RANGE(b) ||
+               a[0] + b[0] >= BDB_IDL_UM_MAX ) {
+               ida = IDL_MIN( a[1], b[1] );
+               idb = IDL_MAX( a[2], b[2] );
+               a[0] = NOID;
+               a[1] = ida;
+               a[2] = idb;
+               return 0;
+       }
+
+       if ( b[1] < a[1] ) {
+               ida = a[1];
+               a[1] = b[1];
+       } else {
+               ida = b[1];
+       }
+       a[0]++;
+       a[a[0]] = ida;
+
+       if ( b[0] > 1 && b[2] > a[2] ) {
+               ida = a[2];
+               a[2] = b[2];
+       } else {
+               ida = b[2];
+       }
+       a[0]++;
+       a[a[0]] = ida;
+
+       if ( b[0] > 2 ) {
+               int i = b[0] - 2;
+               AC_MEMCPY(a+a[0]+1, b+3, i * sizeof(ID));
+               a[0] += i;
+       }
+       return 0;
+       
+}
+
+/* Sort an IDL using HeapSort */
+static void
+siftDown(ID *ids, int root, int bottom)
+{
+       int child;
+       ID temp;
+
+       temp = ids[root];
+       while ((child=root*2) <= bottom) {
+               if (child < bottom && ids[child] < ids[child + 1])
+                       child++;
+
+               if (temp >= ids[child])
+                       break;
+               ids[root] = ids[child];
+               root = child;
+       }
+       ids[root] = temp;
+}
+
+void
+bdb_idl_sort( ID *ids )
+{
+       int i;
+       ID temp;
+
+       if ( BDB_IDL_IS_RANGE( ids ))
+               return;
+
+       for (i = ids[0] / 2; i >= 1; i--)
+               siftDown(ids, i, ids[0]);
+
+       for (i = ids[0]; i > 1; i--)
+       {
+               temp = ids[i];
+               ids[i] = ids[1];
+               ids[1] = temp;
+               siftDown(ids, 1, i-1);
+       }
+}
index 4db3c6794a5fbc36b11dc965f7c6caf19b93ff96..ea78c1098e8f39d0468562eafd17d30c6a17195e 100644 (file)
 static char presence_keyval[LUTIL_HASH_BYTES] = {0,0,0,1};
 static struct berval presence_key = {LUTIL_HASH_BYTES, presence_keyval};
 
-static slap_mask_t index_mask(
+static AttrInfo *index_mask(
        Backend *be,
        AttributeDescription *desc,
        struct berval *atname )
 {
        AttributeType *at;
-       slap_mask_t mask = 0;
-
-       bdb_attr_mask( be->be_private, desc, &mask );
+       AttrInfo *ai = bdb_attr_mask( be->be_private, desc );
 
-       if( mask ) {
+       if( ai ) {
                *atname = desc->ad_cname;
-               return mask;
+               return ai;
        }
 
        /* If there is a tagging option, did we ever index the base
@@ -48,11 +46,11 @@ static slap_mask_t index_mask(
         */
        if( slap_ad_is_tagged( desc ) && desc != desc->ad_type->sat_ad ) {
                /* has tagging option */
-               bdb_attr_mask( be->be_private, desc->ad_type->sat_ad, &mask );
+               ai = bdb_attr_mask( be->be_private, desc->ad_type->sat_ad );
 
-               if ( mask && ( mask ^ SLAP_INDEX_NOTAGS ) ) {
+               if ( ai && ( ai->ai_indexmask ^ SLAP_INDEX_NOTAGS ) ) {
                        *atname = desc->ad_type->sat_cname;
-                       return mask;
+                       return ai;
                }
        }
 
@@ -61,11 +59,11 @@ static slap_mask_t index_mask(
                /* If no AD, we've never indexed this type */
                if ( !at->sat_ad ) continue;
 
-               bdb_attr_mask( be->be_private, at->sat_ad, &mask );
+               ai = bdb_attr_mask( be->be_private, at->sat_ad );
 
-               if ( mask && ( mask ^ SLAP_INDEX_NOSUBTYPES ) ) {
+               if ( ai && ( ai->ai_indexmask ^ SLAP_INDEX_NOSUBTYPES ) ) {
                        *atname = at->sat_cname;
-                       return mask;
+                       return ai;
                }
        }
 
@@ -76,18 +74,19 @@ int bdb_index_is_indexed(
        Backend *be,
        AttributeDescription *desc )
 {
-       slap_mask_t mask;
+       AttrInfo *ai;
        struct berval prefix;
 
-       mask = index_mask( be, desc, &prefix );
+       ai = index_mask( be, desc, &prefix );
 
-       if( mask == 0 ) {
+       if( !ai )
                return LDAP_INAPPROPRIATE_MATCHING;
-       }
 
        return LDAP_SUCCESS;
 }
 
+/* This function is only called when evaluating search filters.
+ */
 int bdb_index_param(
        Backend *be,
        AttributeDescription *desc,
@@ -96,15 +95,17 @@ int bdb_index_param(
        slap_mask_t *maskp,
        struct berval *prefixp )
 {
+       AttrInfo *ai;
        int rc;
        slap_mask_t mask;
        DB *db;
 
-       mask = index_mask( be, desc, prefixp );
+       ai = index_mask( be, desc, prefixp );
 
-       if( mask == 0 ) {
+       if( !ai ) {
                return LDAP_INAPPROPRIATE_MATCHING;
        }
+       mask = ai->ai_indexmask;
 
        rc = bdb_db_cache( be, prefixp->bv_val, &db );
 
@@ -268,6 +269,11 @@ static int index_at_values(
 {
        int rc;
        slap_mask_t mask = 0;
+       int ixop = opid;
+       AttrInfo *ai = NULL;
+
+       if ( opid == BDB_INDEX_UPDATE_OP )
+               ixop = SLAP_INDEX_ADD_OP;
 
        if( type->sat_sup ) {
                /* recurse */
@@ -280,49 +286,59 @@ static int index_at_values(
 
        /* If this type has no AD, we've never used it before */
        if( type->sat_ad ) {
+               ai = bdb_attr_mask( op->o_bd->be_private, type->sat_ad );
+               if ( ai ) {
 #ifdef LDAP_COMP_MATCH
-               /* component indexing */
-               ComponentReference* cr_list, *cr;
-
-               bdb_attr_mask_cr( op->o_bd->be_private, type->sat_ad, &mask, &cr_list );
-               if ( cr_list ) {
-                       for( cr = cr_list ; cr ; cr = cr->cr_next ) {
-                               rc = indexer( op, txn, cr->cr_ad, &type->sat_cname,
-                                       cr->cr_nvals, id, opid,
-                                       cr->cr_indexmask );
+                       /* component indexing */
+                       if ( ai->ai_cr ) {
+                               ComponentReference *cr;
+                               for( cr = ai->ai_cr ; cr ; cr = cr->cr_next ) {
+                                       rc = indexer( op, txn, cr->cr_ad, &type->sat_cname,
+                                               cr->cr_nvals, id, ixop,
+                                               cr->cr_indexmask );
+                               }
                        }
-               }
-#else
-               bdb_attr_mask( op->o_bd->be_private, type->sat_ad, &mask );
 #endif
-               ad = type->sat_ad;
-       }
-
-       if( mask ) {
-               rc = indexer( op, txn, ad, &type->sat_cname,
-                       vals, id, opid,
-                       mask );
-
-               if( rc ) return rc;
+                       ad = type->sat_ad;
+                       /* If we're updating the index, just set the new bits that aren't
+                        * already in the old mask.
+                        */
+                       if ( opid == BDB_INDEX_UPDATE_OP )
+                               mask = ai->ai_newmask & ~ai->ai_indexmask;
+                       else
+                       /* For regular updates, if there is a newmask use it. Otherwise
+                        * just use the old mask.
+                        */
+                               mask = ai->ai_newmask ? ai->ai_newmask : ai->ai_indexmask;
+                       if( mask ) {
+                               rc = indexer( op, txn, ad, &type->sat_cname,
+                                       vals, id, ixop, mask );
+
+                               if( rc ) return rc;
+                       }
+               }
        }
 
        if( tags->bv_len ) {
                AttributeDescription *desc;
 
-               mask = 0;
-
                desc = ad_find_tags( type, tags );
                if( desc ) {
-                       bdb_attr_mask( op->o_bd->be_private, desc, &mask );
-               }
-
-               if( mask ) {
-                       rc = indexer( op, txn, desc, &desc->ad_cname,
-                               vals, id, opid,
-                               mask );
-
-                       if( rc ) {
-                               return rc;
+                       ai = bdb_attr_mask( op->o_bd->be_private, desc );
+
+                       if( ai ) {
+                               if ( opid == BDB_INDEX_UPDATE_OP )
+                                       mask = ai->ai_newmask & ~ai->ai_indexmask;
+                               else
+                                       mask = ai->ai_newmask ? ai->ai_newmask : ai->ai_indexmask;
+                               if ( mask ) {
+                                       rc = indexer( op, txn, desc, &desc->ad_cname,
+                                               vals, id, ixop, mask );
+
+                                       if( rc ) {
+                                               return rc;
+                                       }
+                               }
                        }
                }
        }
@@ -340,6 +356,10 @@ int bdb_index_values(
 {
        int rc;
 
+       /* Never index ID 0 */
+       if ( id == 0 )
+               return 0;
+
        rc = index_at_values( op, txn, desc,
                desc->ad_type, &desc->ad_tags,
                vals, id, opid );
@@ -369,14 +389,17 @@ bdb_index_entry(
 #endif
 
        Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
-               opid == SLAP_INDEX_ADD_OP ? "add" : "del",
+               opid == SLAP_INDEX_DELETE_OP ? "del" : "add",
                (long) e->e_id, e->e_dn );
 
        /* add each attribute to the indexes */
        for ( ; ap != NULL; ap = ap->a_next ) {
 #ifdef LDAP_COMP_MATCH
+               AttrInfo *ai;
                /* see if attribute has components to be indexed */
-               bdb_attr_comp_ref( op->o_bd->be_private, ap->a_desc->ad_type->sat_ad, &cr_list );
+               ai = bdb_attr_mask( op->o_bd->be_private, ap->a_desc->ad_type->sat_ad );
+               if ( ai ) cr_list = ai->ai_cr;
+               else cr_list = NULL;
                if ( attr_converter && cr_list ) {
                        syn = ap->a_desc->ad_type->sat_syntax;
                        ap->a_comp_data = op->o_tmpalloc( sizeof( ComponentData ), op->o_tmpmemctx );
@@ -439,7 +462,7 @@ bdb_index_entry(
        }
 
        Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
-               opid == SLAP_INDEX_ADD_OP ? "add" : "del",
+               opid == SLAP_INDEX_DELETE_OP ? "del" : "add",
                (long) e->e_id, e->e_dn );
 
        return LDAP_SUCCESS;
index e202de4cfcfb137bc65309a3076991919621b8be..21c4985d8f770d5b5f53fe687d0c96b2638ab6c4 100644 (file)
 #include <ac/string.h>
 #include <ac/unistd.h>
 #include <ac/stdlib.h>
-
+#include <ac/errno.h>
+#include <sys/stat.h>
 #include "back-bdb.h"
 #include <lutil.h>
 #include <ldap_rq.h>
+#include "alock.h"
 
 static const struct bdbi_database {
        char *file;
@@ -44,9 +46,9 @@ bdb_db_init( BackendDB *be )
 {
        struct bdb_info *bdb;
 
-       Debug( LDAP_DEBUG_ANY,
-               LDAP_XSTRING(bdb_db_init) ": Initializing "
-               BDB_UCTYPE " database\n", 0, 0, 0 );
+       Debug( LDAP_DEBUG_TRACE,
+               LDAP_XSTRING(bdb_db_init) ": Initializing " BDB_UCTYPE " database\n",
+               0, 0, 0 );
 
        /* allocate backend-database-specific stuff */
        bdb = (struct bdb_info *) ch_calloc( 1, sizeof(struct bdb_info) );
@@ -74,26 +76,186 @@ bdb_db_init( BackendDB *be )
        return 0;
 }
 
-static void *
-bdb_checkpoint( void *ctx, void *arg )
+/*
+ * Unconditionally perform a database recovery. Only works on
+ * databases that were previously opened with transactions and
+ * logs enabled.
+ */
+static int
+bdb_do_recovery( BackendDB *be )
 {
-       struct re_s *rtask = arg;
-       struct bdb_info *bdb = rtask->arg;
-       
-       TXN_CHECKPOINT( bdb->bi_dbenv, bdb->bi_txn_cp_kbyte,
-               bdb->bi_txn_cp_min, 0 );
-       return NULL;
+       struct bdb_info *bdb = (struct bdb_info *) be->be_private;
+       DB_ENV  *re_dbenv;
+       u_int32_t flags;
+       int             rc;
+       char    path[MAXPATHLEN], *ptr;
+
+       /* Create and init the recovery environment */
+       rc = db_env_create( &re_dbenv, 0 );
+       if( rc != 0 ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_do_recovery: db_env_create failed: %s (%d)\n",
+                       db_strerror(rc), rc, 0 );
+               return rc;
+       }
+       re_dbenv->set_errpfx( re_dbenv, be->be_suffix[0].bv_val );
+       re_dbenv->set_errcall( re_dbenv, bdb_errcall );
+       (void)re_dbenv->set_verbose(re_dbenv, DB_VERB_RECOVERY, 1);
+#if DB_VERSION_FULL < 0x04030000
+       (void)re_dbenv->set_verbose(re_dbenv, DB_VERB_CHKPOINT, 1);
+#else
+       re_dbenv->set_msgcall( re_dbenv, bdb_msgcall );
+#endif
+
+       flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL |
+               DB_INIT_TXN | DB_USE_ENVIRON | DB_RECOVER;
+
+       /* If a key was set, use shared memory for the BDB environment */
+       if ( bdb->bi_shm_key ) {
+               re_dbenv->set_shm_key( re_dbenv, bdb->bi_shm_key );
+               flags |= DB_SYSTEM_MEM;
+       }
+
+       /* Open the environment, which will also perform the recovery */
+#ifdef HAVE_EBCDIC
+       strcpy( path, bdb->bi_dbenv_home );
+       __atoe( path );
+       rc = re_dbenv->open( re_dbenv,
+               path,
+               flags,
+               bdb->bi_dbenv_mode );
+#else
+       rc = re_dbenv->open( re_dbenv,
+               bdb->bi_dbenv_home,
+               flags,
+               bdb->bi_dbenv_mode );
+#endif
+       if( rc != 0 ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_do_recovery: dbenv_open failed: %s (%d)\n",
+                       db_strerror(rc), rc, 0 );
+               return rc;
+       }
+       (void) re_dbenv->close( re_dbenv, 0 );
+
+       /* By convention we reset the mtime for id2entry.bdb to the current time */
+       ptr = lutil_strcopy( path, bdb->bi_dbenv_home);
+       *ptr++ = LDAP_DIRSEP[0];
+       strcpy( ptr, bdbi_databases[0].file);
+       (void) utime( path, NULL);
+
+       return 0;
+}
+
+/*
+ * Database recovery logic:
+ * This function is called whenever the database appears to have been
+ * shut down uncleanly, as determined by the alock functions. 
+ * Because of the -q function in slapadd, there is also the possibility
+ * that the shutdown happened when transactions weren't being used and
+ * the database is likely to be corrupt. The function checks for this
+ * condition by examining the environment to make sure it had previously
+ * been opened with transactions enabled. If this is the case, the
+ * database is recovered as usual. If transactions were not enabled,
+ * then this function will return a fail.
+ */
+static int
+bdb_db_recover( BackendDB *be )
+{
+       struct bdb_info *bdb = (struct bdb_info *) be->be_private;
+       DB_ENV  *re_dbenv;
+       u_int32_t flags;
+       int             rc;
+#ifdef HAVE_EBCDIC
+       char    path[MAXPATHLEN];
+#endif
+
+       /* Create the recovery environment, then open it.
+        * We use the DB_JOIN in combination with a flags value of
+        * zero so we join an existing environment and can read the
+        * value of the flags that were used the last time the 
+        * environment was opened. DB_CREATE is added because the
+        * open would fail if the only thing that had been done
+        * was an open with transactions and logs disabled.
+        */
+       rc = db_env_create( &re_dbenv, 0 );
+       if( rc != 0 ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_recover: db_env_create failed: %s (%d)\n",
+                       db_strerror(rc), rc, 0 );
+               return rc;
+       }
+       re_dbenv->set_errpfx( re_dbenv, be->be_suffix[0].bv_val );
+       re_dbenv->set_errcall( re_dbenv, bdb_errcall );
+
+       Debug( LDAP_DEBUG_TRACE,
+               "bdb_db_recover: dbenv_open(%s)\n",
+               bdb->bi_dbenv_home, 0, 0);
+
+#ifdef HAVE_EBCDIC
+       strcpy( path, bdb->bi_dbenv_home );
+       __atoe( path );
+       rc = re_dbenv->open( re_dbenv,
+               path,
+               DB_JOINENV,
+               bdb->bi_dbenv_mode );
+#else
+       rc = re_dbenv->open( re_dbenv,
+               bdb->bi_dbenv_home,
+               DB_JOINENV,
+               bdb->bi_dbenv_mode );
+#endif
+
+       if( rc == ENOENT ) {
+               goto re_exit;
+       }
+       else if( rc != 0 ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_recover: dbenv_open failed: %s (%d)\n",
+                       db_strerror(rc), rc, 0 );
+               return rc;
+       }
+
+       /*
+        * Check the flags that had been used in the previous open.
+        * The environment needed to have had both
+        * DB_INIT_LOG and DB_INIT_TXN set for us to be willing to
+        * recover the database. Otherwise the an app failed while running
+        * without transactions and logs enabled and the dn2id and id2entry
+        * mapping is likely to be corrupt.
+        */
+       rc = re_dbenv->get_open_flags( re_dbenv, &flags );
+       if( rc != 0 ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_recover: get_open_flags failed: %s (%d)\n",
+                       db_strerror(rc), rc, 0 );
+               return rc;
+       }
+
+       (void) re_dbenv->close( re_dbenv, 0 );
+
+       if( (flags & DB_INIT_LOG) && (flags & DB_INIT_TXN) ) {
+               return bdb_do_recovery( be );
+       }
+
+re_exit:
+       Debug( LDAP_DEBUG_ANY,
+               "bdb_db_recover: Database cannot be recovered. "\
+               "Restore from backup!\n", 0, 0, 0);
+       return -1;
+
 }
 
+
 static int
 bdb_db_open( BackendDB *be )
 {
        int rc, i;
        struct bdb_info *bdb = (struct bdb_info *) be->be_private;
+       struct stat stat1, stat2;
        u_int32_t flags;
-#ifdef HAVE_EBCDIC
        char path[MAXPATHLEN];
-#endif
+       char *ptr;
 
        Debug( LDAP_DEBUG_ARGS,
                "bdb_db_open: %s\n",
@@ -106,7 +268,89 @@ bdb_db_open( BackendDB *be )
                return -1;
        }
 #endif
-       /* we should check existance of dbenv_home and db_directory */
+
+       /* Check existence of dbenv_home. Any error means trouble */
+       rc = stat( bdb->bi_dbenv_home, &stat1 );
+       if( rc !=0 ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_open: Cannot access database directory %s (%d)\n",
+                       bdb->bi_dbenv_home, errno, 0 );
+                       return -1;
+       }
+       
+       /* Perform database use arbitration/recovery logic */
+       rc = alock_open( &bdb->bi_alock_info, 
+                               "slapd", 
+                               bdb->bi_dbenv_home,
+                               slapMode & SLAP_TOOL_READONLY ?
+                               ALOCK_LOCKED : ALOCK_UNIQUE );
+
+       if( rc == ALOCK_RECOVER ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_open: unclean shutdown detected;"
+                       " attempting recovery.\n", 
+                       0, 0, 0 );
+               if( bdb_db_recover( be ) != 0 ) {
+                       Debug( LDAP_DEBUG_ANY,
+                               "bdb_db_open: DB recovery failed.\n",
+                               0, 0, 0 );
+                       return -1;
+               }
+               if( alock_recover (&bdb->bi_alock_info) != 0 ) {
+                       Debug( LDAP_DEBUG_ANY,
+                               "bdb_db_open: alock_recover failed\n",
+                               0, 0, 0 );
+                       return -1;
+               }
+
+       } else if( rc == ALOCK_BUSY ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_open: database already in use\n", 
+                       0, 0, 0 );
+               return -1;
+       } else if( rc != ALOCK_CLEAN ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_open: alock package is unstable\n", 
+                       0, 0, 0 );
+               return -1;
+       }
+       
+       /*
+        * The DB_CONFIG file may have changed. If so, recover the
+        * database so that new settings are put into effect. Also
+        * note the possible absence of DB_CONFIG in the log.
+        */
+       if( stat( bdb->bi_db_config_path, &stat1 ) == 0 ) {
+               ptr = lutil_strcopy(path, bdb->bi_dbenv_home);
+               *ptr++ = LDAP_DIRSEP[0];
+               strcpy( ptr, bdbi_databases[0].file);
+               if( stat( path, &stat2 ) == 0 ) {
+                       if( stat2.st_mtime <= stat1.st_mtime ) {
+                               Debug( LDAP_DEBUG_ANY,
+                                       "bdb_db_open: DB_CONFIG for suffix %s has changed.\n"
+                                       "Performing database recovery to activate new settings.\n",
+                                       be->be_suffix[0].bv_val, 0, 0 );
+                               if( bdb_do_recovery( be ) != 0) {
+                                       Debug( LDAP_DEBUG_ANY,
+                                               "bdb_db_open: db recovery failed.\n",
+                                               0, 0, 0 );
+                                       return -1;
+                               }
+                       }
+                                       
+               }
+       }
+       else {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_open: Warning - No DB_CONFIG file found "
+                       "in directory %s: (%d)\n"
+                       "Expect poor performance for suffix %s.\n",
+                       bdb->bi_dbenv_home, errno, be->be_suffix[0].bv_val );
+       }
+               
+       flags = DB_INIT_MPOOL | DB_THREAD | DB_CREATE;
+       if ( !( slapMode & SLAP_TOOL_QUICK ))
+               flags |= DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN;
 
        rc = db_env_create( &bdb->bi_dbenv, 0 );
        if( rc != 0 ) {
@@ -116,19 +360,6 @@ bdb_db_open( BackendDB *be )
                return rc;
        }
 
-       flags = DB_INIT_MPOOL | DB_THREAD | DB_CREATE;
-
-       if ( !( slapMode & SLAP_TOOL_QUICK ))
-               flags |= DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN;
-       
-#if 0
-       /* Never do automatic recovery, must perform it manually.
-        * Otherwise restarting with gentlehup will corrupt the
-        * database.
-        */
-       if( !(slapMode & SLAP_TOOL_MODE) ) flags |= DB_RECOVER;
-#endif
-
        /* If a key was set, use shared memory for the BDB environment */
        if ( bdb->bi_shm_key ) {
                bdb->bi_dbenv->set_shm_key( bdb->bi_dbenv, bdb->bi_shm_key );
@@ -159,63 +390,6 @@ bdb_db_open( BackendDB *be )
                bdb->bi_idl_cache_size = 0;
        }
 
-#ifdef BDB_SUBDIRS
-       {
-               char dir[MAXPATHLEN], *ptr;
-               
-               if (bdb->bi_dbenv_home[0] == '.') {
-                       /* If home is a relative path, relative subdirs
-                        * are just concat'd by BDB. We don't want the
-                        * path to be concat'd twice, e.g.
-                        * ./test-db/./test-db/tmp
-                        */
-                       ptr = dir;
-               } else {
-                       ptr = lutil_strcopy( dir, bdb->bi_dbenv_home );
-                       *ptr++ = LDAP_DIRSEP[0];
-#ifdef HAVE_EBCDIC
-                       __atoe( dir );
-#endif
-               }
-
-               strcpy( ptr, BDB_TMP_SUBDIR );
-#ifdef HAVE_EBCDIC
-               __atoe( ptr );
-#endif
-               rc = bdb->bi_dbenv->set_tmp_dir( bdb->bi_dbenv, dir );
-               if( rc != 0 ) {
-                       Debug( LDAP_DEBUG_ANY,
-                               "bdb_db_open: set_tmp_dir(%s) failed: %s (%d)\n",
-                               dir, db_strerror(rc), rc );
-                       return rc;
-               }
-
-               strcpy( ptr, BDB_LG_SUBDIR );
-#ifdef HAVE_EBCDIC
-               __atoe( ptr );
-#endif
-               rc = bdb->bi_dbenv->set_lg_dir( bdb->bi_dbenv, dir );
-               if( rc != 0 ) {
-                       Debug( LDAP_DEBUG_ANY,
-                               "bdb_db_open: set_lg_dir(%s) failed: %s (%d)\n",
-                               dir, db_strerror(rc), rc );
-                       return rc;
-               }
-
-               strcpy( ptr, BDB_DATA_SUBDIR );
-#ifdef HAVE_EBCDIC
-               __atoe( ptr );
-#endif
-               rc = bdb->bi_dbenv->set_data_dir( bdb->bi_dbenv, dir );
-               if( rc != 0 ) {
-                       Debug( LDAP_DEBUG_ANY,
-                               "bdb_db_open: set_data_dir(%s) failed: %s (%d)\n",
-                               dir, db_strerror(rc), rc );
-                       return rc;
-               }
-       }
-#endif
-
        if( bdb->bi_dbenv_xflags != 0 ) {
                rc = bdb->bi_dbenv->set_flags( bdb->bi_dbenv,
                        bdb->bi_dbenv_xflags, 1);
@@ -353,16 +527,7 @@ bdb_db_open( BackendDB *be )
                XLOCK_ID(bdb->bi_dbenv, &bdb->bi_cache.c_locker);
        }
 
-       /* If we're in server mode and time-based checkpointing is enabled,
-        * submit a task to perform periodic checkpoints.
-        */
-       if ( slapMode & SLAP_SERVER_MODE && bdb->bi_txn_cp &&
-               bdb->bi_txn_cp_min )  {
-               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
-               ldap_pvt_runqueue_insert( &slapd_rq, bdb->bi_txn_cp_min*60,
-                       bdb_checkpoint, bdb );
-               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
-       }
+       bdb->bi_flags |= BDB_IS_OPEN;
 
        return 0;
 }
@@ -375,7 +540,12 @@ bdb_db_close( BackendDB *be )
        struct bdb_db_info *db;
        bdb_idl_cache_entry_t *entry, *next_entry;
 
-       while( bdb->bi_ndatabases-- ) {
+       bdb->bi_flags &= ~BDB_IS_OPEN;
+
+       ber_bvarray_free( bdb->bi_db_config );
+       bdb->bi_db_config = NULL;
+
+       while( bdb->bi_databases && bdb->bi_ndatabases-- ) {
                db = bdb->bi_databases[bdb->bi_ndatabases];
                rc = db->bdi_db->close( db->bdi_db, 0 );
                /* Lower numbered names are not strdup'd */
@@ -384,13 +554,14 @@ bdb_db_close( BackendDB *be )
                free( db );
        }
        free( bdb->bi_databases );
-       bdb_attr_index_destroy( bdb->bi_attrs );
+       bdb->bi_databases = NULL;
 
        bdb_cache_release_all (&bdb->bi_cache);
 
        if ( bdb->bi_idl_cache_max_size ) {
                ldap_pvt_thread_rdwr_wlock ( &bdb->bi_idl_tree_rwlock );
                avl_free( bdb->bi_idl_tree, NULL );
+               bdb->bi_idl_tree = NULL;
                entry = bdb->bi_idl_lru_head;
                while ( entry != NULL ) {
                        next_entry = entry->idl_lru_next;
@@ -400,22 +571,15 @@ bdb_db_close( BackendDB *be )
                        free( entry );
                        entry = next_entry;
                }
+               bdb->bi_idl_lru_head = bdb->bi_idl_lru_tail = NULL;
                ldap_pvt_thread_rdwr_wunlock ( &bdb->bi_idl_tree_rwlock );
        }
 
-       if ( !( slapMode & SLAP_TOOL_QUICK )) {
+       if ( !( slapMode & SLAP_TOOL_QUICK ) && bdb->bi_dbenv ) {
                XLOCK_ID_FREE(bdb->bi_dbenv, bdb->bi_cache.c_locker);
+               bdb->bi_cache.c_locker = 0;
        }
 
-       return 0;
-}
-
-static int
-bdb_db_destroy( BackendDB *be )
-{
-       int rc;
-       struct bdb_info *bdb = (struct bdb_info *) be->be_private;
-
        /* close db environment */
        if( bdb->bi_dbenv ) {
                /* force a checkpoint */
@@ -423,7 +587,7 @@ bdb_db_destroy( BackendDB *be )
                        rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE );
                        if( rc != 0 ) {
                                Debug( LDAP_DEBUG_ANY,
-                                       "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n",
+                                       "bdb_db_close: txn_checkpoint failed: %s (%d)\n",
                                        db_strerror(rc), rc, 0 );
                        }
                }
@@ -432,13 +596,32 @@ bdb_db_destroy( BackendDB *be )
                bdb->bi_dbenv = NULL;
                if( rc != 0 ) {
                        Debug( LDAP_DEBUG_ANY,
-                               "bdb_db_destroy: close failed: %s (%d)\n",
+                               "bdb_db_close: close failed: %s (%d)\n",
                                db_strerror(rc), rc, 0 );
                        return rc;
                }
        }
 
+       rc = alock_close( &bdb->bi_alock_info );
+       if( rc != 0 ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_close: alock_close failed\n", 0, 0, 0 );
+               return -1;
+       }
+
+       return 0;
+}
+
+static int
+bdb_db_destroy( BackendDB *be )
+{
+       int rc;
+       struct bdb_info *bdb = (struct bdb_info *) be->be_private;
+
        if( bdb->bi_dbenv_home ) ch_free( bdb->bi_dbenv_home );
+       if( bdb->bi_db_config_path ) ch_free( bdb->bi_db_config_path );
+
+       bdb_attr_index_destroy( bdb->bi_attrs );
 
        ldap_pvt_thread_rdwr_destroy ( &bdb->bi_cache.c_rwlock );
        ldap_pvt_thread_mutex_destroy( &bdb->bi_cache.lru_mutex );
@@ -507,13 +690,14 @@ bdb_back_initialize(
 #endif
 
                ver = (major << 24) | (minor << 16) | patch;
-               if( ver < DB_VERSION_FULL )
-               {
+               if( ver != DB_VERSION_FULL ) {
+                       /* fail if a versions don't match */
                        Debug( LDAP_DEBUG_ANY,
                                LDAP_XSTRING(bdb_back_initialize) ": "
                                "BDB library version mismatch:"
                                " expected " DB_VERSION_STRING ","
                                " got %s\n", version, 0, 0 );
+                       return -1;
                }
 
                Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_back_initialize)
@@ -577,7 +761,7 @@ bdb_back_initialize(
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = 0;
 
-       rc = bdb_back_init_cf(bi);
+       rc = bdb_back_init_cf( bi );
 
        return rc;
 }
index 6ca4e3208ab89e0e5979042199f7fe00f43ac3fc..1f8af04ce46746ed0b7a4c659e990a01ea89211a 100644 (file)
@@ -62,11 +62,11 @@ int bdb_modify_internal(
                case LDAP_MOD_REPLACE:
                        if ( mod->sm_desc == slap_schema.si_ad_structuralObjectClass ) {
                                value_match( &match, slap_schema.si_ad_structuralObjectClass,
-                               slap_schema.si_ad_structuralObjectClass->ad_type->sat_equality,
-                               SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
-                               &mod->sm_values[0], &scbva[0], text );
-                               if ( !match )
-                                       glue_attr_delete = 1;
+                                       slap_schema.si_ad_structuralObjectClass->
+                                               ad_type->sat_equality,
+                                       SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
+                                       &mod->sm_values[0], &scbva[0], text );
+                               if ( !match ) glue_attr_delete = 1;
                        }
                }
                if ( glue_attr_delete )
@@ -181,9 +181,7 @@ int bdb_modify_internal(
                        e->e_ocflags = 0;
                }
 
-               if ( glue_attr_delete ) {
-                       e->e_ocflags = 0;
-               }
+               if ( glue_attr_delete ) e->e_ocflags = 0;
 
                /* check if modified attribute was indexed
                 * but not in case of NOOP... */
@@ -271,6 +269,7 @@ bdb_modify( Operation *op, SlapReply *rs )
        DB_TXN  *ltid = NULL, *lt2;
        struct bdb_op_info opinfo = {0};
        Entry           dummy = {0};
+       int                     fakeroot = 0;
 
        u_int32_t       locker = 0;
        DB_LOCK         lock;
@@ -311,6 +310,10 @@ retry:     /* transaction retry */
                        rs->sr_text = "internal error";
                        goto return_results;
                }
+               if ( op->o_abandon ) {
+                       rs->sr_err = SLAPD_ABANDON;
+                       goto return_results;
+               }
                ldap_pvt_thread_yield();
                bdb_trans_backoff( ++num_retries );
        }
@@ -341,6 +344,8 @@ retry:      /* transaction retry */
        rs->sr_err = bdb_dn2entry( op, ltid, &op->o_req_ndn, &ei, 1,
                locker, &lock );
 
+       e = ei->bei_e;
+
        if ( rs->sr_err != 0 ) {
                Debug( LDAP_DEBUG_TRACE,
                        LDAP_XSTRING(bdb_modify) ": dn2entry failed (%d)\n",
@@ -350,6 +355,19 @@ retry:     /* transaction retry */
                case DB_LOCK_NOTGRANTED:
                        goto retry;
                case DB_NOTFOUND:
+                       if ( BER_BVISEMPTY( &op->o_req_ndn )) {
+                               struct berval gluebv = BER_BVC("glue");
+                               e = ch_calloc( 1, sizeof(Entry));
+                               e->e_name.bv_val = ch_strdup( "" );
+                               ber_dupbv( &e->e_nname, &e->e_name );
+                               attr_merge_one( e, slap_schema.si_ad_objectClass,
+                                       &gluebv, NULL );
+                               attr_merge_one( e, slap_schema.si_ad_structuralObjectClass,
+                                       &gluebv, NULL );
+                               e->e_private = ei;
+                               fakeroot = 1;
+                               rs->sr_err = 0;
+                       }
                        break;
                case LDAP_BUSY:
                        rs->sr_text = "ldap server busy";
@@ -361,7 +379,6 @@ retry:      /* transaction retry */
                }
        }
 
-       e = ei->bei_e;
        /* acquire and lock entry */
        /* FIXME: dn2entry() should return non-glue entry */
        if (( rs->sr_err == DB_NOTFOUND ) ||
@@ -377,7 +394,7 @@ retry:      /* transaction retry */
 
                } else {
                        rs->sr_ref = referral_rewrite( default_referral, NULL,
-                                       &op->o_req_dn, LDAP_SCOPE_DEFAULT );
+                               &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                }
 
                rs->sr_err = LDAP_REFERRAL;
@@ -427,20 +444,18 @@ retry:    /* transaction retry */
                        &slap_pre_read_bv, preread_ctrl ) )
                {
                        Debug( LDAP_DEBUG_TRACE,
-                               "<=- " LDAP_XSTRING(bdb_modify)
-                               ": pre-read failed!\n", 0, 0, 0 );
+                               "<=- " LDAP_XSTRING(bdb_modify) ": pre-read failed!\n",
+                               0, 0, 0 );
                        goto return_results;
                }
        }
 
        /* nested transaction */
-       rs->sr_err = TXN_BEGIN( bdb->bi_dbenv, ltid, &lt2, 
-               bdb->bi_db_opflags );
+       rs->sr_err = TXN_BEGIN( bdb->bi_dbenv, ltid, &lt2, bdb->bi_db_opflags );
        rs->sr_text = NULL;
        if( rs->sr_err != 0 ) {
                Debug( LDAP_DEBUG_TRACE,
-                       LDAP_XSTRING(bdb_modify) ": txn_begin(2) failed: "
-                       "%s (%d)\n",
+                       LDAP_XSTRING(bdb_modify) ": txn_begin(2) failed: " "%s (%d)\n",
                        db_strerror(rs->sr_err), rs->sr_err, 0 );
                rs->sr_err = LDAP_OTHER;
                rs->sr_text = "internal error";
@@ -472,8 +487,8 @@ retry:      /* transaction retry */
        rs->sr_err = bdb_id2entry_update( op->o_bd, lt2, &dummy );
        if ( rs->sr_err != 0 ) {
                Debug( LDAP_DEBUG_TRACE,
-                       LDAP_XSTRING(bdb_modify) ": id2entry update failed "
-                       "(%d)\n", rs->sr_err, 0, 0 );
+                       LDAP_XSTRING(bdb_modify) ": id2entry update failed " "(%d)\n",
+                       rs->sr_err, 0, 0 );
                switch( rs->sr_err ) {
                case DB_LOCK_DEADLOCK:
                case DB_LOCK_NOTGRANTED:
@@ -514,11 +529,16 @@ retry:    /* transaction retry */
        } else {
                /* may have changed in bdb_modify_internal() */
                e->e_ocflags = dummy.e_ocflags;
-               rc = bdb_cache_modify( e, dummy.e_attrs, bdb->bi_dbenv, locker, &lock );
-               switch( rc ) {
-               case DB_LOCK_DEADLOCK:
-               case DB_LOCK_NOTGRANTED:
-                       goto retry;
+               if ( fakeroot ) {
+                       e->e_private = NULL;
+                       entry_free( e );
+               } else {
+                       rc = bdb_cache_modify( e, dummy.e_attrs, bdb->bi_dbenv, locker, &lock );
+                       switch( rc ) {
+                       case DB_LOCK_DEADLOCK:
+                       case DB_LOCK_NOTGRANTED:
+                               goto retry;
+                       }
                }
                dummy.e_attrs = NULL;
 
index 4385e8e92cdd05f43f98b505b9abb08438090ac5..54c487c4507b118cf8a574c323aef8bf16dc55fd 100644 (file)
@@ -103,6 +103,10 @@ retry:     /* transaction retry */
                        rs->sr_text = "internal error";
                        goto return_results;
                }
+               if ( op->o_abandon ) {
+                       rs->sr_err = SLAPD_ABANDON;
+                       goto return_results;
+               }
                parent_is_glue = 0;
                parent_is_leaf = 0;
                ldap_pvt_thread_yield();
@@ -289,7 +293,10 @@ retry:     /* transaction retry */
 
                /* check parent for "children" acl */
                rs->sr_err = access_allowed( op, p,
-                       children, NULL, ACL_WRITE, NULL );
+                       children, NULL,
+                       op->oq_modrdn.rs_newSup == NULL ?
+                               ACL_WRITE : ACL_WDEL,
+                       NULL );
 
                if ( ! rs->sr_err ) {
                        switch( opinfo.boi_err ) {
@@ -330,7 +337,10 @@ retry:     /* transaction retry */
 
                                /* check parent for "children" acl */
                                rs->sr_err = access_allowed( op, p,
-                                       children, NULL, ACL_WRITE, NULL );
+                                       children, NULL,
+                                       op->oq_modrdn.rs_newSup == NULL ?
+                                               ACL_WRITE : ACL_WDEL,
+                                       NULL );
 
                                p = NULL;
 
@@ -397,8 +407,13 @@ retry:     /* transaction retry */
                        np_dn = op->oq_modrdn.rs_newSup;
                        np_ndn = op->oq_modrdn.rs_nnewSup;
 
-                       /* newSuperior == oldParent?, if so ==> ERROR */
+                       /* newSuperior == oldParent? - checked above */
                        /* newSuperior == entry being moved?, if so ==> ERROR */
+                       if ( dnIsSuffix( np_ndn, &e->e_nname )) {
+                               rs->sr_err = LDAP_NAMING_VIOLATION;
+                               rs->sr_text = "new superior is invalid";
+                               goto return_results;
+                       }
                        /* Get Entry with dn=newSuperior. Does newSuperior exist? */
 
                        rs->sr_err = bdb_dn2entry( op, ltid, np_ndn,
@@ -437,7 +452,7 @@ retry:      /* transaction retry */
 
                        /* check newSuperior for "children" acl */
                        rs->sr_err = access_allowed( op, np, children,
-                               NULL, ACL_WRITE, NULL );
+                               NULL, ACL_WADD, NULL );
 
                        if( ! rs->sr_err ) {
                                switch( opinfo.boi_err ) {
@@ -492,7 +507,7 @@ retry:      /* transaction retry */
 
                                        /* check parent for "children" acl */
                                        rs->sr_err = access_allowed( op, np,
-                                               children, NULL, ACL_WRITE, NULL );
+                                               children, NULL, ACL_WADD, NULL );
 
                                        np = NULL;
 
index d3921feca51f1f5f89880d4b734be555357b92a0..7d3d49b7d335a6b63ded2dc6d14338ee21733d8f 100644 (file)
@@ -31,25 +31,16 @@ LDAP_BEGIN_DECL
  */
 
 #define bdb_attr_mask                          BDB_SYMBOL(attr_mask)
+#define bdb_attr_flush                         BDB_SYMBOL(attr_flush)
 #define bdb_attr_index_config          BDB_SYMBOL(attr_index_config)
 #define bdb_attr_index_destroy         BDB_SYMBOL(attr_index_destroy)
+#define bdb_attr_index_free                    BDB_SYMBOL(attr_index_free)
 #define bdb_attr_index_unparse         BDB_SYMBOL(attr_index_unparse)
 
-#ifdef LDAP_COMP_MATCH
-#define bdb_attr_comp_ref                      BDB_SYMBOL(attr_comp_ref)
-#define bdb_attr_mask_cr                       BDB_SYMBOL(attr_mask_cr)
-void bdb_attr_comp_ref( struct bdb_info *bdb,
-       AttributeDescription *desc,
-       ComponentReference **cr );
-void bdb_attr_mask_cr( struct bdb_info *bdb,
-       AttributeDescription *desc,
-       slap_mask_t *indexmask,
-       ComponentReference **cr );
-#endif
+AttrInfo *bdb_attr_mask( struct bdb_info *bdb,
+       AttributeDescription *desc );
 
-void bdb_attr_mask( struct bdb_info *bdb,
-       AttributeDescription *desc,
-       slap_mask_t *indexmask );
+void bdb_attr_flush( struct bdb_info *bdb );
 
 int bdb_attr_index_config LDAP_P(( struct bdb_info *bdb,
        const char *fname, int lineno,
@@ -57,6 +48,8 @@ int bdb_attr_index_config LDAP_P(( struct bdb_info *bdb,
 
 void bdb_attr_index_unparse LDAP_P(( struct bdb_info *bdb, BerVarray *bva ));
 void bdb_attr_index_destroy LDAP_P(( Avlnode *tree ));
+void bdb_attr_index_free LDAP_P(( struct bdb_info *bdb,
+       AttributeDescription *ad ));
 
 /*
  * config.c
@@ -146,7 +139,9 @@ int bdb_fix_dn( Entry *e, int checkit );
 #if DB_VERSION_FULL < 0x04030000
 void bdb_errcall( const char *pfx, char * msg );
 #else
+#define bdb_msgcall                                    BDB_SYMBOL(msgcall)
 void bdb_errcall( const DB_ENV *env, const char *pfx, const char * msg );
+void bdb_msgcall( const DB_ENV *env, const char * msg );
 #endif
 
 #ifdef HAVE_EBCDIC
@@ -249,6 +244,9 @@ bdb_idl_cache_del(
 #define bdb_idl_insert                         BDB_SYMBOL(idl_insert)
 #define bdb_idl_intersection           BDB_SYMBOL(idl_intersection)
 #define bdb_idl_union                          BDB_SYMBOL(idl_union)
+#define bdb_idl_sort                           BDB_SYMBOL(idl_sort)
+#define bdb_idl_append                         BDB_SYMBOL(idl_append)
+#define bdb_idl_append_one                     BDB_SYMBOL(idl_append_one)
 
 #define bdb_idl_fetch_key                      BDB_SYMBOL(idl_fetch_key)
 #define bdb_idl_insert_key                     BDB_SYMBOL(idl_insert_key)
@@ -294,6 +292,9 @@ bdb_idl_union(
 ID bdb_idl_first( ID *ids, ID *cursor );
 ID bdb_idl_next( ID *ids, ID *cursor );
 
+void bdb_idl_sort( ID *ids );
+int bdb_idl_append( ID *a, ID *b );
+int bdb_idl_append_one( ID *ids, ID id );
 
 
 /*
index b2f34ed8b7acaae61c529e9b57094421cb377b34..830497e49fa82c2371a055d83bbd653cf49b625f 100644 (file)
@@ -150,7 +150,11 @@ static int search_aliases(
        Entry *matched, *a;
        EntryInfo *ei;
        struct berval bv_alias = BER_BVC( "alias" );
+#ifdef LDAP_COMP_MATCH
        AttributeAssertion aa_alias = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion aa_alias = { NULL, BER_BVNULL };
+#endif
        Filter  af;
        DB_LOCK locka, lockr;
        int first = 1;
@@ -1016,10 +1020,18 @@ static int search_candidates(
        int rc, depth = 1;
        Filter          f, rf, xf, nf;
        ID              *stack;
+#ifdef LDAP_COMP_MATCH
        AttributeAssertion aa_ref = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion aa_ref = { NULL, BER_BVNULL };
+#endif
 #ifdef BDB_SUBENTRIES
        Filter  sf;
+#ifdef LDAP_COMP_MATCH
        AttributeAssertion aa_subentry = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion aa_subentry = { NULL, BER_BVNULL };
+#endif
 #endif
 
        /*
@@ -1249,7 +1261,8 @@ send_paged_response(
 
        op->o_conn->c_pagedresults_state.ps_cookie = respcookie;
        op->o_conn->c_pagedresults_state.ps_count =
-               ((PagedResultsState *)op->o_pagedresults_state)->ps_count + rs->sr_nentries;
+               ((PagedResultsState *)op->o_pagedresults_state)->ps_count +
+               rs->sr_nentries;
 
        /* return size of 0 -- no estimate */
        ber_printf( ber, "{iO}", 0, &cookie ); 
index a702106f35ba0c4621793821566c6bb41926e712..9ef48193f706702903b0a394703d792da941a7a5 100644 (file)
@@ -142,6 +142,9 @@ ID bdb_tool_dn2id_get(
        Opheader ohdr = {0};
        EntryInfo ei = {0};
 
+       if ( BER_BVISEMPTY(dn) )
+               return 0;
+
        op.o_hdr = &ohdr;
        op.o_bd = be;
        op.o_tmpmemctx = NULL;
@@ -160,7 +163,20 @@ int bdb_tool_id2entry_get(
        Entry **e
 )
 {
-       return bdb_id2entry( be, NULL, id, e );
+       int rc = bdb_id2entry( be, NULL, id, e );
+
+       if ( rc == DB_NOTFOUND && id == 0 ) {
+               Entry *dummy = ch_calloc( 1, sizeof(Entry) );
+               struct berval gluebv = BER_BVC("glue");
+               dummy->e_name.bv_val = ch_strdup( "" );
+               dummy->e_nname.bv_val = ch_strdup( "" );
+               attr_merge_one( dummy, slap_schema.si_ad_objectClass, &gluebv, NULL );
+               attr_merge_one( dummy, slap_schema.si_ad_structuralObjectClass,
+                       &gluebv, NULL );
+               *e = dummy;
+               rc = LDAP_SUCCESS;
+       }
+       return rc;
 }
 
 Entry* bdb_tool_entry_get( BackendDB *be, ID id )
@@ -215,15 +231,19 @@ static int bdb_tool_next_id(
        struct berval dn = e->e_name;
        struct berval ndn = e->e_nname;
        struct berval pdn, npdn;
-       EntryInfo *ei = NULL;
+       EntryInfo *ei = NULL, eidummy;
        int rc;
 
-       if (ndn.bv_len == 0) return 0;
+       if (ndn.bv_len == 0) {
+               e->e_id = 0;
+               return 0;
+       }
 
        rc = bdb_cache_find_ndn( op, tid, &ndn, &ei );
        if ( ei ) bdb_cache_entryinfo_unlock( ei );
        if ( rc == DB_NOTFOUND ) {
                if ( !be_issuffix( op->o_bd, &ndn ) ) {
+                       ID eid = e->e_id;
                        dnParent( &dn, &pdn );
                        dnParent( &ndn, &npdn );
                        e->e_name = pdn;
@@ -234,6 +254,14 @@ static int bdb_tool_next_id(
                        if ( rc ) {
                                return rc;
                        }
+                       /* If parent didn't exist, it was created just now
+                        * and its ID is now in e->e_id. Make sure the current
+                        * entry gets added under the new parent ID.
+                        */
+                       if ( eid != e->e_id ) {
+                               eidummy.bei_id = e->e_id;
+                               ei = &eidummy;
+                       }
                }
                rc = bdb_next_id( op->o_bd, tid, &e->e_id );
                if ( rc ) {
@@ -501,7 +529,6 @@ ID bdb_tool_entry_modify(
        assert( text->bv_val[0] == '\0' );      /* overconservative? */
 
        assert ( e->e_id != NOID );
-       assert ( e->e_id != 0 );
 
        Debug( LDAP_DEBUG_TRACE,
                "=> " LDAP_XSTRING(bdb_tool_entry_modify) "( %ld, \"%s\" )\n",
@@ -538,6 +565,10 @@ ID bdb_tool_entry_modify(
                goto done;
        }
 
+#if 0
+       /* FIXME: this is bogus, we don't have the old values to delete
+        * from the index because the given entry has already been modified.
+        */
        rc = bdb_index_entry_del( &op, tid, e );
        if( rc != 0 ) {
                snprintf( text->bv_val, text->bv_len,
@@ -548,6 +579,7 @@ ID bdb_tool_entry_modify(
                        text->bv_val, 0, 0 );
                goto done;
        }
+#endif
 
        rc = bdb_index_entry_add( &op, tid, e );
        if( rc != 0 ) {
index a487d70e32438360d68d124035a411a720d04955..db6fe0bf77ae6a4a6aec2c31c783022131c0764c 100644 (file)
@@ -39,24 +39,25 @@ dnssrv_back_bind(
                op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val, 
                op->oq_bind.rb_method, NULL );
                
-       if( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE &&
-               op->oq_bind.rb_cred.bv_val != NULL && op->oq_bind.rb_cred.bv_len )
+       if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE &&
+               !BER_BVISNULL( &op->oq_bind.rb_cred ) &&
+               !BER_BVISEMPTY( &op->oq_bind.rb_cred ) )
        {
                Statslog( LDAP_DEBUG_STATS,
                        "%s DNSSRV BIND dn=\"%s\" provided passwd\n",
                        op->o_log_prefix,
-                       op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val , 0, 0, 0 );
+                       BER_BVISNULL( &op->o_req_dn ) ? "" : op->o_req_dn.bv_val , 0, 0, 0 );
 
                Debug( LDAP_DEBUG_TRACE,
                        "DNSSRV: BIND dn=\"%s\" provided cleartext password\n",
-                       op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val, 0, 0 );
+                       BER_BVISNULL( &op->o_req_dn ) ? "" : op->o_req_dn.bv_val, 0, 0 );
 
                send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
-                       "you shouldn\'t send strangers your password" );
+                       "you shouldn't send strangers your password" );
 
        } else {
                Debug( LDAP_DEBUG_TRACE, "DNSSRV: BIND dn=\"%s\"\n",
-                       op->o_req_dn.bv_val == NULL ? "" : op->o_req_dn.bv_val, 0, 0 );
+                       BER_BVISNULL( &op->o_req_dn ) ? "" : op->o_req_dn.bv_val, 0, 0 );
 
                send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
                        "anonymous bind expected" );
index 980d231200509f2cb137e937d8bf3fe5f2622dfb..2abd7ffee9d80cb9ea730924827096613464d6ea 100644 (file)
@@ -67,6 +67,10 @@ dnssrv_back_initialize(
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = 0;
 
+#ifdef SLAP_OVERLAY_ACCESS
+       bi->bi_access_allowed = slap_access_always_allowed;
+#endif /* SLAP_OVERLAY_ACCESS */
+
        return 0;
 }
 
index 77cd3fcc3f159e849af0b6d2d1677dfa0f439f01..7a03d3c6b7a933869f070349492d738611b6874a 100644 (file)
@@ -67,16 +67,18 @@ dnssrv_back_referrals(
                rs->sr_err = LDAP_REFERRAL;
                rs->sr_ref = default_referral;
                send_ldap_result( op, rs );
+               rs->sr_ref = NULL;
                return LDAP_REFERRAL;
        }
 
        Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
                op->o_req_dn.bv_val, domain, 0 );
 
-       if( ( rc = ldap_domain2hostlist( domain, &hostlist ) ) ) {
+       i = ldap_domain2hostlist( domain, &hostlist );
+       if ( i ) {
                Debug( LDAP_DEBUG_TRACE,
                        "DNSSRV: domain2hostlist(%s) returned %d\n",
-                       domain, rc, 0 );
+                       domain, i, 0 );
                rs->sr_text = "no DNS SRV RR available for DN";
                rc = LDAP_NO_SUCH_OBJECT;
                goto done;
@@ -93,11 +95,11 @@ dnssrv_back_referrals(
        for( i=0; hosts[i] != NULL; i++) {
                struct berval url;
 
-               url.bv_len = sizeof("ldap://")-1 + strlen(hosts[i]);
+               url.bv_len = STRLENOF( "ldap://" ) + strlen( hosts[i] );
                url.bv_val = ch_malloc( url.bv_len + 1 );
 
                strcpy( url.bv_val, "ldap://" );
-               strcpy( &url.bv_val[sizeof("ldap://")-1], hosts[i] );
+               strcpy( &url.bv_val[STRLENOF( "ldap://" )], hosts[i] );
 
                if ( ber_bvarray_add( &urls, &url ) < 0 ) {
                        free( url.bv_val );
@@ -117,6 +119,8 @@ dnssrv_back_referrals(
        rs->sr_ref = urls;
        send_ldap_error( op, rs, LDAP_REFERRAL,
                "DNS SRV generated referrals" );
+       rs->sr_ref = NULL;
+       rc = LDAP_REFERRAL;
 
 done:
        if( domain != NULL ) ch_free( domain );
index 26fc1a32cd8823721710ed2bf59939fd25bd03e5..fa4917867319bb3b190a76c1c452af7746031bbc 100644 (file)
@@ -104,11 +104,11 @@ dnssrv_back_search(
        for( i=0; hosts[i] != NULL; i++) {
                struct berval url;
 
-               url.bv_len = sizeof("ldap://")-1 + strlen(hosts[i]);
+               url.bv_len = STRLENOF( "ldap://" ) + strlen(hosts[i]);
                url.bv_val = ch_malloc( url.bv_len + 1 );
 
                strcpy( url.bv_val, "ldap://" );
-               strcpy( &url.bv_val[sizeof("ldap://")-1], hosts[i] );
+               strcpy( &url.bv_val[STRLENOF( "ldap://" )], hosts[i] );
 
                if( ber_bvarray_add( &urls, &url ) < 0 ) {
                        free( url.bv_val );
@@ -167,21 +167,20 @@ dnssrv_back_search(
                send_ldap_error( op, rs, LDAP_SUCCESS, NULL );
 
        } else {
-               Entry *e = ch_calloc( 1, sizeof(Entry) );
+               Entry e = { 0 };
                AttributeDescription *ad_objectClass
                        = slap_schema.si_ad_objectClass;
                AttributeDescription *ad_ref = slap_schema.si_ad_ref;
-               e->e_name.bv_val = strdup( op->o_req_dn.bv_val );
-               e->e_name.bv_len = op->o_req_dn.bv_len;
-               e->e_nname.bv_val = strdup( op->o_req_ndn.bv_val );
-               e->e_nname.bv_len = op->o_req_ndn.bv_len;
+               e.e_name.bv_val = strdup( op->o_req_dn.bv_val );
+               e.e_name.bv_len = op->o_req_dn.bv_len;
+               e.e_nname.bv_val = strdup( op->o_req_ndn.bv_val );
+               e.e_nname.bv_len = op->o_req_ndn.bv_len;
 
-               e->e_attrs = NULL;
-               e->e_private = NULL;
+               e.e_attrs = NULL;
+               e.e_private = NULL;
 
-               attr_mergeit_one( e, ad_objectClass, &slap_schema.si_oc_top->soc_cname );
-               attr_mergeit_one( e, ad_objectClass, &slap_schema.si_oc_referral->soc_cname );
-               attr_mergeit_one( e, ad_objectClass, &slap_schema.si_oc_extensibleObject->soc_cname );
+               attr_merge_one( &e, ad_objectClass, &slap_schema.si_oc_referral->soc_cname, NULL );
+               attr_merge_one( &e, ad_objectClass, &slap_schema.si_oc_extensibleObject->soc_cname, NULL );
 
                if ( ad_dc ) {
                        char            *p;
@@ -201,22 +200,22 @@ dnssrv_back_search(
                                bv.bv_len = strlen( bv.bv_val );
                        }
 
-                       attr_mergeit_one( e, ad_dc, &bv );
+                       attr_merge_normalize_one( &e, ad_dc, &bv, NULL );
                }
 
                if ( ad_associatedDomain ) {
                        struct berval   bv;
 
                        ber_str2bv( domain, 0, 0, &bv );
-                       attr_mergeit_one( e, ad_associatedDomain, &bv );
+                       attr_merge_normalize_one( &e, ad_associatedDomain, &bv, NULL );
                }
 
-               attr_mergeit( e, ad_ref, urls );
+               attr_merge_normalize_one( &e, ad_ref, urls, NULL );
 
-               rc = test_filter( op, e, op->oq_search.rs_filter ); 
+               rc = test_filter( op, &e, op->oq_search.rs_filter ); 
 
                if( rc == LDAP_COMPARE_TRUE ) {
-                       rs->sr_entry = e;
+                       rs->sr_entry = &e;
                        rs->sr_attrs = op->oq_search.rs_attrs;
                        rs->sr_flags = REP_ENTRY_MODIFIABLE;
                        send_search_entry( op, rs );
@@ -224,7 +223,7 @@ dnssrv_back_search(
                        rs->sr_attrs = NULL;
                }
 
-               entry_free( e );
+               entry_clean( &e );
 
                rs->sr_err = LDAP_SUCCESS;
                send_ldap_result( op, rs );
index e7fa1e7ec330d23aa30f663dc60f33d30bc6ae7e..854e5c3b5411a3c8a9cdb5fdc39d3691a707fe08 100644 (file)
@@ -19,13 +19,13 @@ XXDIR = $(srcdir)/../back-bdb
 
 XXSRCS = init.c tools.c config.c \
        add.c bind.c compare.c delete.c modify.c modrdn.c search.c \
-       extended.c referral.c operational.c \
+       extended.c referral.c operational.c alock.c \
        attr.c index.c key.c dbcache.c filterindex.c trans.c \
        dn2entry.c dn2id.c error.c id2entry.c idl.c nextid.c cache.c
 SRCS = $(XXSRCS)
 OBJS = init.lo tools.lo config.lo \
        add.lo bind.lo compare.lo delete.lo modify.lo modrdn.lo search.lo \
-       extended.lo referral.lo operational.lo \
+       extended.lo referral.lo operational.lo alock.lo \
        attr.lo index.lo key.lo dbcache.lo filterindex.lo trans.lo \
        dn2entry.lo dn2id.lo error.lo id2entry.lo idl.lo nextid.lo cache.lo
 
index 48b2e949ad14c4f1e718cfd72ec087037dbf5d00..0a147799298913f501063bb227001c5611dbfe76 100644 (file)
@@ -37,56 +37,53 @@ struct ldapconn {
        struct berval           lc_bound_ndn;
        struct berval           lc_local_ndn;
        int                     lc_bound;
+       int                     lc_ispriv;
        ldap_pvt_thread_mutex_t lc_mutex;
 };
 
-struct ldapauth {
-       struct berval   la_authcID;
-       struct berval   la_authcDN;
-       struct berval   la_passwd;
-
-       struct berval   la_authzID;
-       
-       int             la_authmethod;
-       int             la_sasl_flags;
-       struct berval   la_sasl_mech;
-       struct berval   la_sasl_realm;
-       
-#define LDAP_BACK_AUTH_NONE            0x00U
-#define        LDAP_BACK_AUTH_NATIVE_AUTHZ     0x01U
-#define        LDAP_BACK_AUTH_OVERRIDE         0x02U
-       unsigned        la_flags;
+/*
+ * identity assertion modes
+ */
+enum {
+       LDAP_BACK_IDASSERT_LEGACY,
+       LDAP_BACK_IDASSERT_NOASSERT,
+       LDAP_BACK_IDASSERT_ANONYMOUS,
+       LDAP_BACK_IDASSERT_SELF,
+       LDAP_BACK_IDASSERT_OTHERDN,
+       LDAP_BACK_IDASSERT_OTHERID
 };
 
 struct ldapinfo {
        char            *url;
        LDAPURLDesc     *lud;
-       struct ldapauth acl_la;
-#define        acl_authcDN     acl_la.la_authcDN
-#define        acl_passwd      acl_la.la_passwd
+
+       slap_bindconf   acl_la;
+#define        acl_authcID     acl_la.sb_authcId
+#define        acl_authcDN     acl_la.sb_binddn
+#define        acl_passwd      acl_la.sb_cred
+#define        acl_authzID     acl_la.sb_authzId
+#define        acl_authmethod  acl_la.sb_method
+#define        acl_sasl_mech   acl_la.sb_saslmech
+#define        acl_sasl_realm  acl_la.sb_realm
 
        /* ID assert stuff */
        int             idassert_mode;
-#define        LDAP_BACK_IDASSERT_LEGACY       0
-#define        LDAP_BACK_IDASSERT_NOASSERT     1
-#define        LDAP_BACK_IDASSERT_ANONYMOUS    2
-#define        LDAP_BACK_IDASSERT_SELF         3
-#define        LDAP_BACK_IDASSERT_OTHERDN      4
-#define        LDAP_BACK_IDASSERT_OTHERID      5
-
-       struct ldapauth idassert_la;
-#define        idassert_authcID        idassert_la.la_authcID
-#define        idassert_authcDN        idassert_la.la_authcDN
-#define        idassert_passwd         idassert_la.la_passwd
-#define        idassert_authzID        idassert_la.la_authzID
-#define        idassert_authmethod     idassert_la.la_authmethod
-#define        idassert_sasl_flags     idassert_la.la_sasl_flags
-#define        idassert_sasl_mech      idassert_la.la_sasl_mech
-#define        idassert_sasl_realm     idassert_la.la_sasl_realm
-#define        idassert_flags          idassert_la.la_flags
+
+       slap_bindconf   idassert_la;
+#define        idassert_authcID        idassert_la.sb_authcId
+#define        idassert_authcDN        idassert_la.sb_binddn
+#define        idassert_passwd         idassert_la.sb_cred
+#define        idassert_authzID        idassert_la.sb_authzId
+#define        idassert_authmethod     idassert_la.sb_method
+#define        idassert_sasl_mech      idassert_la.sb_saslmech
+#define        idassert_sasl_realm     idassert_la.sb_realm
+
+       unsigned        idassert_flags;
+#define LDAP_BACK_AUTH_NONE            0x00U
+#define        LDAP_BACK_AUTH_NATIVE_AUTHZ     0x01U
+#define        LDAP_BACK_AUTH_OVERRIDE         0x02U
+
        BerVarray       idassert_authz;
-       
-       int             idassert_ppolicy;
        /* end of ID assert stuff */
 
        ldap_pvt_thread_mutex_t         conn_mutex;
@@ -116,6 +113,9 @@ typedef enum ldap_back_send_t {
        LDAP_BACK_SENDRESULT            = (LDAP_BACK_SENDOK|LDAP_BACK_SENDERR)
 } ldap_back_send_t;
 
+/* define to use asynchronous StartTLS */
+#define SLAP_STARTTLS_ASYNCHRONOUS
+
 LDAP_END_DECL
 
 #include "proto-ldap.h"
index 446ce1c458a74c0765857f0782154de1545b1d99..e53e7b5b3f3b40e37b44d8bcbb0baa66618ab727 100644 (file)
@@ -251,7 +251,7 @@ ldap_back_prepare_conn( struct ldapconn **lcp, Operation *op, SlapReply *rs, lda
        if ( ( LDAP_BACK_USE_TLS( li ) || ( op->o_conn->c_is_tls && LDAP_BACK_PROPAGATE_TLS( li ) ) )
                                && !ldap_is_ldaps_url( li->url ) )
        {
-#if 1
+#ifdef SLAP_STARTTLS_ASYNCHRONOUS
                /*
                 * use asynchronous StartTLS
                 * in case, chase referral (not implemented yet)
@@ -315,12 +315,12 @@ retry:;
                                ldap_msgfree( res );
                        }
                }
-#else
+#else /* ! SLAP_STARTTLS_ASYNCHRONOUS */
                /*
                 * use synchronous StartTLS
                 */
                rs->sr_err = ldap_start_tls_s( ld, NULL, NULL );
-#endif
+#endif /* ! SLAP_STARTTLS_ASYNCHRONOUS */
 
                /* if StartTLS is requested, only attempt it if the URL
                 * is not "ldaps://"; this may occur not only in case
@@ -360,8 +360,7 @@ struct ldapconn *
 ldap_back_getconn( Operation *op, SlapReply *rs, ldap_back_send_t sendok )
 {
        struct ldapinfo *li = (struct ldapinfo *)op->o_bd->be_private;
-       struct ldapconn *lc, lc_curr;
-       int             is_priv = 0;
+       struct ldapconn *lc, lc_curr = { 0 };
 
        /* Searches for a ldapconn in the avl tree */
 
@@ -381,7 +380,7 @@ ldap_back_getconn( Operation *op, SlapReply *rs, ldap_back_send_t sendok )
        if ( op->o_do_not_cache || be_isroot( op ) ) {
                lc_curr.lc_local_ndn = op->o_bd->be_rootndn;
                lc_curr.lc_conn = NULL;
-               is_priv = 1;
+               lc_curr.lc_ispriv = 1;
 
        } else {
                lc_curr.lc_local_ndn = op->o_ndn;
@@ -404,9 +403,10 @@ ldap_back_getconn( Operation *op, SlapReply *rs, ldap_back_send_t sendok )
 
                ldap_pvt_thread_mutex_init( &lc->lc_mutex );
 
-               if ( is_priv ) {
+               if ( lc_curr.lc_ispriv ) {
                        ber_dupbv( &lc->lc_cred, &li->acl_passwd );
                        ber_dupbv( &lc->lc_bound_ndn, &li->acl_authcDN );
+                       lc->lc_ispriv = lc_curr.lc_ispriv;
 
                } else {
                        BER_BVZERO( &lc->lc_cred );
@@ -471,7 +471,6 @@ ldap_back_dobind_int(
 
        assert( retries >= 0 );
 
-       ldap_pvt_thread_mutex_lock( &lc->lc_mutex );
        if ( !lc->lc_bound ) {
                struct ldapinfo *li = (struct ldapinfo *)op->o_bd->be_private;
 
@@ -498,6 +497,8 @@ ldap_back_dobind_int(
                 * It allows to use SASL bind and yet proxyAuthz users
                 */
                if ( op->o_conn != NULL &&
+                               !op->o_do_not_cache &&
+                               !be_isroot( op ) &&
                                ( BER_BVISNULL( &lc->lc_bound_ndn ) ||
                                  ( li->idassert_flags & LDAP_BACK_AUTH_OVERRIDE ) ) )
                {
@@ -505,6 +506,50 @@ ldap_back_dobind_int(
                        goto done;
                }
 
+#ifdef HAVE_CYRUS_SASL
+               if ( lc->lc_ispriv && li->acl_authmethod == LDAP_AUTH_SASL ) {
+                       void            *defaults = NULL;
+
+#if 0  /* will deal with this later... */
+                       if ( sasl_secprops != NULL ) {
+                               rs->sr_err = ldap_set_option( lc->lc_ld, LDAP_OPT_X_SASL_SECPROPS,
+                                       (void *) sasl_secprops );
+
+                               if ( rs->sr_err != LDAP_OPT_SUCCESS ) {
+                                       send_ldap_result( op, rs );
+                                       lc->lc_bound = 0;
+                                       goto done;
+                               }
+                       }
+#endif
+
+                       defaults = lutil_sasl_defaults( lc->lc_ld,
+                                       li->acl_sasl_mech.bv_val,
+                                       li->acl_sasl_realm.bv_val,
+                                       li->acl_authcID.bv_val,
+                                       li->acl_passwd.bv_val,
+                                       NULL );
+
+                       rs->sr_err = ldap_sasl_interactive_bind_s( lc->lc_ld,
+                                       li->acl_authcDN.bv_val,
+                                       li->acl_sasl_mech.bv_val, NULL, NULL,
+                                       LDAP_SASL_QUIET, lutil_sasl_interact,
+                                       defaults );
+
+                       lutil_sasl_freedefs( defaults );
+
+                       rs->sr_err = slap_map_api2result( rs );
+                       if ( rs->sr_err != LDAP_SUCCESS ) {
+                               lc->lc_bound = 0;
+                               send_ldap_result( op, rs );
+
+                       } else {
+                               lc->lc_bound = 1;
+                       }
+                       goto done;
+               }
+#endif /* HAVE_CYRUS_SASL */
+
 retry:;
                rs->sr_err = ldap_sasl_bind( lc->lc_ld,
                                lc->lc_bound_ndn.bv_val,
@@ -539,14 +584,19 @@ retry:;
 
 done:;
        rc = lc->lc_bound;
-       ldap_pvt_thread_mutex_unlock( &lc->lc_mutex );
        return rc;
 }
 
 int
 ldap_back_dobind( struct ldapconn *lc, Operation *op, SlapReply *rs, ldap_back_send_t sendok )
 {
-       return ldap_back_dobind_int( lc, op, rs, sendok, 1 );
+       int     rc;
+
+       ldap_pvt_thread_mutex_lock( &lc->lc_mutex );
+       rc = ldap_back_dobind_int( lc, op, rs, sendok, 1 );
+       ldap_pvt_thread_mutex_unlock( &lc->lc_mutex );
+
+       return rc;
 }
 
 /*
@@ -659,18 +709,21 @@ retry:;
 int
 ldap_back_retry( struct ldapconn *lc, Operation *op, SlapReply *rs, ldap_back_send_t sendok )
 {
+       int     rc;
+
        ldap_pvt_thread_mutex_lock( &lc->lc_mutex );
        ldap_unbind_ext_s( lc->lc_ld, NULL, NULL );
        lc->lc_ld = NULL;
        lc->lc_bound = 0;
 
        /* lc here must be the regular lc, reset and ready for init */
-       if ( ldap_back_prepare_conn( &lc, op, rs, sendok ) != LDAP_SUCCESS ) {
-               return 0;
+       rc = ldap_back_prepare_conn( &lc, op, rs, sendok );
+       if ( rc == LDAP_SUCCESS ) {
+               rc = ldap_back_dobind_int( lc, op, rs, sendok, 0 );
        }
-
        ldap_pvt_thread_mutex_unlock( &lc->lc_mutex );
-       return ldap_back_dobind_int( lc, op, rs, sendok, 0 );
+
+       return rc;
 }
 
 static int
@@ -803,7 +856,7 @@ ldap_back_proxy_authz_bind( struct ldapconn *lc, Operation *op, SlapReply *rs )
 
                rs->sr_err = ldap_sasl_interactive_bind_s( lc->lc_ld, binddn.bv_val,
                                li->idassert_sasl_mech.bv_val, NULL, NULL,
-                               li->idassert_sasl_flags, lutil_sasl_interact,
+                               LDAP_SASL_QUIET, lutil_sasl_interact,
                                defaults );
 
                lutil_sasl_freedefs( defaults );
@@ -898,7 +951,7 @@ ldap_back_proxy_authz_ctrl(
                goto done;
        }
 
-       if ( !op->o_conn ) {
+       if ( !op->o_conn || op->o_do_not_cache || be_isroot( op ) ) {
                goto done;
        }
 
index 543960f2280cd915791c327d9dc41c849d95f530..573ab84ebeb0be6a9caef20376c4acdb4e85d217 100644 (file)
@@ -350,7 +350,7 @@ done:;
 static int
 ldap_chain_response( Operation *op, SlapReply *rs )
 {
-       slap_overinst   *on = (slap_overinst *) op->o_bd->bd_info;
+       slap_overinst   *on = (slap_overinst *)op->o_bd->bd_info;
        void            *private = op->o_bd->be_private;
        slap_callback   *sc = op->o_callback,
                        sc2 = { 0 };
index 436c713c573671045a21fc92d0b10032adbce3bb..6cd07ba40a502df64e5b3463706e8a6282b44774 100644 (file)
@@ -41,6 +41,10 @@ static int
 parse_idassert( BackendDB *be, const char *fname, int lineno,
                int argc, char **argv );
 
+static int
+parse_acl_auth( BackendDB *be, const char *fname, int lineno,
+               int argc, char **argv );
+
 int
 ldap_back_db_config(
                BackendDB       *be,
@@ -258,47 +262,14 @@ ldap_back_db_config(
                        li->flags |= LDAP_BACK_F_PROPAGATE_TLS;
                }
        
-       /* name to use for ldap_back_group */
-       } else if ( strcasecmp( argv[0], "acl-authcdn" ) == 0
-                       || strcasecmp( argv[0], "binddn" ) == 0 )
-       {
-               if ( argc != 2 ) {
-                       fprintf( stderr,
-       "%s: line %d: missing name in \"%s <name>\" line\n",
-                                       fname, lineno, argv[0] );
-                       return( 1 );
-               }
-
-               if ( strcasecmp( argv[0], "binddn" ) == 0 ) {
-                       fprintf( stderr, "%s: line %d: "
-                               "\"binddn\" statement is deprecated; "
-                               "use \"acl-authcDN\" instead\n",
-                               fname, lineno );
-                       /* FIXME: some day we'll need to throw an error */
-               }
-
-               ber_str2bv( argv[1], 0, 1, &li->acl_authcDN );
-
-       /* password to use for ldap_back_group */
-       } else if ( strcasecmp( argv[0], "acl-passwd" ) == 0
-                       || strcasecmp( argv[0], "bindpw" ) == 0 )
+       /* remote ACL stuff... */
+       } else if ( strncasecmp( argv[0], "acl-", STRLENOF( "acl-" ) ) == 0
+                       || strncasecmp( argv[0], "bind", STRLENOF( "bind" ) ) == 0 )
        {
-               if ( argc != 2 ) {
-                       fprintf( stderr,
-       "%s: line %d: missing password in \"%s <password>\" line\n",
-                                       fname, lineno, argv[0] );
-                       return( 1 );
-               }
-
-               if ( strcasecmp( argv[0], "bindpw" ) == 0 ) {
-                       fprintf( stderr, "%s: line %d: "
-                               "\"bindpw\" statement is deprecated; "
-                               "use \"acl-passwd\" instead\n",
-                               fname, lineno );
-                       /* FIXME: some day we'll need to throw an error */
-               }
-
-               ber_str2bv( argv[1], 0, 1, &li->acl_passwd );
+               /* NOTE: "bind{DN,pw}" was initially used; it's now
+                * deprected and undocumented, it can be dropped at some
+                * point, since nobody should be really using it */
+               return parse_acl_auth( be, fname, lineno, argc, argv );
 
        /* identity assertion stuff... */
        } else if ( strncasecmp( argv[0], "idassert-", STRLENOF( "idassert-" ) ) == 0
@@ -783,3 +754,205 @@ parse_idassert(
 
        return 0;
 }
+
+static int
+parse_acl_auth(
+    BackendDB  *be,
+    const char *fname,
+    int                lineno,
+    int                argc,
+    char       **argv
+)
+{
+       struct ldapinfo *li = (struct ldapinfo *) be->be_private;
+
+       /* name to use for remote ACL access */
+       if ( strcasecmp( argv[0], "acl-authcdn" ) == 0
+                       || strcasecmp( argv[0], "binddn" ) == 0 )
+       {
+               struct berval   dn;
+               int             rc;
+
+               /* FIXME: "binddn" is no longer documented, and
+                * temporarily supported for backwards compatibility */
+
+               if ( argc != 2 ) {
+                       fprintf( stderr,
+       "%s: line %d: missing name in \"%s <name>\" line\n",
+                           fname, lineno, argv[0] );
+                       return( 1 );
+               }
+
+               if ( !BER_BVISNULL( &li->acl_authcDN ) ) {
+                       fprintf( stderr, "%s: line %d: "
+                                       "authcDN already defined; replacing...\n",
+                                       fname, lineno );
+                       ch_free( li->acl_authcDN.bv_val );
+               }
+               
+               ber_str2bv( argv[1], 0, 0, &dn );
+               rc = dnNormalize( 0, NULL, NULL, &dn, &li->acl_authcDN, NULL );
+               if ( rc != LDAP_SUCCESS ) {
+                       Debug( LDAP_DEBUG_ANY,
+                               "%s: line %d: acl ID \"%s\" is not a valid DN\n",
+                               fname, lineno, argv[1] );
+                       return 1;
+               }
+
+       /* password to use for remote ACL access */
+       } else if ( strcasecmp( argv[0], "acl-passwd" ) == 0
+                       || strcasecmp( argv[0], "bindpw" ) == 0 )
+       {
+               /* FIXME: "bindpw" is no longer documented, and
+                * temporarily supported for backwards compatibility */
+
+               if ( argc != 2 ) {
+                       fprintf( stderr,
+       "%s: line %d: missing password in \"%s <password>\" line\n",
+                           fname, lineno, argv[0] );
+                       return( 1 );
+               }
+
+               if ( !BER_BVISNULL( &li->acl_passwd ) ) {
+                       fprintf( stderr, "%s: line %d: "
+                                       "passwd already defined; replacing...\n",
+                                       fname, lineno );
+                       ch_free( li->acl_passwd.bv_val );
+               }
+               
+               ber_str2bv( argv[1], 0, 1, &li->acl_passwd );
+
+       } else if ( strcasecmp( argv[0], "acl-method" ) == 0 ) {
+               if ( argc < 2 ) {
+                       fprintf( stderr,
+       "%s: line %d: missing method in \"%s <method>\" line\n",
+                           fname, lineno, argv[0] );
+                       return( 1 );
+               }
+
+               if ( strcasecmp( argv[1], "none" ) == 0 ) {
+                       /* FIXME: is this at all useful? */
+                       li->acl_authmethod = LDAP_AUTH_NONE;
+
+                       if ( argc != 2 ) {
+                               fprintf( stderr,
+       "%s: line %d: trailing args in \"%s %s ...\" line ignored\"\n",
+                                       fname, lineno, argv[0], argv[1] );
+                       }
+
+               } else if ( strcasecmp( argv[1], "simple" ) == 0 ) {
+                       li->acl_authmethod = LDAP_AUTH_SIMPLE;
+
+                       if ( argc != 2 ) {
+                               fprintf( stderr,
+       "%s: line %d: trailing args in \"%s %s ...\" line ignored\"\n",
+                                       fname, lineno, argv[0], argv[1] );
+                       }
+
+               } else if ( strcasecmp( argv[1], "sasl" ) == 0 ) {
+#ifdef HAVE_CYRUS_SASL
+                       int     arg;
+
+                       for ( arg = 2; arg < argc; arg++ ) {
+                               if ( strncasecmp( argv[arg], "mech=", STRLENOF( "mech=" ) ) == 0 ) {
+                                       char    *val = argv[arg] + STRLENOF( "mech=" );
+
+                                       if ( !BER_BVISNULL( &li->acl_sasl_mech ) ) {
+                                               fprintf( stderr, "%s: line %d: "
+                                                               "SASL mech already defined; replacing...\n",
+                                                               fname, lineno );
+                                               ch_free( li->acl_sasl_mech.bv_val );
+                                       }
+                                       ber_str2bv( val, 0, 1, &li->acl_sasl_mech );
+
+                               } else if ( strncasecmp( argv[arg], "realm=", STRLENOF( "realm=" ) ) == 0 ) {
+                                       char    *val = argv[arg] + STRLENOF( "realm=" );
+
+                                       if ( !BER_BVISNULL( &li->acl_sasl_realm ) ) {
+                                               fprintf( stderr, "%s: line %d: "
+                                                               "SASL realm already defined; replacing...\n",
+                                                               fname, lineno );
+                                               ch_free( li->acl_sasl_realm.bv_val );
+                                       }
+                                       ber_str2bv( val, 0, 1, &li->acl_sasl_realm );
+
+                               } else if ( strncasecmp( argv[arg], "authcdn=", STRLENOF( "authcdn=" ) ) == 0 ) {
+                                       char            *val = argv[arg] + STRLENOF( "authcdn=" );
+                                       struct berval   dn;
+                                       int             rc;
+
+                                       if ( !BER_BVISNULL( &li->acl_authcDN ) ) {
+                                               fprintf( stderr, "%s: line %d: "
+                                                               "SASL authcDN already defined; replacing...\n",
+                                                               fname, lineno );
+                                               ch_free( li->acl_authcDN.bv_val );
+                                       }
+                                       if ( strncasecmp( argv[arg], "dn:", STRLENOF( "dn:" ) ) == 0 ) {
+                                               val += STRLENOF( "dn:" );
+                                       }
+
+                                       ber_str2bv( val, 0, 0, &dn );
+                                       rc = dnNormalize( 0, NULL, NULL, &dn, &li->acl_authcDN, NULL );
+                                       if ( rc != LDAP_SUCCESS ) {
+                                               Debug( LDAP_DEBUG_ANY,
+                                                       "%s: line %d: SASL authcdn \"%s\" is not a valid DN\n",
+                                                       fname, lineno, val );
+                                               return 1;
+                                       }
+
+                               } else if ( strncasecmp( argv[arg], "authcid=", STRLENOF( "authcid=" ) ) == 0 ) {
+                                       char    *val = argv[arg] + STRLENOF( "authcid=" );
+
+                                       if ( !BER_BVISNULL( &li->acl_authcID ) ) {
+                                               fprintf( stderr, "%s: line %d: "
+                                                               "SASL authcID already defined; replacing...\n",
+                                                               fname, lineno );
+                                               ch_free( li->acl_authcID.bv_val );
+                                       }
+                                       if ( strncasecmp( argv[arg], "u:", STRLENOF( "u:" ) ) == 0 ) {
+                                               val += STRLENOF( "u:" );
+                                       }
+                                       ber_str2bv( val, 0, 1, &li->acl_authcID );
+
+                               } else if ( strncasecmp( argv[arg], "cred=", STRLENOF( "cred=" ) ) == 0 ) {
+                                       char    *val = argv[arg] + STRLENOF( "cred=" );
+
+                                       if ( !BER_BVISNULL( &li->acl_passwd ) ) {
+                                               fprintf( stderr, "%s: line %d: "
+                                                               "SASL cred already defined; replacing...\n",
+                                                               fname, lineno );
+                                               ch_free( li->acl_passwd.bv_val );
+                                       }
+                                       ber_str2bv( val, 0, 1, &li->acl_passwd );
+
+                               } else {
+                                       fprintf( stderr, "%s: line %d: "
+                                                       "unknown SASL parameter %s\n",
+                                                       fname, lineno, argv[arg] );
+                                       return 1;
+                               }
+                       }
+
+                       li->acl_authmethod = LDAP_AUTH_SASL;
+
+#else /* !HAVE_CYRUS_SASL */
+                       fprintf( stderr, "%s: line %d: "
+                                       "compile --with-cyrus-sasl to enable SASL auth\n",
+                                       fname, lineno );
+                       return 1;
+#endif /* !HAVE_CYRUS_SASL */
+
+               } else {
+                       fprintf( stderr, "%s: line %d: "
+                                       "unhandled acl-method method %s\n",
+                                       fname, lineno, argv[1] );
+                       return 1;
+               }
+
+       } else {
+               return SLAP_CONF_UNKNOWN;
+       }
+
+       return 0;
+}
+
index 08767a481123c2e4264e0c34ffd67c5a10518f20..328e3ceaa8ecb1506205e4dd0d5df7ff77bcb19f 100644 (file)
@@ -87,9 +87,13 @@ ldap_back_db_init( Backend *be )
                return -1;
        }
 
+       BER_BVZERO( &li->acl_authcID );
        BER_BVZERO( &li->acl_authcDN );
        BER_BVZERO( &li->acl_passwd );
 
+       li->acl_authmethod = LDAP_AUTH_SIMPLE;
+       BER_BVZERO( &li->acl_sasl_mech );
+
        li->idassert_mode = LDAP_BACK_IDASSERT_LEGACY;
 
        BER_BVZERO( &li->idassert_authcID );
@@ -97,18 +101,15 @@ ldap_back_db_init( Backend *be )
        BER_BVZERO( &li->idassert_passwd );
 
        BER_BVZERO( &li->idassert_authzID );
-       li->idassert_authz = NULL;
 
        li->idassert_authmethod = LDAP_AUTH_SIMPLE;
-       li->idassert_sasl_flags = LDAP_SASL_QUIET;
        BER_BVZERO( &li->idassert_sasl_mech );
-       BER_BVZERO( &li->idassert_sasl_realm );
-
-       li->idassert_ppolicy = 0;
 
        /* by default, use proxyAuthz control on each operation */
        li->idassert_flags = LDAP_BACK_AUTH_NONE;
 
+       li->idassert_authz = NULL;
+
        /* initialize flags */
        li->flags = LDAP_BACK_F_CHASE_REFERRALS;
 
@@ -217,6 +218,10 @@ ldap_back_db_destroy(
                        ldap_free_urldesc( li->lud );
                        li->lud = NULL;
                }
+               if ( !BER_BVISNULL( &li->acl_authcID ) ) {
+                       ch_free( li->acl_authcID.bv_val );
+                       BER_BVZERO( &li->acl_authcID );
+               }
                if ( !BER_BVISNULL( &li->acl_authcDN ) ) {
                        ch_free( li->acl_authcDN.bv_val );
                        BER_BVZERO( &li->acl_authcDN );
@@ -225,6 +230,14 @@ ldap_back_db_destroy(
                        ch_free( li->acl_passwd.bv_val );
                        BER_BVZERO( &li->acl_passwd );
                }
+               if ( !BER_BVISNULL( &li->acl_sasl_mech ) ) {
+                       ch_free( li->acl_sasl_mech.bv_val );
+                       BER_BVZERO( &li->acl_sasl_mech );
+               }
+               if ( !BER_BVISNULL( &li->acl_sasl_realm ) ) {
+                       ch_free( li->acl_sasl_realm.bv_val );
+                       BER_BVZERO( &li->acl_sasl_realm );
+               }
                if ( !BER_BVISNULL( &li->idassert_authcID ) ) {
                        ch_free( li->idassert_authcID.bv_val );
                        BER_BVZERO( &li->idassert_authcID );
index 6bc32c1f221c0ed4e13169a88f094e2b547929ae..25cb07cc0b6e9ab8a02607b2db4da503e6e6defd 100644 (file)
@@ -62,7 +62,7 @@ ldbm_back_add(
 #endif
 
        if ( !access_allowed( op, op->oq_add.rs_e,
-                               entry, NULL, ACL_WRITE, NULL ) )
+                               entry, NULL, ACL_WADD, NULL ) )
        {
                Debug( LDAP_DEBUG_TRACE, "no write access to entry\n", 0,
                    0, 0 );
@@ -131,7 +131,7 @@ ldbm_back_add(
                        return rs->sr_err;
                }
 
-               if ( ! access_allowed( op, p, children, NULL, ACL_WRITE, NULL ) ) {
+               if ( ! access_allowed( op, p, children, NULL, ACL_WADD, NULL ) ) {
                        /* free parent and writer lock */
                        cache_return_entry_w( &li->li_cache, p ); 
                        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
index cb0282fdb729d1cf052af061f6eb245501c0c3ef..6119e0ad9c4999069c03bce205a5faf8c5eea9a4 100644 (file)
@@ -151,8 +151,7 @@ struct ldbminfo {
        int                     li_dbsyncfreq;
        int                     li_dbsyncwaitn;
        int                     li_dbsyncwaitinterval;
-       ldap_pvt_thread_t       li_dbsynctid;
-       int                     li_dbshutdown;
+       int                     li_dbsyncwaitcount;
 };
 
 LDAP_END_DECL
index 7029786dfe430bfe04cf682158a95bbc083c3601..167f78d0fd98a08010736be262f756bee3014e5f 100644 (file)
@@ -27,17 +27,12 @@ int
 ldbm_back_db_close( Backend *be )
 {
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
-       if ( li->li_dbsyncfreq > 0 )
-       {
-               li->li_dbshutdown++;
-               ldap_pvt_thread_join( li->li_dbsynctid, (void *) NULL );
-       }
+
        Debug( LDAP_DEBUG_TRACE, "ldbm backend syncing\n", 0, 0, 0 );
 
        ldbm_cache_flush_all( be );
        Debug( LDAP_DEBUG_TRACE, "ldbm backend done syncing\n", 0, 0, 0 );
 
-
        cache_release_all( &((struct ldbminfo *) be->be_private)->li_cache );
 
        return 0;
index 74e655c14ed6e2c3de548e554648b15f49d3baf5..cbc28d0a18aa17593edee63012fe368aec6c096e 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "slap.h"
 #include "back-ldbm.h"
+#include <ldap_rq.h>
 
 DBCache *
 ldbm_cache_open(
@@ -264,10 +265,16 @@ ldbm_cache_sync( Backend *be )
 {
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
        int             i;
+       int             do_log = 1;
 
        ldap_pvt_thread_mutex_lock( &li->li_dbcache_mutex );
        for ( i = 0; i < MAXDBCACHE; i++ ) {
                if ( li->li_dbcache[i].dbc_name != NULL && li->li_dbcache[i].dbc_dirty ) {
+                       if ( do_log ) {
+                               do_log = 0;
+                               Debug( LDAP_DEBUG_TRACE, "syncing %s\n",
+                                       li->li_directory, 0, 0 );
+                       }
                        Debug(  LDAP_DEBUG_TRACE, "ldbm syncing db (%s)\n",
                                li->li_dbcache[i].dbc_name, 0, 0 );
                        ldbm_sync( li->li_dbcache[i].dbc_db );
@@ -320,32 +327,30 @@ ldbm_cache_delete(
 
 void *
 ldbm_cache_sync_daemon(
-       void *be_ptr
+       void *ctx,
+       void *arg
 )
 {
-       Backend *be = (Backend *)be_ptr;
+       struct re_s *rtask = arg;
+       Backend *be = rtask->arg;
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
-       Debug( LDAP_DEBUG_ANY, "synchronizer starting for %s\n", li->li_directory, 0, 0 );
-  
-       while (!li->li_dbshutdown) {
-               int i = li->li_dbsyncwaitn;
-
-               sleep( li->li_dbsyncfreq );
-
-               while (i && ldap_pvt_thread_pool_backload(&connection_pool) != 0) {
-                       Debug( LDAP_DEBUG_TRACE, "delay syncing %s\n", li->li_directory, 0, 0 );
-                       sleep(li->li_dbsyncwaitinterval);
-                       i--;
-               }
-
-               if (!li->li_dbshutdown) {
-                       Debug( LDAP_DEBUG_TRACE, "syncing %s\n", li->li_directory, 0, 0 );
-                       ldbm_cache_sync( be );
-               }
+       /* If server is idle, or we've already waited the limit */
+       if ( li->li_dbsyncwaitcount == li->li_dbsyncwaitn || 
+               ldap_pvt_thread_pool_backload(&connection_pool) < 2 ) {
+               rtask->interval.tv_sec = li->li_dbsyncfreq;
+               li->li_dbsyncwaitcount = 0;
+               ldbm_cache_sync( be );
+       } else {
+               rtask->interval.tv_sec = li->li_dbsyncwaitinterval;
+               li->li_dbsyncwaitcount++;
+               Debug( LDAP_DEBUG_TRACE, "delay #%d syncing %s\n", 
+                       li->li_dbsyncwaitcount, li->li_directory, 0 );
        }
 
-       Debug( LDAP_DEBUG_ANY, "synchronizer stopping\n", 0, 0, 0 );
-  
+       ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+       ldap_pvt_runqueue_stoptask( &slapd_rq, rtask );
+       ldap_pvt_runqueue_resched( &slapd_rq, rtask, 0 );
+       ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
        return NULL;
 }
index 7f1a4d5cb4d534dadedd5a4546c90271ad4009c0..6db0d31dbf47be50e88496c1be6621d0850f28ff 100644 (file)
@@ -77,8 +77,7 @@ ldbm_back_delete(
        }
 
        /* check entry for "entry" acl */
-       if ( ! access_allowed( op, e,
-               entry, NULL, ACL_WRITE, NULL ) )
+       if ( ! access_allowed( op, e, entry, NULL, ACL_WDEL, NULL ) )
        {
                Debug( LDAP_DEBUG_TRACE,
                        "<=- ldbm_back_delete: no write access to entry\n", 0,
@@ -115,7 +114,7 @@ ldbm_back_delete(
                        op->o_req_dn.bv_val, 0, 0);
 
                send_ldap_error( op, rs, LDAP_NOT_ALLOWED_ON_NONLEAF,
-                       "subtree delete not supported" );
+                       "subordinate objects must be deleted first");
                goto return_results;
        }
 
@@ -134,7 +133,7 @@ ldbm_back_delete(
 
                /* check parent for "children" acl */
                if ( ! access_allowed( op, p,
-                       children, NULL, ACL_WRITE, NULL ) )
+                       children, NULL, ACL_WDEL, NULL ) )
                {
                        Debug( LDAP_DEBUG_TRACE,
                                "<=- ldbm_back_delete: no access to parent\n", 0,
@@ -153,7 +152,7 @@ ldbm_back_delete(
                                p = (Entry *)&slap_entry_root;
                                
                                rc = access_allowed( op, p,
-                                       children, NULL, ACL_WRITE, NULL );
+                                       children, NULL, ACL_WDEL, NULL );
                                p = NULL;
                                                                
                                /* check parent for "children" acl */
index 3227fbe73517b295cc99e688baac8fe2db143c7e..3fae53e80743c6ea307842c0d87047b827191180 100644 (file)
@@ -117,8 +117,8 @@ int ldbm_back_entry_get(
 
        if ( oc && !is_entry_objectclass( e, oc, 0 )) {
                Debug( LDAP_DEBUG_ACL,
-                       "<= ldbm_back_entry_get: failed to find objectClass\n",
-                       0, 0, 0 ); 
+                       "<= ldbm_back_entry_get: failed to find objectClass %s\n",
+                       oc->soc_cname, 0, 0 ); 
                rc = LDAP_NO_SUCH_ATTRIBUTE;
                goto return_results;
        }
index 85802bff9d3d9424ad07fd0d4b7c64d0a723ddc9..b8a6831ce5d4609d521d475ee66cc5fd59e4893f 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "slap.h"
 #include "back-ldbm.h"
+#include <ldap_rq.h>
 
 int
 ldbm_back_initialize(
@@ -174,8 +175,8 @@ ldbm_back_db_init(
        /* delay interval */
        li->li_dbsyncwaitinterval = 5;
 
-       /* flag to notify ldbm_cache_sync_daemon to shut down */
-       li->li_dbshutdown = 0;
+       /* current wait counter */
+       li->li_dbsyncwaitcount = 0;
 
        /* initialize various mutex locks & condition variables */
        ldap_pvt_thread_rdwr_init( &li->li_giant_rwlock );
@@ -197,19 +198,16 @@ ldbm_back_db_open(
        li->li_dbenv = ldbm_initialize_env( li->li_directory,
                li->li_dbcachesize, &li->li_envdirok );
 
-       /* sync thread */
-       if ( li->li_dbsyncfreq > 0 )
+       /* If we're in server mode and a sync frequency was set,
+        * submit a task to perform periodic db syncs.
+        */
+       if (( slapMode & SLAP_SERVER_MODE ) && li->li_dbsyncfreq > 0 )
        {
-               int rc;
-               rc = ldap_pvt_thread_create( &li->li_dbsynctid,
-                       0, ldbm_cache_sync_daemon, (void*)be );
-
-               if ( rc != 0 )
-               {
-                       Debug(  LDAP_DEBUG_ANY,
-                               "sync ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
-                       return 1;
-               }
+               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+               ldap_pvt_runqueue_insert( &slapd_rq, li->li_dbsyncfreq,
+                       ldbm_cache_sync_daemon, be,
+                       "ldbm_cache_sync", be->be_suffix[0].bv_val );
+               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
        }
 
        return 0;
index 4df7478e0cd828f53b8aeb9393c65cf8a897f320..c999b27b646a07f1f418de94bb39a66b5966b739 100644 (file)
@@ -101,8 +101,7 @@ ldbm_back_modrdn(
        }
 
        /* check entry for "entry" acl */
-       if ( ! access_allowed( op, e,
-               entry, NULL, ACL_WRITE, NULL ) )
+       if ( ! access_allowed( op, e, entry, NULL, ACL_WRITE, NULL ) )
        {
                Debug( LDAP_DEBUG_TRACE,
                        "<=- ldbm_back_modrdn: no write access to entry\n", 0,
@@ -163,8 +162,10 @@ ldbm_back_modrdn(
                }
 
                /* check parent for "children" acl */
-               if ( ! access_allowed( op, p,
-                       children, NULL, ACL_WRITE, NULL ) )
+               if ( ! access_allowed( op, p, children, NULL,
+                               op->oq_modrdn.rs_newSup != NULL ?
+                                       ACL_WDEL : ACL_WRITE,
+                               NULL ) )
                {
                        Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
                                0, 0 );
@@ -197,7 +198,10 @@ ldbm_back_modrdn(
                                p = (Entry *)&slap_entry_root;
                                
                                can_access = access_allowed( op, p,
-                                               children, NULL, ACL_WRITE, NULL );
+                                               children, NULL,
+                                               op->oq_modrdn.rs_newSup ?
+                                                       ACL_WDEL : ACL_WRITE,
+                                               NULL );
                                p = NULL;
                                                                
                                /* check parent for "children" acl */
@@ -270,7 +274,7 @@ ldbm_back_modrdn(
 
                        /* check newSuperior for "children" acl */
                        if ( !access_allowed( op, np, children, NULL,
-                                             ACL_WRITE, NULL ) )
+                                             ACL_WADD, NULL ) )
                        {
                                Debug( LDAP_DEBUG_TRACE,
                                       "ldbm_back_modrdn: no wr to newSup children\n",
@@ -316,7 +320,7 @@ ldbm_back_modrdn(
                                        np = (Entry *)&slap_entry_root;
                                
                                        can_access = access_allowed( op, np,
-                                                       children, NULL, ACL_WRITE, NULL );
+                                                       children, NULL, ACL_WADD, NULL );
                                        np = NULL;
                                                                
                                        /* check parent for "children" acl */
index f0794f34264a46667e16968c711a583f0481e48a..83d48db0d46bebd4135a5ed54a87d70c0a522599 100644 (file)
@@ -82,7 +82,7 @@ Datum ldbm_cache_fetch LDAP_P(( DBCache *db, Datum key ));
 #endif /* 1 */
 int ldbm_cache_store LDAP_P(( DBCache *db, Datum key, Datum data, int flags ));
 int ldbm_cache_delete LDAP_P(( DBCache *db, Datum key ));
-void *ldbm_cache_sync_daemon LDAP_P(( void *));
+void *ldbm_cache_sync_daemon LDAP_P(( void *ctx, void *arg ));
 
 /*
  * dn2id.c
index 1e414f6609a68bb6df93f12dd6bc376ff727295f..4038ee56891acabc07a5d7789bc9586338081e73 100644 (file)
@@ -86,14 +86,17 @@ ldbm_back_search(
 
                if ( matched != NULL ) {
                        BerVarray erefs = NULL;
-                       
+
+#ifdef SLAP_ACL_HONOR_DISCLOSE
                        if ( ! access_allowed( op, matched,
                                                slap_schema.si_ad_entry,
                                                NULL, ACL_DISCLOSE, NULL ) )
                        {
                                rs->sr_err = LDAP_NO_SUCH_OBJECT;
 
-                       } else {
+                       } else
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+                       {
                                ber_dupbv( &matched_dn, &matched->e_name );
 
                                erefs = is_entry_referral( matched )
@@ -127,6 +130,7 @@ ldbm_back_search(
                return rs->sr_err;
        }
 
+#ifdef SLAP_ACL_HONOR_DISCLOSE
        if ( ! access_allowed( op, e, slap_schema.si_ad_entry,
                                NULL, ACL_DISCLOSE, NULL ) )
        {
@@ -138,6 +142,7 @@ ldbm_back_search(
                send_ldap_result( op, rs );
                return rs->sr_err;
        }
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
 
        if ( !manageDSAit && is_entry_referral( e ) ) {
                /* entry is a referral, don't allow add */
index bba08ade48bd9cf93c68ef08d2002f1174b7149c..9467d96288d00ec412e4e33619115c0ad3c93922 100644 (file)
@@ -42,6 +42,13 @@ struct ldif_info {
 
 #define LDIF   ".ldif"
 
+#define IX_DNL '{'
+#define        IX_DNR  '}'
+#ifndef IX_FSL
+#define        IX_FSL  IX_DNL
+#define IX_FSR IX_DNR
+#endif
+
 #define ENTRY_BUFF_INCREMENT 500
 
 static ObjectClass *ldif_oc;
@@ -53,7 +60,7 @@ static ConfigTable ldifcfg[] = {
                ldif_cf, NULL, NULL, NULL },
        { "directory", "dir", 2, 2, 0, ARG_BERVAL|ARG_OFFSET,
                (void *)offsetof(struct ldif_info, li_base_path),
-               "( OLcfgAt:1.1 NAME 'dbDirectory' "
+               "( OLcfgDbAt:0.1 NAME 'olcDbDirectory' "
                        "DESC 'Directory for database content' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
@@ -62,13 +69,13 @@ static ConfigTable ldifcfg[] = {
 };
 
 static ConfigOCs ldifocs[] = {
-       { "( OLcfgOc:2.1 "
-               "NAME 'ldifConfig' "
+       { "( OLcfgDbOc:2.1 "
+               "NAME 'olcLdifConfig' "
                "DESC 'LDIF backend configuration' "
-               "AUXILIARY "
-               "MAY ( dbDirectory ) )",
+               "SUP olcDatabaseConfig "
+               "MUST ( olcDbDirectory ) )", Cft_Database,
                &ldif_oc },
-       { NULL, NULL }
+       { NULL, 0, NULL }
 };
 
 static int
@@ -100,39 +107,45 @@ dn2path(struct berval * dn, struct berval * rootdn, struct berval * base_path,
                end = sep;
        }
        strcpy(ptr, LDIF);
+#if IX_FSL != IX_DNL
+       ptr = res->bv_val;
+       while( ptr=strchr(ptr, IX_DNL) ) {
+               *ptr++ = IX_FSL;
+               ptr = strchr(ptr, IX_DNR);
+               if ( ptr )
+                       *ptr++ = IX_FSR;
+               else
+                       break;
+       }
+#endif
 }
 
 static char * slurp_file(int fd) {
-       int entry_buf_size = 40 * ENTRY_BUFF_INCREMENT;
        int read_chars_total = 0;
        int read_chars = 0;
-       int entry_size = 40 * ENTRY_BUFF_INCREMENT;
-       char * entry = (char *) malloc(sizeof(char) * 40 * ENTRY_BUFF_INCREMENT);
-       char * entry_pos = entry;
+       int entry_size;
+       char * entry;
+       char * entry_pos;
+       struct stat st;
+
+       fstat(fd, &st);
+       entry_size = st.st_size;
+       entry = ch_malloc( entry_size+1 );
+       entry_pos = entry;
        
        while(1) {
-               if(entry_size - read_chars_total == 0) {
-                       entry = (char *) realloc(entry, sizeof(char) * 2 * entry_size);
-                       entry_size = 2 * entry_size;
-               }
                read_chars = read(fd, (void *) entry_pos, entry_size - read_chars_total);
                if(read_chars == -1) {
                        SLAP_FREE(entry);
                        return NULL;
                }
-               entry_pos += read_chars;
                if(read_chars == 0) {
-                       if(entry_size - read_chars_total > 0)
-                               entry[read_chars_total] = '\0';
-                       else {
-                               entry = (char *) realloc(entry, sizeof(char) * entry_size + 1);
-                               entry_size = entry_size + 1;
-                               entry[read_chars_total] = '\0';
-                       }       
+                       entry[read_chars_total] = '\0';
                        break;
                }
                else {
                        read_chars_total += read_chars;
+                       entry_pos += read_chars;
                }
        }
        return entry;
@@ -140,7 +153,7 @@ static char * slurp_file(int fd) {
 
 static int spew_file(int fd, char * spew) {
        int written = 0;
-       int writeres;
+       int writeres = 0;
        int len = strlen(spew);
        char * spewptr = spew;
        
@@ -173,7 +186,26 @@ static int spew_entry(Entry * e, struct berval * path) {
                        rs = LDAP_UNWILLING_TO_PERFORM;
        }
        else {
+               struct berval rdn;
+               int tmp;
+
+               /* Only save the RDN onto disk */
+               dnRdn( &e->e_name, &rdn );
+               if ( rdn.bv_len != e->e_name.bv_len ) {
+                       e->e_name.bv_val[rdn.bv_len] = '\0';
+                       tmp = e->e_name.bv_len;
+                       e->e_name.bv_len = rdn.bv_len;
+                       rdn.bv_len = tmp;
+               }
+
                entry_as_string = entry2str(e, &entry_length);
+
+               /* Restore full DN */
+               if ( rdn.bv_len != e->e_name.bv_len ) {
+                       e->e_name.bv_val[e->e_name.bv_len] = ',';
+                       e->e_name.bv_len = rdn.bv_len;
+               }
+
                if(entry_as_string == NULL) {
                        rs = LDAP_UNWILLING_TO_PERFORM;
                        close(openres);
@@ -190,7 +222,10 @@ static int spew_entry(Entry * e, struct berval * path) {
        return rs;
 }
 
-static Entry * get_entry_for_fd(int fd) {
+static Entry * get_entry_for_fd(int fd,
+       struct berval *pdn,
+       struct berval *pndn)
+{
        char * entry = (char *) slurp_file(fd);
        Entry * ldentry = NULL;
        
@@ -200,6 +235,15 @@ static Entry * get_entry_for_fd(int fd) {
        }
 
        ldentry = str2entry(entry);
+       if ( ldentry ) {
+               struct berval rdn;
+               rdn = ldentry->e_name;
+               build_new_dn( &ldentry->e_name, pdn, &rdn, NULL );
+               ch_free( rdn.bv_val );
+               rdn = ldentry->e_nname;
+               build_new_dn( &ldentry->e_nname, pndn, &rdn, NULL );
+               ch_free( rdn.bv_val );
+       }
 
  return_value:
        if(fd != -1) {
@@ -212,11 +256,13 @@ static Entry * get_entry_for_fd(int fd) {
        return ldentry;
 }
 
-static Entry * get_entry(struct berval * dn, struct berval * rootdn, struct berval * base_path) {
-       struct berval path;
+static Entry * get_entry(Operation *op, struct berval *base_path) {
+       struct berval path, pdn, pndn;
        int fd;
 
-       dn2path(dn, rootdn, base_path, &path);
+       dnParent(&op->o_req_dn, &pdn);
+       dnParent(&op->o_req_ndn, &pndn);
+       dn2path(&op->o_req_ndn, op->o_bd->be_nsuffix, base_path, &path);
        fd = open(path.bv_val, O_RDONLY);
        /* error opening file (mebbe should log error) */
        if(fd == -1) {
@@ -225,7 +271,12 @@ static Entry * get_entry(struct berval * dn, struct berval * rootdn, struct berv
 
        if(path.bv_val != NULL)
                SLAP_FREE(path.bv_val);
-       return get_entry_for_fd(fd);
+
+       if ( fd != -1 ) {
+               return get_entry_for_fd(fd, &pdn, &pndn);
+       }
+
+       return NULL;
 }
 
 static void fullpath(struct berval *base, struct berval *name, struct berval *res) {
@@ -241,44 +292,59 @@ static void fullpath(struct berval *base, struct berval *name, struct berval *re
 typedef struct bvlist {
        struct bvlist *next;
        struct berval bv;
+       struct berval num;
+       unsigned int inum;
+       int off;
 } bvlist;
 
-static Entry ** r_enum_tree(Entry ** entries, int *elen, int *eind,
-       struct berval * path, int scope) {
+typedef struct enumCookie {
+       Entry **entries;
+       int elen;
+       int eind;
+       int scope;
+} enumCookie;
 
-       if(entries == NULL) {
-               entries = (Entry **) SLAP_MALLOC(sizeof(Entry *) * ENTRY_BUFF_INCREMENT);
-               *elen = ENTRY_BUFF_INCREMENT;
+static int r_enum_tree(enumCookie *ck, struct berval *path,
+       struct berval *pdn, struct berval *pndn)
+{
+       Entry *e;
+       int fd, rc = LDAP_SUCCESS;
+
+       fd = open( path->bv_val, O_RDONLY );
+       if ( fd < 0 ) {
+               Debug( LDAP_DEBUG_TRACE,
+                       "=> ldif_enum_tree: failed to open %s\n",
+                       path->bv_val, 0, 0 );
+               return LDAP_NO_SUCH_OBJECT;
        }
 
-       if ( scope == LDAP_SCOPE_BASE || scope == LDAP_SCOPE_SUBTREE ) {
-               int fd;
-               Entry * e;
-               if(! (*eind < *elen)) { /* grow entries if necessary */ 
-                       entries = (Entry **) SLAP_REALLOC(entries, sizeof(Entry *) * (*elen) * 2);
-                       *elen = *elen * 2;
-               }
-               fd = open( path->bv_val, O_RDONLY );
-               if ( fd < 0 ) {
-                       Debug( LDAP_DEBUG_TRACE,
-                               "=> ldif_enum_tree: failed to open %s\n",
-                               path->bv_val, 0, 0 );
-                       goto leave;
-               }
+       if(ck->entries == NULL) {
+               ck->entries = (Entry **) SLAP_MALLOC(sizeof(Entry *) * ENTRY_BUFF_INCREMENT);
+               ck->elen = ENTRY_BUFF_INCREMENT;
+       }
 
-               e = get_entry_for_fd(fd);
-               if(e != NULL) {
-                       entries[*eind] = e;
-                       *eind = *eind + 1;
-               }
-               else {
-                       Debug( LDAP_DEBUG_ANY,
-                               "=> ldif_enum_tree: failed to read entry for %s\n",
-                               path->bv_val, 0, 0 );
-                       goto leave;
+       e = get_entry_for_fd(fd, pdn, pndn);
+       if ( !e ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "=> ldif_enum_tree: failed to read entry for %s\n",
+                       path->bv_val, 0, 0 );
+               return LDAP_BUSY;
+       }
+
+       if ( ck->scope == LDAP_SCOPE_BASE || ck->scope == LDAP_SCOPE_SUBTREE ) {
+               if(! (ck->eind < ck->elen)) { /* grow entries if necessary */   
+                       ck->entries = (Entry **) SLAP_REALLOC(ck->entries, sizeof(Entry *) * (ck->elen) * 2);
+                       ck->elen *= 2;
                }
+
+               ck->entries[ck->eind] = e;
+               ck->eind++;
+               fd = 0;
+       } else {
+               fd = 1;
        }
-       if ( scope != LDAP_SCOPE_BASE ) {
+
+       if ( ck->scope != LDAP_SCOPE_BASE ) {
                DIR * dir_of_path;
                bvlist *list = NULL, *ptr;
 
@@ -286,15 +352,20 @@ static Entry ** r_enum_tree(Entry ** entries, int *elen, int *eind,
                path->bv_val[path->bv_len] = '\0';
 
                dir_of_path = opendir(path->bv_val);
-               if(dir_of_path == NULL) {/* can't open directory */
-                       Debug( LDAP_DEBUG_TRACE,
-                               "=> ldif_enum_tree: failed to opendir %s\n",
-                               path->bv_val, 0, 0 );
+               if(dir_of_path == NULL) { /* can't open directory */
+                       if ( errno != ENOENT ) {
+                               /* it shouldn't be treated as an error
+                                * only if the directory doesn't exist */
+                               rc = LDAP_BUSY;
+                               Debug( LDAP_DEBUG_TRACE,
+                                       "=> ldif_enum_tree: failed to opendir %s (%d)\n",
+                                       path->bv_val, errno, 0 );
+                       }
                        goto leave;
                }
        
                while(1) {
-                       struct berval fname;
+                       struct berval fname, itmp;
                        struct dirent * dir;
                        bvlist *bvl, *prev;
 
@@ -309,10 +380,27 @@ static Entry ** r_enum_tree(Entry ** entries, int *elen, int *eind,
 
                        bvl = ch_malloc( sizeof(bvlist) );
                        ber_dupbv( &bvl->bv, &fname );
+                       BER_BVZERO( &bvl->num );
+                       itmp.bv_val = strchr( bvl->bv.bv_val, IX_FSL );
+                       if ( itmp.bv_val ) {
+                               char *ptr;
+                               itmp.bv_val++;
+                               ptr = strchr( itmp.bv_val, IX_FSR );
+                               if ( ptr ) {
+                                       itmp.bv_len = ptr - itmp.bv_val;
+                                       ber_dupbv( &bvl->num, &itmp );
+                                       bvl->inum = strtoul( itmp.bv_val, NULL, 0 );
+                                       itmp.bv_val[0] = '\0';
+                                       bvl->off = itmp.bv_val - bvl->bv.bv_val;
+                               }
+                       }
 
                        for (ptr = list, prev = (bvlist *)&list; ptr;
                                prev = ptr, ptr = ptr->next) {
-                               if ( strcmp( bvl->bv.bv_val, ptr->bv.bv_val ) < 0 )
+                               int cmp = strcmp( bvl->bv.bv_val, ptr->bv.bv_val );
+                               if ( !cmp && bvl->num.bv_val )
+                                       cmp = bvl->inum - ptr->inum;
+                               if ( cmp < 0 )
                                        break;
                        }
                        prev->next = bvl;
@@ -321,25 +409,59 @@ static Entry ** r_enum_tree(Entry ** entries, int *elen, int *eind,
                }
                closedir(dir_of_path);
 
-               for ( ptr = list; ptr; ptr=ptr->next ) {
+               if (ck->scope == LDAP_SCOPE_ONELEVEL)
+                       ck->scope = LDAP_SCOPE_BASE;
+               else if ( ck->scope == LDAP_SCOPE_SUBORDINATE)
+                       ck->scope = LDAP_SCOPE_SUBTREE;
+
+               while ( ( ptr = list ) ) {
                        struct berval fpath;
+
+                       list = ptr->next;
+
+                       if ( ptr->num.bv_val )
+                               AC_MEMCPY( ptr->bv.bv_val + ptr->off, ptr->num.bv_val,
+                                       ptr->num.bv_len );
                        fullpath( path, &ptr->bv, &fpath );
-                       entries = r_enum_tree(entries, elen, eind, &fpath,
-                               scope == LDAP_SCOPE_ONELEVEL ? LDAP_SCOPE_BASE : scope);
+                       r_enum_tree(ck, &fpath, &e->e_name, &e->e_nname );
                        free(fpath.bv_val);
+                       if ( ptr->num.bv_val )
+                               free( ptr->num.bv_val );
+                       free(ptr->bv.bv_val);
+                       free(ptr);
                }
        }
 leave:
-       return entries;
+       if ( fd ) entry_free( e );
+       return rc;
 }
 
-static Entry ** enum_tree(BackendDB *be, struct berval * ndn, int * length, int scope) {
+static int
+enum_tree(
+       BackendDB *be,
+       struct berval *dn,
+       struct berval *ndn,
+       int * length,
+       Entry ***e,
+       int scope )
+{
        struct ldif_info *ni = (struct ldif_info *) be->be_private;
        struct berval path;
-       int index = 0;
+       int rc;
+       enumCookie ck = {0};
+       struct berval pdn, pndn;
 
+       assert( e != NULL );
+       *e = NULL;
+
+       ck.scope = scope;
+       dnParent( dn, &pdn );
+       dnParent( ndn, &pndn );
        dn2path(ndn, &be->be_nsuffix[0], &ni->li_base_path, &path);
-       return r_enum_tree(NULL, &index, length, &path, scope);
+       rc = r_enum_tree(&ck, &path, &pdn, &pndn);
+       *length = ck.eind;
+       *e = ck.entries;
+       return rc;
 }
 
 /* Get the parent path plus the LDIF suffix */
@@ -363,19 +485,13 @@ static int apply_modify_to_entry(Entry * entry,
                                SlapReply * rs)
 {
        char textbuf[SLAP_TEXT_BUFLEN];
-       size_t textlen = sizeof textbuf;
-       int rc;
-       int tempdebug;
+       int rc = LDAP_UNWILLING_TO_PERFORM;
        Modification *mods = NULL;
-       Attribute *save_attrs;
 
        if (!acl_check_modlist(op, entry, modlist)) {
                return LDAP_INSUFFICIENT_ACCESS;
        }
 
-       /*  save_attrs = entry->e_attrs; Why?
-                       entry->e_attrs = attrs_dup(entry->e_attrs); */
-
        for (; modlist != NULL; modlist = modlist->sml_next) {
                mods = &modlist->sml_mod;
 
@@ -384,14 +500,14 @@ static int apply_modify_to_entry(Entry * entry,
                        rc = modify_add_values(entry, mods,
                                   get_permissiveModify(op),
                                   &rs->sr_text, textbuf,
-                                  textlen);
+                                  sizeof( textbuf ) );
                        break;
                                
                case LDAP_MOD_DELETE:
                        rc = modify_delete_values(entry, mods,
                                get_permissiveModify(op),
                                &rs->sr_text, textbuf,
-                               textlen);
+                               sizeof( textbuf ) );
 
                        break;
                                
@@ -399,7 +515,7 @@ static int apply_modify_to_entry(Entry * entry,
                        rc = modify_replace_values(entry, mods,
                                 get_permissiveModify(op),
                                 &rs->sr_text, textbuf,
-                                textlen);
+                                sizeof( textbuf ) );
 
                        break;
                case LDAP_MOD_INCREMENT:
@@ -409,7 +525,7 @@ static int apply_modify_to_entry(Entry * entry,
                        rc = modify_add_values(entry, mods,
                                   get_permissiveModify(op),
                                   &rs->sr_text, textbuf,
-                                  textlen);
+                                  sizeof( textbuf ) );
                        mods->sm_op = SLAP_MOD_SOFTADD;
                        if (rc == LDAP_TYPE_OR_VALUE_EXISTS) {
                                rc = LDAP_SUCCESS;
@@ -426,13 +542,138 @@ static int apply_modify_to_entry(Entry * entry,
                        entry->e_ocflags = 0;
                }
                /* check that the entry still obeys the schema */
-               rc = entry_schema_check(op->o_bd, entry,
-                                 save_attrs, &rs->sr_text,
-                                 textbuf, textlen);
+               rc = entry_schema_check(op->o_bd, entry, NULL,
+                                 &rs->sr_text, textbuf, sizeof( textbuf ) );
        }
        return rc;
 }
 
+int
+ldif_back_referrals( Operation *op, SlapReply *rs )
+{
+       struct ldif_info        *ni = NULL;
+       Entry                   *entry;
+       int                     rc = LDAP_SUCCESS;
+
+#if 0
+       if ( op->o_tag == LDAP_REQ_SEARCH ) {
+               /* let search take care of itself */
+               return rc;
+       }
+#endif
+
+       if ( get_manageDSAit( op ) ) {
+               /* let op take care of DSA management */
+               return rc;
+       }
+
+       ni = (struct ldif_info *)op->o_bd->be_private;
+       ldap_pvt_thread_mutex_lock( &ni->li_mutex );
+       entry = (Entry *)get_entry( op, &ni->li_base_path );
+
+       /* no object is found for them */
+       if ( entry == NULL ) {
+               struct berval   odn = op->o_req_dn;
+               struct berval   ondn = op->o_req_ndn;
+
+               struct berval   pndn = op->o_req_ndn;
+
+               for ( ; entry == NULL; ) {
+                       dnParent( &pndn, &pndn );
+                       
+                       if ( !dnIsSuffix( &pndn, &op->o_bd->be_nsuffix[0] ) ) {
+                               break;
+                       }
+
+                       op->o_req_dn = pndn;
+                       op->o_req_ndn = pndn;
+
+                       entry = (Entry *)get_entry( op, &ni->li_base_path );
+               }
+
+               ldap_pvt_thread_mutex_unlock( &ni->li_mutex );
+
+               op->o_req_dn = odn;
+               op->o_req_ndn = ondn;
+
+               rc = LDAP_SUCCESS;
+               rs->sr_matched = NULL;
+               if ( entry != NULL ) {
+                       Debug( LDAP_DEBUG_TRACE,
+                               "ldif_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
+                               (long) op->o_tag, op->o_req_dn.bv_val, entry->e_name.bv_val );
+
+                       if ( is_entry_referral( entry ) ) {
+                               rc = LDAP_OTHER;
+                               rs->sr_ref = get_entry_referrals( op, entry );
+                               if ( rs->sr_ref ) {
+                                       rs->sr_matched = ber_strdup_x(
+                                       entry->e_name.bv_val, op->o_tmpmemctx );
+                               }
+                       }
+
+                       entry_free(entry);
+
+               } else if ( default_referral != NULL ) {
+                       rc = LDAP_OTHER;
+                       rs->sr_ref = referral_rewrite( default_referral,
+                               NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
+               }
+
+               if ( rs->sr_ref != NULL ) {
+                       /* send referrals */
+                       rc = rs->sr_err = LDAP_REFERRAL;
+                       send_ldap_result( op, rs );
+                       ber_bvarray_free( rs->sr_ref );
+                       rs->sr_ref = NULL;
+
+               } else if ( rc != LDAP_SUCCESS ) {
+                       rs->sr_err = rc;
+                       rs->sr_text = rs->sr_matched ? "bad referral object" : NULL;
+                       send_ldap_result( op, rs );
+               }
+
+               if ( rs->sr_matched ) {
+                       op->o_tmpfree( (char *)rs->sr_matched, op->o_tmpmemctx );
+                       rs->sr_matched = NULL;
+               }
+
+               return rc;
+       }
+
+       ldap_pvt_thread_mutex_unlock( &ni->li_mutex );
+
+       if ( is_entry_referral( entry ) ) {
+               /* entry is a referral */
+               BerVarray refs = get_entry_referrals( op, entry );
+               rs->sr_ref = referral_rewrite(
+                       refs, &entry->e_name, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
+
+               Debug( LDAP_DEBUG_TRACE,
+                       "ldif_back_referrals: op=%ld target=\"%s\" matched=\"%s\"\n",
+                       (long) op->o_tag, op->o_req_dn.bv_val, entry->e_name.bv_val );
+
+               rs->sr_matched = entry->e_name.bv_val;
+               if ( rs->sr_ref != NULL ) {
+                       rc = rs->sr_err = LDAP_REFERRAL;
+                       send_ldap_result( op, rs );
+                       ber_bvarray_free( rs->sr_ref );
+                       rs->sr_ref = NULL;
+
+               } else {
+                       send_ldap_error( op, rs, LDAP_OTHER, "bad referral object" );
+                       rc = rs->sr_err;
+               }
+
+               rs->sr_matched = NULL;
+               ber_bvarray_free( refs );
+
+               entry_free( entry );
+       }
+
+       return rc;
+}
+
 static int
 ldif_back_bind( Operation *op, SlapReply *rs )
 {
@@ -444,24 +685,16 @@ ldif_back_bind( Operation *op, SlapReply *rs )
 
        ni = (struct ldif_info *) op->o_bd->be_private;
        ldap_pvt_thread_mutex_lock(&ni->li_mutex);
-       entry = (Entry *) get_entry(&op->o_req_ndn, &op->o_bd->be_nsuffix[0], &ni->li_base_path);
+       entry = (Entry *) get_entry(op, &ni->li_base_path);
 
        /* no object is found for them */
        if(entry == NULL) {
                if(be_isroot_pw(op)) {
-                       return_val = LDAP_SUCCESS;
-                       goto return_result;
-               }
-               else if(be_root_dn(op->o_bd)) {
-                       return_val = LDAP_INVALID_CREDENTIALS;
-                       rs->sr_err = LDAP_INVALID_CREDENTIALS;
-                       goto return_result;
-               }
-               else {
-                       rs->sr_err = LDAP_NO_SUCH_OBJECT;
-                       return_val = 1;
-                       goto return_result;
+                       rs->sr_err = return_val = LDAP_SUCCESS;
+               } else {
+                       rs->sr_err = return_val = LDAP_INVALID_CREDENTIALS;
                }
+               goto return_result;
        }
 
        /* they don't have userpassword */
@@ -500,11 +733,34 @@ static int ldif_back_search(Operation *op, SlapReply *rs)
        Entry ** entries = NULL;
 
        ldap_pvt_thread_mutex_lock(&ni->li_mutex);
-       entries = (Entry **) enum_tree(op->o_bd, &op->o_req_ndn, &numentries, op->ors_scope);
-
-       if(entries != NULL) {
-               for(i=0;i<numentries;i++) {
-                       if(test_filter(op, entries[i], op->ors_filter) == LDAP_COMPARE_TRUE) {
+       rs->sr_err = enum_tree(op->o_bd, &op->o_req_dn, &op->o_req_ndn, &numentries, &entries, op->ors_scope);
+       if ( rs->sr_err == LDAP_SUCCESS ) {
+               for ( i = 0; i < numentries; i++ ) {
+
+
+                       /*
+                        * if it's a referral, add it to the list of referrals. only do
+                        * this for non-base searches, and don't check the filter
+                        * explicitly here since it's only a candidate anyway.
+                        */
+                       if ( !get_manageDSAit( op )
+                                       && op->oq_search.rs_scope != LDAP_SCOPE_BASE
+                                       && is_entry_referral( entries[i] ) )
+                       {
+                               BerVarray erefs = get_entry_referrals( op, entries[i] );
+                               rs->sr_ref = referral_rewrite( erefs,
+                                               &entries[i]->e_name, NULL,
+                                               op->oq_search.rs_scope == LDAP_SCOPE_ONELEVEL
+                                                       ? LDAP_SCOPE_BASE : LDAP_SCOPE_SUBTREE );
+
+                               send_search_reference( op, rs );
+
+                               ber_bvarray_free( rs->sr_ref );
+                               ber_bvarray_free( erefs );
+                               rs->sr_ref = NULL;
+
+                       } else if ( test_filter( op, entries[i], op->ors_filter ) == LDAP_COMPARE_TRUE )
+                       {
                                rs->sr_entry = entries[i];
                                rs->sr_attrs = op->ors_attrs;
                                rs->sr_flags = REP_ENTRY_MODIFIABLE;
@@ -512,18 +768,12 @@ static int ldif_back_search(Operation *op, SlapReply *rs)
                        }
                        entry_free(entries[i]);
                }
-               SLAP_FREE(entries);
-               rs->sr_err = LDAP_SUCCESS;
-               ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
-               send_ldap_result(op, rs);
-       }
-       else {
-               rs->sr_err = LDAP_BUSY;
-               ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
-               send_ldap_result(op, rs);
        }
+       SLAP_FREE(entries);
+       ldap_pvt_thread_mutex_unlock(&ni->li_mutex);
+       send_ldap_result(op, rs);
 
-       return 0;
+       return rs->sr_err;
 }
 
 static int ldif_back_add(Operation *op, SlapReply *rs) {
@@ -534,10 +784,9 @@ static int ldif_back_add(Operation *op, SlapReply *rs) {
        struct stat stats;
        int statres;
        char textbuf[SLAP_TEXT_BUFLEN];
-       size_t textlen = sizeof textbuf;
 
        rs->sr_err = entry_schema_check(op->o_bd, e,
-                                 NULL, &rs->sr_text, textbuf, textlen);
+                                 NULL, &rs->sr_text, textbuf, sizeof( textbuf ) );
        if ( rs->sr_err != LDAP_SUCCESS ) goto send_res;
                                
        ldap_pvt_thread_mutex_lock(&ni->li_mutex);
@@ -597,8 +846,7 @@ static int ldif_back_modify(Operation *op, SlapReply *rs) {
        ldap_pvt_thread_mutex_lock(&ni->li_mutex);
        dn2path(&op->o_req_ndn, &op->o_bd->be_nsuffix[0], &ni->li_base_path,
                &path);
-       entry = (Entry *) get_entry(&op->o_req_ndn, &op->o_bd->be_nsuffix[0],
-               &ni->li_base_path);
+       entry = (Entry *) get_entry(op, &ni->li_base_path);
 
        if(entry != NULL) {
                rs->sr_err = apply_modify_to_entry(entry, modlst, op, rs);
@@ -633,7 +881,15 @@ static int ldif_back_delete(Operation *op, SlapReply *rs) {
 
        ldap_pvt_thread_mutex_lock(&ni->li_mutex);
        dn2path(&op->o_req_ndn, &op->o_bd->be_nsuffix[0], &ni->li_base_path, &path);
-       res = unlink(path.bv_val);
+
+       path.bv_val[path.bv_len - STRLENOF(LDIF)] = '\0';
+       res = rmdir(path.bv_val);
+       path.bv_val[path.bv_len - STRLENOF(LDIF)] = '.';
+       if ( res && errno != ENOENT ) {
+               rs->sr_err = LDAP_NOT_ALLOWED_ON_NONLEAF;
+       } else {
+               res = unlink(path.bv_val);
+       }
 
        if(res == -1) {
                if(errno == ENOENT)
@@ -650,23 +906,6 @@ static int ldif_back_delete(Operation *op, SlapReply *rs) {
        return 0;
 }
 
-static int is_leaf_node(struct berval * path) {
-       DIR * nonleafnode;
-       int path_len = path->bv_len;
-       int res;
-
-       path->bv_val[path->bv_len - STRLENOF(LDIF)] = '\0';
-       nonleafnode = opendir(path->bv_val);
-       path->bv_val[path->bv_len - STRLENOF(LDIF)] = '.';
-       if(nonleafnode == NULL) {
-               res = 1;
-       }
-       else {
-               closedir(nonleafnode);
-               res = 0;
-       }
-       return res;
-}
 
 static int move_entry(Entry * entry, struct berval * ndn,
                           struct berval * newndn, struct berval * rootdn,
@@ -683,9 +922,6 @@ static int move_entry(Entry * entry, struct berval * ndn,
                /* some object doesn't exist */
                res = LDAP_NO_SUCH_OBJECT;
        }
-       else if(! is_leaf_node(&path)) { /* entry is not a leaf node */
-               res = LDAP_NOT_ALLOWED_ON_NONLEAF;
-       }
        else { /* do the modrdn */
                exists_res = open(newpath.bv_val, O_RDONLY);
                if(exists_res == -1 && errno == ENOENT) {
@@ -724,9 +960,8 @@ static int move_entry(Entry * entry, struct berval * ndn,
 
 static int ldif_back_modrdn(Operation *op, SlapReply *rs) {
        struct ldif_info *ni = (struct ldif_info *) op->o_bd->be_private;
-       struct berval new_dn = {0, NULL}, new_ndn = {0, NULL};
-       struct berval * new_parent_dn = NULL;
-       struct berval p_dn, bv = {0, NULL};
+       struct berval new_dn = BER_BVNULL, new_ndn = BER_BVNULL;
+       struct berval p_dn, bv = BER_BVNULL;
        Entry * entry = NULL;
        LDAPRDN new_rdn = NULL;
        LDAPRDN old_rdn = NULL;
@@ -735,8 +970,7 @@ static int ldif_back_modrdn(Operation *op, SlapReply *rs) {
 
        ldap_pvt_thread_mutex_lock(&ni->li_mutex);
        ldap_pvt_thread_mutex_lock(&entry2str_mutex);
-       entry = (Entry *) get_entry(&op->o_req_ndn, &op->o_bd->be_nsuffix[0],
-               &ni->li_base_path);
+       entry = (Entry *) get_entry(op, &ni->li_base_path);
 
        /* build the mods to the entry */
        if(entry != NULL) {
@@ -800,8 +1034,7 @@ static int ldif_back_compare(Operation *op, SlapReply *rs) {
 
        ldap_pvt_thread_mutex_lock(&ni->li_mutex);
 
-       e = (Entry *) get_entry(&op->o_req_ndn, &op->o_bd->be_nsuffix[0],
-               &ni->li_base_path);
+       e = (Entry *) get_entry(op, &ni->li_base_path);
        if(e != NULL) {
                for(a = attrs_find( e->e_attrs, op->oq_compare.rs_ava->aa_desc );
                        a != NULL;
@@ -845,25 +1078,30 @@ static int ldif_tool_entry_close(BackendDB * be) {
        return 0;
 }
 
-static ID ldif_tool_entry_first(BackendDB *be) {
+static ID
+ldif_tool_entry_first(BackendDB *be)
+{
        struct ldif_info *ni = (struct ldif_info *) be->be_private;
        ID id = 1; /* first entry in the array of entries shifted by one */
 
        ni->tool_current = 1;
        if(ni->tool_entries == NULL || ni->tool_put_entry_flag) {
-               ni->tool_entries = (Entry **) enum_tree(be, &be->be_nsuffix[0],
-                       &ni->tool_numentries, LDAP_SCOPE_SUBTREE);
+               (void)enum_tree(be, be->be_suffix, be->be_nsuffix,
+                       &ni->tool_numentries, &ni->tool_entries,
+                       LDAP_SCOPE_SUBTREE);
                ni->tool_put_entry_flag = 0;
        }
        return id;
 }
 
-static ID ldif_tool_entry_next(BackendDB *be) {
+static ID ldif_tool_entry_next(BackendDB *be)
+{
        struct ldif_info *ni = (struct ldif_info *) be->be_private;
        ni->tool_current += 1;
        if(ni->tool_put_entry_flag) {
-               ni->tool_entries = (Entry **) enum_tree(be, &be->be_nsuffix[0],
-                       &ni->tool_numentries, LDAP_SCOPE_SUBTREE);
+                (void)enum_tree(be, be->be_suffix, be->be_nsuffix,
+                       &ni->tool_numentries, &ni->tool_entries,
+                       LDAP_SCOPE_SUBTREE);
                ni->tool_put_entry_flag = 0;
        }
        if(ni->tool_current > ni->tool_numentries)
@@ -887,13 +1125,10 @@ static Entry * ldif_tool_entry_get(BackendDB * be, ID id) {
 
 static ID ldif_tool_entry_put(BackendDB * be, Entry * e, struct berval *text) {
        struct ldif_info *ni = (struct ldif_info *) be->be_private;
-       Attribute *save_attrs;
        struct berval dn = e->e_nname;
        struct berval leaf_path = BER_BVNULL;
        struct stat stats;
        int statres;
-       char textbuf[SLAP_TEXT_BUFLEN];
-       size_t textlen = sizeof textbuf;
        int res = LDAP_SUCCESS;
 
        dn2path(&dn, &be->be_nsuffix[0], &ni->li_base_path, &leaf_path);
@@ -981,8 +1216,17 @@ ldif_back_initialize(
                           BackendInfo  *bi
                           )
 {
+       static char *controls[] = {
+               LDAP_CONTROL_MANAGEDSAIT,
+               NULL
+       };
        int rc;
 
+       bi->bi_flags |=
+               SLAP_BFLAG_REFERRALS;
+
+       bi->bi_controls = controls;
+
        bi->bi_cf_table = ldifcfg;
 
        bi->bi_open = 0;
@@ -1008,7 +1252,7 @@ ldif_back_initialize(
 
        bi->bi_extended = 0;
 
-       bi->bi_chk_referrals = 0;
+       bi->bi_chk_referrals = ldif_back_referrals;
 
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = 0;
index 857ce7ec5f452c6b3a158990fb38faa6a1b978bd..4a5fe570184e366c34414c04d64fbace49d40e80 100644 (file)
 int
 meta_back_add( Operation *op, SlapReply *rs )
 {
-       struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
-       struct metaconn *lc;
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       metaconn_t      *mc;
        int             i, candidate = -1;
        int             isupdate;
        Attribute       *a;
        LDAPMod         **attrs;
        struct berval   mdn = BER_BVNULL, mapped;
        dncookie        dc;
+       int             msgid, do_retry = 1;
 
        Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n",
                        op->o_req_dn.bv_val, 0, 0 );
@@ -50,22 +51,17 @@ meta_back_add( Operation *op, SlapReply *rs )
        /*
         * get the current connection
         */
-       lc = meta_back_getconn( op, rs, META_OP_REQUIRE_SINGLE,
-                       &op->o_req_ndn, &candidate, LDAP_BACK_SENDERR );
-       if ( !lc || !meta_back_dobind( lc, op, LDAP_BACK_SENDERR ) ) {
+       mc = meta_back_getconn( op, rs, &candidate, LDAP_BACK_SENDERR );
+       if ( !mc || !meta_back_dobind( op, rs, mc, LDAP_BACK_SENDERR ) ) {
                return rs->sr_err;
        }
 
-       if ( !meta_back_is_valid( lc, candidate ) ) {
-               rs->sr_err = LDAP_UNAVAILABLE;
-               send_ldap_result( op, rs );
-               return rs->sr_err;
-       }
+       assert( mc->mc_conns[ candidate ].msc_ld != NULL );
 
        /*
         * Rewrite the add dn, if needed
         */
-       dc.rwmap = &li->targets[ candidate ]->mt_rwmap;
+       dc.rwmap = &mi->mi_targets[ candidate ]->mt_rwmap;
        dc.conn = op->o_conn;
        dc.rs = rs;
        dc.ctx = "addDN";
@@ -75,7 +71,7 @@ meta_back_add( Operation *op, SlapReply *rs )
                return rs->sr_err;
        }
 
-       /* Count number of attributes in entry */
+       /* Count number of attributes in entry ( +1 ) */
        for ( i = 1, a = op->ora_e->e_attrs; a; i++, a = a->a_next );
        
        /* Create array of LDAPMods for ldap_add() */
@@ -97,7 +93,7 @@ meta_back_add( Operation *op, SlapReply *rs )
                        mapped = a->a_desc->ad_cname;
 
                } else {
-                       ldap_back_map( &li->targets[ candidate ]->mt_rwmap.rwm_at,
+                       ldap_back_map( &mi->mi_targets[ candidate ]->mt_rwmap.rwm_at,
                                        &a->a_desc->ad_cname, &mapped, BACKLDAP_MAP );
                        if ( BER_BVISNULL( &mapped ) || BER_BVISEMPTY( &mapped ) ) {
                                continue;
@@ -122,11 +118,11 @@ meta_back_add( Operation *op, SlapReply *rs )
                        for ( j = 0; !BER_BVISNULL( &a->a_vals[ j ] ); ) {
                                struct ldapmapping      *mapping;
 
-                               ldap_back_mapping( &li->targets[ candidate ]->mt_rwmap.rwm_oc,
+                               ldap_back_mapping( &mi->mi_targets[ candidate ]->mt_rwmap.rwm_oc,
                                                &a->a_vals[ j ], &mapping, BACKLDAP_MAP );
 
                                if ( mapping == NULL ) {
-                                       if ( li->targets[ candidate ]->mt_rwmap.rwm_oc.drop_missing ) {
+                                       if ( mi->mi_targets[ candidate ]->mt_rwmap.rwm_oc.drop_missing ) {
                                                continue;
                                        }
                                        attrs[ i ]->mod_bvalues[ j ] = &a->a_vals[ j ];
@@ -166,8 +162,21 @@ meta_back_add( Operation *op, SlapReply *rs )
        }
        attrs[ i ] = NULL;
 
-       rs->sr_err = ldap_add_ext_s( lc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
+retry:;
+#if 0
+       rs->sr_err = ldap_add_ext( mc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
+                             attrs, op->o_ctrls, NULL, &msgid );
+       rs->sr_err = meta_back_op_result( op, rs, &mc->mc_conns[ candidate ], msgid, LDAP_BACK_SENDERR );
+#endif
+       rs->sr_err = ldap_add_ext_s( mc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
                              attrs, op->o_ctrls, NULL );
+       if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
+               do_retry = 0;
+               if ( meta_back_retry( op, rs, mc, candidate, LDAP_BACK_SENDERR ) ) {
+                       goto retry;
+               }
+       }
+
        for ( --i; i >= 0; --i ) {
                free( attrs[ i ]->mod_bvalues );
                free( attrs[ i ] );
@@ -178,6 +187,6 @@ meta_back_add( Operation *op, SlapReply *rs )
                BER_BVZERO( &mdn );
        }
 
-       return meta_back_op_result( lc, op, rs );
+       return meta_back_op_result( mc, op, rs, candidate );
 }
 
index 6df5a58e5c7149be6def00eac32c788fd781a0cd..7b74ae923034e2b5f5d44ac68b528ca91b9616dc 100644 (file)
@@ -82,8 +82,8 @@ typedef struct dncookie {
 #endif
 } dncookie;
 
-#define META_BIND_NRETRIES     3
-#define META_BIND_TIMEOUT      1000
+/* TODO: allow to define it on a per-target basis */
+#define META_BIND_TIMEOUT      10000
 
 int ldap_back_dn_massage(dncookie *dc, struct berval *dn,
        struct berval *res);
@@ -105,52 +105,62 @@ void ldap_back_map ( struct ldapmap *map, struct berval *s, struct berval *m,
 #define BACKLDAP_REMAP 1
 char *
 ldap_back_map_filter(
-               struct ldapmap *at_map,
-               struct ldapmap *oc_map,
-               struct berval *f,
-               int remap
-);
+       struct ldapmap *at_map,
+       struct ldapmap *oc_map,
+       struct berval *f,
+       int remap );
 
 int
 ldap_back_map_attrs(
-               struct ldapmap *at_map,
-               AttributeName *a,
-               int remap,
-               char ***mapped_attrs
-);
+       struct ldapmap *at_map,
+       AttributeName *a,
+       int remap,
+       char ***mapped_attrs );
 
 extern int ldap_back_map_config(
-               struct ldapmap  *oc_map,
-               struct ldapmap  *at_map,
-               const char      *fname,
-               int             lineno,
-               int             argc,
-               char            **argv );
+       struct ldapmap  *oc_map,
+       struct ldapmap  *at_map,
+       const char      *fname,
+       int             lineno,
+       int             argc,
+       char            **argv );
 
 extern int
 ldap_back_filter_map_rewrite(
-               dncookie                *dc,
-               Filter                  *f,
-               struct berval           *fstr,
-               int                     remap );
+       dncookie        *dc,
+       Filter          *f,
+       struct berval   *fstr,
+       int             remap );
 
 /* suffix massaging by means of librewrite */
 #ifdef ENABLE_REWRITE
-extern int suffix_massage_config( struct rewrite_info *info,
-               struct berval *pvnc, struct berval *nvnc,
-               struct berval *prnc, struct berval *nrnc);
+extern int
+suffix_massage_config( struct rewrite_info *info,
+       struct berval *pvnc,
+       struct berval *nvnc,
+       struct berval *prnc,
+       struct berval *nrnc );
 #endif /* ENABLE_REWRITE */
-extern int ldap_back_referral_result_rewrite( dncookie *dc, BerVarray a_vals );
-extern int ldap_dnattr_rewrite( dncookie *dc, BerVarray a_vals );
-extern int ldap_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );
+extern int
+ldap_back_referral_result_rewrite(
+       dncookie        *dc,
+       BerVarray       a_vals );
+extern int
+ldap_dnattr_rewrite(
+       dncookie        *dc,
+       BerVarray       a_vals );
+extern int
+ldap_dnattr_result_rewrite(
+       dncookie        *dc,
+       BerVarray       a_vals );
 
 /* (end of) from back-ldap.h before rwm removal */
 
-struct metasingleconn {
+typedef struct metasingleconn_t {
        int                     msc_candidate;
-#define        META_NOT_CANDIDATE      0
-#define        META_CANDIDATE          1
-#define        META_LAST_CONN          -1
+#define        META_NOT_CANDIDATE      ((ber_tag_t)0)
+#define        META_CANDIDATE          ((ber_tag_t)1)
+#define        META_LAST_CONN          ((ber_tag_t)(-1))
        
        LDAP                    *msc_ld;
        struct berval           msc_bound_ndn;
@@ -159,26 +169,26 @@ struct metasingleconn {
 #define META_UNBOUND           0
 #define META_BOUND             1
 #define META_ANONYMOUS         2
-};
+} metasingleconn_t;
 
-#define META_LAST(lsc)         ((lsc)->msc_candidate == META_LAST_CONN)
+#define META_LAST(msc)         ((msc)->msc_candidate == META_LAST_CONN)
 
-struct metaconn {
+typedef struct metaconn_t {
        struct slap_conn        *mc_conn;
-       struct rewrite_info     *mc_rwinfo;
+       ldap_pvt_thread_mutex_t mc_mutex;
        
        /*
         * means that the connection is bound; 
         * of course only one target actually is ...
         */
-       int                     mc_bound_target;
-#define META_BOUND_NONE                -1
-#define META_BOUND_ALL         -2
+       int                     mc_auth_target;
+#define META_BOUND_NONE                (-1)
+#define META_BOUND_ALL         (-2)
        /* supersedes the connection stuff */
-       struct metasingleconn   *mc_conns;
-};
+       metasingleconn_t        *mc_conns;
+} metaconn_t;
 
-struct metatarget {
+typedef struct metatarget_t {
        char                    *mt_uri;
        struct berval           mt_psuffix;             /* pretty suffix */
        struct berval           mt_nsuffix;             /* normalized suffix */
@@ -188,174 +198,179 @@ struct metatarget {
        struct berval           mt_pseudorootdn;
        struct berval           mt_pseudorootpw;
 
+       int                     mt_nretries;
+#define META_RETRY_UNDEFINED   (-2)
+#define META_RETRY_FOREVER     (-1)
+#define META_RETRY_NEVER       (0)
+#define META_RETRY_DEFAULT     (3)
+
        struct ldaprwmap        mt_rwmap;
-};
+} metatarget_t;
 
-struct metadncache {
+typedef struct metadncache_t {
        ldap_pvt_thread_mutex_t mutex;
        Avlnode                 *tree;
 
-#define META_DNCACHE_DISABLED   0
-#define META_DNCACHE_FOREVER    -1
+#define META_DNCACHE_DISABLED   (0)
+#define META_DNCACHE_FOREVER    (-1)
        long int                ttl;  /* seconds; 0: no cache, -1: no expiry */
-};
+} metadncache_t;
 
-struct metainfo {
-       int                     ntargets;
-       int                     defaulttarget;
-       int                     network_timeout;
-#define META_DEFAULT_TARGET_NONE       -1
-       struct metatarget       **targets;
+typedef struct metainfo_t {
+       int                     mi_ntargets;
+       int                     mi_defaulttarget;
+       int                     mi_network_timeout;
+#define META_DEFAULT_TARGET_NONE       (-1)
+       int                     mi_nretries;
 
-       struct rewrite_info     *rwinfo;
-       Backend                 *glue_be; 
+       metatarget_t            **mi_targets;
+       SlapReply               *mi_candidates;
 
-       struct metadncache      cache;
+       metadncache_t           mi_cache;
        
-       ldap_pvt_thread_mutex_t conn_mutex;
-       Avlnode                 *conntree;
+       ldap_pvt_thread_mutex_t mi_conn_mutex;
+       Avlnode                 *mi_conntree;
 
        unsigned                flags;
-/* defined in <back-ldap/back-ldap.h>
+#if 0
+/* defined in <back-ldap/back-ldap.h> */
 #define LDAP_BACK_F_NONE               0x00U
 #define LDAP_BACK_F_SAVECRED           0x01U
 #define LDAP_BACK_F_USE_TLS            0x02U
 #define LDAP_BACK_F_TLS_CRITICAL       ( 0x04U | LDAP_BACK_F_USE_TLS )
 #define LDAP_BACK_F_CHASE_REFERRALS    0x8U
-*/
-};
+#endif
+} metainfo_t;
+
+typedef enum meta_op_type {
+       META_OP_ALLOW_MULTIPLE = 0,
+       META_OP_REQUIRE_SINGLE,
+       META_OP_REQUIRE_ALL
+} meta_op_type;
 
-#define META_OP_ALLOW_MULTIPLE         0x00
-#define META_OP_REQUIRE_SINGLE         0x01
-#define META_OP_REQUIRE_ALL            0x02
-extern struct metaconn *
+SlapReply *
+meta_back_candidates_get( Operation *op );
+
+extern metaconn_t *
 meta_back_getconn(
-               Operation               *op,
-               SlapReply               *rs,
-               int                     op_type,
-               struct berval           *dn,
-               int                     *candidate,
-               ldap_back_send_t        sendok
-);
+       Operation               *op,
+       SlapReply               *rs,
+       int                     *candidate,
+       ldap_back_send_t        sendok );
 
 extern int
-meta_back_dobind(
-               struct metaconn         *lc,
-               Operation               *op,
-               ldap_back_send_t        sendok
-);
+meta_back_retry(
+       Operation               *op,
+       SlapReply               *rs,
+       metaconn_t              *mc,
+       int                     candidate,
+       ldap_back_send_t        sendok );
+
+extern void
+meta_back_conn_free( metaconn_t *mc );
 
 extern int
-meta_back_is_valid(
-               struct metaconn         *lc, 
-               int                     candidate 
-);
+meta_back_init_one_conn(
+       Operation               *op,
+       SlapReply               *rs,
+       metatarget_t            *mt, 
+       metasingleconn_t        *msc,
+       ldap_back_send_t        sendok );
+
+extern int
+meta_back_dobind(
+       Operation               *op,
+       SlapReply               *rs,
+       metaconn_t              *mc,
+       ldap_back_send_t        sendok );
+
+int
+meta_back_single_dobind(
+       Operation               *op,
+       SlapReply               *rs,
+       metaconn_t              *msc,
+       int                     candidate,
+       ldap_back_send_t        sendok,
+       int                     retries );
 
 extern int
 meta_back_op_result(
-               struct metaconn         *lc,
-               Operation               *op,
-               SlapReply               *rs
-);
+       metaconn_t              *mc,
+       Operation               *op,
+       SlapReply               *rs,
+       int                     candidate );
 
 extern int
 back_meta_LTX_init_module(
-               int                     argc,
-               char                    *argv[]
-);
+       int                     argc,
+       char                    *argv[] );
 
 extern int
 meta_back_conn_cmp(
-               const void              *c1,
-               const void              *c2
-);
+       const void              *c1,
+       const void              *c2 );
 
 extern int
 meta_back_conn_dup(
-               void                    *c1,
-               void                    *c2
-);
+       void                    *c1,
+       void                    *c2 );
 
 /*
  * Candidate stuff
  */
 extern int
 meta_back_is_candidate(
-               struct berval           *nsuffix,
-               struct berval           *ndn
-);
-
-extern int
-meta_back_count_candidates(
-               struct metainfo         *li,
-               struct berval           *ndn
-);
-
-extern int
-meta_back_is_candidate_unique(
-               struct metainfo         *li,
-               struct berval           *ndn
-);
+       struct berval           *nsuffix,
+       struct berval           *ndn,
+       int                     scope );
 
 extern int
 meta_back_select_unique_candidate(
-               struct metainfo         *li,
-               struct berval           *ndn
-);
+       metainfo_t              *mi,
+       struct berval           *ndn );
 
 extern int
 meta_clear_unused_candidates(
-               struct metainfo         *li,
-               struct metaconn         *lc,
-               int                     candidate,
-               int                     reallyclean
-);
+       Operation               *op,
+       int                     candidate );
 
 extern int
 meta_clear_one_candidate(
-               struct metasingleconn   *lc,
-               int                     reallyclean
-);
+       metasingleconn_t        *mc );
 
 /*
  * Dn cache stuff (experimental)
  */
 extern int
 meta_dncache_cmp(
-               const void              *c1,
-               const void              *c2
-);
+       const void              *c1,
+       const void              *c2 );
 
 extern int
 meta_dncache_dup(
-               void                    *c1,
-               void                    *c2
-);
+       void                    *c1,
+       void                    *c2 );
 
 #define META_TARGET_NONE       (-1)
+#define META_TARGET_MULTIPLE   (-2)
 extern int
 meta_dncache_get_target(
-               struct metadncache      *cache,
-               struct berval           *ndn
-);
+       metadncache_t           *cache,
+       struct berval           *ndn );
 
 extern int
 meta_dncache_update_entry(
-               struct metadncache      *cache,
-               struct berval           *ndn,
-               int                     target
-);
+       metadncache_t           *cache,
+       struct berval           *ndn,
+       int                     target );
 
 extern int
 meta_dncache_delete_entry(
-               struct metadncache      *cache,
-               struct berval           *ndn
-);
+       metadncache_t           *cache,
+       struct berval           *ndn );
 
 extern void
-meta_dncache_free(
-               void *entry
-);
+meta_dncache_free( void *entry );
 
 LDAP_END_DECL
 
index 69fe2ea995ea527d5f127a425f0484a6123dad0f..1c088369ae3653306882427580f6ce3db99cf275 100644 (file)
 static LDAP_REBIND_PROC        meta_back_rebind;
 
 static int
-meta_back_do_single_bind(
-               struct metaconn         *lc,
-               Operation               *op,
-               SlapReply               *rs,
-               int                     candidate
-);
+meta_back_single_bind(
+       Operation               *op,
+       SlapReply               *rs,
+       metaconn_t              *mc,
+       int                     candidate );
 
 int
 meta_back_bind( Operation *op, SlapReply *rs )
 {
-       struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
-       struct metaconn *lc;
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       metaconn_t      *mc;
 
-       int rc = -1, i, gotit = 0, ndnlen, isroot = 0;
-       int op_type = META_OP_ALLOW_MULTIPLE;
+       int             rc = LDAP_OTHER,
+                       i, gotit = 0, isroot = 0;
+
+       SlapReply       *candidates = meta_back_candidates_get( op );
 
        rs->sr_err = LDAP_SUCCESS;
 
@@ -60,77 +61,80 @@ meta_back_bind( Operation *op, SlapReply *rs )
        if ( op->orb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) {
                isroot = 1;
                ber_dupbv( &op->orb_edn, be_root_dn( op->o_bd ) );
-               op_type = META_OP_REQUIRE_ALL;
        }
-       lc = meta_back_getconn( op, rs, op_type,
-                       &op->o_req_ndn, NULL, LDAP_BACK_SENDERR );
-       if ( !lc ) {
-               Debug( LDAP_DEBUG_ANY,
-                               "meta_back_bind: no target for dn %s.\n%s%s",
-                               op->o_req_dn.bv_val, "", "");
 
+       /* we need meta_back_getconn() not send result even on error,
+        * because we want to intercept the error and make it
+        * invalidCredentials */
+       mc = meta_back_getconn( op, rs, NULL, LDAP_BACK_DONTSEND );
+       if ( !mc ) {
+               Debug( LDAP_DEBUG_ANY,
+                               "meta_back_bind: no target "
+                               "for dn \"%s\" (%d: %s).\n",
+                               op->o_req_dn.bv_val, rs->sr_err,
+                               rs->sr_text ? rs->sr_text : "" );
+               /* FIXME: there might be cases where we don't want
+                * to map the error onto invalidCredentials */
+               switch ( rs->sr_err ) {
+               case LDAP_NO_SUCH_OBJECT:
+               case LDAP_UNWILLING_TO_PERFORM:
+                       rs->sr_err = LDAP_INVALID_CREDENTIALS;
+                       rs->sr_text = NULL;
+                       break;
+               }
                send_ldap_result( op, rs );
-               return -1;
+               return rs->sr_err;
        }
 
        /*
         * Each target is scanned ...
         */
-       lc->mc_bound_target = META_BOUND_NONE;
-       ndnlen = op->o_req_ndn.bv_len;
-       for ( i = 0; i < li->ntargets; i++ ) {
+       mc->mc_auth_target = META_BOUND_NONE;
+       for ( i = 0; i < mi->mi_ntargets; i++ ) {
                int             lerr;
-               struct berval   orig_dn = op->o_req_dn;
-               struct berval   orig_ndn = op->o_req_ndn;
-               struct berval   orig_cred = op->orb_cred;
-               int             orig_method = op->orb_method;
-               
+               Operation       op2 = *op;
 
                /*
                 * Skip non-candidates
                 */
-               if ( lc->mc_conns[ i ].msc_candidate != META_CANDIDATE ) {
+               if ( candidates[ i ].sr_tag != META_CANDIDATE ) {
                        continue;
                }
 
                if ( gotit == 0 ) {
                        gotit = 1;
-               } else {
+
+               } else if ( isroot == 0 ) {
                        /*
                         * A bind operation is expected to have
                         * ONE CANDIDATE ONLY!
                         */
                        Debug( LDAP_DEBUG_ANY,
                                        "==>meta_back_bind: more than one"
-                                       " candidate is attempting to bind"
-                                       " ...\n%s%s%s", 
-                                       "", "", "" );
+                                       " candidate is trying to bind...\n",
+                                       0, 0, 0 );
                }
 
-               if ( isroot && li->targets[ i ]->mt_pseudorootdn.bv_val != NULL ) {
-                       op->o_req_dn = li->targets[ i ]->mt_pseudorootdn;
-                       op->o_req_ndn = li->targets[ i ]->mt_pseudorootdn;
-                       op->orb_cred = li->targets[ i ]->mt_pseudorootpw;
-                       op->orb_method = LDAP_AUTH_SIMPLE;
+               if ( isroot && !BER_BVISNULL( &mi->mi_targets[ i ]->mt_pseudorootdn ) )
+               {
+                       op2.o_req_dn = mi->mi_targets[ i ]->mt_pseudorootdn;
+                       op2.o_req_ndn = mi->mi_targets[ i ]->mt_pseudorootdn;
+                       op2.orb_cred = mi->mi_targets[ i ]->mt_pseudorootpw;
+                       op2.orb_method = LDAP_AUTH_SIMPLE;
                }
                
-               lerr = meta_back_do_single_bind( lc, op, rs, i );
+               lerr = meta_back_single_bind( &op2, rs, mc, i );
                if ( lerr != LDAP_SUCCESS ) {
                        rs->sr_err = lerr;
-                       ( void )meta_clear_one_candidate( &lc->mc_conns[ i ], 1 );
+                       candidates[ i ].sr_tag = META_NOT_CANDIDATE;
 
                } else {
                        rc = LDAP_SUCCESS;
                }
-
-               op->o_req_dn = orig_dn;
-               op->o_req_ndn = orig_ndn;
-               op->orb_cred = orig_cred;
-               op->orb_method = orig_method;
        }
 
        if ( isroot ) {
-               lc->mc_bound_target = META_BOUND_ALL;
+               mc->mc_auth_target = META_BOUND_ALL;
        }
 
        /*
@@ -138,7 +142,7 @@ meta_back_bind( Operation *op, SlapReply *rs )
         * err is the last error that occurred during a bind;
         * if at least (and at most?) one bind succeedes, fine.
         */
-       if ( rc != LDAP_SUCCESS /* && rs->sr_err != LDAP_SUCCESS */ ) {
+       if ( rc != LDAP_SUCCESS ) {
                
                /*
                 * deal with bind failure ...
@@ -154,35 +158,36 @@ meta_back_bind( Operation *op, SlapReply *rs )
 
                rs->sr_err = slap_map_api2result( rs );
                send_ldap_result( op, rs );
-               return -1;
+               return rs->sr_err;
        }
 
-       return 0;
+       return LDAP_SUCCESS;
 }
 
 /*
- * meta_back_do_single_bind
+ * meta_back_single_bind
  *
  * attempts to perform a bind with creds
  */
 static int
-meta_back_do_single_bind(
-               struct metaconn         *lc,
-               Operation               *op,
-               SlapReply               *rs,
-               int                     candidate
-)
+meta_back_single_bind(
+       Operation               *op,
+       SlapReply               *rs,
+       metaconn_t              *mc,
+       int                     candidate )
 {
-       struct metainfo         *li = ( struct metainfo * )op->o_bd->be_private;
+       metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
+       metatarget_t            *mt = mi->mi_targets[ candidate ];
        struct berval           mdn = BER_BVNULL;
        dncookie                dc;
-       struct metasingleconn   *lsc = &lc->mc_conns[ candidate ];
-       int                     msgid;
+       metasingleconn_t        *msc = &mc->mc_conns[ candidate ];
+       int                     msgid,
+                               rebinding = 0;
        
        /*
         * Rewrite the bind dn if needed
         */
-       dc.rwmap = &li->targets[ candidate ]->mt_rwmap;
+       dc.rwmap = &mi->mi_targets[ candidate ]->mt_rwmap;
        dc.conn = op->o_conn;
        dc.rs = rs;
        dc.ctx = "bindDN";
@@ -197,37 +202,80 @@ meta_back_do_single_bind(
         * and more in case of failure ... */
        /* FIXME: should be check if at least some of the op->o_ctrls
         * can/should be passed? */
-       rs->sr_err = ldap_sasl_bind( lsc->msc_ld, mdn.bv_val,
+rebind:;
+       rs->sr_err = ldap_sasl_bind( msc->msc_ld, mdn.bv_val,
                        LDAP_SASL_SIMPLE, &op->orb_cred,
                        op->o_ctrls, NULL, &msgid );
        if ( rs->sr_err == LDAP_SUCCESS ) {
                LDAPMessage     *res;
-               struct timeval  tv = { 0, 0 };
+               struct timeval  tv;
                int             rc;
-               int             nretries = 0;
+               int             nretries = mt->mt_nretries;
 
                /*
                 * handle response!!!
                 */
 retry:;
-               switch ( ldap_result( lsc->msc_ld, msgid, 0, &tv, &res ) ) {
+               tv.tv_sec = 0;
+               tv.tv_usec = META_BIND_TIMEOUT;
+               switch ( ldap_result( msc->msc_ld, msgid, 0, &tv, &res ) ) {
                case 0:
-                       if ( ++nretries <= META_BIND_NRETRIES ) {
+                       Debug( LDAP_DEBUG_ANY, "%s meta_back_single_bind: ldap_result=%d nretries=%d\n",
+                               op->o_log_prefix, 0, nretries );
+
+                       if ( nretries != META_RETRY_NEVER ) {
                                ldap_pvt_thread_yield();
-                               tv.tv_sec = 0;
-                               tv.tv_usec = META_BIND_TIMEOUT;
+                               if ( nretries > 0 ) {
+                                       nretries--;
+                               }
                                goto retry;
                        }
                        rs->sr_err = LDAP_BUSY;
-                       break;
+                       if ( rebinding ) {
+                               ldap_abandon_ext( msc->msc_ld, msgid, NULL, NULL );
+                               break;
+                       }
+
+                       /* FIXME: some times the request times out
+                        * while the other party is not willing to
+                        * send a response any more.  Give it a second
+                        * chance with a freshly bound connection */
+                       rebinding = 1;
+                       nretries = mt->mt_nretries;
+                       /* fallthru */
 
                case -1:
-                       ldap_get_option( lsc->msc_ld, LDAP_OPT_ERROR_NUMBER,
+                       ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER,
                                        &rs->sr_err );
+
+                       if ( rebinding ) {
+                               ldap_abandon_ext( msc->msc_ld, msgid, NULL, NULL );
+                       }
+
+                       Debug( LDAP_DEBUG_ANY, "### %s meta_back_single_bind: err=%d nretries=%d\n",
+                               op->o_log_prefix, rs->sr_err, nretries );
+
+                       rc = slap_map_api2result( rs );
+                       if ( rs->sr_err == LDAP_UNAVAILABLE && nretries != META_RETRY_NEVER ) {
+                               ldap_unbind_ext_s( msc->msc_ld, NULL, NULL );
+                               msc->msc_ld = NULL;
+                               msc->msc_bound = 0;
+
+                               /* mc here must be the regular mc, reset and ready for init */
+                               rc = meta_back_init_one_conn( op, rs, mt, msc,
+                                               LDAP_BACK_DONTSEND );
+                               if ( rc ) {
+                                       if ( nretries > 0 ) {
+                                               nretries--;
+                                       }
+                                       ldap_pvt_thread_yield();
+                                       goto rebind;
+                               }
+                       }
                        break;
 
                default:
-                       rc = ldap_parse_result( lsc->msc_ld, res, &rs->sr_err,
+                       rc = ldap_parse_result( msc->msc_ld, res, &rs->sr_err,
                                        NULL, NULL, NULL, NULL, 1 );
                        if ( rc != LDAP_SUCCESS ) {
                                rs->sr_err = rc;
@@ -241,31 +289,23 @@ retry:;
                goto return_results;
        }
 
-       if ( !BER_BVISNULL( &lsc->msc_bound_ndn ) ) {
-               ber_memfree( lsc->msc_bound_ndn.bv_val );
-       }
-       ber_dupbv( &lsc->msc_bound_ndn, &op->o_req_dn );
-       lsc->msc_bound = META_BOUND;
-       lc->mc_bound_target = candidate;
-
-       if ( LDAP_BACK_SAVECRED( li ) ) {
-               if ( !BER_BVISNULL( &lsc->msc_cred ) ) {
-                       /* destroy sensitive data */
-                       memset( lsc->msc_cred.bv_val, 0, lsc->msc_cred.bv_len );
-                       ber_memfree( lsc->msc_cred.bv_val );
-               }
-               ber_dupbv( &lsc->msc_cred, &op->orb_cred );
-               ldap_set_rebind_proc( lsc->msc_ld, meta_back_rebind, lsc );
+       ber_bvreplace( &msc->msc_bound_ndn, &op->o_req_dn );
+       msc->msc_bound = META_BOUND;
+       mc->mc_auth_target = candidate;
+
+       if ( LDAP_BACK_SAVECRED( mi ) ) {
+               ber_bvreplace( &msc->msc_cred, &op->orb_cred );
+               ldap_set_rebind_proc( msc->msc_ld, meta_back_rebind, msc );
        }
 
-       if ( li->cache.ttl != META_DNCACHE_DISABLED
-                       && op->o_req_ndn.bv_len != 0 ) {
-               ( void )meta_dncache_update_entry( &li->cache,
+       if ( mi->mi_cache.ttl != META_DNCACHE_DISABLED
+                       && op->o_req_ndn.bv_len != 0 )
+       {
+               ( void )meta_dncache_update_entry( &mi->mi_cache,
                                &op->o_req_ndn, candidate );
        }
 
 return_results:;
-       
        if ( mdn.bv_val != op->o_req_dn.bv_val ) {
                free( mdn.bv_val );
        }
@@ -273,108 +313,186 @@ return_results:;
        return rs->sr_err;
 }
 
+/*
+ * meta_back_single_dobind
+ */
+int
+meta_back_single_dobind(
+       Operation               *op,
+       SlapReply               *rs,
+       metaconn_t              *mc,
+       int                     candidate,
+       ldap_back_send_t        sendok,
+       int                     nretries )
+{
+       metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
+       metatarget_t            *mt = mi->mi_targets[ candidate ];
+       metasingleconn_t        *msc = &mc->mc_conns[ candidate ];
+       int                     rc;
+       struct berval           cred = BER_BVC( "" );
+       int                     msgid,
+                               rebinding = 0,
+                               save_nretries = nretries;
+
+       /*
+        * Otherwise an anonymous bind is performed
+        * (note: if the target was already bound, the anonymous
+        * bind clears the previous bind).
+        */
+       if ( !BER_BVISNULL( &msc->msc_bound_ndn ) ) {
+               ber_memfree( msc->msc_bound_ndn.bv_val );
+               BER_BVZERO( &msc->msc_bound_ndn );
+       }
+               
+       if ( !BER_BVISNULL( &msc->msc_cred ) ) {
+               /* destroy sensitive data */
+               memset( msc->msc_cred.bv_val, 0, msc->msc_cred.bv_len );
+               ber_memfree( msc->msc_cred.bv_val );
+               BER_BVZERO( &msc->msc_cred );
+       }
+
+       /* FIXME: should we check if at least some of the op->o_ctrls
+        * can/should be passed? */
+rebind:;
+       rc = ldap_sasl_bind( msc->msc_ld, "", LDAP_SASL_SIMPLE, &cred,
+                       NULL, NULL, &msgid );
+       if ( rc == LDAP_SUCCESS ) {
+               LDAPMessage     *res;
+               struct timeval  tv;
+
+               /*
+                * handle response!!!
+                */
+retry:;
+               tv.tv_sec = 0;
+               tv.tv_usec = META_BIND_TIMEOUT;
+               switch ( ldap_result( msc->msc_ld, msgid, 0, &tv, &res ) ) {
+               case 0:
+                       Debug( LDAP_DEBUG_ANY, "%s meta_back_single_dobind: ldap_result=%d nretries=%d\n",
+                               op->o_log_prefix, 0, nretries );
+
+                       if ( nretries != META_RETRY_NEVER ) {
+                               ldap_pvt_thread_yield();
+                               if ( nretries > 0 ) {
+                                       nretries--;
+                               }
+                               goto retry;
+                       }
+
+                       rc = LDAP_BUSY;
+                       if ( rebinding ) {
+                               ldap_abandon_ext( msc->msc_ld, msgid, NULL, NULL );
+                               break;
+                       }
+
+                       /* FIXME: some times the request times out
+                        * while the other party is not willing to
+                        * send a response any more.  Give it a second
+                        * chance with a freshly bound connection */
+                       rebinding = 1;
+                       nretries = save_nretries;
+                       /* fallthru */
+
+               case -1:
+                       ldap_get_option( msc->msc_ld,
+                                       LDAP_OPT_ERROR_NUMBER, &rs->sr_err );
+
+                       if ( rebinding ) {
+                               ldap_abandon_ext( msc->msc_ld, msgid, NULL, NULL );
+                       }
+
+                       Debug( LDAP_DEBUG_ANY, "### %s meta_back_single_dobind: err=%d nretries=%d\n",
+                                       op->o_log_prefix, rs->sr_err, nretries );
+
+                       rc = slap_map_api2result( rs );
+                       if ( rc == LDAP_UNAVAILABLE && nretries != META_RETRY_NEVER ) {
+                               ldap_unbind_ext_s( msc->msc_ld, NULL, NULL );
+                               msc->msc_ld = NULL;
+                               msc->msc_bound = 0;
+
+                               /* mc here must be the regular mc, reset and ready for init */
+                               rc = meta_back_init_one_conn( op, rs, mt, msc, LDAP_BACK_DONTSEND );
+
+                               if ( rc == LDAP_SUCCESS ) {
+                                       ldap_pvt_thread_yield();
+                                       if ( nretries > 0 ) {
+                                               nretries--;
+                                       }
+                                       goto rebind;
+                               }
+                       }
+                       break;
+
+               default:
+                       rc = ldap_parse_result( msc->msc_ld, res, &rs->sr_err,
+                                       NULL, NULL, NULL, NULL, 1 );
+                       if ( rc == LDAP_SUCCESS ) {
+                               rc = slap_map_api2result( rs );
+                       }
+                       break;
+               }
+       }
+
+       rs->sr_err = rc;
+       if ( rc != LDAP_SUCCESS && ( sendok & LDAP_BACK_SENDERR ) ) {
+               send_ldap_result( op, rs );
+       }
+
+       return rc;
+}
+
 /*
  * meta_back_dobind
  */
 int
-meta_back_dobind( struct metaconn *lc, Operation *op, ldap_back_send_t sendok )
+meta_back_dobind(
+       Operation               *op,
+       SlapReply               *rs,
+       metaconn_t              *mc,
+       ldap_back_send_t        sendok )
 {
-       struct metasingleconn   *lsc;
+       metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
+
+       metasingleconn_t        *msc;
        int                     bound = 0, i;
 
+       SlapReply               *candidates = meta_back_candidates_get( op );
+
+       ldap_pvt_thread_mutex_lock( &mc->mc_mutex );
+
        /*
         * all the targets are bound as pseudoroot
         */
-       if ( lc->mc_bound_target == META_BOUND_ALL ) {
-               return 1;
+       if ( mc->mc_auth_target == META_BOUND_ALL ) {
+               bound = 1;
+               goto done;
        }
 
-       for ( i = 0, lsc = lc->mc_conns; !META_LAST( lsc ); ++i, ++lsc ) {
+       for ( i = 0, msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ); ++i, ++msc ) {
+               metatarget_t    *mt = mi->mi_targets[ i ];
                int             rc;
-               struct berval   cred = BER_BVC("");
-               int             msgid;
 
                /*
                 * Not a candidate or something wrong with this target ...
                 */
-               if ( lsc->msc_ld == NULL ) {
+               if ( msc->msc_ld == NULL ) {
                        continue;
                }
 
                /*
                 * If the target is already bound it is skipped
                 */
-               if ( lsc->msc_bound == META_BOUND && lc->mc_bound_target == i ) {
+               if ( msc->msc_bound == META_BOUND && mc->mc_auth_target == i ) {
                        ++bound;
                        continue;
                }
 
-               /*
-                * Otherwise an anonymous bind is performed
-                * (note: if the target was already bound, the anonymous
-                * bind clears the previous bind).
-                */
-               if ( !BER_BVISNULL( &lsc->msc_bound_ndn ) ) {
-                       ber_memfree( lsc->msc_bound_ndn.bv_val );
-                       BER_BVZERO( &lsc->msc_bound_ndn );
-               }
-               
-               if ( /* FIXME: need li ... li->savecred && */ 
-                               !BER_BVISNULL( &lsc->msc_cred ) )
-               {
-                       /* destroy sensitive data */
-                       memset( lsc->msc_cred.bv_val, 0, lsc->msc_cred.bv_len );
-                       ber_memfree( lsc->msc_cred.bv_val );
-                       BER_BVZERO( &lsc->msc_cred );
-               }
-
-               /* FIXME: should we check if at least some of the op->o_ctrls
-                * can/should be passed? */
-               rc = ldap_sasl_bind( lsc->msc_ld, "", LDAP_SASL_SIMPLE, &cred,
-                               NULL, NULL, &msgid );
-               if ( rc == LDAP_SUCCESS ) {
-                       LDAPMessage     *res;
-                       struct timeval  tv = { 0, 0 };
-                       int             err;
-                       int             nretries = 0;
-
-                       /*
-                        * handle response!!!
-                        */
-retry:;
-                       switch ( ldap_result( lsc->msc_ld, msgid, 0, &tv, &res ) ) {
-                       case 0:
-                               if ( ++nretries <= META_BIND_NRETRIES ) {
-                                       ldap_pvt_thread_yield();
-                                       tv.tv_sec = 0;
-                                       tv.tv_usec = META_BIND_TIMEOUT;
-                                       goto retry;
-                               }
-
-                               rc = LDAP_BUSY;
-                               break;
-
-                       case -1:
-                               ldap_get_option( lsc->msc_ld, LDAP_OPT_ERROR_NUMBER,
-                                               &rc );
-                               break;
-
-                       default:
-                               rc = ldap_parse_result( lsc->msc_ld, res, &err,
-                                               NULL, NULL, NULL, NULL, 1 );
-                               if ( rc == LDAP_SUCCESS ) {
-                                       rc = err;
-                               }
-                               break;
-                       }
-               }
-
+               rc = meta_back_single_dobind( op, rs, mc, i,
+                               LDAP_BACK_DONTSEND, mt->mt_nretries );
                if ( rc != LDAP_SUCCESS ) {
-                       Debug( LDAP_DEBUG_ANY,
-                                       "==>meta_back_dobind: (anonymous)"
-                                       " bind failed"
-                                       " with error %d (%s)\n",
-                                       rc, ldap_err2string( rc ), 0 );
+                       Debug( LDAP_DEBUG_ANY, "%s meta_back_dobind[%d]: "
+                                       "(anonymous) err=%d\n",
+                                       op->o_log_prefix, i, rc );
 
                        /*
                         * null cred bind should always succeed
@@ -383,40 +501,29 @@ retry:;
                         * due to technical reasons (remote host down?)
                         * so better clear the handle
                         */
-                       ( void )meta_clear_one_candidate( lsc, 1 );
+                       candidates[ i ].sr_tag = META_NOT_CANDIDATE;
+#if 0
+                       ( void )meta_clear_one_candidate( msc );
+#endif
                        continue;
                } /* else */
                
-               lsc->msc_bound = META_ANONYMOUS;
+               candidates[ i ].sr_tag = META_CANDIDATE;
+               msc->msc_bound = META_ANONYMOUS;
                ++bound;
        }
 
-       return( bound > 0 );
-}
-
-/*
- *
- */
-int
-meta_back_is_valid( struct metaconn *lc, int candidate )
-{
-       struct metasingleconn   *lsc;
-       int                     i;
-
-       assert( lc );
+done:;
+        ldap_pvt_thread_mutex_unlock( &mc->mc_mutex );
 
-       if ( candidate < 0 ) {
-               return 0;
-       }
-
-       for ( i = 0, lsc = lc->mc_conns; !META_LAST( lsc ) && i < candidate; 
-                       ++i, ++lsc );
-       
-       if ( !META_LAST( lsc ) ) {
-               return ( lsc->msc_ld != NULL );
+       if ( bound == 0 && sendok & LDAP_BACK_SENDERR ) {
+               if ( rs->sr_err == LDAP_SUCCESS ) {
+                       rs->sr_err = LDAP_BUSY;
+               }
+               send_ldap_result( op, rs );
        }
 
-       return 0;
+       return( bound > 0 );
 }
 
 /*
@@ -426,13 +533,17 @@ meta_back_is_valid( struct metaconn *lc, int candidate )
  * credentials as the original user on this session.
  */
 static int 
-meta_back_rebind( LDAP *ld, LDAP_CONST char *url, ber_tag_t request,
-       ber_int_t msgid, void *params )
+meta_back_rebind(
+       LDAP                    *ld,
+       LDAP_CONST char         *url,
+       ber_tag_t               request,
+       ber_int_t               msgid,
+       void                    *params )
 {
-       struct metasingleconn   *lsc = params;
+       metasingleconn_t        *msc = ( metasingleconn_t * )params;
 
-       return ldap_sasl_bind_s( ld, lsc->msc_bound_ndn.bv_val,
-                       LDAP_SASL_SIMPLE, &lsc->msc_cred,
+       return ldap_sasl_bind_s( ld, msc->msc_bound_ndn.bv_val,
+                       LDAP_SASL_SIMPLE, &msc->msc_cred,
                        NULL, NULL, NULL );
 }
 
@@ -440,23 +551,26 @@ meta_back_rebind( LDAP *ld, LDAP_CONST char *url, ber_tag_t request,
  * FIXME: error return must be handled in a cleaner way ...
  */
 int
-meta_back_op_result( struct metaconn *lc, Operation *op, SlapReply *rs )
+meta_back_op_result(
+       metaconn_t      *mc,
+       Operation       *op,
+       SlapReply       *rs,
+       int             candidate )
 {
        int                     i,
                                rerr = LDAP_SUCCESS;
-       struct metasingleconn   *lsc;
+       metasingleconn_t        *msc;
        char                    *rmsg = NULL;
        char                    *rmatch = NULL;
        int                     free_rmsg = 0,
                                free_rmatch = 0;
 
-       for ( i = 0, lsc = lc->mc_conns; !META_LAST( lsc ); ++i, ++lsc ) {
-               char    *msg = NULL;
-               char    *match = NULL;
+       if ( candidate != META_TARGET_NONE ) {
+               msc = &mc->mc_conns[ candidate ];
 
                rs->sr_err = LDAP_SUCCESS;
 
-               ldap_get_option( lsc->msc_ld, LDAP_OPT_ERROR_NUMBER, &rs->sr_err );
+               ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER, &rs->sr_err );
                if ( rs->sr_err != LDAP_SUCCESS ) {
                        /*
                         * better check the type of error. In some cases
@@ -464,50 +578,87 @@ meta_back_op_result( struct metaconn *lc, Operation *op, SlapReply *rs )
                         * success if at least one of the targets gave
                         * positive result ...
                         */
-                       ldap_get_option( lsc->msc_ld,
-                                       LDAP_OPT_ERROR_STRING, &msg );
-                       ldap_get_option( lsc->msc_ld,
-                                       LDAP_OPT_MATCHED_DN, &match );
-                       rs->sr_err = slap_map_api2result( rs );
+                       ldap_get_option( msc->msc_ld,
+                                       LDAP_OPT_ERROR_STRING, &rmsg );
+                       ldap_get_option( msc->msc_ld,
+                                       LDAP_OPT_MATCHED_DN, &rmatch );
+                       rerr = rs->sr_err = slap_map_api2result( rs );
+
+                       if ( rmsg ) {
+                               free_rmsg = 1;
+                       }
+                       if ( rmatch ) {
+                               free_rmatch = 1;
+                       }
 
                        Debug(LDAP_DEBUG_ANY,
                                        "==> meta_back_op_result: target"
                                        " <%d> sending msg \"%s\""
                                        " (matched \"%s\")\n", 
-                                       i, ( msg ? msg : "" ),
-                                       ( match ? match : "" ) );
+                                       candidate, ( rmsg ? rmsg : "" ),
+                                       ( rmatch ? rmatch : "" ) );
+               }
 
-                       /*
-                        * FIXME: need to rewrite "match" (need rwinfo)
-                        */
-                       switch ( rs->sr_err ) {
-                       default:
-                               rerr = rs->sr_err;
-                               if ( rmsg ) {
-                                       ber_memfree( rmsg );
+       } else {
+               for ( i = 0, msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ); ++i, ++msc ) {
+                       char    *msg = NULL;
+                       char    *match = NULL;
+
+                       rs->sr_err = LDAP_SUCCESS;
+
+                       ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER, &rs->sr_err );
+                       if ( rs->sr_err != LDAP_SUCCESS ) {
+                               /*
+                                * better check the type of error. In some cases
+                                * (search ?) it might be better to return a
+                                * success if at least one of the targets gave
+                                * positive result ...
+                                */
+                               ldap_get_option( msc->msc_ld,
+                                               LDAP_OPT_ERROR_STRING, &msg );
+                               ldap_get_option( msc->msc_ld,
+                                               LDAP_OPT_MATCHED_DN, &match );
+                               rs->sr_err = slap_map_api2result( rs );
+       
+                               Debug(LDAP_DEBUG_ANY,
+                                               "==> meta_back_op_result: target"
+                                               " <%d> sending msg \"%s\""
+                                               " (matched \"%s\")\n", 
+                                               i, ( msg ? msg : "" ),
+                                               ( match ? match : "" ) );
+       
+                               /*
+                                * FIXME: need to rewrite "match" (need rwinfo)
+                                */
+                               switch ( rs->sr_err ) {
+                               default:
+                                       rerr = rs->sr_err;
+                                       if ( rmsg ) {
+                                               ber_memfree( rmsg );
+                                       }
+                                       rmsg = msg;
+                                       free_rmsg = 1;
+                                       msg = NULL;
+                                       if ( rmatch ) {
+                                               ber_memfree( rmatch );
+                                       }
+                                       rmatch = match;
+                                       free_rmatch = 1;
+                                       match = NULL;
+                                       break;
                                }
-                               rmsg = msg;
-                               free_rmsg = 1;
-                               msg = NULL;
-                               if ( rmatch ) {
-                                       ber_memfree( rmatch );
+       
+                               /* better test the pointers before freeing? */
+                               if ( match ) {
+                                       free( match );
+                               }
+                               if ( msg ) {
+                                       free( msg );
                                }
-                               rmatch = match;
-                               free_rmatch = 1;
-                               match = NULL;
-                               break;
-                       }
-
-                       /* better test the pointers before freeing? */
-                       if ( match ) {
-                               free( match );
-                       }
-                       if ( msg ) {
-                               free( msg );
                        }
                }
        }
-
+       
        rs->sr_err = rerr;
        rs->sr_text = rmsg;
        rs->sr_matched = rmatch;
index a018588d9c83a3b6422f718508053cd2f3fc6f6b..882403d0ba2ada456dc82066338583bebd97c7d8 100644 (file)
  * A possible extension will include the handling of multiple suffixes
  */
 
+static int
+meta_back_is_candidate_unique(
+       metainfo_t      *mi,
+       struct berval   *ndn );
+
 /*
  * returns 1 if suffix is candidate for dn, otherwise 0
  *
  */
 int 
 meta_back_is_candidate(
-               struct berval   *nsuffix,
-               struct berval   *ndn
-)
+       struct berval   *nsuffix,
+       struct berval   *ndn,
+       int             scope )
 {
-       if ( dnIsSuffix( nsuffix, ndn ) || dnIsSuffix( ndn, nsuffix ) ) {
+       if ( dnIsSuffix( ndn, nsuffix ) ) {
+               return META_CANDIDATE;
+       }
+
+       if ( scope == LDAP_SCOPE_SUBTREE && dnIsSuffix( nsuffix, ndn ) ) {
                /*
-                * suffix longer than dn
+                * suffix longer than dn, but common part matches
                 */
                return META_CANDIDATE;
        }
@@ -71,52 +80,24 @@ meta_back_is_candidate(
        return META_NOT_CANDIDATE;
 }
 
-/*
- * meta_back_count_candidates
- *
- * returns a count of the possible candidate targets
- * Note: dn MUST be normalized
- */
-
-int
-meta_back_count_candidates(
-               struct metainfo         *li,
-               struct berval           *ndn
-)
-{
-       int i, cnt = 0;
-
-       /*
-        * I know assertions should not check run-time values;
-        * at present I didn't find a place for such checks
-        * after config.c
-        */
-       assert( li->targets != NULL );
-       assert( li->ntargets != 0 );
-
-       for ( i = 0; i < li->ntargets; ++i ) {
-               if ( meta_back_is_candidate( &li->targets[ i ]->mt_nsuffix, ndn ) )
-               {
-                       ++cnt;
-               }
-       }
-
-       return cnt;
-}
-
 /*
  * meta_back_is_candidate_unique
  *
  * checks whether a candidate is unique
  * Note: dn MUST be normalized
  */
-int
+static int
 meta_back_is_candidate_unique(
-               struct metainfo         *li,
-               struct berval           *ndn
-)
+       metainfo_t      *mi,
+       struct berval   *ndn )
 {
-       return ( meta_back_count_candidates( li, ndn ) == 1 );
+       switch ( meta_back_select_unique_candidate( mi, ndn ) ) {
+       case META_TARGET_MULTIPLE:
+       case META_TARGET_NONE:
+               return 0;
+       }
+
+       return 1;
 }
 
 /*
@@ -128,29 +109,24 @@ meta_back_is_candidate_unique(
  */
 int
 meta_back_select_unique_candidate(
-               struct metainfo         *li,
-               struct berval           *ndn
-)
+       metainfo_t      *mi,
+       struct berval   *ndn )
 {
-       int     i;
-       
-       switch ( meta_back_count_candidates( li, ndn ) ) {
-       case 1:
-               break;
-       case 0:
-       default:
-               return ( li->defaulttarget == META_DEFAULT_TARGET_NONE
-                               ? META_TARGET_NONE : li->defaulttarget );
-       }
+       int     i, candidate = META_TARGET_NONE;
 
-       for ( i = 0; i < li->ntargets; ++i ) {
-               if ( meta_back_is_candidate( &li->targets[ i ]->mt_nsuffix, ndn ) )
+       for ( i = 0; i < mi->mi_ntargets; ++i ) {
+               if ( meta_back_is_candidate( &mi->mi_targets[ i ]->mt_nsuffix, ndn, LDAP_SCOPE_BASE ) )
                {
-                       return i;
+                       if ( candidate == META_TARGET_NONE ) {
+                               candidate = i;
+
+                       } else {
+                               return META_TARGET_MULTIPLE;
+                       }
                }
        }
 
-       return META_TARGET_NONE;
+       return candidate;
 }
 
 /*
@@ -160,19 +136,18 @@ meta_back_select_unique_candidate(
  */
 int
 meta_clear_unused_candidates(
-               struct metainfo         *li,
-               struct metaconn         *lc,
-               int                     candidate,
-               int                     reallyclean
-)
+       Operation       *op,
+       int             candidate )
 {
-       int i;
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       int             i;
+       SlapReply       *candidates = meta_back_candidates_get( op );
        
-       for ( i = 0; i < li->ntargets; ++i ) {
+       for ( i = 0; i < mi->mi_ntargets; ++i ) {
                if ( i == candidate ) {
                        continue;
                }
-               meta_clear_one_candidate( &lc->mc_conns[ i ], reallyclean );
+               candidates[ i ].sr_tag = META_NOT_CANDIDATE;
        }
 
        return 0;
@@ -185,29 +160,21 @@ meta_clear_unused_candidates(
  */
 int
 meta_clear_one_candidate(
-               struct metasingleconn   *lsc,
-               int                     reallyclean
-)
+       metasingleconn_t        *msc )
 {
-       lsc->msc_candidate = META_NOT_CANDIDATE;
-
-       if ( !reallyclean ) {
-               return 0;
-       }
-
-       if ( lsc->msc_ld ) {
-               ldap_unbind_ext_s( lsc->msc_ld, NULL, NULL );
-               lsc->msc_ld = NULL;
+       if ( msc->msc_ld ) {
+               ldap_unbind_ext_s( msc->msc_ld, NULL, NULL );
+               msc->msc_ld = NULL;
        }
 
-       if ( !BER_BVISNULL( &lsc->msc_bound_ndn ) ) {
-               ber_memfree( lsc->msc_bound_ndn.bv_val );
-               BER_BVZERO( &lsc->msc_bound_ndn );
+       if ( !BER_BVISNULL( &msc->msc_bound_ndn ) ) {
+               ber_memfree( msc->msc_bound_ndn.bv_val );
+               BER_BVZERO( &msc->msc_bound_ndn );
        }
 
-       if ( !BER_BVISNULL( &lsc->msc_cred ) ) {
-               ber_memfree( lsc->msc_cred.bv_val );
-               BER_BVZERO( &lsc->msc_cred );
+       if ( !BER_BVISNULL( &msc->msc_cred ) ) {
+               ber_memfree( msc->msc_cred.bv_val );
+               BER_BVZERO( &msc->msc_cred );
        }
 
        return 0;
index ee15d1495d459409ef229e72c45721aecfee50ac..04678f5ff5e81a5583143478e0e8c1842a5dca2a 100644 (file)
 int
 meta_back_compare( Operation *op, SlapReply *rs )
 {
-       struct metainfo         *li = ( struct metainfo * )op->o_bd->be_private;
-       struct metaconn         *lc;
-       struct metasingleconn   *lsc;
+       metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
+       metaconn_t              *mc;
+       metasingleconn_t        *msc;
        char                    *match = NULL,
                                *err = NULL;
        struct berval           mmatch = BER_BVNULL;
-       int                     candidates = 0,
+       int                     ncandidates = 0,
                                last = 0,
                                i,
                                count = 0,
@@ -50,13 +50,14 @@ meta_back_compare( Operation *op, SlapReply *rs )
                                *msgid;
        dncookie                dc;
 
-       lc = meta_back_getconn( op, rs, META_OP_ALLOW_MULTIPLE,
-                       &op->o_req_ndn, NULL, LDAP_BACK_SENDERR );
-       if ( !lc || !meta_back_dobind( lc, op, LDAP_BACK_SENDERR ) ) {
+       SlapReply               *candidates = meta_back_candidates_get( op );
+
+       mc = meta_back_getconn( op, rs, NULL, LDAP_BACK_SENDERR );
+       if ( !mc || !meta_back_dobind( op, rs, mc, LDAP_BACK_SENDERR ) ) {
                return rs->sr_err;
        }
        
-       msgid = ch_calloc( sizeof( int ), li->ntargets );
+       msgid = ch_calloc( sizeof( int ), mi->mi_ntargets );
        if ( msgid == NULL ) {
                return -1;
        }
@@ -68,12 +69,12 @@ meta_back_compare( Operation *op, SlapReply *rs )
        dc.rs = rs;
        dc.ctx = "compareDN";
 
-       for ( i = 0, lsc = lc->mc_conns; !META_LAST( lsc ); ++i, ++lsc ) {
+       for ( i = 0, msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ); ++i, ++msc ) {
                struct berval mdn = BER_BVNULL;
                struct berval mapped_attr = op->orc_ava->aa_desc->ad_cname;
                struct berval mapped_value = op->orc_ava->aa_value;
 
-               if ( lsc->msc_candidate != META_CANDIDATE ) {
+               if ( candidates[ i ].sr_tag != META_CANDIDATE ) {
                        msgid[ i ] = -1;
                        continue;
                }
@@ -81,7 +82,7 @@ meta_back_compare( Operation *op, SlapReply *rs )
                /*
                 * Rewrite the compare dn, if needed
                 */
-               dc.rwmap = &li->targets[ i ]->mt_rwmap;
+               dc.rwmap = &mi->mi_targets[ i ]->mt_rwmap;
 
                switch ( ldap_back_dn_massage( &dc, &op->o_req_dn, &mdn ) ) {
                case LDAP_UNWILLING_TO_PERFORM:
@@ -96,21 +97,21 @@ meta_back_compare( Operation *op, SlapReply *rs )
                 * if attr is objectClass, try to remap the value
                 */
                if ( op->orc_ava->aa_desc == slap_schema.si_ad_objectClass ) {
-                       ldap_back_map( &li->targets[ i ]->mt_rwmap.rwm_oc,
+                       ldap_back_map( &mi->mi_targets[ i ]->mt_rwmap.rwm_oc,
                                        &op->orc_ava->aa_value,
                                        &mapped_value, BACKLDAP_MAP );
 
-                       if ( mapped_value.bv_val == NULL || mapped_value.bv_val[0] == '\0' ) {
+                       if ( BER_BVISNULL( &mapped_value ) || mapped_value.bv_val[0] == '\0' ) {
                                continue;
                        }
                /*
                 * else try to remap the attribute
                 */
                } else {
-                       ldap_back_map( &li->targets[ i ]->mt_rwmap.rwm_at,
+                       ldap_back_map( &mi->mi_targets[ i ]->mt_rwmap.rwm_at,
                                &op->orc_ava->aa_desc->ad_cname,
                                &mapped_attr, BACKLDAP_MAP );
-                       if ( mapped_attr.bv_val == NULL || mapped_attr.bv_val[0] == '\0' ) {
+                       if ( BER_BVISNULL( &mapped_attr ) || mapped_attr.bv_val[0] == '\0' ) {
                                continue;
                        }
 
@@ -135,7 +136,7 @@ meta_back_compare( Operation *op, SlapReply *rs )
                 * that returns determines the result; a constraint on unicity
                 * of the result ought to be enforced
                 */
-                rc = ldap_compare_ext( lc->mc_conns[ i ].msc_ld, mdn.bv_val,
+                rc = ldap_compare_ext( mc->mc_conns[ i ].msc_ld, mdn.bv_val,
                                mapped_attr.bv_val, &mapped_value,
                                op->o_ctrls, NULL, &msgid[ i ] );
 
@@ -159,37 +160,46 @@ meta_back_compare( Operation *op, SlapReply *rs )
                        continue;
                }
 
-               ++candidates;
+               ++ncandidates;
        }
 
        /*
         * wait for replies
         */
-       for ( rc = 0, count = 0; candidates > 0; ) {
+       for ( rc = 0, count = 0; ncandidates > 0; ) {
 
                /*
                 * FIXME: should we check for abandon?
                 */
-               for ( i = 0, lsc = lc->mc_conns; !META_LAST( lsc ); lsc++, i++ ) {
+               for ( i = 0, msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ); msc++, i++ ) {
                        int             lrc;
                        LDAPMessage     *res = NULL;
+                       struct timeval  tv = { 0 };
+
+                       tv.tv_sec = 0;
+                       tv.tv_usec = 0;
 
                        if ( msgid[ i ] == -1 ) {
                                continue;
                        }
 
-                       lrc = ldap_result( lsc->msc_ld, msgid[ i ],
-                                       0, NULL, &res );
+                       lrc = ldap_result( msc->msc_ld, msgid[ i ],
+                                       0, &tv, &res );
 
                        if ( lrc == 0 ) {
-                               /*
-                                * FIXME: should we yield?
-                                */
-                               if ( res ) {
-                                       ldap_msgfree( res );
-                               }
+                               assert( res == NULL );
                                continue;
 
+                       } else if ( lrc == -1 ) {
+                               /* we do not retry in this case;
+                                * only for unique operations... */
+                               ldap_get_option( msc->msc_ld,
+                                       LDAP_OPT_ERROR_NUMBER, &rs->sr_err );
+                               rres = slap_map_api2result( rs );
+                               rres = rc;
+                               rc = -1;
+                               goto finish;
+
                        } else if ( lrc == LDAP_RES_COMPARE ) {
                                if ( count > 0 ) {
                                        rres = LDAP_OTHER;
@@ -197,7 +207,7 @@ meta_back_compare( Operation *op, SlapReply *rs )
                                        goto finish;
                                }
 
-                               rc = ldap_parse_result( lsc->msc_ld, res,
+                               rc = ldap_parse_result( msc->msc_ld, res,
                                                &rs->sr_err,
                                                NULL, NULL, NULL, NULL, 1 );
                                if ( rc != LDAP_SUCCESS ) {
@@ -211,11 +221,11 @@ meta_back_compare( Operation *op, SlapReply *rs )
                                case LDAP_COMPARE_FALSE:
 
                                        /*
-                                        * true or flase, got it;
+                                        * true or false, got it;
                                         * sending to cache ...
                                         */
-                                       if ( li->cache.ttl != META_DNCACHE_DISABLED ) {
-                                               ( void )meta_dncache_update_entry( &li->cache, &op->o_req_ndn, i );
+                                       if ( mi->mi_cache.ttl != META_DNCACHE_DISABLED ) {
+                                               ( void )meta_dncache_update_entry( &mi->mi_cache, &op->o_req_ndn, i );
                                        }
 
                                        count++;
@@ -228,24 +238,24 @@ meta_back_compare( Operation *op, SlapReply *rs )
                                        if ( err != NULL ) {
                                                free( err );
                                        }
-                                       ldap_get_option( lsc->msc_ld,
+                                       ldap_get_option( msc->msc_ld,
                                                LDAP_OPT_ERROR_STRING, &err );
 
                                        if ( match != NULL ) {
                                                free( match );
                                        }
-                                       ldap_get_option( lsc->msc_ld,
+                                       ldap_get_option( msc->msc_ld,
                                                LDAP_OPT_MATCHED_DN, &match );
                                        
                                        last = i;
                                        break;
                                }
                                msgid[ i ] = -1;
-                               --candidates;
+                               --ncandidates;
 
                        } else {
                                msgid[ i ] = -1;
-                               --candidates;
+                               --ncandidates;
                                if ( res ) {
                                        ldap_msgfree( res );
                                }
@@ -280,8 +290,7 @@ finish:;
        } else if ( match != NULL &&  match[0] != '\0' ) {
                struct berval matched;
 
-               matched.bv_val = match;
-               matched.bv_len = strlen( match );
+               ber_str2bv( match, 0, 0, &matched );
 
                dc.ctx = "matchedDN";
                ldap_back_dn_massage( &dc, &matched, &mmatch );
index a7a6fa1805f6049f67ba74f6a9519c65bffd0d15..777eee643c2bcd5d3ab9d5909d3e310d41dea53b 100644 (file)
 #include "../../../libraries/libldap/ldap-int.h"
 #include "back-meta.h"
 
-static struct metatarget *
+static metatarget_t *
 new_target( void )
 {
-       struct metatarget *lt;
+       metatarget_t *mt;
         struct ldapmapping *mapping;
 
-       lt = ch_calloc( sizeof( struct metatarget ), 1 );
-       if ( lt == NULL ) {
+       mt = ch_malloc( sizeof( metatarget_t ) );
+       if ( mt == NULL ) {
                return NULL;
        }
+       memset( mt, 0, sizeof( metatarget_t ) );
 
-       lt->mt_rwmap.rwm_rw = rewrite_info_init( REWRITE_MODE_USE_DEFAULT );
-       if ( lt->mt_rwmap.rwm_rw == NULL ) {
-               free( lt );
+       mt->mt_rwmap.rwm_rw = rewrite_info_init( REWRITE_MODE_USE_DEFAULT );
+       if ( mt->mt_rwmap.rwm_rw == NULL ) {
+               free( mt );
                 return NULL;
        }
 
@@ -62,19 +63,19 @@ new_target( void )
                rargv[ 0 ] = "rewriteContext";
                rargv[ 1 ] = "searchFilter";
                rargv[ 2 ] = NULL;
-               rewrite_parse( lt->mt_rwmap.rwm_rw, "<suffix massage>", 
+               rewrite_parse( mt->mt_rwmap.rwm_rw, "<suffix massage>", 
                                1, 2, rargv );
 
                rargv[ 0 ] = "rewriteContext";
                rargv[ 1 ] = "default";
                rargv[ 2 ] = NULL;
-               rewrite_parse( lt->mt_rwmap.rwm_rw, "<suffix massage>", 
+               rewrite_parse( mt->mt_rwmap.rwm_rw, "<suffix massage>", 
                                1, 2, rargv );
        }
 
-       ldap_back_map_init( &lt->mt_rwmap.rwm_at, &mapping );
+       ldap_back_map_init( &mt->mt_rwmap.rwm_at, &mapping );
 
-       return lt;
+       return mt;
 }
 
 int
@@ -86,9 +87,9 @@ meta_back_db_config(
                char            **argv
 )
 {
-       struct metainfo *li = ( struct metainfo * )be->be_private;
+       metainfo_t      *mi = ( metainfo_t * )be->be_private;
 
-       if ( li == NULL ) {
+       if ( mi == NULL ) {
                fprintf( stderr, 
        "%s: line %d: meta backend info is null!\n",
                    fname, lineno );
@@ -97,7 +98,7 @@ meta_back_db_config(
 
        /* URI of server to query */
        if ( strcasecmp( argv[ 0 ], "uri" ) == 0 ) {
-               int             i = li->ntargets;
+               int             i = mi->mi_ntargets;
 #if 0
                int             j;
 #endif /* uncomment if uri MUST be a branch of suffix */
@@ -113,11 +114,11 @@ meta_back_db_config(
                        return 1;
                }
                
-               ++li->ntargets;
+               ++mi->mi_ntargets;
 
-               li->targets = ch_realloc( li->targets, 
-                       sizeof( struct metatarget *)*li->ntargets );
-               if ( li->targets == NULL ) {
+               mi->mi_targets = ( metatarget_t ** )ch_realloc( mi->mi_targets, 
+                       sizeof( metatarget_t * ) * mi->mi_ntargets );
+               if ( mi->mi_targets == NULL ) {
                        fprintf( stderr,
        "%s: line %d: out of memory while storing server name"
        " in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
@@ -125,7 +126,7 @@ meta_back_db_config(
                        return 1;
                }
 
-               if ( ( li->targets[ i ] = new_target() ) == NULL ) {
+               if ( ( mi->mi_targets[ i ] = new_target() ) == NULL ) {
                        fprintf( stderr,
        "%s: line %d: unable to init server"
        " in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
@@ -133,6 +134,8 @@ meta_back_db_config(
                        return 1;
                }
 
+               mi->mi_targets[ i ]->mt_nretries = mi->mi_nretries;
+
                /*
                 * uri MUST be legal!
                 */
@@ -161,8 +164,8 @@ meta_back_db_config(
                dn.bv_val = ludp->lud_dn;
                dn.bv_len = strlen( ludp->lud_dn );
 
-               rc = dnPrettyNormal( NULL, &dn, &li->targets[ i ]->mt_psuffix,
-                       &li->targets[ i ]->mt_nsuffix, NULL );
+               rc = dnPrettyNormal( NULL, &dn, &mi->mi_targets[ i ]->mt_psuffix,
+                       &mi->mi_targets[ i ]->mt_nsuffix, NULL );
                if( rc != LDAP_SUCCESS ) {
                        fprintf( stderr, "%s: line %d: "
                                        "target '%s' DN is invalid\n",
@@ -188,9 +191,9 @@ meta_back_db_config(
                        }
                }
 
-               li->targets[ i ]->mt_uri = ldap_url_list2urls( ludp );
+               mi->mi_targets[ i ]->mt_uri = ldap_url_list2urls( ludp );
                ldap_free_urllist( ludp );
-               if ( li->targets[ i ]->mt_uri == NULL) {
+               if ( mi->mi_targets[ i ]->mt_uri == NULL) {
                        fprintf( stderr, "%s: line %d: no memory?\n",
                                        fname, lineno );
                        return( 1 );
@@ -200,7 +203,7 @@ meta_back_db_config(
                 * uri MUST be a branch of suffix!
                 */
 #if 0 /* too strict a constraint */
-               if ( select_backend( &li->targets[ i ]->suffix, 0, 0 ) != be ) {
+               if ( select_backend( &mi->mi_targets[ i ]->suffix, 0, 0 ) != be ) {
                        fprintf( stderr,
        "%s: line %d: <naming context> of URI does not refer to current backend"
        " in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
@@ -211,7 +214,7 @@ meta_back_db_config(
                /*
                 * uri MUST be a branch of a suffix!
                 */
-               if ( select_backend( &li->targets[ i ]->mt_nsuffix, 0, 0 ) == NULL ) {
+               if ( select_backend( &mi->mi_targets[ i ]->mt_nsuffix, 0, 0 ) == NULL ) {
                        fprintf( stderr,
        "%s: line %d: <naming context> of URI does not resolve to a backend"
        " in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
@@ -228,8 +231,8 @@ meta_back_db_config(
                 * or worked out, at least, in some manner
                 */
                for ( j = 0; j < i-1; j++ ) {
-                       if ( dn_match( &li->targets[ i ]->suffix,
-                                       &li->targets[ j ]->suffix ) ) {
+                       if ( dn_match( &mi->mi_targets[ i ]->suffix,
+                                       &mi->mi_targets[ j ]->suffix ) ) {
                                fprintf( stderr,
        "%s: line %d: naming context \"%s\" already used"
        " in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
@@ -241,13 +244,13 @@ meta_back_db_config(
 
 #if 0
                fprintf(stderr, "%s: line %d: URI \"%s\", suffix \"%s\"\n",
-                       fname, lineno, li->targets[ i ]->uri, 
-                       li->targets[ i ]->psuffix.bv_val );
+                       fname, lineno, mi->mi_targets[ i ]->uri, 
+                       mi->mi_targets[ i ]->psuffix.bv_val );
 #endif
                
        /* default target directive */
        } else if ( strcasecmp( argv[ 0 ], "default-target" ) == 0 ) {
-               int             i = li->ntargets-1;
+               int             i = mi->mi_ntargets - 1;
                
                if ( argc == 1 ) {
                        if ( i < 0 ) {
@@ -257,7 +260,7 @@ meta_back_db_config(
                                        fname, lineno );
                                return 1;
                        }
-                       li->defaulttarget = i;
+                       mi->mi_defaulttarget = i;
                } else {
                        if ( strcasecmp( argv[ 1 ], "none" ) == 0 ) {
                                if ( i >= 0 ) {
@@ -266,16 +269,18 @@ meta_back_db_config(
                " should go before uri definitions\n",
                                                fname, lineno );
                                }
-                               li->defaulttarget = META_DEFAULT_TARGET_NONE;
+                               mi->mi_defaulttarget = META_DEFAULT_TARGET_NONE;
+
                        } else {
-                               int n = atoi( argv[ 1 ] );
-                               if ( n < 1 || n >= i ) {
+                               char    *next;
+                               int     n = strtol( argv[ 1 ], &next, 10 );
+                               if ( n < 0 || n >= i - 1 ) {
                                        fprintf( stderr,
        "%s: line %d: illegal target number %d\n",
                                                fname, lineno, n );
                                        return 1;
                                }
-                               li->defaulttarget = n-1;
+                               mi->mi_defaulttarget = n;
                        }
                }
                
@@ -289,11 +294,11 @@ meta_back_db_config(
                }
                
                if ( strcasecmp( argv[ 1 ], "forever" ) == 0 ) {
-                       li->cache.ttl = META_DNCACHE_FOREVER;
+                       mi->mi_cache.ttl = META_DNCACHE_FOREVER;
                } else if ( strcasecmp( argv[ 1 ], "disabled" ) == 0 ) {
-                       li->cache.ttl = META_DNCACHE_DISABLED;
+                       mi->mi_cache.ttl = META_DNCACHE_DISABLED;
                } else {
-                       li->cache.ttl = atol( argv[ 1 ] );
+                       mi->mi_cache.ttl = atol( argv[ 1 ] );
                }
 
        /* network timeout when connecting to ldap servers */
@@ -304,13 +309,13 @@ meta_back_db_config(
                                fname, lineno );
                        return 1;
                }
-               li->network_timeout = atol(argv[ 1 ]);
+               mi->mi_network_timeout = atol(argv[ 1 ]);
 
        /* name to use for meta_back_group */
        } else if ( strcasecmp( argv[ 0 ], "acl-authcDN" ) == 0
                        || strcasecmp( argv[ 0 ], "binddn" ) == 0 )
        {
-               int             i = li->ntargets-1;
+               int             i = mi->mi_ntargets - 1;
                struct berval   dn;
 
                if ( i < 0 ) {
@@ -337,7 +342,7 @@ meta_back_db_config(
 
                dn.bv_val = argv[ 1 ];
                dn.bv_len = strlen( argv[ 1 ] );
-               if ( dnNormalize( 0, NULL, NULL, &dn, &li->targets[ i ]->mt_binddn,
+               if ( dnNormalize( 0, NULL, NULL, &dn, &mi->mi_targets[ i ]->mt_binddn,
                        NULL ) != LDAP_SUCCESS )
                {
                        fprintf( stderr, "%s: line %d: "
@@ -350,7 +355,7 @@ meta_back_db_config(
        } else if ( strcasecmp( argv[ 0 ], "acl-passwd" ) == 0
                        || strcasecmp( argv[ 0 ], "bindpw" ) == 0 )
        {
-               int             i = li->ntargets-1;
+               int             i = mi->mi_ntargets - 1;
 
                if ( i < 0 ) {
                        fprintf( stderr,
@@ -374,7 +379,7 @@ meta_back_db_config(
                        /* FIXME: some day we'll need to throw an error */
                }
 
-               ber_str2bv( argv[ 1 ], 0L, 1, &li->targets[ i ]->mt_bindpw );
+               ber_str2bv( argv[ 1 ], 0L, 1, &mi->mi_targets[ i ]->mt_bindpw );
                
        /* save bind creds for referral rebinds? */
        } else if ( strcasecmp( argv[0], "rebind-as-user" ) == 0 ) {
@@ -385,7 +390,7 @@ meta_back_db_config(
                        return( 1 );
                }
 
-               li->flags |= LDAP_BACK_F_SAVECRED;
+               mi->flags |= LDAP_BACK_F_SAVECRED;
 
        } else if ( strcasecmp( argv[0], "chase-referrals" ) == 0 ) {
                if ( argc != 1 ) {
@@ -395,7 +400,7 @@ meta_back_db_config(
                        return( 1 );
                }
 
-               li->flags |= LDAP_BACK_F_CHASE_REFERRALS;
+               mi->flags |= LDAP_BACK_F_CHASE_REFERRALS;
 
        } else if ( strcasecmp( argv[0], "dont-chase-referrals" ) == 0 ) {
                if ( argc != 1 ) {
@@ -405,7 +410,7 @@ meta_back_db_config(
                        return( 1 );
                }
 
-               li->flags &= ~LDAP_BACK_F_CHASE_REFERRALS;
+               mi->flags &= ~LDAP_BACK_F_CHASE_REFERRALS;
 
        } else if ( strncasecmp( argv[0], "tls-", STRLENOF( "tls-" ) ) == 0 ) {
 
@@ -417,7 +422,7 @@ meta_back_db_config(
                                                fname, lineno );
                                return( 1 );
                        }
-                       li->flags |= ( LDAP_BACK_F_USE_TLS | LDAP_BACK_F_TLS_CRITICAL );
+                       mi->flags |= ( LDAP_BACK_F_USE_TLS | LDAP_BACK_F_TLS_CRITICAL );
        
                /* try start tls */
                } else if ( strcasecmp( argv[0], "tls-try-start" ) == 0 ) {
@@ -427,8 +432,8 @@ meta_back_db_config(
                                                fname, lineno );
                                return( 1 );
                        }
-                       li->flags &= ~LDAP_BACK_F_TLS_CRITICAL;
-                       li->flags |= LDAP_BACK_F_USE_TLS;
+                       mi->flags &= ~LDAP_BACK_F_TLS_CRITICAL;
+                       mi->flags |= LDAP_BACK_F_USE_TLS;
        
                /* propagate start tls */
                } else if ( strcasecmp( argv[0], "tls-propagate" ) == 0 ) {
@@ -438,7 +443,7 @@ meta_back_db_config(
                                                fname, lineno );
                                return( 1 );
                        }
-                       li->flags |= ( LDAP_BACK_F_PROPAGATE_TLS | LDAP_BACK_F_TLS_CRITICAL );
+                       mi->flags |= ( LDAP_BACK_F_PROPAGATE_TLS | LDAP_BACK_F_TLS_CRITICAL );
                
                /* try start tls */
                } else if ( strcasecmp( argv[0], "tls-try-propagate" ) == 0 ) {
@@ -448,13 +453,13 @@ meta_back_db_config(
                                                fname, lineno );
                                return( 1 );
                        }
-                       li->flags &= ~LDAP_BACK_F_TLS_CRITICAL;
-                       li->flags |= LDAP_BACK_F_PROPAGATE_TLS;
+                       mi->flags &= ~LDAP_BACK_F_TLS_CRITICAL;
+                       mi->flags |= LDAP_BACK_F_PROPAGATE_TLS;
                }
        
        /* name to use as pseudo-root dn */
        } else if ( strcasecmp( argv[ 0 ], "pseudorootdn" ) == 0 ) {
-               int             i = li->ntargets-1;
+               int             i = mi->mi_ntargets - 1;
                struct berval   dn;
 
                if ( i < 0 ) {
@@ -474,7 +479,7 @@ meta_back_db_config(
                dn.bv_val = argv[ 1 ];
                dn.bv_len = strlen( argv[ 1 ] );
                if ( dnNormalize( 0, NULL, NULL, &dn,
-                       &li->targets[ i ]->mt_pseudorootdn, NULL ) != LDAP_SUCCESS )
+                       &mi->mi_targets[ i ]->mt_pseudorootdn, NULL ) != LDAP_SUCCESS )
                {
                        fprintf( stderr, "%s: line %d: "
                                        "pseudoroot DN '%s' is invalid\n",
@@ -484,7 +489,7 @@ meta_back_db_config(
 
        /* password to use as pseudo-root */
        } else if ( strcasecmp( argv[ 0 ], "pseudorootpw" ) == 0 ) {
-               int             i = li->ntargets-1;
+               int             i = mi->mi_ntargets - 1;
 
                if ( i < 0 ) {
                        fprintf( stderr,
@@ -499,12 +504,12 @@ meta_back_db_config(
                            fname, lineno );
                        return 1;
                }
-               ber_str2bv( argv[ 1 ], 0L, 1, &li->targets[ i ]->mt_pseudorootpw );
+               ber_str2bv( argv[ 1 ], 0L, 1, &mi->mi_targets[ i ]->mt_pseudorootpw );
        
        /* dn massaging */
        } else if ( strcasecmp( argv[ 0 ], "suffixmassage" ) == 0 ) {
                BackendDB       *tmp_be;
-               int             i = li->ntargets-1;
+               int             i = mi->mi_ntargets - 1;
                struct berval   dn, nvnc, pvnc, nrnc, prnc;
 
                if ( i < 0 ) {
@@ -584,27 +589,26 @@ meta_back_db_config(
                 * FIXME: no extra rewrite capabilities should be added
                 * to the database
                 */
-               return suffix_massage_config( li->targets[ i ]->mt_rwmap.rwm_rw,
+               return suffix_massage_config( mi->mi_targets[ i ]->mt_rwmap.rwm_rw,
                                &pvnc, &nvnc, &prnc, &nrnc );
                
        /* rewrite stuff ... */
        } else if ( strncasecmp( argv[ 0 ], "rewrite", 7 ) == 0 ) {
-               int             i = li->ntargets-1;
+               int             i = mi->mi_ntargets - 1;
 
                if ( i < 0 ) {
-                       if ( strcasecmp( argv[0], "rewriteEngine" ) == 0 ) {
-                               li->rwinfo = rewrite_info_init( REWRITE_MODE_USE_DEFAULT );
-                       }
-                       return rewrite_parse( li->rwinfo, fname, lineno,
-                                       argc, argv ); 
+                       fprintf( stderr, "%s: line %d: \"rewrite\" "
+                               "statement outside target definition.\n",
+                               fname, lineno );
+                       return 1;
                }
                
-               return rewrite_parse( li->targets[ i ]->mt_rwmap.rwm_rw,
+               return rewrite_parse( mi->mi_targets[ i ]->mt_rwmap.rwm_rw,
                                fname, lineno, argc, argv );
 
        /* objectclass/attribute mapping */
        } else if ( strcasecmp( argv[ 0 ], "map" ) == 0 ) {
-               int             i = li->ntargets-1;
+               int             i = mi->mi_ntargets - 1;
 
                if ( i < 0 ) {
                        fprintf( stderr,
@@ -613,9 +617,46 @@ meta_back_db_config(
                        return 1;
                }
 
-               return ldap_back_map_config( &li->targets[ i ]->mt_rwmap.rwm_oc, 
-                               &li->targets[ i ]->mt_rwmap.rwm_at,
+               return ldap_back_map_config( &mi->mi_targets[ i ]->mt_rwmap.rwm_oc, 
+                               &mi->mi_targets[ i ]->mt_rwmap.rwm_at,
                                fname, lineno, argc, argv );
+
+       } else if ( strcasecmp( argv[ 0 ], "nretries" ) == 0 ) {
+               int             i = mi->mi_ntargets - 1;
+               int             nretries = META_RETRY_UNDEFINED;
+
+               if ( argc != 2 ) {
+                       fprintf( stderr,
+       "%s: line %d: need value in \"nretries <value>\"\n",
+                               fname, lineno );
+                       return 1;
+               }
+
+               if ( strcasecmp( argv[ 1 ], "forever" ) == 0 ) {
+                       nretries = META_RETRY_FOREVER;
+
+               } else if ( strcasecmp( argv[ 1 ], "never" ) == 0 ) {
+                       nretries = META_RETRY_NEVER;
+
+               } else {
+                       char    *next;
+
+                       nretries = strtol( argv[ 1 ], &next, 10 );
+                       if ( next == argv[ 1 ] || next[ 0 ] != '\0' ) {
+                               fprintf( stderr,
+       "%s: line %d: unable to parse value \"%s\" in \"nretries <value>\"\n",
+                                       fname, lineno, argv[ 1 ] );
+                               return 1;
+                       }
+               }
+
+               if ( i < 0 ) {
+                       mi->mi_nretries = nretries;
+
+               } else {
+                       mi->mi_targets[ i ]->mt_nretries = nretries;
+               }
+
        /* anything else */
        } else {
                return SLAP_CONF_UNKNOWN;
@@ -794,9 +835,12 @@ suffix_massage_regexize( const char *s )
                        p = r + 1, i++ )
                ;
 
-       res = ch_calloc( sizeof( char ), strlen( s ) + 4 + 4*i + 1 );
+       res = ch_calloc( sizeof( char ),
+                       strlen( s )
+                       + STRLENOF( "(.+,)?" )
+                       + STRLENOF( "[ ]?" ) * i + 1 );
 
-       ptr = lutil_strcopy( res, "(.*)" );
+       ptr = lutil_strcopy( res, "(.+,)?" );
        for ( i = 0, p = s;
                        ( r = strchr( p, ',' ) ) != NULL;
                        p = r + 1 , i++ ) {
@@ -820,13 +864,13 @@ suffix_massage_patternize( const char *s )
 
        len = strlen( s );
 
-       res = ch_calloc( sizeof( char ), len + sizeof( "%1" ) );
+       res = ch_calloc( sizeof( char ), len + STRLENOF( "%1" ) + 1 );
        if ( res == NULL ) {
                return NULL;
        }
 
        strcpy( res, "%1" );
-       strcpy( res + sizeof( "%1" ) - 1, s );
+       strcpy( &res[ STRLENOF( "%1" ) ], s );
 
        return res;
 }
index 3b31118c3fabdcb1d155c366c1409b7c0bac59aa..ebf63df8397b932633aeb1189936b56b53a276ba 100644 (file)
 int
 meta_back_conn_cmp(
        const void *c1,
-       const void *c2
-       )
+       const void *c2 )
 {
-       struct metaconn *lc1 = ( struct metaconn * )c1;
-        struct metaconn *lc2 = ( struct metaconn * )c2;
+       metaconn_t      *mc1 = ( metaconn_t * )c1;
+        metaconn_t     *mc2 = ( metaconn_t * )c2;
        
-       return SLAP_PTRCMP( lc1->mc_conn, lc2->mc_conn );
+       return SLAP_PTRCMP( mc1->mc_conn, mc2->mc_conn );
 }
 
 /*
@@ -65,13 +64,12 @@ meta_back_conn_cmp(
 int
 meta_back_conn_dup(
        void *c1,
-       void *c2
-       )
+       void *c2 )
 {
-       struct metaconn *lc1 = ( struct metaconn * )c1;
-       struct metaconn *lc2 = ( struct metaconn * )c2;
+       metaconn_t      *mc1 = ( metaconn_t * )c1;
+       metaconn_t      *mc2 = ( metaconn_t * )c2;
 
-       return( ( lc1->mc_conn == lc2->mc_conn ) ? -1 : 0 );
+       return( ( mc1->mc_conn == mc2->mc_conn ) ? -1 : 0 );
 }
 
 /*
@@ -93,7 +91,7 @@ ravl_print( Avlnode *root, int depth )
                printf( "    " );
        }
 
-       printf( "c(%d) %d\n", ( ( struct metaconn * )root->avl_data )->mc_conn->c_connid, root->avl_bf );
+       printf( "c(%d) %d\n", ( ( metaconn_t * )root->avl_data )->mc_conn->c_connid, root->avl_bf );
        
        ravl_print( root->avl_left, depth + 1 );
 }
@@ -121,89 +119,86 @@ myprint( Avlnode *root )
  * 
  * Allocates a connection structure, making room for all the referenced targets
  */
-static struct metaconn *
-metaconn_alloc( int ntargets )
+static metaconn_t *
+metaconn_alloc(
+       int             ntargets )
 {
-       struct metaconn *lc;
+       metaconn_t      *mc;
 
        assert( ntargets > 0 );
 
-       lc = ch_calloc( sizeof( struct metaconn ), 1 );
-       if ( lc == NULL ) {
+       /* malloc once only; leave an extra one for one-past-end */
+       mc = ( metaconn_t * )ch_malloc( sizeof( metaconn_t )
+                       + sizeof( metasingleconn_t ) * ( ntargets + 1 ) );
+       if ( mc == NULL ) {
                return NULL;
        }
-       
-       /*
-        * make it a null-terminated array ...
-        */
-       lc->mc_conns = ch_calloc( sizeof( struct metasingleconn ), ntargets+1 );
-       if ( lc->mc_conns == NULL ) {
-               free( lc );
-               return NULL;
-       }
-       lc->mc_conns[ ntargets ].msc_candidate = META_LAST_CONN;
+
+       mc->mc_conns = ( metasingleconn_t * )&mc[ 1 ];
+
+       /* FIXME: needed by META_LAST() */
+       mc->mc_conns[ ntargets ].msc_candidate = META_LAST_CONN;
 
        for ( ; ntargets-- > 0; ) {
-               lc->mc_conns[ ntargets ].msc_ld = NULL;
-               BER_BVZERO( &lc->mc_conns[ ntargets ].msc_bound_ndn );
-               BER_BVZERO( &lc->mc_conns[ ntargets ].msc_cred );
-               lc->mc_conns[ ntargets ].msc_bound = META_UNBOUND;
+               mc->mc_conns[ ntargets ].msc_ld = NULL;
+               BER_BVZERO( &mc->mc_conns[ ntargets ].msc_bound_ndn );
+               BER_BVZERO( &mc->mc_conns[ ntargets ].msc_cred );
+               mc->mc_conns[ ntargets ].msc_bound = META_UNBOUND;
        }
 
-       lc->mc_bound_target = META_BOUND_NONE;
+       mc->mc_auth_target = META_BOUND_NONE;
+       ldap_pvt_thread_mutex_init( &mc->mc_mutex );
 
-       return lc;
+       return mc;
 }
 
 /*
- * metaconn_free
+ * meta_back_conn_free
  *
  * clears a metaconn
  */
-static void
-metaconn_free(
-               struct metaconn *lc
-)
+void
+meta_back_conn_free(
+       metaconn_t      *mc )
 {
-       if ( !lc ) {
+       if ( mc == NULL ) {
                return;
        }
-       
-       if ( lc->mc_conns ) {
-               ch_free( lc->mc_conns );
-       }
 
-       free( lc );
+       ldap_pvt_thread_mutex_destroy( &mc->mc_mutex );
+       
+       free( mc );
 }
 
 /*
- * init_one_conn
+ * meta_back_init_one_conn
  * 
  * Initializes one connection
  */
-static int
-init_one_conn(
-               Operation               *op,
-               SlapReply               *rs,
-               struct metatarget       *lt, 
-               struct metasingleconn   *lsc,
-               ldap_back_send_t        sendok )
+int
+meta_back_init_one_conn(
+       Operation               *op,
+       SlapReply               *rs,
+       metatarget_t            *mt, 
+       metasingleconn_t        *msc,
+       ldap_back_send_t        sendok )
 {
-       struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
        int             vers;
        dncookie        dc;
 
        /*
         * Already init'ed
         */
-       if ( lsc->msc_ld != NULL ) {
-               return LDAP_SUCCESS;
+       if ( msc->msc_ld != NULL ) {
+               rs->sr_err = LDAP_SUCCESS;
+               goto error_return;
        }
        
        /*
         * Attempts to initialize the connection to the target ds
         */
-       rs->sr_err = ldap_initialize( &lsc->msc_ld, lt->mt_uri );
+       rs->sr_err = ldap_initialize( &msc->msc_ld, mt->mt_uri );
        if ( rs->sr_err != LDAP_SUCCESS ) {
                goto error_return;
        }
@@ -213,39 +208,41 @@ init_one_conn(
         * bound with a particular version, then so can we.
         */
        vers = op->o_conn->c_protocol;
-       ldap_set_option( lsc->msc_ld, LDAP_OPT_PROTOCOL_VERSION, &vers );
+       ldap_set_option( msc->msc_ld, LDAP_OPT_PROTOCOL_VERSION, &vers );
 
        /* automatically chase referrals ("chase-referrals"/"dont-chase-referrals" statement) */
-       if ( LDAP_BACK_CHASE_REFERRALS( li ) ) {
-               ldap_set_option( lsc->msc_ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON );
+       if ( LDAP_BACK_CHASE_REFERRALS( mi ) ) {
+               ldap_set_option( msc->msc_ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON );
        }
 
 #ifdef HAVE_TLS
        /* start TLS ("start-tls"/"try-start-tls" statements) */
-       if ( ( LDAP_BACK_USE_TLS( li ) || ( op->o_conn->c_is_tls && LDAP_BACK_PROPAGATE_TLS( li ) ) )
-                       && !ldap_is_ldaps_url( lt->mt_uri ) )
+       if ( ( LDAP_BACK_USE_TLS( mi ) || ( op->o_conn->c_is_tls && LDAP_BACK_PROPAGATE_TLS( mi ) ) )
+                       && !ldap_is_ldaps_url( mt->mt_uri ) )
        {
-#if 1
+#ifdef SLAP_STARTTLS_ASYNCHRONOUS
                /*
                 * use asynchronous StartTLS
                 * in case, chase referral (not implemented yet)
                 */
                int             msgid;
 
-               rs->sr_err = ldap_start_tls( lsc->msc_ld, NULL, NULL, &msgid );
+               rs->sr_err = ldap_start_tls( msc->msc_ld, NULL, NULL, &msgid );
                if ( rs->sr_err == LDAP_SUCCESS ) {
                        LDAPMessage     *res = NULL;
-                       int             rc, retries = 1;
+                       int             rc, nretries = mt->mt_nretries;
                        struct timeval  tv = { 0, 0 };
 
 retry:;
-                       rc = ldap_result( lsc->msc_ld, msgid, LDAP_MSG_ALL, &tv, &res );
+                       rc = ldap_result( msc->msc_ld, msgid, LDAP_MSG_ALL, &tv, &res );
                        if ( rc < 0 ) {
                                rs->sr_err = LDAP_OTHER;
 
                        } else if ( rc == 0 ) {
-                               if ( retries ) {
-                                       retries--;
+                               if ( nretries != 0 ) {
+                                       if ( nretries > 0 ) {
+                                               nretries--;
+                                       }
                                        tv.tv_sec = 0;
                                        tv.tv_usec = 100000;
                                        goto retry;
@@ -255,10 +252,10 @@ retry:;
                        } else if ( rc == LDAP_RES_EXTENDED ) {
                                struct berval   *data = NULL;
 
-                               rs->sr_err = ldap_parse_extended_result( lsc->msc_ld, res,
+                               rs->sr_err = ldap_parse_extended_result( msc->msc_ld, res,
                                                NULL, &data, 0 );
                                if ( rs->sr_err == LDAP_SUCCESS ) {
-                                       rs->sr_err = ldap_result2error( lsc->msc_ld, res, 1 );
+                                       rs->sr_err = ldap_result2error( msc->msc_ld, res, 1 );
                                        res = NULL;
                                        
                                        /* FIXME: in case a referral 
@@ -266,7 +263,7 @@ retry:;
                                         * using it instead of the 
                                         * configured URI? */
                                        if ( rs->sr_err == LDAP_SUCCESS ) {
-                                               ldap_install_tls( lsc->msc_ld );
+                                               ldap_install_tls( msc->msc_ld );
 
                                        } else if ( rs->sr_err == LDAP_REFERRAL ) {
                                                rs->sr_err = LDAP_OTHER;
@@ -289,21 +286,21 @@ retry:;
                                ldap_msgfree( res );
                        }
                }
-#else
+#else /* ! SLAP_STARTTLS_ASYNCHRONOUS */
                /*
                 * use synchronous StartTLS
                 */
-               rs->sr_err = ldap_start_tls_s( lsc->msc_ld, NULL, NULL );
-#endif
+               rs->sr_err = ldap_start_tls_s( msc->msc_ld, NULL, NULL );
+#endif /* ! SLAP_STARTTLS_ASYNCHRONOUS */
 
                /* if StartTLS is requested, only attempt it if the URL
                 * is not "ldaps://"; this may occur not only in case
                 * of misconfiguration, but also when used in the chain 
                 * overlay, where the "uri" can be parsed out of a referral */
                if ( rs->sr_err == LDAP_SERVER_DOWN
-                               || ( rs->sr_err != LDAP_SUCCESS && LDAP_BACK_TLS_CRITICAL( li ) ) )
+                               || ( rs->sr_err != LDAP_SUCCESS && LDAP_BACK_TLS_CRITICAL( mi ) ) )
                {
-                       ldap_unbind_ext_s( lsc->msc_ld, NULL, NULL );
+                       ldap_unbind_ext_s( msc->msc_ld, NULL, NULL );
                        goto error_return;
                }
        }
@@ -312,26 +309,26 @@ retry:;
        /*
         * Set the network timeout if set
         */
-       if (li->network_timeout != 0){
+       if ( mi->mi_network_timeout != 0 ) {
                struct timeval  network_timeout;
 
                network_timeout.tv_usec = 0;
-               network_timeout.tv_sec = li->network_timeout;
+               network_timeout.tv_sec = mi->mi_network_timeout;
 
-               ldap_set_option( lsc->msc_ld, LDAP_OPT_NETWORK_TIMEOUT,
+               ldap_set_option( msc->msc_ld, LDAP_OPT_NETWORK_TIMEOUT,
                                (void *)&network_timeout );
        }
 
        /*
         * Sets a cookie for the rewrite session
         */
-       ( void )rewrite_session_init( lt->mt_rwmap.rwm_rw, op->o_conn );
+       ( void )rewrite_session_init( mt->mt_rwmap.rwm_rw, op->o_conn );
 
        /*
         * If the connection DN is not null, an attempt to rewrite it is made
         */
        if ( !BER_BVISEMPTY( &op->o_conn->c_dn ) ) {
-               dc.rwmap = &lt->mt_rwmap;
+               dc.rwmap = &mt->mt_rwmap;
                dc.conn = op->o_conn;
                dc.rs = rs;
                dc.ctx = "bindDN";
@@ -340,23 +337,23 @@ retry:;
                 * Rewrite the bind dn if needed
                 */
                if ( ldap_back_dn_massage( &dc, &op->o_conn->c_dn,
-                                       &lsc->msc_bound_ndn ) )
+                                       &msc->msc_bound_ndn ) )
                {
                        goto error_return;
                }
 
                /* copy the DN idf needed */
-               if ( lsc->msc_bound_ndn.bv_val == op->o_conn->c_dn.bv_val ) {
-                       ber_dupbv( &lsc->msc_bound_ndn, &op->o_conn->c_dn );
+               if ( msc->msc_bound_ndn.bv_val == op->o_conn->c_dn.bv_val ) {
+                       ber_dupbv( &msc->msc_bound_ndn, &op->o_conn->c_dn );
                }
 
-               assert( !BER_BVISNULL( &lsc->msc_bound_ndn ) );
+               assert( !BER_BVISNULL( &msc->msc_bound_ndn ) );
 
        } else {
-               ber_str2bv( "", 0, 1, &lsc->msc_bound_ndn );
+               ber_str2bv( "", 0, 1, &msc->msc_bound_ndn );
        }
 
-       lsc->msc_bound = META_UNBOUND;
+       msc->msc_bound = META_UNBOUND;
 
 error_return:;
        if ( rs->sr_err != LDAP_SUCCESS ) {
@@ -365,16 +362,189 @@ error_return:;
                        send_ldap_result( op, rs );
                        rs->sr_text = NULL;
                }
+       }
+
+       return rs->sr_err;
+}
+
+/*
+ * meta_back_retry
+ * 
+ * Retries one connection
+ */
+int
+meta_back_retry(
+       Operation               *op,
+       SlapReply               *rs,
+       metaconn_t              *mc,
+       int                     candidate,
+       ldap_back_send_t        sendok )
+{
+       metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
+       metatarget_t            *mt = mi->mi_targets[ candidate ];
+       int                     rc;
+       metasingleconn_t        *msc = &mc->mc_conns[ candidate ];
+
+       ldap_pvt_thread_mutex_lock( &mc->mc_mutex );
+
+       ldap_unbind_ext_s( msc->msc_ld, NULL, NULL );
+        msc->msc_ld = NULL;
+        msc->msc_bound = 0;
+
+        /* mc here must be the regular mc, reset and ready for init */
+        rc = meta_back_init_one_conn( op, rs, mt, msc, sendok );
+
+       if ( rc == LDAP_SUCCESS ) {
+               rc = meta_back_single_dobind( op, rs, mc, candidate,
+                               sendok, mt->mt_nretries );
+        }
+
+       ldap_pvt_thread_mutex_unlock( &mc->mc_mutex );
+
+       return rc == LDAP_SUCCESS ? 1 : 0;
+}
+
+/*
+ * callback for unique candidate selection
+ */
+static int
+meta_back_conn_cb( Operation *op, SlapReply *rs )
+{
+       assert( op->o_tag == LDAP_REQ_SEARCH );
+
+       switch ( rs->sr_type ) {
+       case REP_SEARCH:
+               ((int *)op->o_callback->sc_private)[0] = (int)op->o_private;
+               break;
+
+       case REP_SEARCHREF:
+       case REP_RESULT:
+               break;
+
+       default:
+               return rs->sr_err;
+       }
+
+       return 0;
+}
+
+
+static int
+meta_back_get_candidate(
+       Operation       *op,
+       SlapReply       *rs,
+       struct berval   *ndn )
+{
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       int             candidate;
+
+       /*
+        * tries to get a unique candidate
+        * (takes care of default target)
+        */
+       candidate = meta_back_select_unique_candidate( mi, ndn );
+
+       /*
+        * if any is found, inits the connection
+        */
+       if ( candidate == META_TARGET_NONE ) {
+               rs->sr_err = LDAP_NO_SUCH_OBJECT;
+               rs->sr_text = "no suitable candidate target found";
+
+       } else if ( candidate == META_TARGET_MULTIPLE ) {
+               Filter          f = { 0 };
+               Operation       op2 = *op;
+               SlapReply       rs2 = { 0 };
+               slap_callback   cb2 = { 0 };
+               int             rc;
+
+               /* try to get a unique match for the request ndn
+                * among the multiple candidates available */
+               op2.o_tag = LDAP_REQ_SEARCH;
+               op2.o_req_dn = *ndn;
+               op2.o_req_ndn = *ndn;
+               op2.ors_scope = LDAP_SCOPE_BASE;
+               op2.ors_deref = LDAP_DEREF_NEVER;
+               op2.ors_attrs = slap_anlist_no_attrs;
+               op2.ors_attrsonly = 0;
+               op2.ors_limit = NULL;
+               op2.ors_slimit = 1;
+               op2.ors_tlimit = SLAP_NO_LIMIT;
+
+               f.f_choice = LDAP_FILTER_PRESENT;
+               f.f_desc = slap_schema.si_ad_objectClass;
+               op2.ors_filter = &f;
+               BER_BVSTR( &op2.ors_filterstr, "(objectClass=*)" );
+
+               op2.o_callback = &cb2;
+               cb2.sc_response = meta_back_conn_cb;
+               cb2.sc_private = (void *)&candidate;
+
+               rc = op->o_bd->be_search( &op2, &rs2 );
+
+               switch ( rs2.sr_err ) {
+               case LDAP_SUCCESS:
+               default:
+                       rs->sr_err = rs2.sr_err;
+                       break;
+
+               case LDAP_SIZELIMIT_EXCEEDED:
+                       /* if multiple candidates can serve the operation,
+                        * and a default target is defined, and it is
+                        * a candidate, try using it (FIXME: YMMV) */
+                       if ( mi->mi_defaulttarget != META_DEFAULT_TARGET_NONE
+                               && meta_back_is_candidate( &mi->mi_targets[ mi->mi_defaulttarget ]->mt_nsuffix,
+                                               ndn, op->o_tag == LDAP_REQ_SEARCH ? op->ors_scope : LDAP_SCOPE_BASE ) )
+                       {
+                               candidate = mi->mi_defaulttarget;
+                               rs->sr_err = LDAP_SUCCESS;
+                               rs->sr_text = NULL;
+
+                       } else {
+                               rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+                               rs->sr_text = "cannot select unique candidate target";
+                       }
+                       break;
+               }
+       }
+
+       return candidate;
+}
+
+static void
+meta_back_candidate_keyfree(
+       void            *key,
+       void            *data )
+{
+       ber_memfree_x( data, NULL );
+}
+
+SlapReply *
+meta_back_candidates_get( Operation *op )
+{
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       void            *data = NULL;
 
+       if ( op->o_threadctx ) {
+               ldap_pvt_thread_pool_getkey( op->o_threadctx,
+                               meta_back_candidate_keyfree, &data, NULL );
        } else {
+               data = (void *)mi->mi_candidates;
+       }
 
-               /*
-                * The candidate is activated
-                */
-               lsc->msc_candidate = META_CANDIDATE;
+       if ( data == NULL ) {
+               data = ber_memalloc( sizeof( SlapReply ) * mi->mi_ntargets );
+               if ( op->o_threadctx ) {
+                       ldap_pvt_thread_pool_setkey( op->o_threadctx,
+                                       meta_back_candidate_keyfree, data,
+                                       meta_back_candidate_keyfree );
+
+               } else {
+                       mi->mi_candidates = (SlapReply *)data;
+               }
        }
 
-       return rs->sr_err;
+       return (SlapReply *)data;
 }
 
 /*
@@ -382,63 +552,134 @@ error_return:;
  * 
  * Prepares the connection structure
  * 
- * FIXME: This function needs to receive some info on the type of operation
- * it is invoked by, so that only the correct pool of candidate targets
- * is initialized in case no connection was available yet.
- * 
- * At present a flag that says whether the candidate target must be unique
- * is passed; eventually an operation agent will be used.
+ * RATIONALE:
+ *
+ * - determine what DN is being requested:
+ *
+ *     op      requires candidate      checks
+ *
+ *     add     unique                  parent of o_req_ndn
+ *     bind    unique^*[/all]          o_req_ndn [no check]
+ *     compare unique^+                o_req_ndn
+ *     delete  unique                  o_req_ndn
+ *     modify  unique                  o_req_ndn
+ *     search  any                     o_req_ndn
+ *     modrdn  unique[, unique]        o_req_ndn[, orr_nnewSup]
+ *
+ * - for ops that require the candidate to be unique, in case of multiple
+ *   occurrences an internal search with sizeLimit=1 is performed
+ *   if a unique candidate can actually be determined.  If none is found,
+ *   the operation aborts; if multiple are found, the default target
+ *   is used if defined and candidate; otherwise the operation aborts.
+ *
+ * *^note: actually, the bind operation is handled much like a search;
+ *   i.e. the bind is broadcast to all candidate targets.
+ *
+ * +^note: actually, the compare operation is handled much like a search;
+ *   i.e. the compare is broadcast to all candidate targets, while checking
+ *   that exactly none (noSuchObject) or one (TRUE/FALSE/UNDEFINED) is
+ *   returned.
  */
-struct metaconn *
+metaconn_t *
 meta_back_getconn(
-               Operation               *op,
-               SlapReply               *rs,
-               int                     op_type,
-               struct berval           *ndn,
-               int                     *candidate,
-               ldap_back_send_t        sendok )
+               Operation               *op,
+       SlapReply               *rs,
+       int                     *candidate,
+       ldap_back_send_t        sendok )
 {
-       struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
-       struct metaconn *lc, lc_curr;
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       metaconn_t      *mc, mc_curr;
        int             cached = META_TARGET_NONE,
                        i = META_TARGET_NONE,
                        err = LDAP_SUCCESS,
                        new_conn = 0;
 
+       meta_op_type    op_type = META_OP_REQUIRE_SINGLE;
+       int             parent = 0,
+                       newparent = 0;
+       struct berval   ndn = op->o_req_ndn,
+                       pndn;
+
+       SlapReply       *candidates = meta_back_candidates_get( op );
+
        /* Searches for a metaconn in the avl tree */
-       lc_curr.mc_conn = op->o_conn;
-       ldap_pvt_thread_mutex_lock( &li->conn_mutex );
-       lc = (struct metaconn *)avl_find( li->conntree, 
-               (caddr_t)&lc_curr, meta_back_conn_cmp );
-       ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
-
-       /* Looks like we didn't get a bind. Open a new session... */
-       if ( !lc ) {
-               lc = metaconn_alloc( li->ntargets );
-               lc->mc_conn = op->o_conn;
-               new_conn = 1;
+       mc_curr.mc_conn = op->o_conn;
+       ldap_pvt_thread_mutex_lock( &mi->mi_conn_mutex );
+       mc = (metaconn_t *)avl_find( mi->mi_conntree, 
+               (caddr_t)&mc_curr, meta_back_conn_cmp );
+       ldap_pvt_thread_mutex_unlock( &mi->mi_conn_mutex );
+
+       switch ( op->o_tag ) {
+       case LDAP_REQ_ADD:
+               /* if we go to selection, the entry must not exist,
+                * and we must be able to resolve the parent */
+               parent = 1;
+               dnParent( &ndn, &pndn );
+               break;
+
+       case LDAP_REQ_MODRDN:
+               /* if nnewSuperior is not NULL, it must resolve
+                * to the same candidate as the req_ndn */
+               if ( op->orr_nnewSup ) {
+                       newparent = 1;
+               }
+               break;
+
+       case LDAP_REQ_BIND:
+               /* if bound as rootdn, the backend must bind to all targets
+                * with the administrative identity */
+               if ( op->orb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) {
+                       op_type = META_OP_REQUIRE_ALL;
+               }
+               break;
+
+       case LDAP_REQ_DELETE:
+       case LDAP_REQ_MODIFY:
+               /* just a unique candidate */
+               break;
+
+       case LDAP_REQ_COMPARE:
+       case LDAP_REQ_SEARCH:
+               /* allow multiple candidates for the searchBase */
+               op_type = META_OP_ALLOW_MULTIPLE;
+               break;
+
+       default:
+               /* right now, just break (exop?) */
+               break;
        }
 
        /*
         * require all connections ...
         */
        if ( op_type == META_OP_REQUIRE_ALL ) {
-               for ( i = 0; i < li->ntargets; i++ ) {
+
+               /* Looks like we didn't get a bind. Open a new session... */
+               if ( !mc ) {
+                       mc = metaconn_alloc( mi->mi_ntargets );
+                       mc->mc_conn = op->o_conn;
+                       new_conn = 1;
+               }
+
+               for ( i = 0; i < mi->mi_ntargets; i++ ) {
 
                        /*
                         * The target is activated; if needed, it is
                         * also init'd
                         */
-                       int lerr = init_one_conn( op, rs, li->targets[ i ],
-                                       &lc->mc_conns[ i ], sendok );
-                       if ( lerr != LDAP_SUCCESS ) {
+                       int lerr = meta_back_init_one_conn( op, rs, mi->mi_targets[ i ],
+                                       &mc->mc_conns[ i ], sendok );
+                       if ( lerr == LDAP_SUCCESS ) {
+                               candidates[ i ].sr_tag = META_CANDIDATE;
+                               
+                       } else {
                                
                                /*
                                 * FIXME: in case one target cannot
                                 * be init'd, should the other ones
                                 * be tried?
                                 */
-                               ( void )meta_clear_one_candidate( &lc->mc_conns[ i ], 1 );
+                               candidates[ i ].sr_tag = META_NOT_CANDIDATE;
                                err = lerr;
                                continue;
                        }
@@ -449,58 +690,92 @@ meta_back_getconn(
        /*
         * looks in cache, if any
         */
-       if ( li->cache.ttl != META_DNCACHE_DISABLED ) {
-               cached = i = meta_dncache_get_target( &li->cache, ndn );
+       if ( mi->mi_cache.ttl != META_DNCACHE_DISABLED ) {
+               cached = i = meta_dncache_get_target( &mi->mi_cache, &op->o_req_ndn );
        }
 
        if ( op_type == META_OP_REQUIRE_SINGLE ) {
+               int     j;
 
-               /*
-                * tries to get a unique candidate
-                * (takes care of default target 
-                */
-               if ( i == META_TARGET_NONE ) {
-                       i = meta_back_select_unique_candidate( li, ndn );
+               for ( j = 0; j < mi->mi_ntargets; j++ ) {
+                       candidates[ j ].sr_tag = META_NOT_CANDIDATE;
                }
 
                /*
-                * if any is found, inits the connection
+                * tries to get a unique candidate
+                * (takes care of default target)
                 */
                if ( i == META_TARGET_NONE ) {
-                       if ( new_conn ) {
-                               metaconn_free( lc );
+                       i = meta_back_get_candidate( op, rs, &ndn );
+
+                       if ( rs->sr_err == LDAP_NO_SUCH_OBJECT && parent ) {
+                               i = meta_back_get_candidate( op, rs, &pndn );
+                       }
+       
+                       if ( rs->sr_err != LDAP_SUCCESS ) {
+                               if ( sendok & LDAP_BACK_SENDERR ) {
+                                       send_ldap_result( op, rs );
+                                       rs->sr_text = NULL;
+                               }
+                               return NULL;
                        }
+               }
 
-                       rs->sr_err = LDAP_NO_SUCH_OBJECT;
+               if ( newparent && meta_back_get_candidate( op, rs, op->orr_nnewSup ) != i )
+               {
+                       rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+                       rs->sr_text = "cross-target rename not supported";
+                       if ( sendok & LDAP_BACK_SENDERR ) {
+                               send_ldap_result( op, rs );
+                               rs->sr_text = NULL;
+                       }
                        return NULL;
                }
-                               
+
                Debug( LDAP_DEBUG_CACHE,
        "==>meta_back_getconn: got target %d for ndn=\"%s\" from cache\n",
-                               i, ndn->bv_val, 0 );
+                               i, op->o_req_ndn.bv_val, 0 );
+
+               /* Retries searching for a metaconn in the avl tree */
+               mc_curr.mc_conn = op->o_conn;
+               ldap_pvt_thread_mutex_lock( &mi->mi_conn_mutex );
+               mc = (metaconn_t *)avl_find( mi->mi_conntree, 
+                       (caddr_t)&mc_curr, meta_back_conn_cmp );
+               ldap_pvt_thread_mutex_unlock( &mi->mi_conn_mutex );
+
+               /* Looks like we didn't get a bind. Open a new session... */
+               if ( !mc ) {
+                       mc = metaconn_alloc( mi->mi_ntargets );
+                       mc->mc_conn = op->o_conn;
+                       new_conn = 1;
+               }
 
                /*
                 * Clear all other candidates
                 */
-               ( void )meta_clear_unused_candidates( li, lc, i, 0 );
+               ( void )meta_clear_unused_candidates( op, i );
 
                /*
                 * The target is activated; if needed, it is
-                * also init'd. In case of error, init_one_conn
+                * also init'd. In case of error, meta_back_init_one_conn
                 * sends the appropriate result.
                 */
-               err = init_one_conn( op, rs, li->targets[ i ],
-                               &lc->mc_conns[ i ], sendok );
-               if ( err != LDAP_SUCCESS ) {
+               err = meta_back_init_one_conn( op, rs, mi->mi_targets[ i ],
+                               &mc->mc_conns[ i ], sendok );
+               if ( err == LDAP_SUCCESS ) {
+                       candidates[ i ].sr_tag = META_CANDIDATE;
+
+               } else {
                
                        /*
                         * FIXME: in case one target cannot
                         * be init'd, should the other ones
                         * be tried?
                         */
-                       ( void )meta_clear_one_candidate( &lc->mc_conns[ i ], 1 );
-                       if ( new_conn ) {
-                               metaconn_free( lc );
+                       candidates[ i ].sr_tag = META_NOT_CANDIDATE;
+                       if ( new_conn ) {
+                               ( void )meta_clear_one_candidate( &mc->mc_conns[ i ] );
+                               meta_back_conn_free( mc );
                        }
                        return NULL;
                }
@@ -513,35 +788,79 @@ meta_back_getconn(
         * if no unique candidate ...
         */
        } else {
-               for ( i = 0; i < li->ntargets; i++ ) {
+
+               int     ncandidates = 0;
+
+               /* Looks like we didn't get a bind. Open a new session... */
+               if ( !mc ) {
+                       mc = metaconn_alloc( mi->mi_ntargets );
+                       mc->mc_conn = op->o_conn;
+                       new_conn = 1;
+               }
+
+               for ( i = 0; i < mi->mi_ntargets; i++ ) {
                        if ( i == cached 
-                               || meta_back_is_candidate( &li->targets[ i ]->mt_nsuffix, ndn ) )
+                               || meta_back_is_candidate( &mi->mi_targets[ i ]->mt_nsuffix,
+                                               &op->o_req_ndn, LDAP_SCOPE_SUBTREE ) )
                        {
 
                                /*
                                 * The target is activated; if needed, it is
                                 * also init'd
                                 */
-                               int lerr = init_one_conn( op, rs,
-                                               li->targets[ i ],
-                                               &lc->mc_conns[ i ], sendok );
-                               if ( lerr != LDAP_SUCCESS ) {
+                               int lerr = meta_back_init_one_conn( op, rs,
+                                               mi->mi_targets[ i ],
+                                               &mc->mc_conns[ i ], sendok );
+                               if ( lerr == LDAP_SUCCESS ) {
+                                       candidates[ i ].sr_tag = META_CANDIDATE;
+                                       ncandidates++;
+
+                               } else {
                                
                                        /*
                                         * FIXME: in case one target cannot
                                         * be init'd, should the other ones
                                         * be tried?
                                         */
-                                       ( void )meta_clear_one_candidate( &lc->mc_conns[ i ], 1 );
+                                       if ( new_conn ) {
+                                               ( void )meta_clear_one_candidate( &mc->mc_conns[ i ] );
+                                       }
+                                       candidates[ i ].sr_tag = META_NOT_CANDIDATE;
                                        err = lerr;
+
+                                       Debug( LDAP_DEBUG_ANY, "%s: meta_back_init_one_conn(%d) failed: %d\n",
+                                               op->o_log_prefix, i, lerr );
+
                                        continue;
                                }
+
+                       } else {
+                               if ( new_conn ) {
+                                       ( void )meta_clear_one_candidate( &mc->mc_conns[ i ] );
+                               }
+                               candidates[ i ].sr_tag = META_NOT_CANDIDATE;
+                       }
+               }
+
+               if ( ncandidates == 0 ) {
+                       if ( new_conn ) {
+                               meta_back_conn_free( mc );
+                       }
+
+                       rs->sr_err = LDAP_NO_SUCH_OBJECT;
+                       rs->sr_text = "Unable to select valid candidates";
+
+                       if ( sendok & LDAP_BACK_SENDERR ) {
+                               send_ldap_result( op, rs );
+                               rs->sr_text = NULL;
                        }
+
+                       return NULL;
                }
        }
 
 done:;
-       /* clear out init_one_conn non-fatal errors */
+       /* clear out meta_back_init_one_conn non-fatal errors */
        rs->sr_err = LDAP_SUCCESS;
        rs->sr_text = NULL;
 
@@ -550,36 +869,45 @@ done:;
                /*
                 * Inserts the newly created metaconn in the avl tree
                 */
-               ldap_pvt_thread_mutex_lock( &li->conn_mutex );
-               err = avl_insert( &li->conntree, ( caddr_t )lc,
+               ldap_pvt_thread_mutex_lock( &mi->mi_conn_mutex );
+               err = avl_insert( &mi->mi_conntree, ( caddr_t )mc,
                                meta_back_conn_cmp, meta_back_conn_dup );
 
 #if PRINT_CONNTREE > 0
-               myprint( li->conntree );
+               myprint( mi->mi_conntree );
 #endif /* PRINT_CONNTREE */
                
-               ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
+               ldap_pvt_thread_mutex_unlock( &mi->mi_conn_mutex );
 
-               Debug( LDAP_DEBUG_TRACE,
-                       "=>meta_back_getconn: conn %ld inserted\n",
-                       lc->mc_conn->c_connid, 0, 0 );
-               
                /*
                 * Err could be -1 in case a duplicate metaconn is inserted
                 */
-               if ( err != 0 ) {
+               if ( err == 0 ) {
+                       Debug( LDAP_DEBUG_TRACE,
+                               "%s meta_back_getconn: conn %ld inserted\n",
+                               op->o_log_prefix, mc->mc_conn->c_connid, 0 );
+
+               } else {
+                       Debug( LDAP_DEBUG_TRACE,
+                               "%s meta_back_getconn: conn %ld insert failed\n",
+                               op->o_log_prefix, mc->mc_conn->c_connid, 0 );
+               
                        rs->sr_err = LDAP_OTHER;
                        rs->sr_text = "Internal server error";
-                       metaconn_free( lc );
+                       meta_back_conn_free( mc );
+                       if ( sendok & LDAP_BACK_SENDERR ) {
+                               send_ldap_result( op, rs );
+                               rs->sr_text = NULL;
+                       }
                        return NULL;
                }
 
        } else {
                Debug( LDAP_DEBUG_TRACE,
-                       "=>meta_back_getconn: conn %ld fetched\n",
-                       lc->mc_conn->c_connid, 0, 0 );
+                       "%s meta_back_getconn: conn %ld fetched\n",
+                       op->o_log_prefix, mc->mc_conn->c_connid, 0 );
        }
        
-       return lc;
+       return mc;
 }
 
index 646cbe8de646ad16823aeec17392017e11ab3be6..e2e60623de19ec24615fe22d3358d97689af1b0f 100644 (file)
 int
 meta_back_delete( Operation *op, SlapReply *rs )
 {
-       struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
-       struct metaconn *lc;
-       int candidate = -1;
-       struct berval mdn = BER_BVNULL;
-       dncookie dc;
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       metaconn_t      *mc;
+       int             candidate = -1;
+       struct berval   mdn = BER_BVNULL;
+       dncookie        dc;
+       int             msgid, do_retry = 1;
 
-       lc = meta_back_getconn( op, rs, META_OP_REQUIRE_SINGLE,
-                       &op->o_req_ndn, &candidate, LDAP_BACK_SENDERR );
-       if ( !lc || !meta_back_dobind( lc, op, LDAP_BACK_SENDERR ) ) {
+       mc = meta_back_getconn( op, rs, &candidate, LDAP_BACK_SENDERR );
+       if ( !mc || !meta_back_dobind( op, rs, mc, LDAP_BACK_SENDERR ) ) {
                return rs->sr_err;
        }
 
-       if ( !meta_back_is_valid( lc, candidate ) ) {
-               rs->sr_err = LDAP_OTHER;
-               send_ldap_result( op, rs );
-               return rs->sr_err;
-       }
+       assert( mc->mc_conns[ candidate ].msc_ld != NULL );
 
        /*
         * Rewrite the compare dn, if needed
         */
-       dc.rwmap = &li->targets[ candidate ]->mt_rwmap;
+       dc.rwmap = &mi->mi_targets[ candidate ]->mt_rwmap;
        dc.conn = op->o_conn;
        dc.rs = rs;
        dc.ctx = "deleteDN";
@@ -65,14 +61,21 @@ meta_back_delete( Operation *op, SlapReply *rs )
                return -1;
        }
 
-       (void)ldap_delete_ext_s( lc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
-                       op->o_ctrls, NULL );
+retry:;
+       rs->sr_err = ldap_delete_ext_s( mc->mc_conns[ candidate ].msc_ld,
+                       mdn.bv_val, op->o_ctrls, NULL );
+       if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
+               do_retry = 0;
+               if ( meta_back_retry( op, rs, mc, candidate, LDAP_BACK_SENDERR ) ) {
+                       goto retry;
+               }
+       }
 
        if ( mdn.bv_val != op->o_req_dn.bv_val ) {
                free( mdn.bv_val );
                BER_BVZERO( &mdn );
        }
        
-       return meta_back_op_result( lc, op, rs );
+       return meta_back_op_result( mc, op, rs, candidate );
 }
 
index c1020c73409aeff4c88886e7a3120476ac345474..cfe5a80c5f7bfb1ce3a3a70f3ccbd126a16f2e4e 100644 (file)
@@ -23,6 +23,7 @@
 #include "portable.h"
 
 #include <stdio.h>
+#include <ac/string.h>
 
 #include "slap.h"
 #include "../back-ldap/back-ldap.h"
  * The dncache, at present, maps an entry to the target that holds it.
  */
 
-struct metadncacheentry {
+typedef struct metadncacheentry_t {
        struct berval   dn;
        int             target;
 
        time_t          lastupdated;
-};
+} metadncacheentry_t;
 
 /*
  * meta_dncache_cmp
@@ -48,12 +49,11 @@ struct metadncacheentry {
  */
 int
 meta_dncache_cmp(
-               const void *c1,
-               const void *c2
-)
+       const void      *c1,
+       const void      *c2 )
 {
-       struct metadncacheentry *cc1 = ( struct metadncacheentry * )c1;
-       struct metadncacheentry *cc2 = ( struct metadncacheentry * )c2;
+       metadncacheentry_t      *cc1 = ( metadncacheentry_t * )c1;
+       metadncacheentry_t      *cc2 = ( metadncacheentry_t * )c2;
 
        /*
         * case sensitive, because the dn MUST be normalized
@@ -69,12 +69,11 @@ meta_dncache_cmp(
  */
 int
 meta_dncache_dup(
-               void *c1,
-               void *c2
-)
+       void            *c1,
+       void            *c2 )
 {
-       struct metadncacheentry *cc1 = ( struct metadncacheentry * )c1;
-       struct metadncacheentry *cc2 = ( struct metadncacheentry * )c2;
+       metadncacheentry_t      *cc1 = ( metadncacheentry_t * )c1;
+       metadncacheentry_t      *cc2 = ( metadncacheentry_t * )c2;
        
        /*
         * case sensitive, because the dn MUST be normalized
@@ -90,20 +89,20 @@ meta_dncache_dup(
  */
 int
 meta_dncache_get_target(
-               struct metadncache      *cache,
-               struct berval           *ndn
-)
+       metadncache_t   *cache,
+       struct berval   *ndn )
 {
-       struct metadncacheentry tmp_entry, *entry;
-       time_t curr_time;
-       int target = META_TARGET_NONE;
+       metadncacheentry_t      tmp_entry,
+                               *entry;
+       time_t                  curr_time;
+       int                     target = META_TARGET_NONE;
 
        assert( cache );
        assert( ndn );
 
        tmp_entry.dn = *ndn;
        ldap_pvt_thread_mutex_lock( &cache->mutex );
-       entry = ( struct metadncacheentry * )avl_find( cache->tree,
+       entry = ( metadncacheentry_t * )avl_find( cache->tree,
                        ( caddr_t )&tmp_entry, meta_dncache_cmp );
 
        if ( entry != NULL ) {
@@ -141,14 +140,14 @@ meta_dncache_get_target(
  */
 int
 meta_dncache_update_entry(
-               struct metadncache      *cache,
-               struct berval           *ndn,
-               int                     target
-)
+       metadncache_t   *cache,
+       struct berval   *ndn,
+       int             target )
 {
-       struct metadncacheentry *entry, tmp_entry;
-       time_t curr_time = 0L;
-       int err = 0;
+       metadncacheentry_t      *entry,
+                               tmp_entry;
+       time_t                  curr_time = 0L;
+       int                     err = 0;
 
        assert( cache );
        assert( ndn );
@@ -169,24 +168,22 @@ meta_dncache_update_entry(
        tmp_entry.dn = *ndn;
 
        ldap_pvt_thread_mutex_lock( &cache->mutex );
-       entry = ( struct metadncacheentry * )avl_find( cache->tree,
+       entry = ( metadncacheentry_t * )avl_find( cache->tree,
                        ( caddr_t )&tmp_entry, meta_dncache_cmp );
 
        if ( entry != NULL ) {
                entry->target = target;
                entry->lastupdated = curr_time;
+
        } else {
-               entry = ch_calloc( sizeof( struct metadncacheentry ), 1 );
+               entry = ch_malloc( sizeof( metadncacheentry_t ) + ndn->bv_len + 1 );
                if ( entry == NULL ) {
                        ldap_pvt_thread_mutex_unlock( &cache->mutex );
                        return -1;
                }
 
-               ber_dupbv( &entry->dn, ndn );
-               if ( entry->dn.bv_val == NULL ) {
-                       ldap_pvt_thread_mutex_unlock( &cache->mutex );
-                       return -1;
-               }
+               entry->dn.bv_val = (char *)&entry[ 1 ];
+               AC_MEMCPY( entry->dn.bv_val, ndn->bv_val, ndn->bv_len + 1 );
                entry->target = target;
                entry->lastupdated = curr_time;
 
@@ -206,11 +203,11 @@ meta_dncache_update_entry(
  */
 int
 meta_dncache_delete_entry(
-               struct metadncache      *cache,
-               struct berval           *ndn
-)
+       metadncache_t   *cache,
+       struct berval   *ndn )
 {
-       struct metadncacheentry *entry, tmp_entry;
+       metadncacheentry_t      *entry,
+                               tmp_entry;
 
        assert( cache );
        assert( ndn );
@@ -237,11 +234,8 @@ meta_dncache_delete_entry(
  */
 void
 meta_dncache_free(
-               void *e
-)
+       void            *e )
 {
-       struct metadncacheentry *entry = ( struct metadncacheentry * )e;
-
-       free( entry->dn.bv_val );
+       free( e );
 }
 
index e7883ce14738fb4077c9eda321983e02961997d3..b7cacb6243a847f726c29d18ad98dbc3396f6922 100644 (file)
@@ -28,8 +28,7 @@
 
 int
 meta_back_open(
-       BackendInfo *bi
-)
+       BackendInfo     *bi )
 {
        bi->bi_controls = slap_known_controls;
        return 0;
@@ -37,8 +36,7 @@ meta_back_open(
 
 int
 meta_back_initialize(
-               BackendInfo     *bi
-)
+       BackendInfo     *bi )
 {
        bi->bi_open = meta_back_open;
        bi->bi_config = 0;
@@ -73,65 +71,62 @@ meta_back_initialize(
 
 int
 meta_back_db_init(
-               Backend *be
-)
+       Backend         *be )
 {
-       struct metainfo *li;
+       metainfo_t      *mi;
 
-       struct rewrite_info     *rwinfo;
-
-       rwinfo = rewrite_info_init( REWRITE_MODE_USE_DEFAULT );
-       if ( rwinfo == NULL ) {
-               return -1;
-       }
-
-       li = ch_calloc( 1, sizeof( struct metainfo ) );
-       if ( li == NULL ) {
-               rewrite_info_delete( &rwinfo );
+       mi = ch_malloc( sizeof( metainfo_t ) );
+       if ( mi == NULL ) {
                return -1;
        }
+       memset( mi, 0, sizeof( metainfo_t ) );
 
        /*
         * At present the default is no default target;
         * this may change
         */
-       li->defaulttarget = META_DEFAULT_TARGET_NONE;
-       li->rwinfo = rwinfo;
+       mi->mi_defaulttarget = META_DEFAULT_TARGET_NONE;
+
+       ldap_pvt_thread_mutex_init( &mi->mi_conn_mutex );
+       ldap_pvt_thread_mutex_init( &mi->mi_cache.mutex );
 
-       ldap_pvt_thread_mutex_init( &li->conn_mutex );
-       ldap_pvt_thread_mutex_init( &li->cache.mutex );
-       be->be_private = li;
+       /* safe default */
+       mi->mi_nretries = META_RETRY_DEFAULT;
+       
+       be->be_private = mi;
 
        return 0;
 }
 
 static void
 conn_free( 
-       void *v_lc
-)
+       void            *v_mc )
 {
-       struct metaconn         *lc = v_lc;
-       struct metasingleconn   *lsc;
+       metaconn_t              *mc = v_mc;
+       metasingleconn_t        *msc;
 
-       for ( lsc = lc->mc_conns; !META_LAST( lsc ); lsc++ ) {
-               if ( lsc->msc_ld != NULL ) {
-                       ldap_unbind_ext_s( lsc->msc_ld, NULL, NULL );
+       assert( mc->mc_conns != NULL );
+
+       for ( msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ); msc++ ) {
+               if ( msc->msc_ld != NULL ) {
+                       ldap_unbind_ext_s( msc->msc_ld, NULL, NULL );
                }
-               if ( !BER_BVISNULL( &lsc->msc_bound_ndn ) ) {
-                       ber_memfree( lsc->msc_bound_ndn.bv_val );
+               if ( !BER_BVISNULL( &msc->msc_bound_ndn ) ) {
+                       ber_memfree( msc->msc_bound_ndn.bv_val );
                }
-               if ( !BER_BVISNULL( &lsc->msc_cred ) ) {
+               if ( !BER_BVISNULL( &msc->msc_cred ) ) {
                        /* destroy sensitive data */
-                       memset( lsc->msc_cred.bv_val, 0, lsc->msc_cred.bv_len );
-                       ber_memfree( lsc->msc_cred.bv_val );
+                       memset( msc->msc_cred.bv_val, 0, msc->msc_cred.bv_len );
+                       ber_memfree( msc->msc_cred.bv_val );
                }
        }
-       free( lc->mc_conns );
-       free( lc );
+
+       free( mc );
 }
 
 static void
-mapping_free( void *v_mapping )
+mapping_free(
+       void            *v_mapping )
 {
        struct ldapmapping *mapping = v_mapping;
        ch_free( mapping->src.bv_val );
@@ -141,81 +136,83 @@ mapping_free( void *v_mapping )
 
 static void
 target_free(
-               struct metatarget *lt
-)
+       metatarget_t    *mt )
 {
-       if ( lt->mt_uri ) {
-               free( lt->mt_uri );
+       if ( mt->mt_uri ) {
+               free( mt->mt_uri );
        }
-       if ( !BER_BVISNULL( &lt->mt_psuffix ) ) {
-               free( lt->mt_psuffix.bv_val );
+       if ( !BER_BVISNULL( &mt->mt_psuffix ) ) {
+               free( mt->mt_psuffix.bv_val );
        }
-       if ( !BER_BVISNULL( &lt->mt_nsuffix ) ) {
-               free( lt->mt_nsuffix.bv_val );
+       if ( !BER_BVISNULL( &mt->mt_nsuffix ) ) {
+               free( mt->mt_nsuffix.bv_val );
        }
-       if ( !BER_BVISNULL( &lt->mt_binddn ) ) {
-               free( lt->mt_binddn.bv_val );
+       if ( !BER_BVISNULL( &mt->mt_binddn ) ) {
+               free( mt->mt_binddn.bv_val );
        }
-       if ( !BER_BVISNULL( &lt->mt_bindpw ) ) {
-               free( lt->mt_bindpw.bv_val );
+       if ( !BER_BVISNULL( &mt->mt_bindpw ) ) {
+               free( mt->mt_bindpw.bv_val );
        }
-       if ( !BER_BVISNULL( &lt->mt_pseudorootdn ) ) {
-               free( lt->mt_pseudorootdn.bv_val );
+       if ( !BER_BVISNULL( &mt->mt_pseudorootdn ) ) {
+               free( mt->mt_pseudorootdn.bv_val );
        }
-       if ( !BER_BVISNULL( &lt->mt_pseudorootpw ) ) {
-               free( lt->mt_pseudorootpw.bv_val );
+       if ( !BER_BVISNULL( &mt->mt_pseudorootpw ) ) {
+               free( mt->mt_pseudorootpw.bv_val );
        }
-       if ( lt->mt_rwmap.rwm_rw ) {
-               rewrite_info_delete( &lt->mt_rwmap.rwm_rw );
+       if ( mt->mt_rwmap.rwm_rw ) {
+               rewrite_info_delete( &mt->mt_rwmap.rwm_rw );
        }
-       avl_free( lt->mt_rwmap.rwm_oc.remap, NULL );
-       avl_free( lt->mt_rwmap.rwm_oc.map, mapping_free );
-       avl_free( lt->mt_rwmap.rwm_at.remap, NULL );
-       avl_free( lt->mt_rwmap.rwm_at.map, mapping_free );
+       avl_free( mt->mt_rwmap.rwm_oc.remap, NULL );
+       avl_free( mt->mt_rwmap.rwm_oc.map, mapping_free );
+       avl_free( mt->mt_rwmap.rwm_at.remap, NULL );
+       avl_free( mt->mt_rwmap.rwm_at.map, mapping_free );
 }
 
 int
 meta_back_db_destroy(
-    Backend    *be
-)
+       Backend         *be )
 {
-       struct metainfo *li;
+       metainfo_t      *mi;
 
        if ( be->be_private ) {
                int i;
 
-               li = ( struct metainfo * )be->be_private;
+               mi = ( metainfo_t * )be->be_private;
 
                /*
                 * Destroy the connection tree
                 */
-               ldap_pvt_thread_mutex_lock( &li->conn_mutex );
+               ldap_pvt_thread_mutex_lock( &mi->mi_conn_mutex );
 
-               if ( li->conntree ) {
-                       avl_free( li->conntree, conn_free );
+               if ( mi->mi_conntree ) {
+                       avl_free( mi->mi_conntree, conn_free );
                }
 
                /*
                 * Destroy the per-target stuff (assuming there's at
                 * least one ...)
                 */
-               for ( i = 0; i < li->ntargets; i++ ) {
-                       target_free( li->targets[ i ] );
-                       free( li->targets[ i ] );
+               for ( i = 0; i < mi->mi_ntargets; i++ ) {
+                       target_free( mi->mi_targets[ i ] );
+                       free( mi->mi_targets[ i ] );
                }
 
-               free( li->targets );
+               free( mi->mi_targets );
 
-               ldap_pvt_thread_mutex_lock( &li->cache.mutex );
-               if ( li->cache.tree ) {
-                       avl_free( li->cache.tree, meta_dncache_free );
+               ldap_pvt_thread_mutex_lock( &mi->mi_cache.mutex );
+               if ( mi->mi_cache.tree ) {
+                       avl_free( mi->mi_cache.tree, meta_dncache_free );
                }
                
-               ldap_pvt_thread_mutex_unlock( &li->cache.mutex );
-               ldap_pvt_thread_mutex_destroy( &li->cache.mutex );
+               ldap_pvt_thread_mutex_unlock( &mi->mi_cache.mutex );
+               ldap_pvt_thread_mutex_destroy( &mi->mi_cache.mutex );
 
-               ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
-               ldap_pvt_thread_mutex_destroy( &li->conn_mutex );
+               ldap_pvt_thread_mutex_unlock( &mi->mi_conn_mutex );
+               ldap_pvt_thread_mutex_destroy( &mi->mi_conn_mutex );
+
+               if ( mi->mi_candidates != NULL ) {
+                       ber_memfree_x( mi->mi_candidates, NULL );
+               }
        }
 
        free( be->be_private );
index 5021fc5c59f3da827b5b38e9e980811d4d4695d3..d248d418663d0308e13ebb80c9fe97a9912df736 100644 (file)
@@ -585,7 +585,8 @@ ldap_back_referral_result_rewrite(
        last--;
 
        for ( i = 0; !BER_BVISNULL( &a_vals[ i ] ); i++ ) {
-               struct berval   dn, olddn;
+               struct berval   dn,
+                               olddn = BER_BVNULL;
                int             rc;
                LDAPURLDesc     *ludp;
 
index e09b9c35666347c744093e4da5a41ad4b6ca7f9c..a39e63a501578cb9369f41902782053c75a9b79d 100644 (file)
@@ -34,8 +34,8 @@
 int
 meta_back_modify( Operation *op, SlapReply *rs )
 {
-       struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
-       struct metaconn *lc;
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       metaconn_t      *mc;
        int             rc = 0;
        LDAPMod         **modv = NULL;
        LDAPMod         *mods = NULL;
@@ -45,23 +45,19 @@ meta_back_modify( Operation *op, SlapReply *rs )
        struct berval   mdn = BER_BVNULL;
        struct berval   mapped;
        dncookie        dc;
+       int             do_retry = 1;
 
-       lc = meta_back_getconn( op, rs, META_OP_REQUIRE_SINGLE,
-                       &op->o_req_ndn, &candidate, LDAP_BACK_SENDERR );
-       if ( !lc || !meta_back_dobind( lc, op, LDAP_BACK_SENDERR ) ) {
-               return rs->sr_err;
-       }
-       
-       if ( !meta_back_is_valid( lc, candidate ) ) {
-               rs->sr_err = LDAP_OTHER;
-               send_ldap_result( op, rs );
+       mc = meta_back_getconn( op, rs, &candidate, LDAP_BACK_SENDERR );
+       if ( !mc || !meta_back_dobind( op, rs, mc, LDAP_BACK_SENDERR ) ) {
                return rs->sr_err;
        }
 
+       assert( mc->mc_conns[ candidate ].msc_ld != NULL );
+
        /*
         * Rewrite the modify dn, if needed
         */
-       dc.rwmap = &li->targets[ candidate ]->mt_rwmap;
+       dc.rwmap = &mi->mi_targets[ candidate ]->mt_rwmap;
        dc.conn = op->o_conn;
        dc.rs = rs;
        dc.ctx = "modifyDN";
@@ -103,7 +99,7 @@ meta_back_modify( Operation *op, SlapReply *rs )
                        mapped = ml->sml_desc->ad_cname;
 
                } else {
-                       ldap_back_map( &li->targets[ candidate ]->mt_rwmap.rwm_at,
+                       ldap_back_map( &mi->mi_targets[ candidate ]->mt_rwmap.rwm_at,
                                        &ml->sml_desc->ad_cname, &mapped,
                                        BACKLDAP_MAP );
                        if ( BER_BVISNULL( &mapped ) || BER_BVISEMPTY( &mapped ) ) {
@@ -130,11 +126,11 @@ meta_back_modify( Operation *op, SlapReply *rs )
                                for ( j = 0; !BER_BVISNULL( &ml->sml_values[ j ] ); ) {
                                        struct ldapmapping      *mapping;
 
-                                       ldap_back_mapping( &li->targets[ candidate ]->mt_rwmap.rwm_oc,
+                                       ldap_back_mapping( &mi->mi_targets[ candidate ]->mt_rwmap.rwm_oc,
                                                        &ml->sml_values[ j ], &mapping, BACKLDAP_MAP );
 
                                        if ( mapping == NULL ) {
-                                               if ( li->targets[ candidate ]->mt_rwmap.rwm_oc.drop_missing ) {
+                                               if ( mi->mi_targets[ candidate ]->mt_rwmap.rwm_oc.drop_missing ) {
                                                        continue;
                                                }
                                                mods[ i ].mod_bvalues[ j ] = &ml->sml_values[ j ];
@@ -175,8 +171,15 @@ meta_back_modify( Operation *op, SlapReply *rs )
        }
        modv[ i ] = 0;
 
-       rs->sr_err = ldap_modify_ext_s( lc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
+retry:;
+       rs->sr_err = ldap_modify_ext_s( mc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
                        modv, op->o_ctrls, NULL );
+       if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
+               do_retry = 0;
+               if ( meta_back_retry( op, rs, mc, candidate, LDAP_BACK_SENDERR ) ) {
+                       goto retry;
+               }
+       }
 
 cleanup:;
        if ( mdn.bv_val != op->o_req_dn.bv_val ) {
@@ -192,7 +195,7 @@ cleanup:;
        free( modv );
 
        if ( rc != -1 ) {
-               return meta_back_op_result( lc, op, rs );
+               return meta_back_op_result( mc, op, rs, candidate );
        }
        
        send_ldap_result( op, rs );
index a0d7e408ccd443925aa01126eb17465e8dc9f864..7ffbc555b542f8de742f42e1c47eeb73698f2223 100644 (file)
 int
 meta_back_modrdn( Operation *op, SlapReply *rs )
 {
-       struct metainfo         *li = ( struct metainfo * )op->o_bd->be_private;
-       struct metaconn         *lc;
-       int                     rc = 0;
+       metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
+       metaconn_t              *mc;
        int                     candidate = -1;
        struct berval           mdn = BER_BVNULL,
                                mnewSuperior = BER_BVNULL;
        dncookie                dc;
+       int                     msgid, do_retry = 1;
 
-       lc = meta_back_getconn( op, rs, META_OP_REQUIRE_SINGLE,
-                       &op->o_req_ndn, &candidate, LDAP_BACK_SENDERR );
-       if ( !lc ) {
+       mc = meta_back_getconn( op, rs, &candidate, LDAP_BACK_SENDERR );
+       if ( !mc || !meta_back_dobind( op, rs, mc, LDAP_BACK_SENDERR ) ) {
                return rs->sr_err;
        }
 
-       assert( candidate != META_TARGET_NONE );
-
-       if ( !meta_back_dobind( lc, op, LDAP_BACK_SENDERR ) ) {
-               return rs->sr_err;
-       }
+       assert( mc->mc_conns[ candidate ].msc_ld != NULL );
                
-       if ( !meta_back_is_valid( lc, candidate ) ) {
-               rs->sr_err = LDAP_OTHER;
-               send_ldap_result( op, rs );
-               return rs->sr_err;
-       }
-
        dc.conn = op->o_conn;
        dc.rs = rs;
 
        if ( op->orr_newSup ) {
-               int nsCandidate, version = LDAP_VERSION3;
-
-               nsCandidate = meta_back_select_unique_candidate( li,
-                               op->orr_nnewSup );
-
-               if ( nsCandidate != candidate ) {
-                       /*
-                        * FIXME: one possibility is to delete the entry
-                        * from one target and add it to the other;
-                        * unfortunately we'd need write access to both,
-                        * which is nearly impossible; for administration
-                        * needs, the rootdn of the metadirectory could
-                        * be mapped to an administrative account on each
-                        * target (the binddn?); we'll see.
-                        */
-                       /*
-                        * FIXME: is this the correct return code?
-                        */
-                       rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
-                       rs->sr_text = "cross-target rename not supported";
-                       rc = -1;
-                       goto cleanup;
-               }
+               int     version = LDAP_VERSION3;
 
-               ldap_set_option( lc->mc_conns[ nsCandidate ].msc_ld,
+               /*
+                * NOTE: the newParent, if defined, must be on the 
+                * same target as the entry to be renamed.  This check
+                * has been anticipated in meta_back_getconn()
+                */
+               /*
+                * FIXME: one possibility is to delete the entry
+                * from one target and add it to the other;
+                * unfortunately we'd need write access to both,
+                * which is nearly impossible; for administration
+                * needs, the rootdn of the metadirectory could
+                * be mapped to an administrative account on each
+                * target (the binddn?); we'll see.
+                */
+               /*
+                * NOTE: we need to port the identity assertion
+                * feature from back-ldap
+                */
+
+               /* newSuperior needs LDAPv3; if we got here, we can safely
+                * enforce it */
+               ldap_set_option( mc->mc_conns[ candidate ].msc_ld,
                                LDAP_OPT_PROTOCOL_VERSION, &version );
 
                /*
                 * Rewrite the new superior, if defined and required
                 */
-               dc.rwmap = &li->targets[ nsCandidate ]->mt_rwmap;
+               dc.rwmap = &mi->mi_targets[ candidate ]->mt_rwmap;
                dc.ctx = "newSuperiorDN";
                if ( ldap_back_dn_massage( &dc, op->orr_newSup, &mnewSuperior ) ) {
-                       rc = -1;
+                       rs->sr_err = LDAP_OTHER;
                        goto cleanup;
                }
        }
@@ -105,18 +93,24 @@ meta_back_modrdn( Operation *op, SlapReply *rs )
        /*
         * Rewrite the modrdn dn, if required
         */
-       dc.rwmap = &li->targets[ candidate ]->mt_rwmap;
+       dc.rwmap = &mi->mi_targets[ candidate ]->mt_rwmap;
        dc.ctx = "modrDN";
        if ( ldap_back_dn_massage( &dc, &op->o_req_dn, &mdn ) ) {
-               rc = -1;
+               rs->sr_err = LDAP_OTHER;
                goto cleanup;
        }
 
-       rc = ldap_rename_s( lc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
-                       op->orr_newrdn.bv_val,
-                       mnewSuperior.bv_val,
-                       op->orr_deleteoldrdn,
-                       op->o_ctrls, NULL ) != LDAP_SUCCESS;
+retry:;
+       rs->sr_err = ldap_rename_s( mc->mc_conns[ candidate ].msc_ld,
+                       mdn.bv_val, op->orr_newrdn.bv_val,
+                       mnewSuperior.bv_val, op->orr_deleteoldrdn,
+                       op->o_ctrls, NULL );
+       if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
+               do_retry = 0;
+               if ( meta_back_retry( op, rs, mc, candidate, LDAP_BACK_SENDERR ) ) {
+                       goto retry;
+               }
+       }
 
 cleanup:;
        if ( mdn.bv_val != op->o_req_dn.bv_val ) {
@@ -131,13 +125,12 @@ cleanup:;
                BER_BVZERO( &mnewSuperior );
        }
 
-       if ( rc == 0 ) {
-               return meta_back_op_result( lc, op, rs ) == LDAP_SUCCESS
-                       ? 0 : 1;
-       } /* else */
+       if ( rs->sr_err == LDAP_SUCCESS ) {
+               meta_back_op_result( mc, op, rs, candidate );
+       }
 
        send_ldap_result( op, rs );
 
-       return rc;
+       return rs->sr_err;
 }
 
index 3dbd522a8be9a3b305032280a155caaef129ed33..e88b7e9162ded79998bb4b0f695af524881a1fdb 100644 (file)
 
 static int
 meta_send_entry(
-               Operation       *op,
-               SlapReply       *rs,
-               struct metaconn *lc,
-               int             i,
-               LDAPMessage     *e
-);
+       Operation       *op,
+       SlapReply       *rs,
+       metaconn_t      *mc,
+       int             i,
+       LDAPMessage     *e );
 
-int
-meta_back_search( Operation *op, SlapReply *rs )
+static int
+meta_back_search_start(
+       Operation               *op,
+       SlapReply               *rs,
+       dncookie                *dc,
+       metasingleconn_t        *msc,
+       int                     candidate,
+       SlapReply               *candidates
+)
 {
-       struct metainfo *li = ( struct metainfo * )op->o_bd->be_private;
-       struct metaconn *lc;
-       struct metasingleconn *lsc;
-       struct timeval  tv = { 0, 0 };
-       LDAPMessage     *res = NULL, *e;
-       int     rc = 0, *msgid, sres = LDAP_SUCCESS;
-       char *err = NULL;
-       struct berval match = BER_BVNULL, mmatch = BER_BVNULL;
-       BerVarray v2refs = NULL;
-               
-       int i, last = 0, candidates = 0, initial_candidates = 0,
-                       candidate_match = 0;
-       dncookie dc;
-
-       int     is_scope = 0,
-               is_filter = 0;
+       metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
+       struct berval           realbase = op->o_req_dn;
+       int                     realscope = op->ors_scope;
+       ber_len_t               suffixlen = 0;
+       struct berval           mbase = BER_BVNULL; 
+       struct berval           mfilter = BER_BVNULL;
+       char                    **mapped_attrs = NULL;
+       int                     rc;
+
+       /* should we check return values? */
+       if ( op->ors_deref != -1 ) {
+               ldap_set_option( msc->msc_ld, LDAP_OPT_DEREF,
+                               ( void * )&op->ors_deref);
+       }
+       if ( op->ors_tlimit != SLAP_NO_LIMIT ) {
+               ldap_set_option( msc->msc_ld, LDAP_OPT_TIMELIMIT,
+                               ( void * )&op->ors_tlimit);
+       }
+       if ( op->ors_slimit != SLAP_NO_LIMIT ) {
+               ldap_set_option( msc->msc_ld, LDAP_OPT_SIZELIMIT,
+                               ( void * )&op->ors_slimit);
+       }
+
+       dc->rwmap = &mi->mi_targets[ candidate ]->mt_rwmap;
 
        /*
-        * controls are set in ldap_back_dobind()
-        * 
-        * FIXME: in case of values return filter, we might want
-        * to map attrs and maybe rewrite value
+        * modifies the base according to the scope, if required
         */
-       lc = meta_back_getconn( op, rs, META_OP_ALLOW_MULTIPLE, 
-                       &op->o_req_ndn, NULL, LDAP_BACK_SENDERR );
-       if ( !lc || !meta_back_dobind( lc, op, LDAP_BACK_SENDERR ) ) {
-               return rs->sr_err;
+       suffixlen = mi->mi_targets[ candidate ]->mt_nsuffix.bv_len;
+       if ( suffixlen > op->o_req_ndn.bv_len ) {
+               switch ( op->ors_scope ) {
+               case LDAP_SCOPE_SUBTREE:
+                       /*
+                        * make the target suffix the new base
+                        * FIXME: this is very forgiving, because
+                        * "illegal" searchBases may be turned
+                        * into the suffix of the target; however,
+                        * the requested searchBase already passed
+                        * thru the candidate analyzer...
+                        */
+                       if ( dnIsSuffix( &mi->mi_targets[ candidate ]->mt_nsuffix,
+                                       &op->o_req_ndn ) )
+                       {
+                               realbase = mi->mi_targets[ candidate ]->mt_nsuffix;
+
+                       } else {
+                               /*
+                                * this target is no longer candidate
+                                */
+                               return 0;
+                       }
+                       break;
+
+               case LDAP_SCOPE_ONELEVEL:
+               {
+                       struct berval   rdn = mi->mi_targets[ candidate ]->mt_nsuffix;
+                       rdn.bv_len -= op->o_req_ndn.bv_len + STRLENOF( "," );
+                       if ( dnIsOneLevelRDN( &rdn )
+                                       && dnIsSuffix( &mi->mi_targets[ candidate ]->mt_nsuffix, &op->o_req_ndn ) )
+                       {
+                               /*
+                                * if there is exactly one level,
+                                * make the target suffix the new
+                                * base, and make scope "base"
+                                */
+                               realbase = mi->mi_targets[ candidate ]->mt_nsuffix;
+                               realscope = LDAP_SCOPE_BASE;
+                               break;
+                       } /* else continue with the next case */
+               }
+
+               case LDAP_SCOPE_BASE:
+                       /*
+                        * this target is no longer candidate
+                        */
+                       return 0;
+               }
        }
 
        /*
-        * Array of message id of each target
+        * Rewrite the search base, if required
         */
-       msgid = ch_calloc( sizeof( int ), li->ntargets );
-       if ( msgid == NULL ) {
-               rs->sr_err = LDAP_OTHER;
-               send_ldap_result( op, rs );
+       dc->ctx = "searchBase";
+       switch ( ldap_back_dn_massage( dc, &realbase, &mbase ) ) {
+       default:
+               break;
+
+       case REWRITE_REGEXEC_UNWILLING:
+               rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+               rs->sr_text = "Operation not allowed";
+               send_ldap_result( op, rs );
                return -1;
+
+       case REWRITE_REGEXEC_ERR:
+
+               /*
+                * this target is no longer candidate
+                */
+               return 0;
        }
-       
-       dc.conn = op->o_conn;
-       dc.rs = rs;
 
        /*
-        * Inits searches
+        * Maps filter
         */
-       for ( i = 0, lsc = lc->mc_conns; !META_LAST( lsc ); ++i, ++lsc ) {
-               struct berval   realbase = op->o_req_dn;
-               int             realscope = op->ors_scope;
-               ber_len_t       suffixlen = 0;
-               struct berval   mbase = BER_BVNULL; 
-               struct berval   mfilter = BER_BVNULL;
-               char            **mapped_attrs = NULL;
-
-               if ( lsc->msc_candidate != META_CANDIDATE ) {
-                       msgid[ i ] = -1;
-                       continue;
-               }
-
-               /* should we check return values? */
-               if ( op->ors_deref != -1 ) {
-                       ldap_set_option( lsc->msc_ld, LDAP_OPT_DEREF,
-                                       ( void * )&op->ors_deref);
-               }
-               if ( op->ors_tlimit != SLAP_NO_LIMIT ) {
-                       ldap_set_option( lsc->msc_ld, LDAP_OPT_TIMELIMIT,
-                                       ( void * )&op->ors_tlimit);
-               }
-               if ( op->ors_slimit != SLAP_NO_LIMIT ) {
-                       ldap_set_option( lsc->msc_ld, LDAP_OPT_SIZELIMIT,
-                                       ( void * )&op->ors_slimit);
-               }
-
-               dc.rwmap = &li->targets[ i ]->mt_rwmap;
+       rc = ldap_back_filter_map_rewrite( dc, op->ors_filter,
+                       &mfilter, BACKLDAP_MAP );
+       switch ( rc ) {
+       case LDAP_SUCCESS:
+               break;
+
+       case LDAP_COMPARE_FALSE:
+       default:
+               /*
+                * this target is no longer candidate
+                */
+               rc = 0;
+               goto done;
+       }
 
+       /*
+        * Maps required attributes
+        */
+       rc = ldap_back_map_attrs( &mi->mi_targets[ candidate ]->mt_rwmap.rwm_at,
+                       op->ors_attrs, BACKLDAP_MAP, &mapped_attrs );
+       if ( rc != LDAP_SUCCESS ) {
                /*
-                * modifies the base according to the scope, if required
+                * this target is no longer candidate
                 */
-               suffixlen = li->targets[ i ]->mt_nsuffix.bv_len;
-               if ( suffixlen > op->o_req_ndn.bv_len ) {
-                       switch ( op->ors_scope ) {
-                       case LDAP_SCOPE_SUBTREE:
-                               /*
-                                * make the target suffix the new base
-                                * FIXME: this is very forgiving, because
-                                * illegal bases may be turned into 
-                                * the suffix of the target.
-                                */
-                               if ( dnIsSuffix( &li->targets[ i ]->mt_nsuffix,
-                                               &op->o_req_ndn ) ) {
-                                       realbase = li->targets[ i ]->mt_nsuffix;
-                                       is_scope++;
-
-                               } else {
-                                       /*
-                                        * this target is no longer candidate
-                                        */
-                                       msgid[ i ] = -1;
-                                       goto new_candidate;
-                               }
-                               break;
+               rc = 0;
+               goto done;
+       }
 
-                       case LDAP_SCOPE_ONELEVEL:
-                       {
-                               struct berval   rdn = li->targets[ i ]->mt_nsuffix;
-                               rdn.bv_len -= op->o_req_ndn.bv_len + STRLENOF( "," );
-                               if ( dnIsOneLevelRDN( &rdn )
-                                               && dnIsSuffix( &li->targets[ i ]->mt_nsuffix, &op->o_req_ndn ) )
-                               {
-                                       /*
-                                        * if there is exactly one level,
-                                        * make the target suffix the new
-                                        * base, and make scope "base"
-                                        */
-                                       realbase = li->targets[ i ]->mt_nsuffix;
-                                       realscope = LDAP_SCOPE_BASE;
-                                       is_scope++;
-                                       break;
-                               } /* else continue with the next case */
-                       }
+       /*
+        * Starts the search
+        */
+       rc = ldap_search_ext( msc->msc_ld,
+                       mbase.bv_val, realscope, mfilter.bv_val,
+                       mapped_attrs, op->ors_attrsonly,
+                       op->o_ctrls, NULL, NULL, op->ors_slimit,
+                       &candidates[ candidate ].sr_msgid ); 
+       if ( rc == LDAP_SUCCESS ) {
+               rc = 1;
+
+       } else {
+               candidates[ candidate ].sr_msgid = -1;
+               rc = 0;
+       }
 
-                       case LDAP_SCOPE_BASE:
-                               /*
-                                * this target is no longer candidate
-                                */
-                               msgid[ i ] = -1;
-                               goto new_candidate;
-                       }
+done:;
+       if ( mapped_attrs ) {
+               free( mapped_attrs );
+       }
+       if ( mfilter.bv_val != op->ors_filterstr.bv_val ) {
+               free( mfilter.bv_val );
+       }
+       if ( mbase.bv_val != realbase.bv_val ) {
+               free( mbase.bv_val );
+       }
 
-               } else {
-                       is_scope++;
-               }
+       return rc;
+}
 
-               /*
-                * Rewrite the search base, if required
-                */
-               dc.ctx = "searchBase";
-               switch ( ldap_back_dn_massage( &dc, &realbase, &mbase ) ) {
-               default:
-                       break;
+int
+meta_back_search( Operation *op, SlapReply *rs )
+{
+       metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
+       metaconn_t              *mc;
+       metasingleconn_t        *msc;
+       struct timeval          tv = { 0, 0 };
+       LDAPMessage             *res = NULL, *e;
+       int                     rc = 0, sres = LDAP_SUCCESS;
+       char                    *matched = NULL;
+       int                     i, last = 0, ncandidates = 0,
+                               initial_candidates = 0, candidate_match = 0;
+       dncookie                dc;
+       int                     is_ok = 0;
+       void                    *savepriv;
+       SlapReply               *candidates = meta_back_candidates_get( op );
 
-               case REWRITE_REGEXEC_UNWILLING:
-                       rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
-                       rs->sr_text = "Operation not allowed";
-                       send_ldap_result( op, rs );
-                       rc = -1;
-                       goto finish;
+       /*
+        * controls are set in ldap_back_dobind()
+        * 
+        * FIXME: in case of values return filter, we might want
+        * to map attrs and maybe rewrite value
+        */
+       mc = meta_back_getconn( op, rs, NULL, LDAP_BACK_SENDERR );
+       if ( !mc || !meta_back_dobind( op, rs, mc, LDAP_BACK_SENDERR ) ) {
+               return rs->sr_err;
+       }
 
-               case REWRITE_REGEXEC_ERR:
-#if 0
-                       rs->sr_err = LDAP_OTHER;
-                       rs->sr_text = "Rewrite error";
-                       send_ldap_result( op, rs );
-                       rc = -1;
-                       goto finish;
-#endif 
+       dc.conn = op->o_conn;
+       dc.rs = rs;
 
-                       /*
-                        * this target is no longer candidate
-                        */
-                       msgid[ i ] = -1;
-                       goto new_candidate;
+       /*
+        * Inits searches
+        */
+       for ( i = 0, msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ); ++i, ++msc ) {
+               candidates[ i ].sr_msgid = -1;
+
+               if ( candidates[ i ].sr_tag != META_CANDIDATE ) {
+                       continue;
                }
+               candidates[ i ].sr_err = LDAP_SUCCESS;
+               candidates[ i ].sr_matched = NULL;
+               candidates[ i ].sr_text = NULL;
+               candidates[ i ].sr_ref = NULL;
+               candidates[ i ].sr_ctrls = NULL;
 
-               /*
-                * Maps filter
-                */
-               rc = ldap_back_filter_map_rewrite( &dc,
-                               op->ors_filter,
-                               &mfilter, BACKLDAP_MAP );
-               switch ( rc ) {
-               case LDAP_SUCCESS:
-                       is_filter++;
+               switch ( meta_back_search_start( op, rs, &dc, msc, i, candidates ) )
+               {
+               case 0:
                        break;
 
-               case LDAP_COMPARE_FALSE:
-                       rc = 0;
+               case 1:
+                       ++ncandidates;
+                       break;
 
-               default:
-                       /*
-                        * this target is no longer candidate
-                        */
-                       msgid[ i ] = -1;
-                       goto new_candidate;
+               case -1:
+                       rc = -1;
+                       goto finish;
                }
+       }
 
-               /*
-                * Maps required attributes
-                */
-               rc = ldap_back_map_attrs( &li->targets[ i ]->mt_rwmap.rwm_at,
-                               op->ors_attrs, BACKLDAP_MAP,
-                               &mapped_attrs );
-               if ( rc != LDAP_SUCCESS ) {
-                       /*
-                        * this target is no longer candidate
-                        */
-                       msgid[ i ] = -1;
-                       goto new_candidate;
-               }
+       initial_candidates = ncandidates;
 
-               /*
-                * Starts the search
-                */
-               rc = ldap_search_ext( lsc->msc_ld,
-                               mbase.bv_val, realscope, mfilter.bv_val,
-                               mapped_attrs, op->ors_attrsonly,
-                               op->o_ctrls, NULL,
-                               NULL, op->ors_slimit, &msgid[ i ] ); 
-               if ( mapped_attrs ) {
-                       free( mapped_attrs );
-                       mapped_attrs = NULL;
-               }
-               if ( mfilter.bv_val != op->ors_filterstr.bv_val ) {
-                       free( mfilter.bv_val );
-                       BER_BVZERO( &mfilter );
-               }
-               if ( mbase.bv_val != realbase.bv_val ) {
-                       free( mbase.bv_val );
-                       BER_BVZERO( &mbase );
-               }
+#if 0
+       {
+               char    cnd[BUFSIZ];
+               int     i;
 
-               if ( rc != LDAP_SUCCESS ) {
-                       continue;
+               for ( i = 0; i < mi->mi_ntargets; i++ ) {
+                       if ( candidates[ i ].sr_tag == META_CANDIDATE ) {
+                               cnd[ i ] = '*';
+                       } else {
+                               cnd[ i ] = ' ';
+                       }
                }
-               
-               ++candidates;
+               cnd[ i ] = '\0';
 
-new_candidate:;
+               Debug( LDAP_DEBUG_ANY, "%s meta_back_search: ncandidates=%d "
+                       "cnd=\"%s\"\n", op->o_log_prefix, ncandidates, cnd );
        }
+#endif
+
+       if ( initial_candidates == 0 ) {
+               send_ldap_error( op, rs, LDAP_NO_SUCH_OBJECT, NULL );
+               /* FIXME: find a way to look up the best match */
 
-       initial_candidates = candidates;
+               rc = LDAP_NO_SUCH_OBJECT;
+               goto finish;
+       }
 
        /* We pull apart the ber result, stuff it into a slapd entry, and
         * let send_search_entry stuff it back into ber format. Slow & ugly,
         * but this is necessary for version matching, and for ACL processing.
         */
 
-
        /*
         * In case there are no candidates, no cycle takes place...
         *
-        * FIXME: we might use a queue, to balance the load 
+        * FIXME: we might use a queue, to better balance the load 
         * among the candidates
         */
-       for ( rc = 0; candidates > 0; ) {
-               int ab, gotit = 0;
-
-               /* check for abandon */
-               ab = op->o_abandon;
+       for ( rc = 0; ncandidates > 0; ) {
+               int     gotit = 0, doabandon = 0;
 
-               for ( i = 0, lsc = lc->mc_conns; !META_LAST( lsc ); lsc++, i++ ) {
-                       if ( msgid[ i ] == -1 ) {
+               for ( i = 0, msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ); msc++, i++ ) {
+                       if ( candidates[ i ].sr_msgid == -1 ) {
                                continue;
                        }
-                       
-                       if ( ab ) {
-                               ldap_abandon_ext( lsc->msc_ld, msgid[ i ], NULL, NULL );
-                               rc = SLAPD_ABANDON;
+
+                       /* check for abandon */
+                       if ( op->o_abandon ) {
                                break;
                        }
-
-                       if ( op->ors_slimit > 0
-                                       && rs->sr_nentries == op->ors_slimit ) {
+                       
+                       if ( op->ors_slimit > 0 && rs->sr_nentries == op->ors_slimit )
+                       {
                                rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
-                               rs->sr_v2ref = v2refs;
+                               savepriv = op->o_private;
+                               op->o_private = (void *)i;
                                send_ldap_result( op, rs );
+                               op->o_private = savepriv;
                                goto finish;
                        }
 
@@ -322,7 +346,7 @@ new_candidate:;
                         * get a LDAP_TIMELIMIT_EXCEEDED from
                         * one of them ...
                         */
-                       rc = ldap_result( lsc->msc_ld, msgid[ i ],
+                       rc = ldap_result( msc->msc_ld, candidates[ i ].sr_msgid,
                                        0, &tv, &res );
 
                        if ( rc == 0 ) {
@@ -336,11 +360,12 @@ new_candidate:;
                        } else if ( rc == -1 ) {
 really_bad:;
                                /* something REALLY bad happened! */
-                               ( void )meta_clear_unused_candidates( li,
-                                               lc, -1, 0 );
+                               ( void )meta_clear_unused_candidates( op, -1 );
                                rs->sr_err = LDAP_OTHER;
-                               rs->sr_v2ref = v2refs;
+                               savepriv = op->o_private;
+                               op->o_private = (void *)i;
                                send_ldap_result( op, rs );
+                               op->o_private = savepriv;
                                
                                /* anything else needs be done? */
 
@@ -350,12 +375,20 @@ really_bad:;
                                goto finish;
 
                        } else if ( rc == LDAP_RES_SEARCH_ENTRY ) {
-                               e = ldap_first_entry( lsc->msc_ld, res );
-                               meta_send_entry( op, rs, lc, i, e );
+                               is_ok++;
+
+                               e = ldap_first_entry( msc->msc_ld, res );
+                               savepriv = op->o_private;
+                               op->o_private = (void *)i;
+                               meta_send_entry( op, rs, mc, i, e );
+                               op->o_private = savepriv;
 
                                ldap_msgfree( res );
                                res = NULL;
 
+                               gotit = 1;
+
+#if 0
                                /*
                                 * If scope is BASE, we need to jump out
                                 * as soon as one entry is found; if
@@ -363,20 +396,27 @@ really_bad:;
                                 * this should correspond to the sole
                                 * entry that has the base DN
                                 */
+                               /* FIXME: this defeats the purpose of
+                                * doing a search with scope == base and
+                                * sizelimit = 1 to determine if a
+                                * candidate is actually unique */
                                if ( op->ors_scope == LDAP_SCOPE_BASE
-                                               && rs->sr_nentries > 0 ) {
-                                       candidates = 0;
+                                               && rs->sr_nentries > 0 )
+                               {
+                                       doabandon = 1;
+                                       ncandidates = 0;
                                        sres = LDAP_SUCCESS;
                                        break;
                                }
-
-                               gotit = 1;
+#endif
 
                        } else if ( rc == LDAP_RES_SEARCH_REFERENCE ) {
                                char            **references = NULL;
                                int             cnt;
 
-                               rc = ldap_parse_reference( lsc->msc_ld, res,
+                               is_ok++;
+
+                               rc = ldap_parse_reference( msc->msc_ld, res,
                                                &references, &rs->sr_ctrls, 1 );
                                res = NULL;
 
@@ -394,6 +434,9 @@ really_bad:;
                                dc.tofrom = 0;
                                dc.normalized = 0;
 #endif /* ! ENABLE_REWRITE */
+
+                               /* FIXME: merge all and return at the end */
+
                                for ( cnt = 0; references[ cnt ]; cnt++ )
                                        ;
 
@@ -408,7 +451,10 @@ really_bad:;
 
                                if ( rs->sr_ref != NULL && !BER_BVISNULL( &rs->sr_ref[ 0 ] ) ) {
                                        /* ignore return value by now */
+                                       savepriv = op->o_private;
+                                       op->o_private = (void *)i;
                                        ( void )send_search_reference( op, rs );
+                                       op->o_private = savepriv;
 
                                        ber_bvarray_free( rs->sr_ref );
                                        rs->sr_ref = NULL;
@@ -424,33 +470,125 @@ really_bad:;
                                        rs->sr_ctrls = NULL;
                                }
 
-                       } else {
-                               if ( ldap_parse_result( lsc->msc_ld, res,
-                                                       &rs->sr_err,
-                                                       NULL, NULL, NULL, NULL, 1 ) )
+                       } else if ( rc == LDAP_RES_SEARCH_RESULT ) {
+                               char            buf[ SLAP_TEXT_BUFLEN ];
+                               char            **references = NULL;
+
+                               if ( ldap_parse_result( msc->msc_ld,
+                                                       res,
+                                                       &candidates[ i ].sr_err,
+                                                       (char **)&candidates[ i ].sr_matched,
+                                                       NULL /* (char **)&candidates[ i ].sr_text */ ,
+                                                       &references,
+                                                       &candidates[ i ].sr_ctrls, 1 ) )
                                {
                                        res = NULL;
+                                       ldap_get_option( msc->msc_ld,
+                                                       LDAP_OPT_ERROR_NUMBER,
+                                                       &rs->sr_err );
+                                       sres = slap_map_api2result( rs );
                                        goto really_bad;
                                }
+                               rs->sr_err = candidates[ i ].sr_err;
+                               sres = slap_map_api2result( rs );
                                res = NULL;
 
-                               sres = slap_map_api2result( rs );
-                               if ( err != NULL ) {
-                                       free( err );
+                               /* massage matchedDN if need be */
+                               if ( candidates[ i ].sr_matched != NULL ) {
+                                       if ( candidates[ i ].sr_matched[ 0 ] == '\0' ) {
+                                               ldap_memfree( (char *)candidates[ i ].sr_matched );
+                                               candidates[ i ].sr_matched = NULL;
+
+                                       } else {
+                                               struct berval   match, mmatch;
+
+                                               ber_str2bv( candidates[ i ].sr_matched,
+                                                       0, 0, &match );
+
+                                               dc.ctx = "matchedDN";
+                                               dc.rwmap = &mi->mi_targets[ i ]->mt_rwmap;
+
+                                               if ( !ldap_back_dn_massage( &dc, &match, &mmatch ) ) {
+                                                       if ( mmatch.bv_val == match.bv_val ) {
+                                                               candidates[ i ].sr_matched = ch_strdup( mmatch.bv_val );
+
+                                                       } else {
+                                                               candidates[ i ].sr_matched = mmatch.bv_val;
+                                                       }
+
+                                                       candidate_match++;
+                                               } 
+                                               ldap_memfree( match.bv_val );
+                                       }
+                               }
+
+                               /* just get rid of the error message, if any */
+                               if ( candidates[ i ].sr_text && candidates[ i ].sr_text[ 0 ] == '\0' )
+                               {
+                                       ldap_memfree( (char *)candidates[ i ].sr_text );
+                                       candidates[ i ].sr_text = NULL;
+                               }
+
+                               /* add references to array */
+                               if ( references ) {
+                                       BerVarray       sr_ref;
+                                       int             cnt;
+
+                                       for ( cnt = 0; references[ cnt ]; cnt++ )
+                                               ;
+
+                                       sr_ref = ch_calloc( sizeof( struct berval ), cnt + 1 );
+
+                                       for ( cnt = 0; references[ cnt ]; cnt++ ) {
+                                               ber_str2bv( references[ cnt ], 0, 1, &sr_ref[ cnt ] );
+                                       }
+                                       BER_BVZERO( &sr_ref[ cnt ] );
+
+                                       ( void )ldap_back_referral_result_rewrite( &dc, sr_ref );
+                               
+                                       /* cleanup */
+                                       ldap_value_free( references );
+
+                                       if ( rs->sr_v2ref == NULL ) {
+                                               rs->sr_v2ref = sr_ref;
+
+                                       } else {
+                                               for ( cnt = 0; !BER_BVISNULL( &sr_ref[ cnt ] ); cnt++ ) {
+                                                       ber_bvarray_add( &rs->sr_v2ref, &sr_ref[ cnt ] );
+                                               }
+                                               ber_memfree( sr_ref );
+                                       }
                                }
-                               ldap_get_option( lsc->msc_ld,
-                                               LDAP_OPT_ERROR_STRING, &err );
-                               if ( match.bv_val != NULL ) {
-                                       free( match.bv_val );
+
+                               rs->sr_err = candidates[ i ].sr_err;
+                               sres = slap_map_api2result( rs );
+                               switch ( sres ) {
+                               case LDAP_NO_SUCH_OBJECT:
+                                       /* is_ok is touched any time a valid
+                                        * (even intermediate) result is
+                                        * returned; as a consequence, if
+                                        * a candidate returns noSuchObject
+                                        * it is ignored and the candidate
+                                        * is simply demoted. */
+                                       if ( is_ok ) {
+                                               sres = LDAP_SUCCESS;
+                                       }
+                                       break;
+
+                               case LDAP_SUCCESS:
+                               case LDAP_REFERRAL:
+                                       is_ok++;
+                                       break;
                                }
-                               ldap_get_option( lsc->msc_ld,
-                                               LDAP_OPT_MATCHED_DN, &match.bv_val );
-
-                               Debug( LDAP_DEBUG_ANY,
-                                       "=>meta_back_search [%d] "
-                                       "match=\"%s\" err=\"%s\"\n",
-                                       i, match.bv_val, err ); 
-                               candidate_match++;
+
+                               snprintf( buf, sizeof( buf ),
+                                       "%s meta_back_search[%d] "
+                                       "match=\"%s\" err=%d\n",
+                                       op->o_log_prefix, i,
+                                       candidates[ i ].sr_matched ? candidates[ i ].sr_matched : "",
+                                       candidates[ i ].sr_err );
+                               Debug( LDAP_DEBUG_ANY, "%s", buf, 0, 0 );
+
                                last = i;
                                rc = 0;
 
@@ -458,13 +596,30 @@ really_bad:;
                                 * When no candidates are left,
                                 * the outer cycle finishes
                                 */
-                               msgid[ i ] = -1;
-                               --candidates;
+                               candidates[ i ].sr_msgid = -1;
+                               --ncandidates;
+
+                       } else {
+                               assert( 0 );
+                               goto really_bad;
                        }
                }
 
-               if ( ab ) {
-                       goto finish;
+               /* check for abandon */
+               if ( op->o_abandon || doabandon ) {
+                       for ( i = 0, msc = mc->mc_conns; !META_LAST( msc ); msc++, i++ ) {
+                               if ( candidates[ i ].sr_msgid != -1 ) {
+                                       ldap_abandon_ext( msc->msc_ld,
+                                               candidates[ i ].sr_msgid,
+                                               NULL, NULL );
+                                       candidates[ i ].sr_msgid = -1;
+                               }
+                       }
+
+                       if ( op->o_abandon ) {
+                               rc = SLAPD_ABANDON;
+                               goto finish;
+                       }
                }
 
                if ( gotit == 0 ) {
@@ -480,9 +635,9 @@ really_bad:;
 
        if ( rc == -1 ) {
                /*
-                * FIXME: need a strategy to handle errors
+                * FIXME: need a better strategy to handle errors
                 */
-               rc = meta_back_op_result( lc, op, rs );
+               rc = meta_back_op_result( mc, op, rs, META_TARGET_NONE );
                goto finish;
        }
 
@@ -491,15 +646,40 @@ really_bad:;
         * 
         * FIXME: only the last one gets caught!
         */
-       if ( candidate_match == initial_candidates
-                       && match.bv_val != NULL && *match.bv_val ) {
-               dc.ctx = "matchedDN";
-               dc.rwmap = &li->targets[ last ]->mt_rwmap;
+       if ( candidate_match > 0 && rs->sr_nentries > 0 ) {
+               /* we use the first one */
+               for ( i = 0; i < mi->mi_ntargets; i++ ) {
+                       if ( candidates[ i ].sr_tag == META_CANDIDATE
+                                       && candidates[ i ].sr_matched )
+                       {
+                               matched = (char *)candidates[ i ].sr_matched;
+                               candidates[ i ].sr_matched = NULL;
+                               break;
+                       }
+               }
+       }
 
-               if ( ldap_back_dn_massage( &dc, &match, &mmatch ) ) {
-                       mmatch.bv_val = NULL;
+#if 0
+       {
+               char    buf[BUFSIZ];
+               char    cnd[BUFSIZ];
+               int     i;
+
+               for ( i = 0; i < mi->mi_ntargets; i++ ) {
+                       if ( candidates[ i ].sr_tag == META_CANDIDATE ) {
+                               cnd[ i ] = '*';
+                       } else {
+                               cnd[ i ] = ' ';
+                       }
                }
+               cnd[ i ] = '\0';
+
+               snprintf( buf, sizeof( buf ), "%s meta_back_search: is_scope=%d is_ok=%d cnd=\"%s\"\n",
+                       op->o_log_prefix, initial_candidates, is_ok, cnd );
+
+               Debug( LDAP_DEBUG_ANY, "%s", buf, 0, 0 );
        }
+#endif
 
        /*
         * In case we returned at least one entry, we return LDAP_SUCCESS
@@ -508,35 +688,53 @@ really_bad:;
         * FIXME: we should handle error codes and return the more 
         * important/reasonable
         */
-       if ( is_scope == 0 ) {
-               sres = LDAP_NO_SUCH_OBJECT;
-       }
 
-       if ( sres == LDAP_SUCCESS && v2refs ) {
+       if ( sres == LDAP_SUCCESS && rs->sr_v2ref ) {
                sres = LDAP_REFERRAL;
        }
        rs->sr_err = sres;
-       rs->sr_matched = mmatch.bv_val;
-       rs->sr_v2ref = v2refs;
+       rs->sr_matched = matched;
+       rs->sr_ref = ( sres == LDAP_REFERRAL ? rs->sr_v2ref : NULL );
+       savepriv = op->o_private;
+       op->o_private = (void *)mi->mi_ntargets;
        send_ldap_result( op, rs );
+       op->o_private = savepriv;
        rs->sr_matched = NULL;
-       rs->sr_v2ref = NULL;
-
+       rs->sr_ref = NULL;
 
 finish:;
-       if ( match.bv_val ) {
-               if ( mmatch.bv_val != match.bv_val ) {
-                       free( mmatch.bv_val );
-               }
-               free( match.bv_val );
+       if ( matched ) {
+               free( matched );
        }
-       
-       if ( err ) {
-               free( err );
+
+       if ( rs->sr_v2ref ) {
+               ber_bvarray_free( rs->sr_v2ref );
        }
-       
-       if ( msgid ) {
-               ch_free( msgid );
+
+       for ( i = 0; i < mi->mi_ntargets; i++ ) {
+               if ( candidates[ i ].sr_tag != META_CANDIDATE ) {
+                       continue;
+               }
+
+               if ( candidates[ i ].sr_matched ) {
+                       free( (char *)candidates[ i ].sr_matched );
+                       candidates[ i ].sr_matched = NULL;
+               }
+
+               if ( candidates[ i ].sr_text ) {
+                       ldap_memfree( (char *)candidates[ i ].sr_text );
+                       candidates[ i ].sr_text = NULL;
+               }
+
+               if ( candidates[ i ].sr_ref ) {
+                       ber_bvarray_free( candidates[ i ].sr_ref );
+                       candidates[ i ].sr_ref = NULL;
+               }
+
+               if ( candidates[ i ].sr_ctrls ) {
+                       ldap_controls_free( candidates[ i ].sr_ctrls );
+                       candidates[ i ].sr_ctrls = NULL;
+               }
        }
 
        return rc;
@@ -544,16 +742,15 @@ finish:;
 
 static int
 meta_send_entry(
-               Operation       *op,
-               SlapReply       *rs,
-               struct metaconn *lc,
-               int             target,
-               LDAPMessage     *e
-)
+       Operation       *op,
+       SlapReply       *rs,
+       metaconn_t      *mc,
+       int             target,
+       LDAPMessage     *e )
 {
-       struct metainfo         *li = ( struct metainfo * )op->o_bd->be_private;
+       metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
        struct berval           a, mapped;
-       Entry                   ent = {0};
+       Entry                   ent = { 0 };
        BerElement              ber = *e->lm_ber;
        Attribute               *attr, **attrp;
        struct berval           *bv, bdn;
@@ -567,7 +764,7 @@ meta_send_entry(
        /*
         * Rewrite the dn of the result, if needed
         */
-       dc.rwmap = &li->targets[ target ]->mt_rwmap;
+       dc.rwmap = &mi->mi_targets[ target ]->mt_rwmap;
        dc.conn = op->o_conn;
        dc.rs = rs;
        dc.ctx = "searchResult";
@@ -593,8 +790,8 @@ meta_send_entry(
        /*
         * cache dn
         */
-       if ( li->cache.ttl != META_DNCACHE_DISABLED ) {
-               ( void )meta_dncache_update_entry( &li->cache,
+       if ( mi->mi_cache.ttl != META_DNCACHE_DISABLED ) {
+               ( void )meta_dncache_update_entry( &mi->mi_cache,
                                &ent.e_nname, target );
        }
 
@@ -604,9 +801,9 @@ meta_send_entry(
        while ( ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) {
                int             last = 0;
 
-               ldap_back_map( &li->targets[ target ]->mt_rwmap.rwm_at, 
+               ldap_back_map( &mi->mi_targets[ target ]->mt_rwmap.rwm_at, 
                                &a, &mapped, BACKLDAP_REMAP );
-               if ( mapped.bv_val == NULL || mapped.bv_val[0] == '\0' ) {
+               if ( BER_BVISNULL( &mapped ) || mapped.bv_val[0] == '\0' ) {
                        continue;
                }
                attr = ( Attribute * )ch_malloc( sizeof( Attribute ) );
@@ -619,10 +816,17 @@ meta_send_entry(
                if ( slap_bv2ad( &mapped, &attr->a_desc, &text )
                                != LDAP_SUCCESS) {
                        if ( slap_bv2undef_ad( &mapped, &attr->a_desc, &text ) 
-                                       != LDAP_SUCCESS) {
-                               Debug( LDAP_DEBUG_ANY,
-                                               "slap_bv2undef_ad(%s): "
-                                               "%s\n%s", mapped.bv_val, text, "" );
+                                       != LDAP_SUCCESS )
+                       {
+                               char    buf[ SLAP_TEXT_BUFLEN ];
+
+                               snprintf( buf, sizeof( buf ),
+                                       "%s meta_send_entry(\"%s\"): "
+                                       "slap_bv2undef_ad(%s): %s\n",
+                                       op->o_log_prefix, ent.e_name.bv_val,
+                                       mapped.bv_val, text );
+
+                               Debug( LDAP_DEBUG_ANY, "%s", buf, 0, 0 );
                                ch_free( attr );
                                continue;
                        }
@@ -645,25 +849,26 @@ meta_send_entry(
                }
 
                if ( ber_scanf( &ber, "[W]", &attr->a_vals ) == LBER_ERROR 
-                               || attr->a_vals == NULL ) {
+                               || attr->a_vals == NULL )
+               {
                        attr->a_vals = (struct berval *)&slap_dummy_bv;
 
                } else if ( attr->a_desc == slap_schema.si_ad_objectClass
-                               || attr->a_desc == slap_schema.si_ad_structuralObjectClass ) {
-
-                       for ( last = 0; attr->a_vals[ last ].bv_val; ++last );
+                               || attr->a_desc == slap_schema.si_ad_structuralObjectClass )
+               {
+                       for ( last = 0; !BER_BVISNULL( &attr->a_vals[ last ] ); ++last );
 
-                       for ( bv = attr->a_vals; bv->bv_val; bv++ ) {
-                               ldap_back_map( &li->targets[ target ]->mt_rwmap.rwm_oc,
+                       for ( bv = attr->a_vals; !BER_BVISNULL( bv ); bv++ ) {
+                               ldap_back_map( &mi->mi_targets[ target ]->mt_rwmap.rwm_oc,
                                                bv, &mapped, BACKLDAP_REMAP );
-                               if ( mapped.bv_val == NULL || mapped.bv_val[0] == '\0') {
+                               if ( BER_BVISNULL( &mapped ) || mapped.bv_val[0] == '\0') {
                                        free( bv->bv_val );
-                                       bv->bv_val = NULL;
+                                       BER_BVZERO( bv );
                                        if ( --last < 0 ) {
                                                break;
                                        }
                                        *bv = attr->a_vals[ last ];
-                                       attr->a_vals[ last ].bv_val = NULL;
+                                       BER_BVZERO( &attr->a_vals[ last ] );
                                        bv--;
 
                                } else if ( mapped.bv_val != bv->bv_val ) {
@@ -695,7 +900,7 @@ meta_send_entry(
                        attr->a_desc->ad_type->sat_equality->smr_normalize ) {
                        int i;
 
-                       attr->a_nvals = ch_malloc((last + 1)*sizeof(struct berval));
+                       attr->a_nvals = ch_malloc( ( last + 1 ) * sizeof( struct berval ) );
                        for ( i = 0; i<last; i++ ) {
                                attr->a_desc->ad_type->sat_equality->smr_normalize(
                                        SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
@@ -704,8 +909,8 @@ meta_send_entry(
                                        &attr->a_vals[i], &attr->a_nvals[i],
                                        NULL );
                        }
-                       attr->a_nvals[i].bv_val = NULL;
-                       attr->a_nvals[i].bv_len = 0;
+                       BER_BVZERO( &attr->a_nvals[i] );
+
                } else {
                        attr->a_nvals = attr->a_vals;
                }
@@ -723,6 +928,9 @@ meta_send_entry(
                attr = ent.e_attrs;
                ent.e_attrs = attr->a_next;
                if ( attr->a_vals != &slap_dummy_bv ) {
+                       if ( attr->a_nvals != attr->a_vals ) {
+                               ber_bvarray_free( attr->a_nvals );
+                       }
                        ber_bvarray_free( attr->a_vals );
                }
                free( attr );
@@ -738,4 +946,3 @@ meta_send_entry(
        return LDAP_SUCCESS;
 }
 
-
index 40350141c9db3570b59056c68b2332c6af269ad3..71f80f7616ab84149a34c2a0e5f346f2bf6057bc 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <ac/socket.h>
 #include <ac/string.h>
+#include <ac/errno.h>
 
 #include "slap.h"
 #include "../back-ldap/back-ldap.h"
 
 int
 meta_back_conn_destroy(
-               Backend         *be,
-               Connection      *conn
-)
+       Backend         *be,
+       Connection      *conn )
 {
-       struct metainfo *li = ( struct metainfo * )be->be_private;
-       struct metaconn *lc,
-                       lc_curr = { 0 };
+       metainfo_t      *mi = ( metainfo_t * )be->be_private;
+       metaconn_t *mc,
+                       mc_curr = { 0 };
 
        Debug( LDAP_DEBUG_TRACE,
                "=>meta_back_conn_destroy: fetching conn %ld\n",
                conn->c_connid, 0, 0 );
        
-       lc_curr.mc_conn = conn;
+       mc_curr.mc_conn = conn;
        
-       ldap_pvt_thread_mutex_lock( &li->conn_mutex );
-       lc = avl_delete( &li->conntree, ( caddr_t )&lc_curr,
+       ldap_pvt_thread_mutex_lock( &mi->mi_conn_mutex );
+       mc = avl_delete( &mi->mi_conntree, ( caddr_t )&mc_curr,
                        meta_back_conn_cmp );
-       ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
+       ldap_pvt_thread_mutex_unlock( &mi->mi_conn_mutex );
+
+       if ( mc ) {
+               int     i;
 
-       if ( lc ) {
-               int i;
-               
                Debug( LDAP_DEBUG_TRACE,
                        "=>meta_back_conn_destroy: destroying conn %ld\n",
-                       lc->mc_conn->c_connid, 0, 0 );
+                       mc->mc_conn->c_connid, 0, 0 );
                
                /*
                 * Cleanup rewrite session
                 */
-               for ( i = 0; i < li->ntargets; ++i ) {
-                       if ( lc->mc_conns[ i ].msc_ld == NULL ) {
+               for ( i = 0; i < mi->mi_ntargets; ++i ) {
+                       if ( mc->mc_conns[ i ].msc_ld == NULL ) {
                                continue;
                        }
 
-                       rewrite_session_delete( li->targets[ i ]->mt_rwmap.rwm_rw, conn );
-                       meta_clear_one_candidate( &lc->mc_conns[ i ], 1 );
+                       rewrite_session_delete( mi->mi_targets[ i ]->mt_rwmap.rwm_rw, conn );
+                       meta_clear_one_candidate( &mc->mc_conns[ i ] );
                }
-
-               free( lc->mc_conns );
-               free( lc );
+               meta_back_conn_free( mc );
        }
 
        /* no response to unbind */
index dc7d4cf2fb20bfff137ca28a232dfc8012c77de4..4f44291adc440fbabe44821659f23b6f3b5127ea 100644 (file)
@@ -33,10 +33,16 @@ LDAP_BEGIN_DECL
 #undef MONITOR_DEFINE_LABELEDURI
 
 typedef struct monitor_callback_t {
-       int                     (*mc_update)( Operation *op, Entry *e, void *priv );
+       int                             (*mc_update)( Operation *op, SlapReply *rs, Entry *e, void *priv );
                                                /* update callback
                                                   for user-defined entries */
-       void                    *mc_private;    /* opaque pointer to
+       int                             (*mc_modify)( Operation *op, SlapReply *rs, Entry *e, void *priv );
+                                               /* modify callback
+                                                  for user-defined entries */
+       int                             (*mc_free)( Entry *e, void *priv );
+                                               /* update callback
+                                                  for user-defined entries */
+       void                            *mc_private;    /* opaque pointer to
                                                   private data */
        struct monitor_callback_t       *mc_next;
 } monitor_callback_t;
@@ -75,7 +81,6 @@ typedef struct monitor_info_t {
        /*
         * Config parameters
         */
-       struct berval           mi_l;
        struct berval           mi_startTime;           /* don't free it! */
        struct berval           mi_creatorsName;        /* don't free it! */
 
@@ -102,17 +107,23 @@ typedef struct monitor_info_t {
        AttributeDescription    *mi_ad_monitorConnectionPeerAddress;
        AttributeDescription    *mi_ad_monitorTimestamp;
        AttributeDescription    *mi_ad_monitorOverlay;
+       AttributeDescription    *mi_ad_monitorConnectionProtocol;
+       AttributeDescription    *mi_ad_monitorConnectionOpsReceived;
+       AttributeDescription    *mi_ad_monitorConnectionOpsExecuting;
+       AttributeDescription    *mi_ad_monitorConnectionOpsPending;
+       AttributeDescription    *mi_ad_monitorConnectionOpsCompleted;
+       AttributeDescription    *mi_ad_monitorConnectionGet;
+       AttributeDescription    *mi_ad_monitorConnectionRead;
+       AttributeDescription    *mi_ad_monitorConnectionWrite;
+       AttributeDescription    *mi_ad_monitorConnectionMask;
+       AttributeDescription    *mi_ad_monitorConnectionListener;
+       AttributeDescription    *mi_ad_monitorConnectionPeerDomain;
+       AttributeDescription    *mi_ad_monitorConnectionStartTime;
+       AttributeDescription    *mi_ad_monitorConnectionActivityTime;
 
        /*
         * Generic description attribute
         */
-       AttributeDescription    *mi_ad_description;
-       AttributeDescription    *mi_ad_seeAlso;
-       AttributeDescription    *mi_ad_l;
-#ifdef MONITOR_DEFINE_LABELEDURI
-       /* enable if si_ad_labeledURI is removed from slap_schema */
-       AttributeDescription    *mi_ad_labeledURI;
-#endif /* MONITOR_DEFINE_LABELEDURI */
        AttributeDescription    *mi_ad_readOnly;
        AttributeDescription    *mi_ad_restrictedOperation;
 
@@ -226,6 +237,7 @@ typedef struct monitor_subsys_t {
        struct berval   mss_rdn;
        struct berval   mss_dn;
        struct berval   mss_ndn;
+       struct berval   mss_desc[ 3 ];
        int             mss_flags;
 #define MONITOR_F_OPENED       0x10000000U
 
@@ -237,18 +249,18 @@ typedef struct monitor_subsys_t {
        /* initialize entry and subentries */
        int             ( *mss_open )( BackendDB *, struct monitor_subsys_t *ms );
        /* update existing dynamic entry and subentries */
-       int             ( *mss_update )( Operation *, Entry * );
+       int             ( *mss_update )( Operation *, SlapReply *, Entry * );
        /* create new dynamic subentries */
-       int             ( *mss_create )( Operation *,
+       int             ( *mss_create )( Operation *, SlapReply *,
                                struct berval *ndn, Entry *, Entry ** );
        /* modify entry and subentries */
-       int             ( *mss_modify )( Operation *, Entry * );
+       int             ( *mss_modify )( Operation *, SlapReply *, Entry * );
 } monitor_subsys_t;
 
 extern BackendDB *be_monitor;
 
 /* increase this bufsize if entries in string form get too big */
-#define BACKMONITOR_BUFSIZE    1024
+#define BACKMONITOR_BUFSIZE    8192
 
 LDAP_END_DECL
 
index d21582179102b764b365c610a81afb0f8b72abc4..976b68a5eb103a9481bbba5867e638673f248893 100644 (file)
@@ -42,6 +42,7 @@ monitor_subsys_backend_init(
        int                     i;
        monitor_entry_t         *mp;
        monitor_subsys_t        *ms_database;
+       BackendInfo                     *bi;
 
        mi = ( monitor_info_t * )be->be_private;
 
@@ -69,14 +70,15 @@ monitor_subsys_backend_init(
        mp->mp_children = NULL;
        ep = &mp->mp_children;
 
-       for ( i = 0; i < nBackendInfo; i++ ) {
+       i = -1;
+       LDAP_STAILQ_FOREACH( bi, &backendInfo, bi_next ) {
                char            buf[ BACKMONITOR_BUFSIZE ];
-               BackendInfo     *bi;
+               BackendDB               *be;
                struct berval   bv;
                int             j;
                Entry           *e;
 
-               bi = &backendInfo[ i ];
+               i++;
 
                snprintf( buf, sizeof( buf ),
                                "dn: cn=Backend %d,%s\n"
@@ -106,9 +108,7 @@ monitor_subsys_backend_init(
                        return( -1 );
                }
                
-               bv.bv_val = bi->bi_type;
-               bv.bv_len = strlen( bv.bv_val );
-
+               ber_str2bv( bi->bi_type, 0, 0, &bv );
                attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
                                &bv, NULL );
                attr_merge_normalize_one( e_backend, mi->mi_ad_monitoredInfo,
@@ -118,27 +118,28 @@ monitor_subsys_backend_init(
                        int j;
 
                        for ( j = 0; bi->bi_controls[ j ]; j++ ) {
-                               bv.bv_val = bi->bi_controls[ j ];
-                               bv.bv_len = strlen( bv.bv_val );
-                               attr_merge_one( e, slap_schema.si_ad_supportedControl, &bv, NULL );
+                               ber_str2bv( bi->bi_controls[ j ], 0, 0, &bv );
+                               attr_merge_one( e, slap_schema.si_ad_supportedControl,
+                                               &bv, &bv );
                        }
                }
 
-               for ( j = 0; j < nBackendDB; j++ ) {
-                       BackendDB       *be = &backendDB[ j ];
+               j = -1;
+               LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
                        char            buf[ SLAP_LDAPDN_MAXLEN ];
                        struct berval   dn;
                        
+                       j++;
+
                        if ( be->bd_info != bi ) {
                                continue;
                        }
 
                        snprintf( buf, sizeof( buf ), "cn=Database %d,%s",
                                        j, ms_database->mss_dn.bv_val );
-                       dn.bv_val = buf;
-                       dn.bv_len = strlen( buf );
 
-                       attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
+                       ber_str2bv( buf, 0, 0, &dn );
+                       attr_merge_normalize_one( e, slap_schema.si_ad_seeAlso,
                                        &dn, NULL );
                }
                
index ddb73decd905b8c4e19b843db5f8f70d4467215d..75ea2373b2c3c512de3ecf4d62cd216c3814159d 100644 (file)
 int
 monitor_back_bind( Operation *op, SlapReply *rs )
 {
-#if 0  /* not used yet */
-       monitor_info_t  *mi
-               = (monitor_info_t *) op->o_bd->be_private;
-#endif
-
        Debug(LDAP_DEBUG_ARGS, "==> monitor_back_bind: dn: %s\n", 
                        op->o_req_dn.bv_val, 0, 0 );
        
        if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE 
-                       && be_isroot_pw( op ) ) {
+                       && be_isroot_pw( op ) )
+       {
                ber_dupbv( &op->oq_bind.rb_edn, be_root_dn( op->o_bd ) );
-               return( 0 );
+               return LDAP_SUCCESS;
        }
 
        rs->sr_err = LDAP_INVALID_CREDENTIALS;
        send_ldap_result( op, rs );
 
-       return( 1 );
+       return rs->sr_err;
 }
 
index db827438c6f08f78954e6462d56a6514e7d9b4e0..8a48d9efae0d32abeb4ee030954c3ccb087fabf2 100644 (file)
@@ -170,6 +170,7 @@ monitor_cache_get(
 int
 monitor_cache_dn2entry(
                Operation               *op,
+               SlapReply               *rs,
                struct berval           *ndn,
                Entry                   **ep,
                Entry                   **matched
@@ -205,7 +206,7 @@ monitor_cache_dn2entry(
                dnParent( ndn, &p_ndn );
        }
 
-       rc = monitor_cache_dn2entry( op, &p_ndn, &e_parent, matched );
+       rc = monitor_cache_dn2entry( op, rs, &p_ndn, &e_parent, matched );
        if ( rc || e_parent == NULL ) {
                return( -1 );
        }
@@ -214,7 +215,7 @@ monitor_cache_dn2entry(
        rc = -1;
        if ( mp->mp_flags & MONITOR_F_VOLATILE_CH ) {
                /* parent entry generates volatile children */
-               rc = monitor_entry_create( op, ndn, e_parent, ep );
+               rc = monitor_entry_create( op, rs, ndn, e_parent, ep );
        }
 
        if ( !rc ) {
index f0264507c775a57fdfce127309f6fbaf55e4dd6b..d752d33040475547f41166b7dd8e6ed92be974e3 100644 (file)
@@ -32,13 +32,24 @@ monitor_back_compare( struct slap_op *op, struct slap_rep *rs)
        monitor_info_t  *mi = ( monitor_info_t * ) op->o_bd->be_private;
        Entry           *e, *matched = NULL;
        Attribute       *a;
+       int             rc;
 
        /* get entry with reader lock */
-       monitor_cache_dn2entry( op, &op->o_req_ndn, &e, &matched );
+       monitor_cache_dn2entry( op, rs, &op->o_req_ndn, &e, &matched );
        if ( e == NULL ) {
                rs->sr_err = LDAP_NO_SUCH_OBJECT;
                if ( matched ) {
-                       rs->sr_matched = matched->e_dn;
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+                       if ( !access_allowed_mask( op, matched,
+                                       slap_schema.si_ad_entry,
+                                       NULL, ACL_DISCLOSE, NULL, NULL ) )
+                       {
+                               /* do nothing */ ;
+                       } else 
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+                       {
+                               rs->sr_matched = matched->e_dn;
+                       }
                }
                send_ldap_result( op, rs );
                if ( matched ) {
@@ -46,7 +57,7 @@ monitor_back_compare( struct slap_op *op, struct slap_rep *rs)
                        rs->sr_matched = NULL;
                }
 
-               return( 0 );
+               return rs->sr_err;
        }
 
        rs->sr_err = access_allowed( op, e, op->oq_compare.rs_ava->aa_desc,
@@ -75,14 +86,32 @@ monitor_back_compare( struct slap_op *op, struct slap_rep *rs)
        }
 
 return_results:;
-       send_ldap_result( op, rs );
-       if ( rs->sr_err == LDAP_COMPARE_FALSE
-                       || rs->sr_err == LDAP_COMPARE_TRUE ) {
-               rs->sr_err = LDAP_SUCCESS;
+       rc = rs->sr_err;
+       switch ( rc ) {
+       case LDAP_COMPARE_FALSE:
+       case LDAP_COMPARE_TRUE:
+               rc = LDAP_SUCCESS;
+               break;
+
+       case LDAP_NO_SUCH_ATTRIBUTE:
+               break;
+
+       default:
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+               if ( !access_allowed_mask( op, e, slap_schema.si_ad_entry,
+                               NULL, ACL_DISCLOSE, NULL, NULL ) )
+               {
+                       rs->sr_err = LDAP_NO_SUCH_OBJECT;
+               }
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+               break;
        }
+               
+       send_ldap_result( op, rs );
+       rs->sr_err = rc;
 
        monitor_cache_release( mi, e );
 
-       return( rs->sr_err );
+       return rs->sr_err;
 }
 
index 40d0a58b91a8121f5901fde17b4f64c9a50093a9..670b015aecd20a160ee6bf8ab2c1f5f16d6aac6f 100644 (file)
 #include "lutil.h"
 #include "back-monitor.h"
 
+#ifndef LDAP_DEVEL
+#define MONITOR_LEGACY_CONN
+#endif
+
 int
 monitor_subsys_conn_init(
        BackendDB               *be,
@@ -86,7 +90,7 @@ monitor_subsys_conn_init(
        }
        
        BER_BVSTR( &bv, "0" );
-       attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
+       attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
        
        mp = monitor_entrypriv_create();
        if ( mp == NULL ) {
@@ -139,7 +143,7 @@ monitor_subsys_conn_init(
        }
        
        BER_BVSTR( &bv, "0" );
-       attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
+       attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
        
        mp = monitor_entrypriv_create();
        if ( mp == NULL ) {
@@ -170,6 +174,7 @@ monitor_subsys_conn_init(
 int
 monitor_subsys_conn_update(
        Operation               *op,
+       SlapReply               *rs,
        Entry                   *e
 )
 {
@@ -221,7 +226,7 @@ monitor_subsys_conn_update(
                /* FIXME: touch modifyTimestamp? */
        }
 
-       return( 0 );
+       return SLAP_CB_CONTINUE;
 }
 
 static int
@@ -233,14 +238,12 @@ conn_create(
 )
 {
        monitor_entry_t *mp;
-       struct tm               *ltm;
-       char                    buf[ BACKMONITOR_BUFSIZE ];
-       char                    buf2[ LDAP_LUTIL_GENTIME_BUFSIZE ];
-       char                    buf3[ LDAP_LUTIL_GENTIME_BUFSIZE ];
-
-       struct berval           bv;
+       struct tm       *ltm;
+       char            buf[ BACKMONITOR_BUFSIZE ];
+       char            buf2[ LDAP_LUTIL_GENTIME_BUFSIZE ];
+       char            buf3[ LDAP_LUTIL_GENTIME_BUFSIZE ];
 
-       Entry                   *e;
+       Entry           *e;
 
        struct tm       *ctm;
        char            ctmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ];
@@ -285,11 +288,76 @@ conn_create(
        ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
 #endif
 
+#ifndef HAVE_GMTIME_R
+       ldap_pvt_thread_mutex_lock( &gmtime_mutex );
+#endif
+
+#ifdef HAVE_GMTIME_R
+       ltm = gmtime_r( &c->c_starttime, &tm_buf );
+#else
+       ltm = gmtime( &c->c_starttime );
+#endif
+       lutil_gentime( buf2, sizeof( buf2 ), ltm );
+
+#ifdef HAVE_GMTIME_R
+       ltm = gmtime_r( &c->c_activitytime, &tm_buf );
+#else
+       ltm = gmtime( &c->c_activitytime );
+#endif
+       lutil_gentime( buf3, sizeof( buf3 ), ltm );
+
+#ifndef HAVE_GMTIME_R
+       ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
+#endif /* HAVE_GMTIME_R */
+
        snprintf( buf, sizeof( buf ),
                "dn: cn=Connection %ld,%s\n"
                "objectClass: %s\n"
                "structuralObjectClass: %s\n"
                "cn: Connection %ld\n"
+
+#ifdef MONITOR_LEGACY_CONN
+               /* NOTE: this will disappear, as the exploded data
+                * has been moved to dedicated attributes */
+               "%s: "
+                       "%ld "
+                       ": %ld "
+                       ": %ld/%ld/%ld/%ld "
+                       ": %ld/%ld/%ld "
+                       ": %s%s%s%s%s%s "
+                       ": %s "
+                       ": %s "
+                       ": %s "
+                       ": %s "
+                       ": %s "
+                       ": %s "
+                       ": %s\n"
+#endif /* MONITOR_LEGACY_CONN */
+
+               "%s: %lu\n"
+               "%s: %ld\n"
+
+               "%s: %ld\n"
+               "%s: %ld\n"
+               "%s: %ld\n"
+               "%s: %ld\n"
+
+               "%s: %ld\n"
+               "%s: %ld\n"
+               "%s: %ld\n"
+
+               "%s: %s%s%s%s%s%s\n"
+
+               "%s: %s\n"
+
+               "%s: %s\n"
+               "%s: %s\n"
+               "%s: %s\n"
+               "%s: %s\n"
+
+               "%s: %s\n"
+               "%s: %s\n"
+
                "creatorsName: %s\n"
                "modifiersName: %s\n"
                "createTimestamp: %s\n"
@@ -298,6 +366,81 @@ conn_create(
                mi->mi_oc_monitorConnection->soc_cname.bv_val,
                mi->mi_oc_monitorConnection->soc_cname.bv_val,
                c->c_connid,
+
+#ifdef MONITOR_LEGACY_CONN
+               mi->mi_ad_monitoredInfo->ad_cname.bv_val,
+                       c->c_connid,
+                       (long) c->c_protocol,
+                       c->c_n_ops_received, c->c_n_ops_executing,
+                               c->c_n_ops_pending, c->c_n_ops_completed,
+                       
+                       /* add low-level counters here */
+                       c->c_n_get, c->c_n_read, c->c_n_write,
+                       
+                       c->c_currentber ? "r" : "",
+                       c->c_writewaiter ? "w" : "",
+                       LDAP_STAILQ_EMPTY( &c->c_ops ) ? "" : "x",
+                       LDAP_STAILQ_EMPTY( &c->c_pending_ops ) ? "" : "p",
+                       connection_state2str( c->c_conn_state ),
+                       c->c_sasl_bind_in_progress ? "S" : "",
+                       
+                       c->c_dn.bv_len ? c->c_dn.bv_val : SLAPD_ANONYMOUS,
+                       
+                       c->c_listener_url.bv_val,
+                       c->c_peer_domain.bv_val,
+                       c->c_peer_name.bv_val,
+                       c->c_sock_name.bv_val,
+                       
+                       buf2,
+                       buf3,
+#endif /* MONITOR_LEGACY_CONN */
+
+               mi->mi_ad_monitorConnectionNumber->ad_cname.bv_val,
+                       c->c_connid,
+               mi->mi_ad_monitorConnectionProtocol->ad_cname.bv_val,
+                       (long)c->c_protocol,
+
+               mi->mi_ad_monitorConnectionOpsReceived->ad_cname.bv_val,
+                       c->c_n_ops_received,
+               mi->mi_ad_monitorConnectionOpsExecuting->ad_cname.bv_val,
+                       c->c_n_ops_executing,
+               mi->mi_ad_monitorConnectionOpsPending->ad_cname.bv_val,
+                       c->c_n_ops_pending,
+               mi->mi_ad_monitorConnectionOpsCompleted->ad_cname.bv_val,
+                       c->c_n_ops_completed,
+
+               mi->mi_ad_monitorConnectionGet->ad_cname.bv_val,
+                       c->c_n_get,
+               mi->mi_ad_monitorConnectionRead->ad_cname.bv_val,
+                       c->c_n_read,
+               mi->mi_ad_monitorConnectionWrite->ad_cname.bv_val,
+                       c->c_n_write,
+
+               mi->mi_ad_monitorConnectionMask->ad_cname.bv_val,
+                       c->c_currentber ? "r" : "",
+                       c->c_writewaiter ? "w" : "",
+                       LDAP_STAILQ_EMPTY( &c->c_ops ) ? "" : "x",
+                       LDAP_STAILQ_EMPTY( &c->c_pending_ops ) ? "" : "p",
+                       connection_state2str( c->c_conn_state ),
+                       c->c_sasl_bind_in_progress ? "S" : "",
+               
+               mi->mi_ad_monitorConnectionAuthzDN->ad_cname.bv_val,
+                       c->c_dn.bv_len ? c->c_dn.bv_val : SLAPD_ANONYMOUS,
+
+               mi->mi_ad_monitorConnectionListener->ad_cname.bv_val,
+                       c->c_listener_url.bv_val,
+               mi->mi_ad_monitorConnectionPeerDomain->ad_cname.bv_val,
+                       c->c_peer_domain.bv_val,
+               mi->mi_ad_monitorConnectionLocalAddress->ad_cname.bv_val,
+                       c->c_peer_name.bv_val,
+               mi->mi_ad_monitorConnectionPeerAddress->ad_cname.bv_val,
+                       c->c_sock_name.bv_val,
+
+               mi->mi_ad_monitorConnectionStartTime->ad_cname.bv_val,
+                       buf2,
+               mi->mi_ad_monitorConnectionActivityTime->ad_cname.bv_val,
+                       buf3,
+
                mi->mi_creatorsName.bv_val,
                mi->mi_creatorsName.bv_val,
                ctmbuf,
@@ -315,93 +458,9 @@ conn_create(
                return( -1 );
        }
 
-#ifndef HAVE_GMTIME_R
-       ldap_pvt_thread_mutex_lock( &gmtime_mutex );
-#endif
-
-#ifdef HAVE_GMTIME_R
-       ltm = gmtime_r( &c->c_starttime, &tm_buf );
-#else
-       ltm = gmtime( &c->c_starttime );
-#endif
-       lutil_gentime( buf2, sizeof( buf2 ), ltm );
-
-#ifdef HAVE_GMTIME_R
-       ltm = gmtime_r( &c->c_activitytime, &tm_buf );
-#else
-       ltm = gmtime( &c->c_activitytime );
-#endif
-       lutil_gentime( buf3, sizeof( buf3 ), ltm );
-
-#ifndef HAVE_GMTIME_R
-       ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
-#endif /* HAVE_GMTIME_R */
-
-       /* monitored info */
-       sprintf( buf,
-               "%ld "
-               ": %ld "
-               ": %ld/%ld/%ld/%ld "
-               ": %ld/%ld/%ld "
-               ": %s%s%s%s%s%s "
-               ": %s "
-               ": %s "
-               ": %s "
-               ": %s "
-               ": %s "
-               ": %s "
-               ": %s",
-               c->c_connid,
-               (long) c->c_protocol,
-               c->c_n_ops_received, c->c_n_ops_executing,
-                       c->c_n_ops_pending, c->c_n_ops_completed,
-               
-               /* add low-level counters here */
-               c->c_n_get, c->c_n_read, c->c_n_write,
-               
-               c->c_currentber ? "r" : "",
-               c->c_writewaiter ? "w" : "",
-               LDAP_STAILQ_EMPTY( &c->c_ops ) ? "" : "x",
-               LDAP_STAILQ_EMPTY( &c->c_pending_ops ) ? "" : "p",
-               connection_state2str( c->c_conn_state ),
-               c->c_sasl_bind_in_progress ? "S" : "",
-               
-               c->c_dn.bv_len ? c->c_dn.bv_val : SLAPD_ANONYMOUS,
-               
-               c->c_listener_url.bv_val,
-               c->c_peer_domain.bv_val,
-               c->c_peer_name.bv_val,
-               c->c_sock_name.bv_val,
-               
-               buf2,
-               buf3
-               );
-
-       bv.bv_val = buf;
-       bv.bv_len = strlen( buf );
-       attr_merge_one( e, mi->mi_ad_monitoredInfo, &bv, NULL );
-
-       /* connection number */
-       snprintf( buf, sizeof( buf ), "%ld", c->c_connid );
-       bv.bv_val = buf;
-       bv.bv_len = strlen( buf );
-       attr_merge_one( e, mi->mi_ad_monitorConnectionNumber, &bv, NULL );
-
-       /* authz DN */
-       attr_merge_one( e, mi->mi_ad_monitorConnectionAuthzDN,
-                       &c->c_dn, &c->c_ndn );
-
-       /* local address */
-       attr_merge_one( e, mi->mi_ad_monitorConnectionLocalAddress,
-                       &c->c_sock_name, NULL );
-
-       /* peer address */
-       attr_merge_one( e, mi->mi_ad_monitorConnectionPeerAddress,
-                       &c->c_peer_name, NULL );
-
        mp = monitor_entrypriv_create();
        if ( mp == NULL ) {
-               return -1;
+               return LDAP_OTHER;
        }
        e->e_private = ( void * )mp;
        mp->mp_info = ms;
@@ -409,12 +468,13 @@ conn_create(
 
        *ep = e;
 
-       return( 0 );
+       return SLAP_CB_CONTINUE;
 }
 
 int 
 monitor_subsys_conn_create( 
        Operation               *op,
+       SlapReply               *rs,
        struct berval           *ndn,
        Entry                   *e_parent,
        Entry                   **ep
@@ -425,7 +485,7 @@ monitor_subsys_conn_create(
        Connection              *c;
        int                     connindex;
        monitor_entry_t         *mp;
-       int                     rc = 0;
+       int                     rc = SLAP_CB_CONTINUE;
        monitor_subsys_t        *ms;
 
        assert( mi != NULL );
@@ -456,7 +516,7 @@ monitor_subsys_conn_create(
 
                                        e_tmp = e;
                                }
-                               rc = -1;
+                               rc = rs->sr_err = LDAP_OTHER;
                                break;
                        }
                        mp = ( monitor_entry_t * )e->e_private;
@@ -484,22 +544,27 @@ monitor_subsys_conn_create(
                
                connid = strtol( &ndn->bv_val[ nconn_bv.bv_len ], &next, 10 );
                if ( next[ 0 ] != ',' ) {
-                       return -1;
+                       return ( rs->sr_err = LDAP_OTHER );
                }
 
                for ( c = connection_first( &connindex );
                                c != NULL;
-                               c = connection_next( c, &connindex )) {
+                               c = connection_next( c, &connindex ) )
+               {
                        if ( c->c_connid == connid ) {
-                               if ( conn_create( mi, c, ep, ms ) || *ep == NULL ) {
-                                       rc = -1;
+                               rc = conn_create( mi, c, ep, ms );
+                               if ( rc != SLAP_CB_CONTINUE ) {
+                                       rs->sr_err = rc;
+
+                               } else if ( *ep == NULL ) {
+                                       rc = rs->sr_err = LDAP_OTHER;
                                }
 
                                break;
                        }
                }
                
-               connection_done(c);
+               connection_done( c );
        }
 
        return rc;
index 5acedec8ca62d38c332a522293caba376e9d25bf..f6f58134d4f43bd4cf0547b1d25dffc2badc7929 100644 (file)
@@ -81,7 +81,7 @@ init_readOnly( monitor_info_t *mi, Entry *e, slap_mask_t restrictops )
        struct berval   *tf = ( ( restrictops & SLAP_RESTRICT_OP_MASK ) == SLAP_RESTRICT_OP_WRITES ) ?
                (struct berval *)&slap_true_bv : (struct berval *)&slap_false_bv;
 
-       return attr_merge_one( e, mi->mi_ad_readOnly, tf, NULL );
+       return attr_merge_one( e, mi->mi_ad_readOnly, tf, tf );
 }
 
 static int
@@ -92,7 +92,8 @@ init_restrictedOperation( monitor_info_t *mi, Entry *e, slap_mask_t restrictops
        for ( i = 0; restricted_ops[ i ].op.bv_val; i++ ) {
                if ( restrictops & restricted_ops[ i ].tag ) {
                        rc = attr_merge_one( e, mi->mi_ad_restrictedOperation,
-                                       &restricted_ops[ i ].op, NULL );
+                                       &restricted_ops[ i ].op,
+                                       &restricted_ops[ i ].op );
                        if ( rc ) {
                                return rc;
                        }
@@ -102,7 +103,8 @@ init_restrictedOperation( monitor_info_t *mi, Entry *e, slap_mask_t restrictops
        for ( i = 0; restricted_exops[ i ].op.bv_val; i++ ) {
                if ( restrictops & restricted_exops[ i ].tag ) {
                        rc = attr_merge_one( e, mi->mi_ad_restrictedOperation,
-                                       &restricted_exops[ i ].op, NULL );
+                                       &restricted_exops[ i ].op,
+                                       &restricted_exops[ i ].op );
                        if ( rc ) {
                                return rc;
                        }
@@ -166,14 +168,15 @@ monitor_subsys_database_init(
        mp->mp_children = NULL;
        ep = &mp->mp_children;
 
-       for ( i = 0; i < nBackendDB; i++ ) {
+       i = -1;
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
                char            buf[ BACKMONITOR_BUFSIZE ];
                int             j;
                slap_overinfo   *oi = NULL;
-               BackendInfo     *bi;
+               BackendInfo     *bi, *bi2;
                Entry           *e;
 
-               be = &backendDB[ i ];
+               i++;
 
                bi = be->bd_info;
 
@@ -192,7 +195,6 @@ monitor_subsys_database_init(
                                "objectClass: %s\n"
                                "structuralObjectClass: %s\n"
                                "cn: Database %d\n"
-                               "description: This object contains the type of the database.\n"
                                "%s: %s\n"
                                "creatorsName: %s\n"
                                "modifiersName: %s\n"
@@ -226,6 +228,13 @@ monitor_subsys_database_init(
                                        be->be_suffix, be->be_nsuffix );
 
                } else {
+                       if ( be->be_suffix == NULL ) {
+                               Debug( LDAP_DEBUG_ANY,
+                                       "monitor_subsys_database_init: "
+                                       "missing suffix for database %d\n",
+                                       i, 0, 0 );
+                               return -1;
+                       }
                        attr_merge( e, slap_schema.si_ad_namingContexts,
                                        be->be_suffix, be->be_nsuffix );
                        attr_merge( e_database, slap_schema.si_ad_namingContexts,
@@ -253,8 +262,7 @@ monitor_subsys_database_init(
                                        break;
                                }
                                
-                               bv.bv_val = on->on_bi.bi_type;
-                               bv.bv_len = strlen( bv.bv_val );
+                               ber_str2bv( on->on_bi.bi_type, 0, 0, &bv );
                                attr_merge_normalize_one( e, mi->mi_ad_monitorOverlay,
                                                &bv, NULL );
 
@@ -269,9 +277,9 @@ monitor_subsys_database_init(
                                snprintf( buf, sizeof( buf ), 
                                        "cn=Overlay %d,%s", 
                                        j, ms_overlay->mss_dn.bv_val );
-                               bv.bv_val = buf;
-                               bv.bv_len = strlen( buf );
-                               attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
+                               ber_str2bv( buf, 0, 0, &bv );
+                               attr_merge_normalize_one( e,
+                                               slap_schema.si_ad_seeAlso,
                                                &bv, NULL );
                        }
                }
@@ -356,8 +364,10 @@ monitor_subsys_database_init(
                }
 #endif /* defined(SLAPD_LDAP) */
 
-               for ( j = 0; j < nBackendInfo; j++ ) {
-                       if ( backendInfo[ j ].bi_type == bi->bi_type ) {
+               j = -1;
+               LDAP_STAILQ_FOREACH( bi2, &backendInfo, bi_next ) {
+                       j++;
+                       if ( bi2->bi_type == bi->bi_type ) {
                                struct berval           bv;
 
                                snprintf( buf, sizeof( buf ), 
@@ -365,7 +375,8 @@ monitor_subsys_database_init(
                                        j, ms_backend->mss_dn.bv_val );
                                bv.bv_val = buf;
                                bv.bv_len = strlen( buf );
-                               attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
+                               attr_merge_normalize_one( e,
+                                               slap_schema.si_ad_seeAlso,
                                                &bv, NULL );
                                break;
                        }
@@ -417,7 +428,6 @@ monitor_subsys_database_init(
                                                "objectClass: %s\n"
                                                "structuralObjectClass: %s\n"
                                                "cn: Overlay %d\n"
-                                               "description: This object contains the type of the overlay.\n"
                                                "%s: %s\n"
                                                "seeAlso: cn=Overlay %d,%s\n"
                                                "creatorsName: %s\n"
@@ -530,13 +540,13 @@ value_mask( BerVarray v, slap_mask_t cur, slap_mask_t *delta )
 int
 monitor_subsys_database_modify(
        Operation       *op,
+       SlapReply       *rs,
        Entry           *e
 )
 {
        monitor_info_t  *mi = (monitor_info_t *)op->o_bd->be_private;
        int             rc = LDAP_OTHER;
        Attribute       *save_attrs, *a;
-       Modifications   *modlist = op->oq_modify.rs_modlist;
        Modifications   *ml;
        Backend         *be;
        int             ro_gotval = 1, i, n;
@@ -544,23 +554,33 @@ monitor_subsys_database_modify(
        struct berval   *tf;
        
        i = sscanf( e->e_nname.bv_val, "cn=database %d,", &n );
-       if ( i != 1 )
-               return LDAP_UNWILLING_TO_PERFORM;
+       if ( i != 1 ) {
+               return SLAP_CB_CONTINUE;
+       }
 
-       if ( n < 0 || n >= nBackendDB )
-               return LDAP_NO_SUCH_OBJECT;
+       if ( n < 0 || n >= nBackendDB ) {
+               rs->sr_text = "invalid database index";
+               return ( rs->sr_err = LDAP_NO_SUCH_OBJECT );
+       }
 
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+               if ( n == 0 ) {
+                       break;
+               }
+               n--;
+       }
        /* do not allow some changes on back-monitor (needs work)... */
-       be = &backendDB[ n ];
-       if ( SLAP_MONITOR( be ) )
-               return LDAP_UNWILLING_TO_PERFORM;
+       if ( SLAP_MONITOR( be ) ) {
+               rs->sr_text = "no modifications allowed to monitor database entry";
+               return ( rs->sr_err = LDAP_UNWILLING_TO_PERFORM );
+       }
                
        rp_cur = be->be_restrictops;
 
        save_attrs = e->e_attrs;
        e->e_attrs = attrs_dup( e->e_attrs );
 
-       for ( ml=modlist; ml; ml=ml->sml_next ) {
+       for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
                Modification *mod = &ml->sml_mod;
 
                if ( mod->sm_desc == mi->mi_ad_readOnly ) {
@@ -568,7 +588,8 @@ monitor_subsys_database_modify(
 
                        if ( mod->sm_values ) {
                                if ( !BER_BVISNULL( &mod->sm_values[ 1 ] ) ) {
-                                       rc = LDAP_CONSTRAINT_VIOLATION;
+                                       rs->sr_text = "attempting to modify multiple values of single-valued attribute";
+                                       rc = rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
                                        goto done;
                                }
 
@@ -579,7 +600,8 @@ monitor_subsys_database_modify(
                                        val = 0;
 
                                } else {
-                                       rc = LDAP_INVALID_SYNTAX;
+                                       assert( 0 );
+                                       rc = rs->sr_err = LDAP_INVALID_SYNTAX;
                                        goto done;
                                }
                        }
@@ -587,18 +609,18 @@ monitor_subsys_database_modify(
                        switch ( mod->sm_op ) {
                        case LDAP_MOD_DELETE:
                                if ( ro_gotval < 1 ) {
-                                       rc = LDAP_CONSTRAINT_VIOLATION;
+                                       rc = rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
                                        goto done;
                                }
                                ro_gotval--;
 
                                if ( val == 0 && ( rp_cur & SLAP_RESTRICT_OP_WRITES ) == SLAP_RESTRICT_OP_WRITES ) {
-                                       rc = LDAP_NO_SUCH_ATTRIBUTE;
+                                       rc = rs->sr_err = LDAP_NO_SUCH_ATTRIBUTE;
                                        goto done;
                                }
                                
                                if ( val == 1 && ( rp_cur & SLAP_RESTRICT_OP_WRITES ) != SLAP_RESTRICT_OP_WRITES ) {
-                                       rc = LDAP_NO_SUCH_ATTRIBUTE;
+                                       rc = rs->sr_err = LDAP_NO_SUCH_ATTRIBUTE;
                                        goto done;
                                }
                                
@@ -610,7 +632,7 @@ monitor_subsys_database_modify(
 
                        case LDAP_MOD_ADD:
                                if ( ro_gotval > 0 ) {
-                                       rc = LDAP_CONSTRAINT_VIOLATION;
+                                       rc = rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
                                        goto done;
                                }
                                ro_gotval++;
@@ -628,7 +650,7 @@ monitor_subsys_database_modify(
                                break;
 
                        default:
-                               rc = LDAP_OTHER;
+                               rc = rs->sr_err = LDAP_OTHER;
                                goto done;
                        }
 
@@ -668,12 +690,12 @@ monitor_subsys_database_modify(
                                        rp_delete &= ~mask;
 
                                } else if ( rc == LDAP_OTHER ) {
-                                       rc = LDAP_TYPE_OR_VALUE_EXISTS;
+                                       rc = rs->sr_err = LDAP_TYPE_OR_VALUE_EXISTS;
                                }
                                break;
 
                        default:
-                               rc = LDAP_OTHER;
+                               rc = rs->sr_err = LDAP_OTHER;
                                break;
                        }
 
@@ -687,29 +709,29 @@ monitor_subsys_database_modify(
                        rc = attr_merge( e, mod->sm_desc, mod->sm_values,
                                mod->sm_nvalues );
                        if ( rc ) {
-                               rc = LDAP_OTHER;
+                               rc = rs->sr_err = LDAP_OTHER;
                                break;
                        }
 
                } else {
-                       rc = LDAP_UNWILLING_TO_PERFORM;
+                       rc = rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
                        break;
                }
        }
 
        /* sanity checks: */
        if ( ro_gotval < 1 ) {
-               rc = LDAP_CONSTRAINT_VIOLATION;
+               rc = rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
                goto done;
        }
 
        if ( ( rp_cur & SLAP_RESTRICT_OP_EXTENDED ) && ( rp_cur & SLAP_RESTRICT_EXOP_MASK ) ) {
-               rc = LDAP_CONSTRAINT_VIOLATION;
+               rc = rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
                goto done;
        }
 
        if ( rp_delete & rp_add ) {
-               rc = LDAP_OTHER;
+               rc = rs->sr_err = LDAP_OTHER;
                goto done;
        }
 
@@ -729,7 +751,7 @@ monitor_subsys_database_modify(
 
        if ( !bvmatch( &a->a_vals[ 0 ], tf ) ) {
                attr_delete( &e->e_attrs, mi->mi_ad_readOnly );
-               rc = attr_merge_one( e, mi->mi_ad_readOnly, tf, NULL );
+               rc = attr_merge_one( e, mi->mi_ad_readOnly, tf, tf );
        }
 
        if ( rc == LDAP_SUCCESS ) {
@@ -740,7 +762,7 @@ monitor_subsys_database_modify(
                        } else {
                                a = attr_find( e->e_attrs, mi->mi_ad_restrictedOperation );
                                if ( a == NULL ) {
-                                       rc = LDAP_OTHER;
+                                       rc = rs->sr_err = LDAP_OTHER;
                                        goto done;
                                }
 
@@ -800,14 +822,16 @@ monitor_subsys_database_modify(
                        for ( i = 0; !BER_BVISNULL( &restricted_ops[ i ].op ); i++ ) {
                                if ( rp_add & restricted_ops[ i ].tag ) {
                                        attr_merge_one( e, mi->mi_ad_restrictedOperation,
-                                                       &restricted_ops[ i ].op, NULL );
+                                                       &restricted_ops[ i ].op,
+                                                       &restricted_ops[ i ].op );
                                }
                        }
 
                        for ( i = 0; !BER_BVISNULL( &restricted_exops[ i ].op ); i++ ) {
                                if ( rp_add & restricted_exops[ i ].tag ) {
                                        attr_merge_one( e, mi->mi_ad_restrictedOperation,
-                                                       &restricted_exops[ i ].op, NULL );
+                                                       &restricted_exops[ i ].op,
+                                                       &restricted_exops[ i ].op );
                                }
                        }
                }
@@ -818,6 +842,7 @@ monitor_subsys_database_modify(
 done:;
        if ( rc == LDAP_SUCCESS ) {
                attrs_free( save_attrs );
+               rc = SLAP_CB_CONTINUE;
 
        } else {
                Attribute *tmp = e->e_attrs;
@@ -865,8 +890,7 @@ monitor_back_add_plugin( monitor_info_t *mi, Backend *be, Entry *e_database )
                                srchdesc->spd_version,
                                srchdesc->spd_description );
 
-               bv.bv_val = buf;
-               bv.bv_len = strlen( buf );
+               ber_str2bv( buf, 0, 0, &bv );
                attr_merge_normalize_one( e_database,
                                mi->mi_ad_monitoredInfo, &bv, NULL );
 
index 3c2b4ebf1c793b217cffae1f9c5d4cc4d253dbb3..aa8cfc0a0dc6276d945c8525cf0559d0301a7b17 100644 (file)
 int
 monitor_entry_update(
        Operation               *op,
+       SlapReply               *rs,
        Entry                   *e
 )
 {
        monitor_info_t  *mi = ( monitor_info_t * )op->o_bd->be_private;
        monitor_entry_t *mp;
-       int                     rc = 0;
+
+       int             rc = SLAP_CB_CONTINUE;
 
        assert( mi != NULL );
        assert( e != NULL );
@@ -41,34 +43,42 @@ monitor_entry_update(
        mp = ( monitor_entry_t * )e->e_private;
 
        if ( mp->mp_info && mp->mp_info->mss_update ) {
-               rc = ( *mp->mp_info->mss_update )( op, e );
+               rc = mp->mp_info->mss_update( op, rs, e );
        }
 
-       if ( rc == 0 && mp->mp_cb ) {
+       if ( rc == SLAP_CB_CONTINUE && mp->mp_cb ) {
                struct monitor_callback_t       *mc;
 
                for ( mc = mp->mp_cb; mc; mc = mc->mc_next ) {
-                       rc = ( *mc->mc_update )( op, e, mc->mc_private );
-                       if ( rc != 0 ) {
-                               break;
+                       if ( mc->mc_update ) {
+                               rc = mc->mc_update( op, rs, e, mc->mc_private );
+                               if ( rc != SLAP_CB_CONTINUE ) {
+                                       break;
+                               }
                        }
                }
        }
 
+       if ( rc == SLAP_CB_CONTINUE ) {
+               rc = LDAP_SUCCESS;
+       }
+
        return rc;
 }
 
 int
 monitor_entry_create(
        Operation               *op,
+       SlapReply               *rs,
        struct berval           *ndn,
        Entry                   *e_parent,
-       Entry                   **ep
-)
+       Entry                   **ep )
 {
        monitor_info_t  *mi = ( monitor_info_t * )op->o_bd->be_private;
        monitor_entry_t *mp;
 
+       int             rc = SLAP_CB_CONTINUE;
+
        assert( mi != NULL );
        assert( e_parent != NULL );
        assert( e_parent->e_private != NULL );
@@ -77,21 +87,28 @@ monitor_entry_create(
        mp = ( monitor_entry_t * )e_parent->e_private;
 
        if ( mp->mp_info && mp->mp_info->mss_create ) {
-               return ( *mp->mp_info->mss_create )( op, ndn, e_parent, ep );
+               rc = mp->mp_info->mss_create( op, rs, ndn, e_parent, ep );
+       }
+
+       if ( rc == SLAP_CB_CONTINUE ) {
+               rc = LDAP_SUCCESS;
        }
        
-       return( 0 );
+       return rc;
 }
 
 int
 monitor_entry_modify(
        Operation               *op,
+       SlapReply               *rs,
        Entry                   *e
 )
 {
        monitor_info_t  *mi = ( monitor_info_t * )op->o_bd->be_private;
        monitor_entry_t *mp;
 
+       int             rc = SLAP_CB_CONTINUE;
+
        assert( mi != NULL );
        assert( e != NULL );
        assert( e->e_private != NULL );
@@ -99,10 +116,27 @@ monitor_entry_modify(
        mp = ( monitor_entry_t * )e->e_private;
 
        if ( mp->mp_info && mp->mp_info->mss_modify ) {
-               return ( *mp->mp_info->mss_modify )( op, e );
+               rc = mp->mp_info->mss_modify( op, rs, e );
        }
 
-       return( 0 );
+       if ( rc == SLAP_CB_CONTINUE && mp->mp_cb ) {
+               struct monitor_callback_t       *mc;
+
+               for ( mc = mp->mp_cb; mc; mc = mc->mc_next ) {
+                       if ( mc->mc_modify ) {
+                               rc = mc->mc_modify( op, rs, e, mc->mc_private );
+                               if ( rc != SLAP_CB_CONTINUE ) {
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       if ( rc == SLAP_CB_CONTINUE ) {
+               rc = LDAP_SUCCESS;
+       }
+
+       return rc;
 }
 
 int
index 6fed315d2f2c7cfce77139683fe845877c6fad87..1e007a06babc23dfd54e5ffde1275c3f8e24f654 100644 (file)
  * so it should not be used outside monitor_back_db_init()
  * until monitor_back_db_open is called.
  */
-BackendDB *be_monitor = NULL;
+BackendDB                      *be_monitor;
 
-static struct monitor_subsys_t **monitor_subsys = NULL;
-static int                     monitor_subsys_opened = 0;
+static struct monitor_subsys_t **monitor_subsys;
+static int                     monitor_subsys_opened;
+static monitor_info_t          monitor_info;
 
 /*
  * subsystem data
@@ -56,6 +57,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
        { 
                SLAPD_MONITOR_BACKEND_NAME, 
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about available backends." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_backend_init,
                NULL,   /* update */
@@ -64,6 +67,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_CONN_NAME,
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about connections." ),
+                       BER_BVNULL },
                MONITOR_F_VOLATILE_CH,
                monitor_subsys_conn_init,
                monitor_subsys_conn_update,
@@ -72,6 +77,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_DATABASE_NAME,    
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about configured databases." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_database_init,
                NULL,   /* update */
@@ -80,6 +87,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_LISTENER_NAME,    
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about active listeners." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_listener_init,
                NULL,   /* update */
@@ -88,6 +97,9 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_LOG_NAME,
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about logging." ),
+                       BER_BVC( "Set the attribute \"managedInfo\" to the desired log levels." ),
+                       BER_BVNULL },
                MONITOR_F_NONE,
                monitor_subsys_log_init,
                NULL,   /* update */
@@ -96,6 +108,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_OPS_NAME,
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about performed operations." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_ops_init,
                monitor_subsys_ops_update,
@@ -104,6 +118,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_OVERLAY_NAME,
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about available overlays." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_overlay_init,
                NULL,   /* update */
@@ -112,6 +128,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
        }, { 
                SLAPD_MONITOR_SASL_NAME,        
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about SASL." ),
+                       BER_BVNULL },
                MONITOR_F_NONE,
                NULL,   /* init */
                NULL,   /* update */
@@ -120,6 +138,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_SENT_NAME,
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains statistics." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_sent_init,
                monitor_subsys_sent_update,
@@ -128,6 +148,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_THREAD_NAME,      
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about threads." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_thread_init,
                monitor_subsys_thread_update,
@@ -136,6 +158,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_TIME_NAME,
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about time." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_time_init,
                monitor_subsys_time_update,
@@ -144,6 +168,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_TLS_NAME,
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about TLS." ),
+                       BER_BVNULL },
                MONITOR_F_NONE,
                NULL,   /* init */
                NULL,   /* update */
@@ -152,6 +178,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
                }, { 
                SLAPD_MONITOR_RWW_NAME,
                BER_BVNULL, BER_BVNULL, BER_BVNULL,
+               { BER_BVC( "This subsystem contains information about read/write waiters." ),
+                       BER_BVNULL },
                MONITOR_F_PERSISTENT_CH,
                monitor_subsys_rww_init,
                monitor_subsys_rww_update,
@@ -161,7 +189,8 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
 };
 
 int
-monitor_back_register_subsys( monitor_subsys_t *ms )
+monitor_back_register_subsys(
+       monitor_subsys_t        *ms )
 {
        int     i = 0;
 
@@ -201,6 +230,7 @@ monitor_back_register_subsys( monitor_subsys_t *ms )
 
 enum {
        LIMBO_ENTRY,
+       LIMBO_ENTRY_PARENT,
        LIMBO_ATTRS,
        LIMBO_CB
 };
@@ -219,8 +249,8 @@ typedef struct entry_limbo_t {
 
 int
 monitor_back_register_entry(
-               Entry                   *e,
-               monitor_callback_t      *cb )
+       Entry                   *e,
+       monitor_callback_t      *cb )
 {
        monitor_info_t  *mi = ( monitor_info_t * )be_monitor->be_private;
 
@@ -281,7 +311,7 @@ monitor_back_register_entry(
                }
 
                e_new = entry_dup( e );
-               if ( e == NULL ) {
+               if ( e_new == NULL ) {
                        Debug( LDAP_DEBUG_ANY,
                                "monitor_back_register_entry(\"%s\"): "
                                "entry_dup() failed\n",
@@ -293,6 +323,7 @@ monitor_back_register_entry(
                e_new->e_private = ( void * )mp;
                mp->mp_info = mp_parent->mp_info;
                mp->mp_flags = mp_parent->mp_flags | MONITOR_F_SUB;
+               mp->mp_cb = cb;
 
                ep = &mp_parent->mp_children;
                for ( ; *ep; ) {
@@ -326,7 +357,7 @@ done:;
                }
 
        } else {
-               entry_limbo_t   *elp, el = { 0 };
+               entry_limbo_t   **elpp, el = { 0 };
 
                el.el_type = LIMBO_ENTRY;
 
@@ -341,16 +372,209 @@ done:;
                
                el.el_cb = cb;
 
-               elp = (entry_limbo_t *)ch_malloc( sizeof( entry_limbo_t ) );
-               if ( elp ) {
+               for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo;
+                               *elpp;
+                               elpp = &(*elpp)->el_next )
+                       /* go to last */;
+
+               *elpp = (entry_limbo_t *)ch_malloc( sizeof( entry_limbo_t ) );
+               if ( *elpp == NULL ) {
                        el.el_e->e_private = NULL;
                        entry_free( el.el_e );
                        return -1;
                }
 
-               el.el_next = (entry_limbo_t *)mi->mi_entry_limbo;
-               *elp = el;
-               mi->mi_entry_limbo = (void *)elp;
+               el.el_next = NULL;
+               **elpp = el;
+       }
+
+       return 0;
+}
+
+int
+monitor_back_register_entry_parent(
+       Entry                   *e,
+       monitor_callback_t      *cb,
+       struct berval           *base,
+       int                     scope,
+       struct berval           *filter )
+{
+       monitor_info_t  *mi = ( monitor_info_t * )be_monitor->be_private;
+       struct berval   ndn = BER_BVNULL;
+
+       assert( mi != NULL );
+       assert( e != NULL );
+       assert( e->e_private == NULL );
+
+       if ( BER_BVISNULL( filter ) ) {
+               /* need a filter */
+               Debug( LDAP_DEBUG_ANY,
+                       "monitor_back_register_entry_parent(\"\"): "
+                       "need a valid filter\n",
+                       0, 0, 0 );
+               return -1;
+       }
+
+       if ( monitor_subsys_opened ) {
+               Entry           *e_parent = NULL,
+                               *e_new = NULL,
+                               **ep = NULL;
+               struct berval   e_name = BER_BVNULL,
+                               e_nname = BER_BVNULL;
+               monitor_entry_t *mp = NULL,
+                               *mp_parent = NULL;
+               int             rc = 0;
+
+               if ( monitor_filter2ndn( base, scope, filter, &ndn ) ) {
+                       /* entry does not exist */
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_back_register_entry_parent(\"\"): "
+                               "base=%s scope=%d filter=%s : "
+                               "unable to find entry\n",
+                               base->bv_val ? base->bv_val : "\"\"",
+                               scope, filter->bv_val );
+                       return -1;
+               }
+
+               if ( monitor_cache_get( mi, &ndn, &e_parent ) != 0 ) {
+                       /* entry does not exist */
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_back_register_entry_parent(\"%s\"): "
+                               "parent entry does not exist\n",
+                               ndn.bv_val, 0, 0 );
+                       rc = -1;
+                       goto done;
+               }
+
+               assert( e_parent->e_private != NULL );
+               mp_parent = ( monitor_entry_t * )e_parent->e_private;
+
+               if ( mp_parent->mp_flags & MONITOR_F_VOLATILE ) {
+                       /* entry is volatile; cannot append callback */
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_back_register_entry_parent(\"%s\"): "
+                               "entry is volatile\n",
+                               e_parent->e_name.bv_val, 0, 0 );
+                       rc = -1;
+                       goto done;
+               }
+
+               build_new_dn( &e_name, &e_parent->e_name, &e->e_name, NULL );
+               build_new_dn( &e_nname, &e_parent->e_nname, &e->e_nname, NULL );
+
+               if ( monitor_cache_get( mi, &e_nname, &e_new ) == 0 ) {
+                       /* entry already exists */
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_back_register_entry_parent(\"%s\"): "
+                               "entry already exists\n",
+                               e_name.bv_val, 0, 0 );
+                       monitor_cache_release( mi, e_new );
+                       rc = -1;
+                       goto done;
+               }
+
+               mp = monitor_entrypriv_create();
+               if ( mp == NULL ) {
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_back_register_entry_parent(\"%s\"): "
+                               "monitor_entrypriv_create() failed\n",
+                               e->e_name.bv_val, 0, 0 );
+                       rc = -1;
+                       goto done;
+               }
+
+               e_new = entry_dup( e );
+               if ( e_new == NULL ) {
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_back_register_entry(\"%s\"): "
+                               "entry_dup() failed\n",
+                               e->e_name.bv_val, 0, 0 );
+                       rc = -1;
+                       goto done;
+               }
+               ch_free( e_new->e_name.bv_val );
+               ch_free( e_new->e_nname.bv_val );
+               e_new->e_name = e_name;
+               e_new->e_nname = e_nname;
+               
+               e_new->e_private = ( void * )mp;
+               mp->mp_info = mp_parent->mp_info;
+               mp->mp_flags = mp_parent->mp_flags | MONITOR_F_SUB;
+               mp->mp_cb = cb;
+
+               ep = &mp_parent->mp_children;
+               for ( ; *ep; ) {
+                       mp_parent = ( monitor_entry_t * )(*ep)->e_private;
+                       ep = &mp_parent->mp_next;
+               }
+               *ep = e_new;
+
+               if ( monitor_cache_add( mi, e_new ) ) {
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_back_register_entry(\"%s\"): "
+                               "unable to add entry\n",
+                               e->e_name.bv_val, 0, 0 );
+                       rc = -1;
+                       goto done;
+               }
+
+done:;
+               if ( !BER_BVISNULL( &ndn ) ) {
+                       ch_free( ndn.bv_val );
+               }
+
+               if ( rc ) {
+                       if ( mp ) {
+                               ch_free( mp );
+                       }
+                       if ( e_new ) {
+                               e_new->e_private = NULL;
+                               entry_free( e_new );
+                       }
+               }
+
+               if ( e_parent ) {
+                       monitor_cache_release( mi, e_parent );
+               }
+
+       } else {
+               entry_limbo_t   **elpp, el = { 0 };
+
+               el.el_type = LIMBO_ENTRY_PARENT;
+
+               el.el_e = entry_dup( e );
+               if ( el.el_e == NULL ) {
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_back_register_entry(\"%s\"): "
+                               "entry_dup() failed\n",
+                               e->e_name.bv_val, 0, 0 );
+                       return -1;
+               }
+               
+               if ( !BER_BVISNULL( base ) ) {
+                       ber_dupbv( &el.el_base, base );
+               }
+               el.el_scope = scope;
+               if ( !BER_BVISNULL( filter ) ) {
+                       ber_dupbv( &el.el_filter, filter );
+               }
+
+               el.el_cb = cb;
+
+               for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo;
+                               *elpp;
+                               elpp = &(*elpp)->el_next )
+                       /* go to last */;
+
+               *elpp = (entry_limbo_t *)ch_malloc( sizeof( entry_limbo_t ) );
+               if ( *elpp == NULL ) {
+                       el.el_e->e_private = NULL;
+                       entry_free( el.el_e );
+                       return -1;
+               }
+
+               el.el_next = NULL;
+               **elpp = el;
        }
 
        return 0;
@@ -369,15 +593,17 @@ monitor_filter2ndn_cb( Operation *op, SlapReply *rs )
 }
 
 int
-monitor_filter2ndn( struct berval *base, int scope, struct berval *filter,
-               struct berval *ndn )
+monitor_filter2ndn(
+       struct berval   *base,
+       int             scope,
+       struct berval   *filter,
+       struct berval   *ndn )
 {
        Connection      conn = { 0 };
-       char opbuf[OPERATION_BUFFER_SIZE];
+       char            opbuf[OPERATION_BUFFER_SIZE];
        Operation       *op;
        SlapReply       rs = { 0 };
        slap_callback   cb = { NULL, monitor_filter2ndn_cb, NULL, NULL };
-       AttributeName   anlist[ 2 ];
        int             rc;
 
        BER_BVZERO( ndn );
@@ -415,9 +641,7 @@ monitor_filter2ndn( struct berval *base, int scope, struct berval *filter,
        op->ors_scope = scope;
        ber_dupbv_x( &op->ors_filterstr, filter, op->o_tmpmemctx );
        op->ors_filter = str2filter_x( op, filter->bv_val );
-       op->ors_attrs = anlist;
-       BER_BVSTR( &anlist[ 0 ].an_name, LDAP_NO_ATTRS );
-       BER_BVZERO( &anlist[ 1 ].an_name );
+       op->ors_attrs = slap_anlist_no_attrs;
        op->ors_attrsonly = 0;
        op->ors_tlimit = SLAP_NO_LIMIT;
        op->ors_slimit = 1;
@@ -427,6 +651,9 @@ monitor_filter2ndn( struct berval *base, int scope, struct berval *filter,
        op->o_nocaching = 1;
        op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
 
+       op->o_dn = be_monitor->be_rootdn;
+       op->o_ndn = be_monitor->be_rootndn;
+
        rc = op->o_bd->be_search( op, &rs );
 
        filter_free_x( op, op->ors_filter );
@@ -460,12 +687,12 @@ monitor_filter2ndn( struct berval *base, int scope, struct berval *filter,
 
 int
 monitor_back_register_entry_attrs(
-               struct berval           *ndn_in,
-               Attribute               *a,
-               monitor_callback_t      *cb,
-               struct berval           *base,
-               int                     scope,
-               struct berval           *filter )
+       struct berval           *ndn_in,
+       Attribute               *a,
+       monitor_callback_t      *cb,
+       struct berval           *base,
+       int                     scope,
+       struct berval           *filter )
 {
        monitor_info_t  *mi = ( monitor_info_t * )be_monitor->be_private;
        struct berval   ndn = BER_BVNULL;
@@ -579,7 +806,7 @@ done:;
                }
 
        } else {
-               entry_limbo_t   *elp, el = { 0 };
+               entry_limbo_t   **elpp, el = { 0 };
 
                el.el_type = LIMBO_ATTRS;
                if ( !BER_BVISNULL( &ndn ) ) {
@@ -596,15 +823,20 @@ done:;
                el.el_a = attrs_dup( a );
                el.el_cb = cb;
 
-               elp = (entry_limbo_t *)ch_malloc( sizeof( entry_limbo_t ) );
-               if ( elp == NULL ) {
-                       attrs_free( a );
+               for ( elpp = (entry_limbo_t **)&mi->mi_entry_limbo;
+                               *elpp;
+                               elpp = &(*elpp)->el_next )
+                       /* go to last */;
+
+               *elpp = (entry_limbo_t *)ch_malloc( sizeof( entry_limbo_t ) );
+               if ( *elpp == NULL ) {
+                       el.el_e->e_private = NULL;
+                       entry_free( el.el_e );
                        return -1;
                }
 
-               el.el_next = (entry_limbo_t *)mi->mi_entry_limbo;
-               *elp = el;
-               mi->mi_entry_limbo = (void *)elp;;
+               el.el_next = NULL;
+               **elpp = el;
        }
 
        return 0;
@@ -612,11 +844,11 @@ done:;
 
 int
 monitor_back_register_entry_callback(
-               struct berval           *ndn,
-               monitor_callback_t      *cb,
-               struct berval           *base,
-               int                     scope,
-               struct berval           *filter )
+       struct berval           *ndn,
+       monitor_callback_t      *cb,
+       struct berval           *base,
+       int                     scope,
+       struct berval           *filter )
 {
        return monitor_back_register_entry_attrs( ndn, NULL, cb,
                        base, scope, filter );
@@ -639,7 +871,9 @@ monitor_back_get_subsys( const char *name )
 }
 
 monitor_subsys_t *
-monitor_back_get_subsys_by_dn( struct berval *ndn, int sub )
+monitor_back_get_subsys_by_dn(
+       struct berval   *ndn,
+       int             sub )
 {
        if ( monitor_subsys != NULL ) {
                int     i;
@@ -665,82 +899,16 @@ monitor_back_get_subsys_by_dn( struct berval *ndn, int sub )
 
 int
 monitor_back_initialize(
-       BackendInfo     *bi
-)
+       BackendInfo     *bi )
 {
        monitor_subsys_t        *ms;
        static char             *controls[] = {
                LDAP_CONTROL_MANAGEDSAIT,
                NULL
        };
-
-       bi->bi_controls = controls;
-
-       bi->bi_init = 0;
-       bi->bi_open = 0;
-       bi->bi_config = monitor_back_config;
-       bi->bi_close = 0;
-       bi->bi_destroy = 0;
-
-       bi->bi_db_init = monitor_back_db_init;
-       bi->bi_db_config = monitor_back_db_config;
-       bi->bi_db_open = monitor_back_db_open;
-       bi->bi_db_close = 0;
-       bi->bi_db_destroy = monitor_back_db_destroy;
-
-       bi->bi_op_bind = monitor_back_bind;
-       bi->bi_op_unbind = 0;
-       bi->bi_op_search = monitor_back_search;
-       bi->bi_op_compare = monitor_back_compare;
-       bi->bi_op_modify = monitor_back_modify;
-       bi->bi_op_modrdn = 0;
-       bi->bi_op_add = 0;
-       bi->bi_op_delete = 0;
-       bi->bi_op_abandon = 0;
-
-       bi->bi_extended = 0;
-
-       bi->bi_entry_release_rw = 0;
-       bi->bi_chk_referrals = 0;
-       bi->bi_operational = monitor_back_operational;
-
-       /*
-        * hooks for slap tools
-        */
-       bi->bi_tool_entry_open = 0;
-       bi->bi_tool_entry_close = 0;
-       bi->bi_tool_entry_first = 0;
-       bi->bi_tool_entry_next = 0;
-       bi->bi_tool_entry_get = 0;
-       bi->bi_tool_entry_put = 0;
-       bi->bi_tool_entry_reindex = 0;
-       bi->bi_tool_sync = 0;
-       bi->bi_tool_dn2id_get = 0;
-       bi->bi_tool_id2entry_get = 0;
-       bi->bi_tool_entry_modify = 0;
-
-       bi->bi_connection_init = 0;
-       bi->bi_connection_destroy = 0;
-
-       for ( ms = known_monitor_subsys; ms->mss_name != NULL; ms++ ) {
-               if ( monitor_back_register_subsys( ms ) ) {
-                       return -1;
-               }
-       }
-
-       return 0;
-}
-
-int
-monitor_back_db_init(
-       BackendDB       *be
-)
-{
-       monitor_info_t  *mi;
-       int             i, rc;
-       struct berval   dn, ndn;
-       struct berval   bv;
-       const char      *text;
+       monitor_info_t          *mi = &monitor_info;
+       int                     i;
+       const char              *text;
 
        struct m_s {
                char    *name;
@@ -755,13 +923,6 @@ monitor_back_db_init(
                        "MUST cn "
                        "MAY ( "
                                "description "
-                               "$ l "
-#if 0  /* temporarily disabled */
-                               "$ st "
-                               "$ street "
-                               "$ postalAddress "
-                               "$ postalCode "
-#endif
                                "$ seeAlso "
                                "$ labeledURI "
                                "$ monitoredInfo "
@@ -886,7 +1047,7 @@ monitor_back_db_init(
                        offsetof(monitor_info_t, mi_ad_monitorTimestamp) },
                { "monitorOverlay", "( 1.3.6.1.4.1.4203.666.1.27 "
                        "NAME 'monitorOverlay' "
-                       "DESC 'name of overlays defined for a give database' "
+                       "DESC 'name of overlays defined for a given database' "
                        "SUP monitoredInfo "
                        "NO-USER-MODIFICATION "
                        "USAGE directoryOperation )", SLAP_AT_HIDE,
@@ -904,111 +1065,153 @@ monitor_back_db_init(
                        "DESC 'name of restricted operation for a given database' "
                        "SUP managedInfo )", SLAP_AT_HIDE,
                        offsetof(monitor_info_t, mi_ad_restrictedOperation ) },
-#ifdef INTEGRATE_CORE_SCHEMA
-               { NULL, NULL, 0, -1 },  /* description */
-               { NULL, NULL, 0, -1 },  /* seeAlso */
-               { NULL, NULL, 0, -1 },  /* l */
-               { NULL, NULL, 0, -1 },  /* labeledURI */
-#endif /* INTEGRATE_CORE_SCHEMA */
-               { NULL, NULL, 0, -1 }
-       }, mat_core[] = {
-               { "description", "( 2.5.4.13 "
-                       "NAME 'description' "
-                       "DESC 'RFC2256: descriptive information' "
-                       "EQUALITY caseIgnoreMatch "
-                       "SUBSTR caseIgnoreSubstringsMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )", 0,
-                       offsetof(monitor_info_t, mi_ad_description) },
-               { "seeAlso", "( 2.5.4.34 "
-                       "NAME 'seeAlso' "
-                       "DESC 'RFC2256: DN of related object' "
-                       "SUP distinguishedName )", 0,
-                       offsetof(monitor_info_t, mi_ad_seeAlso) },
-               { "l", "( 2.5.4.7 "
-                       "NAME ( 'l' 'localityName' ) "
-                       "DESC 'RFC2256: locality which this object resides in' "
-                       "SUP name )", 0,
-                       offsetof(monitor_info_t, mi_ad_l) },
-#ifdef MONITOR_DEFINE_LABELEDURI
-               { "labeledURI", "( 1.3.6.1.4.1.250.1.57 "
-                       "NAME 'labeledURI' "
-                       "DESC 'RFC2079: Uniform Resource Identifier with optional label' "
-                       "EQUALITY caseExactMatch "
-                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", 0,
-                       offsetof(monitor_info_t, mi_ad_labeledURI) },
-#endif /* MONITOR_DEFINE_LABELEDURI */
+               { "monitorConnectionProtocol", "( 1.3.6.1.4.1.4203.666.1.39 "
+                       "NAME 'monitorConnectionProtocol' "
+                       "DESC 'monitor connection protocol' "
+                       "SUP monitoredInfo "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionProtocol) },
+               { "monitorConnectionOpsReceived", "( 1.3.6.1.4.1.4203.666.1.40 "
+                       "NAME 'monitorConnectionOpsReceived' "
+                       "DESC 'monitor number of operations received by the connection' "
+                       "SUP monitorCounter "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionOpsReceived) },
+               { "monitorConnectionOpsExecuting", "( 1.3.6.1.4.1.4203.666.1.41 "
+                       "NAME 'monitorConnectionOpsExecuting' "
+                       "DESC 'monitor number of operations in execution within the connection' "
+                       "SUP monitorCounter "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionOpsExecuting) },
+               { "monitorConnectionOpsPending", "( 1.3.6.1.4.1.4203.666.1.42 "
+                       "NAME 'monitorConnectionOpsPending' "
+                       "DESC 'monitor number of pending operations within the connection' "
+                       "SUP monitorCounter "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionOpsPending) },
+               { "monitorConnectionOpsCompleted", "( 1.3.6.1.4.1.4203.666.1.43 "
+                       "NAME 'monitorConnectionOpsCompleted' "
+                       "DESC 'monitor number of operations completed within the connection' "
+                       "SUP monitorCounter "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionOpsCompleted) },
+               { "monitorConnectionGet", "( 1.3.6.1.4.1.4203.666.1.44 "
+                       "NAME 'monitorConnectionGet' "
+                       "DESC 'number of times connection_get() was called so far' "
+                       "SUP monitorCounter "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionGet) },
+               { "monitorConnectionRead", "( 1.3.6.1.4.1.4203.666.1.45 "
+                       "NAME 'monitorConnectionRead' "
+                       "DESC 'number of times connection_read() was called so far' "
+                       "SUP monitorCounter "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionRead) },
+               { "monitorConnectionWrite", "( 1.3.6.1.4.1.4203.666.1.46 "
+                       "NAME 'monitorConnectionWrite' "
+                       "DESC 'number of times connection_write() was called so far' "
+                       "SUP monitorCounter "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionWrite) },
+               { "monitorConnectionMask", "( 1.3.6.1.4.1.4203.666.1.47 "
+                       "NAME 'monitorConnectionMask' "
+                       "DESC 'monitor connection mask' "
+                       "SUP monitoredInfo "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionMask) },
+               { "monitorConnectionListener", "( 1.3.6.1.4.1.4203.666.1.48 "
+                       "NAME 'monitorConnectionListener' "
+                       "DESC 'monitor connection listener' "
+                       "SUP monitoredInfo "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionListener) },
+               { "monitorConnectionPeerDomain", "( 1.3.6.1.4.1.4203.666.1.49 "
+                       "NAME 'monitorConnectionPeerDomain' "
+                       "DESC 'monitor connection peer domain' "
+                       "SUP monitoredInfo "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionPeerDomain) },
+               { "monitorConnectionStartTime", "( 1.3.6.1.4.1.4203.666.1.50 "
+                       "NAME 'monitorConnectionStartTime' "
+                       "DESC 'monitor connection start time' "
+                       "SUP monitorTimestamp "
+                       "SINGLE-VALUE "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionStartTime) },
+               { "monitorConnectionActivityTime", "( 1.3.6.1.4.1.4203.666.1.51 "
+                       "NAME 'monitorConnectionActivityTime' "
+                       "DESC 'monitor connection activity time' "
+                       "SUP monitorTimestamp "
+                       "SINGLE-VALUE "
+                       "NO-USER-MODIFICATION "
+                       "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorConnectionActivityTime) },
                { NULL, NULL, 0, -1 }
        };
        
-       /*
-        * database monitor can be defined once only
-        */
-       if ( be_monitor ) {
-               Debug( LDAP_DEBUG_ANY,
-                       "only one monitor backend is allowed\n", 0, 0, 0 );
-               return( -1 );
-       }
-       be_monitor = be;
-
-       /* indicate system schema supported */
-       SLAP_BFLAGS(be) |= SLAP_BFLAG_MONITOR;
-
-       dn.bv_val = SLAPD_MONITOR_DN;
-       dn.bv_len = sizeof( SLAPD_MONITOR_DN ) - 1;
-
-       rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, NULL );
-       if( rc != LDAP_SUCCESS ) {
-               Debug( LDAP_DEBUG_ANY,
-                       "unable to normalize monitor DN \"%s\"\n",
-                       SLAPD_MONITOR_DN, 0, 0 );
-               return -1;
-       }
-
-       ber_dupbv( &bv, &dn );
-       ber_bvarray_add( &be->be_suffix, &bv );
-       ber_bvarray_add( &be->be_nsuffix, &ndn );
-
-       mi = ( monitor_info_t * )ch_calloc( sizeof( monitor_info_t ), 1 );
-       if ( mi == NULL ) {
-               Debug( LDAP_DEBUG_ANY,
-                       "unable to initialize monitor backend\n", 0, 0, 0 );
-               return -1;
-       }
+       bi->bi_controls = controls;
 
-       memset( mi, 0, sizeof( monitor_info_t ) );
+       bi->bi_init = 0;
+       bi->bi_open = 0;
+       bi->bi_config = monitor_back_config;
+       bi->bi_close = 0;
+       bi->bi_destroy = 0;
 
-       ldap_pvt_thread_mutex_init( &mi->mi_cache_mutex );
+       bi->bi_db_init = monitor_back_db_init;
+       bi->bi_db_config = monitor_back_db_config;
+       bi->bi_db_open = monitor_back_db_open;
+       bi->bi_db_close = 0;
+       bi->bi_db_destroy = monitor_back_db_destroy;
 
-       be->be_private = mi;
-       
-#ifdef INTEGRATE_CORE_SCHEMA
-       /* prepare for schema integration */
-       for ( k = 0; mat[ k ].name != NULL; k++ );
-#endif /* INTEGRATE_CORE_SCHEMA */
+       bi->bi_op_bind = monitor_back_bind;
+       bi->bi_op_unbind = 0;
+       bi->bi_op_search = monitor_back_search;
+       bi->bi_op_compare = monitor_back_compare;
+       bi->bi_op_modify = monitor_back_modify;
+       bi->bi_op_modrdn = 0;
+       bi->bi_op_add = 0;
+       bi->bi_op_delete = 0;
+       bi->bi_op_abandon = 0;
 
-       for ( i = 0; mat_core[ i ].name != NULL; i++ ) {
-               AttributeDescription    **ad;
-               const char              *text;
+       bi->bi_extended = 0;
 
-               ad = ((AttributeDescription **)&(((char *)mi)[ mat_core[ i ].offset ]));
-               ad[ 0 ] = NULL;
+       bi->bi_entry_release_rw = 0;
+       bi->bi_chk_referrals = 0;
+       bi->bi_operational = monitor_back_operational;
 
-               switch (slap_str2ad( mat_core[ i ].name, ad, &text ) ) {
-               case LDAP_SUCCESS:
-                       break;
+       /*
+        * hooks for slap tools
+        */
+       bi->bi_tool_entry_open = 0;
+       bi->bi_tool_entry_close = 0;
+       bi->bi_tool_entry_first = 0;
+       bi->bi_tool_entry_next = 0;
+       bi->bi_tool_entry_get = 0;
+       bi->bi_tool_entry_put = 0;
+       bi->bi_tool_entry_reindex = 0;
+       bi->bi_tool_sync = 0;
+       bi->bi_tool_dn2id_get = 0;
+       bi->bi_tool_id2entry_get = 0;
+       bi->bi_tool_entry_modify = 0;
 
-#ifdef INTEGRATE_CORE_SCHEMA
-               case LDAP_UNDEFINED_TYPE:
-                       mat[ k ] = mat_core[ i ];
-                       k++;
-                       break;
-#endif /* INTEGRATE_CORE_SCHEMA */
+       bi->bi_connection_init = 0;
+       bi->bi_connection_destroy = 0;
 
-               default:
-                       Debug( LDAP_DEBUG_ANY,
-                               "monitor_back_db_init: %s: %s\n",
-                               mat_core[ i ].name, text, 0 );
-                       return( -1 );
+       for ( ms = known_monitor_subsys; ms->mss_name != NULL; ms++ ) {
+               if ( monitor_back_register_subsys( ms ) ) {
+                       return -1;
                }
        }
 
@@ -1035,7 +1238,7 @@ monitor_back_db_init(
                        return -1;
                }
 
-               code = at_add(at, &err);
+               code = at_add(at, 0, NULL, &err);
                if ( code ) {
                        Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
                                "%s in attributeType \"%s\"\n",
@@ -1078,7 +1281,7 @@ monitor_back_db_init(
                        return -1;
                }
 
-               code = oc_add(oc, 0, &err);
+               code = oc_add(oc, 0, NULL, &err);
                if ( code ) {
                        Debug( LDAP_DEBUG_ANY,
                                "objectclass \"%s\": %s \"%s\"\n" ,
@@ -1104,10 +1307,57 @@ monitor_back_db_init(
        return 0;
 }
 
+int
+monitor_back_db_init(
+       BackendDB       *be )
+{
+       monitor_info_t  *mi;
+       int             rc;
+       struct berval   dn, ndn;
+       struct berval   bv;
+
+       /*
+        * database monitor can be defined once only
+        */
+       if ( be_monitor != NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "only one monitor database is allowed\n", 0, 0, 0 );
+               return( -1 );
+       }
+       be_monitor = be;
+
+       /* indicate system schema supported */
+       SLAP_BFLAGS(be) |= SLAP_BFLAG_MONITOR;
+
+       dn.bv_val = SLAPD_MONITOR_DN;
+       dn.bv_len = sizeof( SLAPD_MONITOR_DN ) - 1;
+
+       rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, NULL );
+       if( rc != LDAP_SUCCESS ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "unable to normalize monitor DN \"%s\"\n",
+                       SLAPD_MONITOR_DN, 0, 0 );
+               return -1;
+       }
+
+       ber_dupbv( &bv, &dn );
+       ber_bvarray_add( &be->be_suffix, &bv );
+       ber_bvarray_add( &be->be_nsuffix, &ndn );
+
+       /* NOTE: only one monitor database is allowed,
+        * so we use static storage */
+       mi = &monitor_info;
+
+       ldap_pvt_thread_mutex_init( &mi->mi_cache_mutex );
+
+       be->be_private = mi;
+
+       return 0;
+}
+
 int
 monitor_back_db_open(
-       BackendDB       *be
-)
+       BackendDB       *be )
 {
        monitor_info_t          *mi = (monitor_info_t *)be->be_private;
        struct monitor_subsys_t **ms;
@@ -1170,12 +1420,10 @@ monitor_back_db_open(
                "objectClass: %s\n"
                "structuralObjectClass: %s\n"
                "cn: Monitor\n"
-               "%s: This subtree contains monitoring/managing objects.\n"
-               "%s: This object contains information about this server.\n"
-#if 0
-               "%s: createTimestamp reflects the time this server instance was created.\n"
-               "%s: modifyTimestamp reflects the time this server instance was last accessed.\n"
-#endif
+               "description: This subtree contains monitoring/managing objects.\n"
+               "description: This object contains information about this server.\n"
+               "description: Most of the information is contained in operational\n"
+               "description: attributeTypes, which must be explicitly requested.\n"
                "creatorsName: %s\n"
                "modifiersName: %s\n"
                "createTimestamp: %s\n"
@@ -1183,12 +1431,6 @@ monitor_back_db_open(
                SLAPD_MONITOR_DN,
                mi->mi_oc_monitorServer->soc_cname.bv_val,
                mi->mi_oc_monitorServer->soc_cname.bv_val,
-               mi->mi_ad_description->ad_cname.bv_val,
-               mi->mi_ad_description->ad_cname.bv_val,
-#if 0
-               mi->mi_ad_description->ad_cname.bv_val,
-               mi->mi_ad_description->ad_cname.bv_val,
-#endif
                mi->mi_creatorsName.bv_val,
                mi->mi_creatorsName.bv_val,
                mi->mi_startTime.bv_val,
@@ -1218,15 +1460,6 @@ monitor_back_db_open(
                return( -1 );
        }
 
-       if ( mi->mi_l.bv_len ) {
-               if ( attr_merge_normalize_one( e, mi->mi_ad_l, &mi->mi_l, NULL ) ) {
-                       Debug( LDAP_DEBUG_ANY,
-                               "unable to add locality to \"%s\" entry\n",
-                               SLAPD_MONITOR_DN, 0, 0 );
-                       return( -1 );
-               }
-       }
-
        mp = monitor_entrypriv_create();
        if ( mp == NULL ) {
                return -1;
@@ -1303,6 +1536,11 @@ monitor_back_db_open(
                        return( -1 );
                }
 
+               if ( !BER_BVISNULL( &monitor_subsys[ i ]->mss_desc[ 0 ] ) ) {
+                       attr_merge_normalize( e, slap_schema.si_ad_description,
+                                       monitor_subsys[ i ]->mss_desc, NULL );
+               }
+
                mp = monitor_entrypriv_create();
                if ( mp == NULL ) {
                        return -1;
@@ -1352,6 +1590,16 @@ monitor_back_db_open(
                                                el->el_cb );
                                break;
 
+                       case LIMBO_ENTRY_PARENT:
+                               monitor_back_register_entry_parent(
+                                               el->el_e,
+                                               el->el_cb,
+                                               &el->el_base,
+                                               el->el_scope,
+                                               &el->el_filter );
+                               break;
+                               
+
                        case LIMBO_ATTRS:
                                monitor_back_register_entry_attrs(
                                                &el->el_ndn,
@@ -1408,8 +1656,7 @@ monitor_back_config(
        const char      *fname,
        int             lineno,
        int             argc,
-       char            **argv
-)
+       char            **argv )
 {
        /*
         * eventually, will hold backend specific configuration parameters
@@ -1423,36 +1670,27 @@ monitor_back_db_config(
        const char  *fname,
        int         lineno,
        int         argc,
-       char        **argv
-)
+       char        **argv )
 {
        monitor_info_t  *mi = ( monitor_info_t * )be->be_private;
 
        /*
         * eventually, will hold database specific configuration parameters
         */
-       if ( strcasecmp( argv[ 0 ], "l" ) == 0 ) {
-               if ( argc != 2 ) {
-                       return 1;
-               }
-               
-               ber_str2bv( argv[ 1 ], 0, 1, &mi->mi_l );
-
-       } else {
-               return SLAP_CONF_UNKNOWN;
-       }
-
-       return( 0 );
+       return SLAP_CONF_UNKNOWN;
 }
 
 int
 monitor_back_db_destroy(
-       BackendDB       *be
-)
+       BackendDB       *be )
 {
+       monitor_info_t  *mi = ( monitor_info_t * )be->be_private;
+
        /*
         * FIXME: destroys all the data
         */
+       /* NOTE: mi points to static storage; don't free it */
+       
        return 0;
 }
 
index d94954e8d021c26c391aa08d1bff99fec9e0798a..ae0453b62bb16cf562746196001a8bc0ffbac8ce 100644 (file)
@@ -22,6 +22,7 @@
 #include "portable.h"
 
 #include <stdio.h>
+#include <ac/string.h>
 
 #include "slap.h"
 #include "back-monitor.h"
@@ -106,9 +107,7 @@ monitor_subsys_listener_init(
                if ( l[ i ]->sl_is_tls ) {
                        struct berval bv;
 
-                       bv.bv_val = "TLS";
-                       bv.bv_len = sizeof("TLS")-1;
-
+                       BER_BVSTR( &bv, "TLS" );
                        attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
                                        &bv, NULL );
                }
index 8ab11949e983ede6f3d2c68d8b7fffed83b1d9cc..607b6354a4c0a51e02068436680d7797243cd4f9 100644 (file)
@@ -71,17 +71,11 @@ static int replace_values( Entry *e, Modification *mod, int *newlevel );
 int
 monitor_subsys_log_init(
        BackendDB               *be,
-       monitor_subsys_t        *ms
-)
+       monitor_subsys_t        *ms )
 {
        monitor_info_t  *mi;
        Entry           *e;
        int             i;
-       struct berval   desc[] = {
-               BER_BVC("This entry allows to set the log level runtime."),
-               BER_BVC("Set the attribute 'managedInfo' to the desired log levels."),
-               BER_BVNULL
-       };
 
        ldap_pvt_thread_mutex_init( &monitor_log_mutex );
 
@@ -119,8 +113,6 @@ monitor_subsys_log_init(
                }
        }
 
-       attr_merge( e, mi->mi_ad_description, desc, NULL );
-
        monitor_cache_release( mi, e );
 
        return( 0 );
@@ -129,8 +121,8 @@ monitor_subsys_log_init(
 int 
 monitor_subsys_log_modify( 
        Operation               *op,
-       Entry                   *e
-)
+       SlapReply               *rs,
+       Entry                   *e )
 {
        monitor_info_t  *mi = ( monitor_info_t * )op->o_bd->be_private;
        int             rc = LDAP_OTHER;
@@ -154,18 +146,17 @@ monitor_subsys_log_modify(
                 */
                if ( is_at_operational( mod->sm_desc->ad_type ) ) {
                        ( void ) attr_delete( &e->e_attrs, mod->sm_desc );
-                       rc = attr_merge( e, mod->sm_desc, mod->sm_values, mod->sm_nvalues );
-                       if ( rc != 0 ) {
-                               rc = LDAP_OTHER;
+                       rc = rs->sr_err = attr_merge( e, mod->sm_desc, mod->sm_values, mod->sm_nvalues );
+                       if ( rc != LDAP_SUCCESS ) {
                                break;
                        }
                        continue;
 
                /*
-                * only the monitor description attribute can be modified
+                * only the "managedInfo" attribute can be modified
                 */
-               } else if ( mod->sm_desc != mi->mi_ad_managedInfo) {
-                       rc = LDAP_UNWILLING_TO_PERFORM;
+               } else if ( mod->sm_desc != mi->mi_ad_managedInfo ) {
+                       rc = rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
                        break;
                }
 
@@ -188,6 +179,7 @@ monitor_subsys_log_modify(
                }
 
                if ( rc != LDAP_SUCCESS ) {
+                       rs->sr_err = rc;
                        break;
                }
        }
@@ -199,7 +191,7 @@ monitor_subsys_log_modify(
 
                /* check for abandon */
                if ( op->o_abandon ) {
-                       rc = SLAPD_ABANDON;
+                       rc = rs->sr_err = SLAPD_ABANDON;
 
                        goto cleanup;
                }
@@ -208,6 +200,7 @@ monitor_subsys_log_modify(
                rc = entry_schema_check( be_monitor, e, save_attrs, 
                                &text, textbuf, sizeof( textbuf ) );
                if ( rc != LDAP_SUCCESS ) {
+                       rs->sr_err = rc;
                        goto cleanup;
                }
 
@@ -236,7 +229,11 @@ cleanup:;
        
        ldap_pvt_thread_mutex_unlock( &monitor_log_mutex );
 
-       return( rc );
+       if ( rc == LDAP_SUCCESS ) {
+               rc = SLAP_CB_CONTINUE;
+       }
+
+       return rc;
 }
 
 static int
@@ -320,7 +317,7 @@ add_values( Entry *e, Modification *mod, int *newlevel )
        a = attr_find( e->e_attrs, mod->sm_desc );
 
        if ( a != NULL ) {
-               /* "description" SHOULD have appropriate rules ... */
+               /* "managedInfo" SHOULD have appropriate rules ... */
                if ( mr == NULL || !mr->smr_match ) {
                        return LDAP_INAPPROPRIATE_MATCHING;
                }
index 9368f27338916ba9797ed59c7f14ca14df41882e..eafeb6e063f6611815e5f4053d3f0d90f144f540 100644 (file)
 
 int
 monitor_back_modify( Operation *op, SlapReply *rs )
-       /*
-       Backend         *be,
-       Connection      *conn,
-       Operation       *op,
-       struct berval   *dn,
-       struct berval   *ndn,
-       Modifications   *modlist
-       */
 {
        int             rc = 0;
        monitor_info_t  *mi = ( monitor_info_t * )op->o_bd->be_private;
@@ -49,31 +41,52 @@ monitor_back_modify( Operation *op, SlapReply *rs )
        Debug(LDAP_DEBUG_ARGS, "monitor_back_modify:\n", 0, 0, 0);
 
        /* acquire and lock entry */
-       monitor_cache_dn2entry( op, &op->o_req_ndn, &e, &matched );
+       monitor_cache_dn2entry( op, rs, &op->o_req_ndn, &e, &matched );
        if ( e == NULL ) {
                rs->sr_err = LDAP_NO_SUCH_OBJECT;
                if ( matched ) {
-                       rs->sr_matched = matched->e_name.bv_val;
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+                       if ( !access_allowed_mask( op, matched,
+                                       slap_schema.si_ad_entry,
+                                       NULL, ACL_DISCLOSE, NULL, NULL ) )
+                       {
+                               /* do nothing */ ;
+                       } else 
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+                       {
+                               rs->sr_matched = matched->e_dn;
+                       }
                }
                send_ldap_result( op, rs );
                if ( matched != NULL ) {
                        rs->sr_matched = NULL;
                        monitor_cache_release( mi, matched );
                }
-               return( 0 );
+               return rs->sr_err;
        }
 
        if ( !acl_check_modlist( op, e, op->oq_modify.rs_modlist )) {
                rc = LDAP_INSUFFICIENT_ACCESS;
+
        } else {
-               rc = monitor_entry_modify( op, e );
+               rc = monitor_entry_modify( op, rs, e );
+       }
+
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+       if ( rc != LDAP_SUCCESS ) {
+               if ( !access_allowed_mask( op, e, slap_schema.si_ad_entry,
+                               NULL, ACL_DISCLOSE, NULL, NULL ) )
+               {
+                       rc = LDAP_NO_SUCH_OBJECT;
+               }
        }
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
 
        rs->sr_err = rc;
        send_ldap_result( op, rs );
 
        monitor_cache_release( mi, e );
 
-       return( 0 );
+       return rs->sr_err;
 }
 
index 8ce09525d3b6a4d18bab52a14c6ad8046e8c2703..a5ac6cf8a51a55c59b95123957cc7f2bd0f2ef33 100644 (file)
@@ -74,8 +74,8 @@ monitor_subsys_ops_init(
                return( -1 );
        }
 
-       attr_merge_one( e_op, mi->mi_ad_monitorOpInitiated, &bv_zero, NULL );
-       attr_merge_one( e_op, mi->mi_ad_monitorOpCompleted, &bv_zero, NULL );
+       attr_merge_one( e_op, mi->mi_ad_monitorOpInitiated, &bv_zero, &bv_zero );
+       attr_merge_one( e_op, mi->mi_ad_monitorOpCompleted, &bv_zero, &bv_zero );
 
        mp = ( monitor_entry_t * )e_op->e_private;
        mp->mp_children = NULL;
@@ -155,6 +155,7 @@ monitor_subsys_ops_init(
 int
 monitor_subsys_ops_update(
        Operation               *op,
+       SlapReply               *rs,
        Entry                   *e
 )
 {
@@ -217,6 +218,6 @@ monitor_subsys_ops_update(
 
        /* FIXME: touch modifyTimestamp? */
 
-       return( 0 );
+       return SLAP_CB_CONTINUE;
 }
 
index b90fc8a2b0a0623758370bf45effe0aee8293e9c..568a808d2ac21ff30f4a6783e281ae5ef26c3f81 100644 (file)
@@ -73,6 +73,7 @@ monitor_subsys_overlay_init(
                struct berval   bv;
                int             j;
                Entry           *e;
+               BackendDB       *be;
 
                snprintf( buf, sizeof( buf ),
                                "dn: cn=Overlay %d,%s\n"
@@ -102,29 +103,27 @@ monitor_subsys_overlay_init(
                        return( -1 );
                }
                
-               bv.bv_val = on->on_bi.bi_type;
-               bv.bv_len = strlen( bv.bv_val );
-
+               ber_str2bv( on->on_bi.bi_type, 0, 0, &bv );
                attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
                                &bv, NULL );
                attr_merge_normalize_one( e_overlay, mi->mi_ad_monitoredInfo,
                                &bv, NULL );
 
-               for ( j = 0; j < nBackendDB; j++ ) {
-                       BackendDB       *be = &backendDB[ j ];
+               j = -1;
+               LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
                        char            buf[ SLAP_LDAPDN_MAXLEN ];
                        struct berval   dn;
 
+                       j++;
                        if ( !overlay_is_inst( be, on->on_bi.bi_type ) ) {
                                continue;
                        }
 
                        snprintf( buf, sizeof( buf ), "cn=Database %d,%s",
                                        j, ms_database->mss_dn.bv_val );
-                       dn.bv_val = buf;
-                       dn.bv_len = strlen( buf );
 
-                       attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
+                       ber_str2bv( buf, 0, 0, &dn );
+                       attr_merge_normalize_one( e, slap_schema.si_ad_seeAlso,
                                        &dn, NULL );
                }
                
index eb0d8422ab7c28ff40a50173ad7ecccbdbdf48dd..0df5ebb1cd1fb524935de99171302eea7951f7de 100644 (file)
@@ -28,99 +28,245 @@ LDAP_BEGIN_DECL
 /*
  * backends
  */
-int monitor_subsys_backend_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
+int
+monitor_subsys_backend_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
 
 /*
  * cache
  */
-extern int monitor_cache_cmp LDAP_P(( const void *c1, const void *c2 ));
-extern int monitor_cache_dup LDAP_P(( void *c1, void *c2 ));
-extern int monitor_cache_add LDAP_P(( monitor_info_t *mi, Entry *e ));
-extern int monitor_cache_get LDAP_P(( monitor_info_t *mi, struct berval *ndn, Entry **ep ));
-extern int monitor_cache_dn2entry LDAP_P(( Operation *op, struct berval *ndn, Entry **ep, Entry **matched ));
-extern int monitor_cache_lock LDAP_P(( Entry *e ));
-extern int monitor_cache_release LDAP_P(( monitor_info_t *mi, Entry *e ));
+extern int
+monitor_cache_cmp LDAP_P((
+       const void              *c1,
+       const void              *c2 ));
+extern int
+monitor_cache_dup LDAP_P((
+       void                    *c1,
+       void                    *c2 ));
+extern int
+monitor_cache_add LDAP_P((
+       monitor_info_t          *mi,
+       Entry                   *e ));
+extern int
+monitor_cache_get LDAP_P((
+       monitor_info_t          *mi,
+       struct berval           *ndn,
+       Entry                   **ep ));
+extern int
+monitor_cache_dn2entry LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       struct berval           *ndn,
+       Entry                   **ep,
+       Entry                   **matched ));
+extern int
+monitor_cache_lock LDAP_P((
+       Entry                   *e ));
+extern int
+monitor_cache_release LDAP_P((
+       monitor_info_t          *mi,
+       Entry                   *e ));
 
 /*
  * connections
  */
-int monitor_subsys_conn_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
-int monitor_subsys_conn_update LDAP_P(( Operation *op, Entry *e ));
-int monitor_subsys_conn_create LDAP_P(( Operation *op, struct berval *ndn,
-                       Entry *e_parent, Entry **ep ));
+extern int
+monitor_subsys_conn_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
+extern int
+monitor_subsys_conn_update LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
+extern int
+monitor_subsys_conn_create LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       struct berval           *ndn,
+       Entry                   *e_parent,
+       Entry                   **ep ));
 
 /*
  * databases 
  */
-int monitor_subsys_database_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
-int monitor_subsys_database_modify LDAP_P(( Operation *op, Entry *e ));
+extern int
+monitor_subsys_database_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
+extern int
+monitor_subsys_database_modify LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
 
 /*
  * entry
  */
-extern int monitor_entry_update LDAP_P(( Operation *op, Entry *e ));
-extern int monitor_entry_create LDAP_P(( Operation *op, struct berval *ndn,
-               Entry *e_parent, Entry **ep ));
-extern int monitor_entry_modify LDAP_P(( Operation *op, Entry *e ));
-int monitor_entry_test_flags LDAP_P(( monitor_entry_t *mp, int cond ));
-extern monitor_entry_t * monitor_entrypriv_create LDAP_P(( void ));
+extern int
+monitor_entry_update LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
+extern int
+monitor_entry_create LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       struct berval           *ndn,
+       Entry                   *e_parent,
+       Entry                   **ep ));
+extern int
+monitor_entry_modify LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
+extern int
+monitor_entry_test_flags LDAP_P((
+       monitor_entry_t         *mp,
+       int                     cond ));
+extern monitor_entry_t *
+monitor_entrypriv_create LDAP_P((
+       void ));
 
 /*
  * init
  */
-extern int monitor_back_register_subsys LDAP_P(( monitor_subsys_t *ms ));
-extern monitor_subsys_t * monitor_back_get_subsys LDAP_P(( const char *name ));
-extern monitor_subsys_t * monitor_back_get_subsys_by_dn LDAP_P(( struct berval *ndn, int sub ));
-extern int monitor_back_register_entry LDAP_P(( Entry *e, monitor_callback_t *cb ));
-extern int monitor_filter2ndn LDAP_P(( struct berval *base, int scope, struct berval *filter, struct berval *ndn ));
-extern int monitor_back_register_entry_attrs LDAP_P(( struct berval *ndn, Attribute *a, monitor_callback_t *cb, struct berval *base, int scope, struct berval *filter ));
-extern int monitor_back_register_entry_callback LDAP_P(( struct berval *ndn, monitor_callback_t *cb, struct berval *base, int scope, struct berval *filter ));
+extern int
+monitor_back_register_subsys LDAP_P((
+       monitor_subsys_t        *ms ));
+extern monitor_subsys_t *
+monitor_back_get_subsys LDAP_P((
+       const char              *name ));
+extern monitor_subsys_t *
+monitor_back_get_subsys_by_dn LDAP_P((
+       struct berval           *ndn,
+       int                     sub ));
+extern int
+monitor_back_register_entry LDAP_P((
+       Entry                   *e,
+       monitor_callback_t      *cb ));
+extern int
+monitor_back_register_entry_parent LDAP_P((
+       Entry                   *e,
+       monitor_callback_t      *cb,
+       struct berval           *base,
+       int                     scope,
+       struct berval           *filter ));
+extern int
+monitor_filter2ndn LDAP_P((
+       struct berval           *base,
+       int                     scope,
+       struct berval           *filter,
+       struct berval           *ndn ));
+extern int
+monitor_back_register_entry_attrs LDAP_P((
+       struct berval           *ndn,
+       Attribute               *a,
+       monitor_callback_t      *cb,
+       struct berval           *base,
+       int                     scope,
+       struct berval           *filter ));
+extern int
+monitor_back_register_entry_callback LDAP_P((
+       struct berval           *ndn,
+       monitor_callback_t      *cb,
+       struct berval           *base,
+       int                     scope,
+       struct berval           *filter ));
 
 /*
  * listener
  */
-int monitor_subsys_listener_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
+extern int
+monitor_subsys_listener_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
 
 /*
  * log
  */
-int monitor_subsys_log_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
-int monitor_subsys_log_modify LDAP_P(( Operation *op, Entry *e ));
+extern int
+monitor_subsys_log_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
+extern int
+monitor_subsys_log_modify LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
 
 /*
  * operations
  */
-int monitor_subsys_ops_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
-int monitor_subsys_ops_update LDAP_P(( Operation *op, Entry *e ));
+extern int
+monitor_subsys_ops_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
+extern int
+monitor_subsys_ops_update LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
 
 /*
  * overlay
  */
-int monitor_subsys_overlay_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
+extern int
+monitor_subsys_overlay_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
 
 /*
  * sent
  */
-int monitor_subsys_sent_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
-int monitor_subsys_sent_update LDAP_P(( Operation *op, Entry *e ));
+extern int
+monitor_subsys_sent_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
+extern int
+monitor_subsys_sent_update LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
 
 /*
  * threads
  */
-int monitor_subsys_thread_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
-int monitor_subsys_thread_update LDAP_P(( Operation *op, Entry *e ));
+extern int
+monitor_subsys_thread_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
+extern int
+monitor_subsys_thread_update LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
 
 /*
  * time
  */
-int monitor_subsys_time_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
-int monitor_subsys_time_update LDAP_P(( Operation *op, Entry *e ));
+extern int monitor_subsys_time_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
+extern int
+monitor_subsys_time_update LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
 
 /*
  * waiters
  */
-int monitor_subsys_rww_init LDAP_P(( BackendDB *be, monitor_subsys_t *ms ));
-int monitor_subsys_rww_update LDAP_P(( Operation *op, Entry *e ));
+extern int
+monitor_subsys_rww_init LDAP_P((
+       BackendDB               *be,
+       monitor_subsys_t        *ms ));
+extern int
+monitor_subsys_rww_update LDAP_P((
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e ));
 
 /* NOTE: this macro assumes that bv has been allocated
  * by ber_* malloc functions or is { 0L, NULL } */
index 150484689779004774a3ea9239b0657ad904eb71..b8f82ab049539d127426877bcbefae009c2ccb3c 100644 (file)
@@ -110,7 +110,7 @@ monitor_subsys_rww_init(
                ber_dupbv( &monitor_rww[ i ].nrdn, &nrdn );
        
                BER_BVSTR( &bv, "0" );
-               attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
+               attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
        
                mp = monitor_entrypriv_create();
                if ( mp == NULL ) {
@@ -142,6 +142,7 @@ monitor_subsys_rww_init(
 int
 monitor_subsys_rww_update(
        Operation               *op,
+       SlapReply               *rs,
        Entry                   *e
 )
 {
@@ -170,7 +171,7 @@ monitor_subsys_rww_update(
        }
 
        if ( i == MONITOR_RWW_LAST ) {
-               return 0;
+               return SLAP_CB_CONTINUE;
        }
 
        nconns = nwritewaiters = nreadwaiters = 0;
@@ -211,7 +212,7 @@ monitor_subsys_rww_update(
                a->a_vals[ 0 ].bv_val = ber_memrealloc( a->a_vals[ 0 ].bv_val, len + 1 );
                if ( BER_BVISNULL( &a->a_vals[ 0 ] ) ) {
                        BER_BVZERO( &a->a_vals[ 0 ] );
-                       return( 0 );
+                       return SLAP_CB_CONTINUE;
                }
        }
        AC_MEMCPY( a->a_vals[ 0 ].bv_val, buf, len + 1 );
@@ -219,6 +220,6 @@ monitor_subsys_rww_update(
 
        /* FIXME: touch modifyTimestamp? */
 
-       return( 0 );
+       return SLAP_CB_CONTINUE;
 }
 
index 9bbe61ce03cbafb58757bbbe90b5555b6493f241..d2e7982c004372afa2360d50f303c827f7f9b8f9 100644 (file)
@@ -48,7 +48,7 @@ monitor_send_children(
 
        e_ch = NULL;
        if ( MONITOR_HAS_VOLATILE_CH( mp ) ) {
-               monitor_entry_create( op, NULL, e_parent, &e_ch );
+               monitor_entry_create( op, rs, NULL, e_parent, &e_ch );
        }
        monitor_cache_release( mi, e_parent );
 
@@ -56,7 +56,7 @@ monitor_send_children(
        if ( e_ch == NULL ) {
                /* no persistent entries? return */
                if ( e == NULL ) {
-                       return( 0 );
+                       return LDAP_SUCCESS;
                }
        
        /* volatile entries */
@@ -86,7 +86,12 @@ monitor_send_children(
        for ( ; e != NULL; ) {
                mp = ( monitor_entry_t * )e->e_private;
 
-               monitor_entry_update( op, e );
+               monitor_entry_update( op, rs, e );
+
+               if ( op->o_abandon ) {
+                       monitor_cache_release( mi, e );
+                       return SLAPD_ABANDON;
+               }
                
                rc = test_filter( op, e, op->oq_search.rs_filter );
                if ( rc == LDAP_COMPARE_TRUE ) {
@@ -97,9 +102,11 @@ monitor_send_children(
                }
 
                if ( ( mp->mp_children || MONITOR_HAS_VOLATILE_CH( mp ) )
-                               && sub ) {
+                               && sub )
+               {
                        rc = monitor_send_children( op, rs, e, sub );
                        if ( rc ) {
+                               monitor_cache_release( mi, e );
                                return( rc );
                        }
                }
@@ -112,7 +119,7 @@ monitor_send_children(
                e = e_tmp;
        }
        
-       return( 0 );
+       return LDAP_SUCCESS;
 }
 
 int
@@ -121,16 +128,27 @@ monitor_back_search( Operation *op, SlapReply *rs )
        monitor_info_t  *mi = ( monitor_info_t * )op->o_bd->be_private;
        int             rc = LDAP_SUCCESS;
        Entry           *e = NULL, *matched = NULL;
+       slap_mask_t     mask;
 
        Debug( LDAP_DEBUG_TRACE, "=> monitor_back_search\n", 0, 0, 0 );
 
 
        /* get entry with reader lock */
-       monitor_cache_dn2entry( op, &op->o_req_ndn, &e, &matched );
+       monitor_cache_dn2entry( op, rs, &op->o_req_ndn, &e, &matched );
        if ( e == NULL ) {
                rs->sr_err = LDAP_NO_SUCH_OBJECT;
                if ( matched ) {
-                       rs->sr_matched = matched->e_dn;
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+                       if ( !access_allowed_mask( op, matched,
+                                       slap_schema.si_ad_entry,
+                                       NULL, ACL_DISCLOSE, NULL, NULL ) )
+                       {
+                               /* do nothing */ ;
+                       } else 
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+                       {
+                               rs->sr_matched = matched->e_dn;
+                       }
                }
 
                send_ldap_result( op, rs );
@@ -139,13 +157,34 @@ monitor_back_search( Operation *op, SlapReply *rs )
                        rs->sr_matched = NULL;
                }
 
-               return( 0 );
+               return rs->sr_err;
+       }
+
+       /* NOTE: __NEW__ "search" access is required
+        * on searchBase object */
+       if ( !access_allowed_mask( op, e, slap_schema.si_ad_entry,
+                               NULL, ACL_SEARCH, NULL, &mask ) )
+       {
+               monitor_cache_release( mi, e );
+
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+               if ( !ACL_GRANT( mask, ACL_DISCLOSE ) ) {
+                       rs->sr_err = LDAP_NO_SUCH_OBJECT;
+               } else 
+#endif /* SLAP_ACL_HONOR_DISCLOSE */
+               {
+                       rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
+               }
+
+               send_ldap_result( op, rs );
+
+               return rs->sr_err;
        }
 
        rs->sr_attrs = op->oq_search.rs_attrs;
        switch ( op->oq_search.rs_scope ) {
        case LDAP_SCOPE_BASE:
-               monitor_entry_update( op, e );
+               monitor_entry_update( op, rs, e );
                rc = test_filter( op, e, op->oq_search.rs_filter );
                if ( rc == LDAP_COMPARE_TRUE ) {
                        rs->sr_entry = e;
@@ -159,14 +198,10 @@ monitor_back_search( Operation *op, SlapReply *rs )
 
        case LDAP_SCOPE_ONELEVEL:
                rc = monitor_send_children( op, rs, e, 0 );
-               if ( rc ) {
-                       rc = LDAP_OTHER;
-               }
-               
                break;
 
        case LDAP_SCOPE_SUBTREE:
-               monitor_entry_update( op, e );
+               monitor_entry_update( op, rs, e );
                rc = test_filter( op, e, op->oq_search.rs_filter );
                if ( rc == LDAP_COMPARE_TRUE ) {
                        rs->sr_entry = e;
@@ -176,17 +211,15 @@ monitor_back_search( Operation *op, SlapReply *rs )
                }
 
                rc = monitor_send_children( op, rs, e, 1 );
-               if ( rc ) {
-                       rc = LDAP_OTHER;
-               }
-
                break;
        }
-       
+
        rs->sr_attrs = NULL;
        rs->sr_err = rc;
-       send_ldap_result( op, rs );
+       if ( rs->sr_err != SLAPD_ABANDON ) {
+               send_ldap_result( op, rs );
+       }
 
-       return( rc == LDAP_SUCCESS ? 0 : 1 );
+       return rs->sr_err;
 }
 
index b7ba178f55a3685d4ab9f979134a5d010f5bfbaa..6600ee6ae13b0a438a7149d284b1482186025150 100644 (file)
@@ -114,7 +114,7 @@ monitor_subsys_sent_init(
                ber_dupbv( &monitor_sent[ i ].nrdn, &nrdn );
        
                BER_BVSTR( &bv, "0" );
-               attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
+               attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
        
                mp = monitor_entrypriv_create();
                if ( mp == NULL ) {
@@ -146,8 +146,8 @@ monitor_subsys_sent_init(
 int
 monitor_subsys_sent_update(
        Operation               *op,
-       Entry                   *e
-)
+       SlapReply               *rs,
+       Entry                   *e )
 {
        monitor_info_t  *mi = ( monitor_info_t *)op->o_bd->be_private;
        
@@ -168,7 +168,7 @@ monitor_subsys_sent_update(
        }
 
        if ( i == MONITOR_SENT_LAST ) {
-               return 0;
+               return SLAP_CB_CONTINUE;
        }
 
        ldap_pvt_thread_mutex_lock(&slap_counters.sc_sent_mutex);
@@ -203,6 +203,6 @@ monitor_subsys_sent_update(
 
        /* FIXME: touch modifyTimestamp? */
 
-       return 0;
+       return SLAP_CB_CONTINUE;
 }
 
index 83ba5ce522c99f8ee54c50ed3c7ebad6f29e6709..5d393a8e197d6f55d6c69737535bd8a927b27472 100644 (file)
@@ -27,6 +27,8 @@
 #include "slap.h"
 #include "back-monitor.h"
 
+#include <ldap_rq.h>
+
 /*
 *  * initializes log subentry
 *   */
@@ -158,6 +160,57 @@ monitor_subsys_thread_init(
        *ep = e;
        ep = &mp->mp_next;
 
+       /*
+        * Runqueue runners
+        */
+       snprintf( buf, sizeof( buf ),
+                       "dn: cn=Runqueue,%s\n"
+                       "objectClass: %s\n"
+                       "structuralObjectClass: %s\n"
+                       "cn: Runqueue\n"
+                       "%s: 0\n"
+                       "creatorsName: %s\n"
+                       "modifiersName: %s\n"
+                       "createTimestamp: %s\n"
+                       "modifyTimestamp: %s\n",
+                       ms->mss_dn.bv_val,
+                       mi->mi_oc_monitoredObject->soc_cname.bv_val,
+                       mi->mi_oc_monitoredObject->soc_cname.bv_val,
+                       mi->mi_ad_monitoredInfo->ad_cname.bv_val,
+                       mi->mi_creatorsName.bv_val,
+                       mi->mi_creatorsName.bv_val,
+                       mi->mi_startTime.bv_val,
+                       mi->mi_startTime.bv_val );
+
+       e = str2entry( buf );
+       if ( e == NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "monitor_subsys_thread_init: "
+                       "unable to create entry \"cn=Runqueue,%s\"\n",
+                       ms->mss_ndn.bv_val, 0, 0 );
+               return( -1 );
+       }
+
+       mp = monitor_entrypriv_create();
+       if ( mp == NULL ) {
+               return -1;
+       }
+       e->e_private = ( void * )mp;
+       mp->mp_info = ms;
+       mp->mp_flags = ms->mss_flags \
+               | MONITOR_F_SUB | MONITOR_F_PERSISTENT;
+
+       if ( monitor_cache_add( mi, e ) ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "monitor_subsys_thread_init: "
+                       "unable to add entry \"cn=Runqueue,%s\"\n",
+                       ms->mss_ndn.bv_val, 0, 0 );
+               return( -1 );
+       }
+       
+       *ep = e;
+       ep = &mp->mp_next;
+
        monitor_cache_release( mi, e_thread );
 
        return( 0 );
@@ -166,6 +219,7 @@ monitor_subsys_thread_init(
 int 
 monitor_subsys_thread_update( 
        Operation               *op,
+       SlapReply               *rs,
        Entry                   *e
 )
 {
@@ -173,32 +227,60 @@ monitor_subsys_thread_update(
        Attribute               *a;
        char                    buf[ BACKMONITOR_BUFSIZE ];
        static struct berval    backload_bv = BER_BVC( "cn=backload" );
-       struct berval           rdn;
+       static struct berval    runqueue_bv = BER_BVC( "cn=runqueue" );
+       struct berval           rdn, bv;
        ber_len_t               len;
+       int which = 0, i;
+       struct re_s *re;
 
        assert( mi != NULL );
 
        dnRdn( &e->e_nname, &rdn );
-       if ( !dn_match( &rdn, &backload_bv ) ) {
-               return 0;
+       if ( dn_match( &rdn, &backload_bv ) ) {
+               which = 1;
+
+       } else if ( dn_match( &rdn, &runqueue_bv ) ) {
+               which = 2;
+
+       } else {
+               return SLAP_CB_CONTINUE;
        }
 
        a = attr_find( e->e_attrs, mi->mi_ad_monitoredInfo );
        if ( a == NULL ) {
-               return -1;
+               return rs->sr_err = LDAP_OTHER;
        }
 
-       snprintf( buf, sizeof( buf ), "%d", 
+       switch ( which ) {
+       case 1:
+               snprintf( buf, sizeof( buf ), "%d", 
                        ldap_pvt_thread_pool_backload( &connection_pool ) );
-       len = strlen( buf );
-       if ( len > a->a_vals[ 0 ].bv_len ) {
-               a->a_vals[ 0 ].bv_val = ber_memrealloc( a->a_vals[ 0 ].bv_val, len + 1 );
+               len = strlen( buf );
+               if ( len > a->a_vals[ 0 ].bv_len ) {
+                       a->a_vals[ 0 ].bv_val = ber_memrealloc( a->a_vals[ 0 ].bv_val, len + 1 );
+               }
+               a->a_vals[ 0 ].bv_len = len;
+               AC_MEMCPY( a->a_vals[ 0 ].bv_val, buf, len + 1 );
+               break;
+
+       case 2:
+               for ( i = 0; !BER_BVISNULL( a->a_vals + i ); i++) {
+                       ch_free( a->a_vals[i].bv_val );
+                       BER_BVZERO( a->a_vals + i );
+               }
+               bv.bv_val = buf;
+               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+               LDAP_STAILQ_FOREACH( re, &slapd_rq.run_list, rnext ) {
+                       bv.bv_len = snprintf( buf, sizeof( buf ), "%s(%s)",
+                               re->tname, re->tspec );
+                       value_add_one( &a->a_vals, &bv );
+               }
+               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+               break;
        }
-       a->a_vals[ 0 ].bv_len = len;
-       AC_MEMCPY( a->a_vals[ 0 ].bv_val, buf, len + 1 );
 
        /* FIXME: touch modifyTimestamp? */
 
-       return( 0 );
+       return SLAP_CB_CONTINUE;
 }
 
index 016b233613861db5dcb254d36bdbe762cc59092d..685365c9eba0f4e2553e4ba55b50b62754555332 100644 (file)
@@ -169,8 +169,8 @@ monitor_subsys_time_init(
 int
 monitor_subsys_time_update(
        Operation               *op,
-       Entry                   *e
-)
+       SlapReply               *rs,
+       Entry                   *e )
 {
        monitor_info_t          *mi = ( monitor_info_t * )op->o_bd->be_private;
        static struct berval    bv_current = BER_BVC( "cn=current" );
@@ -219,7 +219,7 @@ monitor_subsys_time_update(
 
                a = attr_find( e->e_attrs, mi->mi_ad_monitorTimestamp );
                if ( a == NULL ) {
-                       return( -1 );
+                       return rs->sr_err = LDAP_OTHER;
                }
 
                assert( len == a->a_vals[ 0 ].bv_len );
@@ -228,6 +228,6 @@ monitor_subsys_time_update(
                /* FIXME: touch modifyTimestamp? */
        }
 
-       return( 0 );
+       return SLAP_CB_CONTINUE;
 }
 
index e57dae399dc1fe7aaeff040076fdbcf963478b2d..d1e8b010963e561eae71b0d4ba7601bafa2f7121 100644 (file)
@@ -25,6 +25,9 @@
 
 ldap_pvt_thread_mutex_t passwd_mutex;
 
+AttributeDescription *ad_sn;
+AttributeDescription *ad_desc;
+
 int
 passwd_back_initialize(
     BackendInfo        *bi
@@ -32,7 +35,7 @@ passwd_back_initialize(
 {
        ldap_pvt_thread_mutex_init( &passwd_mutex );
 
-       bi->bi_open = 0;
+       bi->bi_open = passwd_back_open;
        bi->bi_config = 0;
        bi->bi_close = 0;
        bi->bi_destroy = passwd_back_destroy;
@@ -63,6 +66,32 @@ passwd_back_initialize(
        return 0;
 }
 
+int
+passwd_back_open(
+       BackendInfo *bi
+)
+{
+       const char      *text;
+       int             rc;
+
+       rc = slap_str2ad( "sn", &ad_sn, &text );
+       if ( rc != LDAP_SUCCESS ) {
+               Debug( LDAP_DEBUG_ANY, "passwd_back_open: "
+                       "slap_str2ad(\"%s\") returned %d: %s\n",
+                       "sn", rc, text );
+               return -1;
+       }
+       rc = slap_str2ad( "description", &ad_desc, &text );
+       if ( rc != LDAP_SUCCESS ) {
+               Debug( LDAP_DEBUG_ANY, "passwd_back_open: "
+                       "slap_str2ad(\"%s\") returned %d: %s\n",
+                       "description", rc, text );
+               return -1;
+       }
+
+       return 0;
+}
+
 int
 passwd_back_destroy(
        BackendInfo *bi
index cf42f7a85e6c61e381b51da5a7202a4b194aa903..7d71e5fe48a6ab52c08a291497370435d34ff193 100644 (file)
 LDAP_BEGIN_DECL
 
 extern BI_init         passwd_back_initialize;
-
+extern BI_open         passwd_back_open;
 extern BI_destroy      passwd_back_destroy;
-
 extern BI_db_config    passwd_back_db_config;
-
 extern BI_op_search    passwd_back_search;
 
+extern AttributeDescription    *ad_sn;
+extern AttributeDescription    *ad_desc;
 LDAP_END_DECL
 
 #endif /* PROTO_PASSWD_H */
index ab2c7c1a2262af6289fd10dcf39a556db774de9f..e32e8b9b6dbb65f7f6d4dfeb80085a0f6e5d1892 100644 (file)
 
 static void pw_start( Backend *be );
 
-static Entry *pw2entry(
-       Backend *be,
-       struct passwd *pw,
-       const char **text);
+static int pw2entry(
+       Backend         *be,
+       struct passwd   *pw,
+       Entry           *ep );
 
 int
 passwd_back_search(
@@ -59,8 +59,6 @@ passwd_back_search(
     SlapReply  *rs )
 {
        struct passwd   *pw;
-       Entry           *e;
-       char            *s;
        time_t          stoptime;
 
        LDAPRDN rdn = NULL;
@@ -68,34 +66,31 @@ passwd_back_search(
 
        AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass;
 
-       if (op->ors_tlimit != SLAP_NO_LIMIT ) {
+       if ( op->ors_tlimit != SLAP_NO_LIMIT ) {
                stoptime = op->o_time + op->ors_tlimit;
        }
 
        /* Handle a query for the base of this backend */
        if ( be_issuffix( op->o_bd, &op->o_req_ndn ) ) {
-               struct berval   vals[2];
-
-               vals[1].bv_val = NULL;
+               struct berval   val;
 
                rs->sr_matched = op->o_req_dn.bv_val;
 
                if( op->ors_scope != LDAP_SCOPE_ONELEVEL ) {
-                       AttributeDescription *desc = NULL;
+                       AttributeDescription    *desc = NULL;
+                       char                    *next;
+                       Entry                   e = { 0 };
 
                        /* Create an entry corresponding to the base DN */
-                       e = (Entry *) ch_calloc(1, sizeof(Entry));
-                       e->e_name.bv_val = ch_strdup( op->o_req_dn.bv_val );
-                       e->e_name.bv_len = op->o_req_dn.bv_len;
-                       e->e_nname.bv_val =  ch_strdup( op->o_req_ndn.bv_val );
-                       e->e_nname.bv_len = op->o_req_ndn.bv_len;
-                       e->e_attrs = NULL;
-                       e->e_private = NULL;
+                       e.e_name.bv_val = ch_strdup( op->o_req_dn.bv_val );
+                       e.e_name.bv_len = op->o_req_dn.bv_len;
+                       e.e_nname.bv_val =  ch_strdup( op->o_req_ndn.bv_val );
+                       e.e_nname.bv_len = op->o_req_ndn.bv_len;
 
                        /* Use the first attribute of the DN
                        * as an attribute within the entry itself.
                        */
-                       if( ldap_bv2rdn( &op->o_req_dn, &rdn, (char **)&rs->sr_text, 
+                       if( ldap_bv2rdn( &op->o_req_dn, &rdn, &next, 
                                LDAP_DN_FORMAT_LDAP ) )
                        {
                                rs->sr_err = LDAP_INVALID_DN_SYNTAX;
@@ -108,8 +103,7 @@ passwd_back_search(
                                goto done;
                        }
 
-                       vals[0] = rdn[0]->la_value;
-                       attr_mergeit( e, desc, vals );
+                       attr_merge_normalize_one( &e, desc, &rdn[0]->la_value, NULL );
 
                        ldap_rdnfree(rdn);
                        rdn = NULL;
@@ -121,16 +115,17 @@ passwd_back_search(
                         *
                         * should be a configuratable item
                         */
-                       vals[0].bv_val = "organizationalUnit";
-                       vals[0].bv_len = sizeof("organizationalUnit")-1;
-                       attr_mergeit( e, ad_objectClass, vals );
+                       BER_BVSTR( &val, "organizationalUnit" );
+                       attr_merge_one( &e, ad_objectClass, &val, NULL );
        
-                       if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
-                               rs->sr_entry = e;
+                       if ( test_filter( op, &e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
+                               rs->sr_entry = &e;
                                rs->sr_attrs = op->ors_attrs;
                                rs->sr_flags = REP_ENTRY_MODIFIABLE;
                                send_search_entry( op, rs );
                        }
+
+                       entry_clean( &e );
                }
 
                if ( op->ors_scope != LDAP_SCOPE_BASE ) {
@@ -139,6 +134,8 @@ passwd_back_search(
                        ldap_pvt_thread_mutex_lock( &passwd_mutex );
                        pw_start( op->o_bd );
                        for ( pw = getpwent(); pw != NULL; pw = getpwent() ) {
+                               Entry           e = { 0 };
+
                                /* check for abandon */
                                if ( op->o_abandon ) {
                                        endpwent();
@@ -156,14 +153,14 @@ passwd_back_search(
                                        return( 0 );
                                }
 
-                               if ( !(e = pw2entry( op->o_bd, pw, &rs->sr_text )) ) {
+                               if ( pw2entry( op->o_bd, pw, &e ) ) {
                                        rs->sr_err = LDAP_OTHER;
                                        endpwent();
                                        ldap_pvt_thread_mutex_unlock( &passwd_mutex );
                                        goto done;
                                }
 
-                               if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
+                               if ( test_filter( op, &e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
                                        /* check size limit */
                                        if ( --op->ors_slimit == -1 ) {
                                                send_ldap_error( op, rs, LDAP_SIZELIMIT_EXCEEDED, NULL );
@@ -172,19 +169,23 @@ passwd_back_search(
                                                return( 0 );
                                        }
 
-                                       rs->sr_entry = e;
+                                       rs->sr_entry = &e;
                                        rs->sr_attrs = op->ors_attrs;
                                        rs->sr_flags = REP_ENTRY_MODIFIABLE;
                                        send_search_entry( op, rs );
                                }
 
-                               entry_free( e );
+                               entry_clean( &e );
                        }
                        endpwent();
                        ldap_pvt_thread_mutex_unlock( &passwd_mutex );
                }
 
        } else {
+               char    *next;
+               Entry   e = { 0 };
+               int     rc;
+
                if (! be_issuffix( op->o_bd, &op->o_req_ndn ) ) {
                        dnParent( &op->o_req_ndn, &parent );
                }
@@ -208,7 +209,7 @@ passwd_back_search(
                        goto done;
                }
 
-               if ( ldap_bv2rdn( &op->o_req_dn, &rdn, (char **)&rs->sr_text,
+               if ( ldap_bv2rdn( &op->o_req_dn, &rdn, &next,
                        LDAP_DN_FORMAT_LDAP ))
                { 
                        rs->sr_err = LDAP_OTHER;
@@ -217,28 +218,29 @@ passwd_back_search(
 
                ldap_pvt_thread_mutex_lock( &passwd_mutex );
                pw_start( op->o_bd );
-               if ( (pw = getpwnam( rdn[0]->la_value.bv_val )) == NULL ) {
+               pw = getpwnam( rdn[0]->la_value.bv_val );
+               if ( pw == NULL ) {
                        rs->sr_matched = parent.bv_val;
                        rs->sr_err = LDAP_NO_SUCH_OBJECT;
                        ldap_pvt_thread_mutex_unlock( &passwd_mutex );
                        goto done;
                }
 
-               e = pw2entry( op->o_bd, pw, &rs->sr_text );
+               rc = pw2entry( op->o_bd, pw, &e );
                ldap_pvt_thread_mutex_unlock( &passwd_mutex );
-               if ( !e ) {
+               if ( rc ) {
                        rs->sr_err = LDAP_OTHER;
                        goto done;
                }
 
-               if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
-                       rs->sr_entry = e;
+               if ( test_filter( op, &e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
+                       rs->sr_entry = &e;
                        rs->sr_attrs = op->ors_attrs;
                        rs->sr_flags = REP_ENTRY_MODIFIABLE;
                        send_search_entry( op, rs );
                }
 
-               entry_free( e );
+               entry_clean( &e );
        }
 
 done:
@@ -264,30 +266,14 @@ pw_start(
 #endif /* HAVE_SETPWFILE */
 }
 
-static Entry *
-pw2entry( Backend *be, struct passwd *pw, const char **text )
+static int
+pw2entry( Backend *be, struct passwd *pw, Entry *e )
 {
-       size_t pwlen;
-       Entry           *e;
-       struct berval   vals[2];
+       size_t          pwlen;
+       struct berval   val;
        struct berval   bv;
 
-       int rc;
-
-       AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass;
-       AttributeDescription *ad_cn = NULL;
-       AttributeDescription *ad_sn = NULL;
-       AttributeDescription *ad_uid = NULL;
-       AttributeDescription *ad_description = NULL;
-
-       rc = slap_str2ad( "cn", &ad_cn, text );
-       if(rc != LDAP_SUCCESS) return NULL;
-       rc = slap_str2ad( "sn", &ad_sn, text );
-       if(rc != LDAP_SUCCESS) return NULL;
-       rc = slap_str2ad( "uid", &ad_uid, text );
-       if(rc != LDAP_SUCCESS) return NULL;
-       rc = slap_str2ad( "description", &ad_description, text );
-       if(rc != LDAP_SUCCESS) return NULL;
+       int             rc;
 
        /*
         * from pw we get pw_name and make it cn
@@ -295,45 +281,36 @@ pw2entry( Backend *be, struct passwd *pw, const char **text )
         */
 
        pwlen = strlen( pw->pw_name );
-       vals[0].bv_len = (sizeof("uid=,")-1) + ( pwlen + be->be_suffix[0].bv_len );
-       vals[0].bv_val = ch_malloc( vals[0].bv_len + 1 );
+       val.bv_len = STRLENOF("uid=,") + ( pwlen + be->be_suffix[0].bv_len );
+       val.bv_val = ch_malloc( val.bv_len + 1 );
 
        /* rdn attribute type should be a configuratable item */
-       sprintf( vals[0].bv_val, "uid=%s,%s",
+       sprintf( val.bv_val, "uid=%s,%s",
                pw->pw_name, be->be_suffix[0].bv_val );
 
-       rc = dnNormalize( 0, NULL, NULL, vals, &bv, NULL );
+       rc = dnNormalize( 0, NULL, NULL, &val, &bv, NULL );
        if( rc != LDAP_SUCCESS ) {
-               free( vals[0].bv_val );
-               return NULL;
+               free( val.bv_val );
+               return( -1 );
        }
 
-       e = (Entry *) ch_calloc( 1, sizeof(Entry) );
-       e->e_name = vals[0];
+       e->e_name = val;
        e->e_nname = bv;
 
        e->e_attrs = NULL;
 
-       vals[1].bv_val = NULL;
-
        /* objectclasses should be configurable items */
-       vals[0].bv_val = "top";
-       vals[0].bv_len = sizeof("top")-1;
-       attr_mergeit( e, ad_objectClass, vals );
+       BER_BVSTR( &val, "person" );
+       attr_merge_one( e, slap_schema.si_ad_objectClass, &val, NULL );
 
-       vals[0].bv_val = "person";
-       vals[0].bv_len = sizeof("person")-1;
-       attr_mergeit( e, ad_objectClass, vals );
+       BER_BVSTR( &val, "uidObject" );
+       attr_merge_one( e, slap_schema.si_ad_objectClass, &val, NULL );
 
-       vals[0].bv_val = "uidObject";
-       vals[0].bv_len = sizeof("uidObject")-1;
-       attr_mergeit( e, ad_objectClass, vals );
-
-       vals[0].bv_val = pw->pw_name;
-       vals[0].bv_len = pwlen;
-       attr_mergeit( e, ad_uid, vals );        /* required by uidObject */
-       attr_mergeit( e, ad_cn, vals ); /* required by person */
-       attr_mergeit( e, ad_sn, vals ); /* required by person */
+       val.bv_val = pw->pw_name;
+       val.bv_len = pwlen;
+       attr_merge_normalize_one( e, slap_schema.si_ad_uid, &val, NULL );       /* required by uidObject */
+       attr_merge_normalize_one( e, slap_schema.si_ad_cn, &val, NULL );        /* required by person */
+       attr_merge_normalize_one( e, ad_sn, &val, NULL );       /* required by person */
 
 #ifdef HAVE_PW_GECOS
        /*
@@ -344,40 +321,38 @@ pw2entry( Backend *be, struct passwd *pw, const char **text )
        if (pw->pw_gecos[0]) {
                char *s;
 
-               vals[0].bv_val = pw->pw_gecos;
-               vals[0].bv_len = strlen(vals[0].bv_val);
-               attr_mergeit(e, ad_description, vals);
+               ber_str2bv( pw->pw_gecos, 0, 0, &val );
+               attr_merge_normalize_one( e, ad_desc, &val, NULL );
 
-               s = strchr(vals[0].bv_val, ',');
-               if (s) *s = '\0';
+               s = strchr( val.bv_val, ',' );
+               if ( s ) *s = '\0';
 
-               s = strchr(vals[0].bv_val, '&');
-               if (s) {
+               s = strchr( val.bv_val, '&' );
+               if ( s ) {
                        char buf[1024];
 
-                       if( vals[0].bv_len + pwlen < sizeof(buf) ) {
-                               int i = s - vals[0].bv_val;
-                               strncpy(buf, vals[0].bv_val, i);
-                               s = buf+i;
-                               strcpy(s, pw->pw_name);
+                       if( val.bv_len + pwlen < sizeof(buf) ) {
+                               int i = s - val.bv_val;
+                               strncpy( buf, val.bv_val, i );
+                               s = buf + i;
+                               strcpy( s, pw->pw_name );
                                *s = TOUPPER((unsigned char)*s);
-                               strcat(s, vals[0].bv_val+i+1);
-                               vals[0].bv_val = buf;
+                               strcat( s, val.bv_val + i + 1 );
+                               val.bv_val = buf;
                        }
                }
-               vals[0].bv_len = strlen(vals[0].bv_val);
+               val.bv_len = strlen( val.bv_val );
 
-               if ( vals[0].bv_len && strcasecmp( vals[0].bv_val, pw->pw_name )) {
-                       attr_mergeit( e, ad_cn, vals );
+               if ( val.bv_len && strcasecmp( val.bv_val, pw->pw_name ) ) {
+                       attr_merge_normalize_one( e, slap_schema.si_ad_cn, &val, NULL );
                }
 
-               if ( (s=strrchr(vals[0].bv_val, ' '))) {
-                       vals[0].bv_val = s + 1;
-                       vals[0].bv_len = strlen(vals[0].bv_val);
-                       attr_mergeit(e, ad_sn, vals);
+               if ( ( s = strrchr(val.bv_val, ' ' ) ) ) {
+                       ber_str2bv( s + 1, 0, 0, &val );
+                       attr_merge_normalize_one( e, ad_sn, &val, NULL );
                }
        }
-#endif
+#endif /* HAVE_PW_GECOS */
 
-       return( e );
+       return( 0 );
 }
index 120ed0e9ceb0354c635775837e8d3956ef18e221..3ae45cec7095f2275e6b2bb206ea6d6742858d46 100644 (file)
@@ -55,7 +55,7 @@ shell_back_add(
        }
 
        if ( ! access_allowed( op, op->oq_add.rs_e,
-               entry, NULL, ACL_WRITE, NULL ) )
+               entry, NULL, ACL_WADD, NULL ) )
        {
                send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, NULL );
                return -1;
index 8721efb082b5882f7fa457f5c4be382769e94af1..df81625688bfe6fe17feeb5f0e48e26f9db93dbe 100644 (file)
@@ -64,7 +64,7 @@ shell_back_delete(
        e.e_private = NULL;
 
        if ( ! access_allowed( op, &e,
-               entry, NULL, ACL_WRITE, NULL ) )
+               entry, NULL, ACL_WDEL, NULL ) )
        {
                send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, NULL );
                return -1;
index 6388f17f6d3a9a388978beacedf486a968bea7fb..60484def5b2b2b3a3a89fec54b475eb607b36fb6 100644 (file)
@@ -63,8 +63,9 @@ shell_back_modrdn(
        e.e_bv.bv_val = NULL;
        e.e_private = NULL;
 
-       if ( ! access_allowed( op, &e,
-               entry, NULL, ACL_WRITE, NULL ) )
+       if ( ! access_allowed( op, &e, entry, NULL,
+                       op->oq_modrdn.rs_newSup ? ACL_WDEL : ACL_WRITE,
+                       NULL ) )
        {
                send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, NULL );
                return -1;
@@ -83,7 +84,7 @@ shell_back_modrdn(
        fprintf( wfp, "dn: %s\n", op->o_req_dn.bv_val );
        fprintf( wfp, "newrdn: %s\n", op->oq_modrdn.rs_newrdn.bv_val );
        fprintf( wfp, "deleteoldrdn: %d\n", op->oq_modrdn.rs_deleteoldrdn ? 1 : 0 );
-       if (op->oq_modrdn.rs_newSup != NULL) {
+       if ( op->oq_modrdn.rs_newSup != NULL ) {
                fprintf( wfp, "newSuperior: %s\n", op->oq_modrdn.rs_newSup->bv_val );
        }
        fclose( wfp );
index 1e46866dd826daaa56582f299cb6f33e0e7ba12d..40aac5a3e42c5eb7b38d5ab4f1297547b1e7a561 100644 (file)
@@ -1152,7 +1152,7 @@ backsql_add( Operation *op, SlapReply *rs )
 
        /* check "children" pseudo-attribute access to parent */
        if ( !access_allowed( op, &p, slap_schema.si_ad_children,
-                               NULL, ACL_WRITE, NULL ) )
+                               NULL, ACL_WADD, NULL ) )
        {
                rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
                e = &p;
@@ -1170,7 +1170,7 @@ backsql_add( Operation *op, SlapReply *rs )
 
        if ( !access_allowed_mask( op, op->ora_e,
                                slap_schema.si_ad_entry,
-                               NULL, ACL_WRITE, NULL, &mask ) )
+                               NULL, ACL_WADD, NULL, &mask ) )
        {
                rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
                e = op->ora_e;
index 79a8e98e54201c9d49292d176407ea45e1833b51..5659541268adaae12a36f7d5779f72bf3deb0f09 100644 (file)
@@ -162,7 +162,7 @@ backsql_delete( Operation *op, SlapReply *rs )
        }
 
        if ( !access_allowed( op, &d, slap_schema.si_ad_entry, 
-                       NULL, ACL_WRITE, NULL ) )
+                       NULL, ACL_WDEL, NULL ) )
        {
                Debug( LDAP_DEBUG_TRACE, "   backsql_delete(): "
                        "no write access to entry\n", 
@@ -186,7 +186,7 @@ backsql_delete( Operation *op, SlapReply *rs )
                        "entry \"%s\" has children\n",
                        op->o_req_dn.bv_val, 0, 0 );
                rs->sr_err = LDAP_NOT_ALLOWED_ON_NONLEAF;
-               rs->sr_text = "subtree delete not supported";
+               rs->sr_text = "subordinate objects must be deleted first";
                /* fallthru */
 
        default:
@@ -238,7 +238,7 @@ backsql_delete( Operation *op, SlapReply *rs )
 
        /* check parent for "children" acl */
        if ( !access_allowed( op, &p, slap_schema.si_ad_children, 
-                       NULL, ACL_WRITE, NULL ) )
+                       NULL, ACL_WDEL, NULL ) )
        {
                Debug( LDAP_DEBUG_TRACE, "   backsql_delete(): "
                        "no write access to parent\n", 
index abfe7027122e8e8bb089763bf864fbb386181221..071be1e47a6a1e9372dd2ae22fc369e234850956 100644 (file)
@@ -299,11 +299,9 @@ backsql_dn2id(
                         */
                        rs->sr_matched = NULL;
                        while ( !be_issuffix( op->o_bd, &pdn ) ) {
-                               struct berval   dn;
                                char            *matchedDN = NULL;
        
-                               dn = pdn;
-                               dnParent( &dn, &pdn );
+                               dnParent( &pdn, &pdn );
        
                                /*
                                 * Empty DN ("") defaults to LDAP_SUCCESS
index a1578e565d8749d6c399feea9a62c11211a6f858..55acd62d2d7b92fe10f550fb51bf7571c4cd97d3 100644 (file)
@@ -194,8 +194,9 @@ backsql_modrdn( Operation *op, SlapReply *rs )
                goto done;
        }
 
-       if ( !access_allowed( op, &p, slap_schema.si_ad_children, 
-                               NULL, ACL_WRITE, NULL ) ) {
+       if ( !access_allowed( op, &p, slap_schema.si_ad_children, NULL,
+                       newSuperior ? ACL_WDEL : ACL_WRITE, NULL ) )
+       {
                Debug( LDAP_DEBUG_TRACE, "   no access to parent\n", 0, 0, 0 );
                rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
                goto done;
@@ -250,7 +251,7 @@ backsql_modrdn( Operation *op, SlapReply *rs )
 #endif /* ! BACKSQL_ARBITRARY_KEY */
 
                if ( !access_allowed( op, &n, slap_schema.si_ad_children, 
-                                       NULL, ACL_WRITE, NULL ) ) {
+                                       NULL, ACL_WADD, NULL ) ) {
                        Debug( LDAP_DEBUG_TRACE, "   backsql_modrdn(): "
                                        "no access to new parent \"%s\"\n", 
                                        new_pdn->bv_val, 0, 0 );
index 9ce43498d3f40329746ebbcf0bc027e3cb2f4d55..bf87251401a4aeba04aff4385d7866005996ad17 100644 (file)
@@ -129,7 +129,7 @@ backsql_make_attr_query(
        backsql_strfcat( &bb, "lbl", 
                        (ber_len_t)STRLENOF( " ORDER BY " BACKSQL_ALIASING_QUOTE ),
                                " ORDER BY " BACKSQL_ALIASING_QUOTE,
-                       &at_map->bam_sel_expr,
+                       &at_map->bam_ad->ad_cname,
                        (ber_len_t)STRLENOF( BACKSQL_ALIASING_QUOTE ),
                                BACKSQL_ALIASING_QUOTE );
 
index 1a0277f25cd89f1d3b1785864e436150629570d2..9a348f44bf00e220fd5c692b4f1afbb7d82b08b5 100644 (file)
@@ -37,8 +37,6 @@
 #include "lutil.h"
 #include "lber_pvt.h"
 
-#include "ldap_rq.h"
-
 #ifdef LDAP_SLAPI
 #include "slapi/slapi.h"
 
@@ -57,10 +55,10 @@ static void call_group_postop_plugins( Operation *op );
  */
 
 int                    nBackendInfo = 0;
-BackendInfo            *backendInfo = NULL;
+slap_bi_head backendInfo = LDAP_STAILQ_HEAD_INITIALIZER(backendInfo);
 
 int                    nBackendDB = 0; 
-BackendDB              *backendDB = NULL;
+slap_be_head backendDB = LDAP_STAILQ_HEAD_INITIALIZER(backendDB);
 
 static int
 backend_init_controls( BackendInfo *bi )
@@ -91,26 +89,25 @@ backend_init_controls( BackendInfo *bi )
 int backend_init(void)
 {
        int rc = -1;
+       BackendInfo *bi;
 
-       if((nBackendInfo != 0) || (backendInfo != NULL)) {
+       if((nBackendInfo != 0) || !LDAP_STAILQ_EMPTY(&backendInfo)) {
                /* already initialized */
                Debug( LDAP_DEBUG_ANY,
                        "backend_init: already initialized\n", 0, 0, 0 );
                return -1;
        }
 
-       for( ;
-               slap_binfo[nBackendInfo].bi_type != NULL;
-               nBackendInfo++ )
+       for( bi=slap_binfo; bi->bi_type != NULL; bi++,nBackendInfo++ )
        {
-               assert( slap_binfo[nBackendInfo].bi_init );
+               assert( bi->bi_init );
 
-               rc = slap_binfo[nBackendInfo].bi_init( &slap_binfo[nBackendInfo] );
+               rc = bi->bi_init( bi );
 
                if(rc != 0) {
                        Debug( LDAP_DEBUG_ANY,
                                "backend_init: initialized for type \"%s\"\n",
-                               slap_binfo[nBackendInfo].bi_type, 0, 0 );
+                               bi->bi_type, 0, 0 );
                        /* destroy those we've already inited */
                        for( nBackendInfo--;
                                nBackendInfo >= 0 ;
@@ -123,10 +120,11 @@ int backend_init(void)
                        }
                        return rc;
                }
+
+               LDAP_STAILQ_INSERT_TAIL(&backendInfo, bi, bi_next);
        }
 
        if ( nBackendInfo > 0) {
-               backendInfo = slap_binfo;
                return 0;
        }
 
@@ -164,25 +162,9 @@ int backend_add(BackendInfo *aBackendInfo)
        (void)backend_init_controls( aBackendInfo );
 
        /* now add the backend type to the Backend Info List */
-       {
-               BackendInfo *newBackendInfo = 0;
-
-               /* if backendInfo == slap_binfo no deallocation of old backendInfo */
-               if (backendInfo == slap_binfo) {
-                       newBackendInfo = ch_calloc(nBackendInfo + 1, sizeof(BackendInfo));
-                       AC_MEMCPY(newBackendInfo, backendInfo,
-                               sizeof(BackendInfo) * nBackendInfo);
-               } else {
-                       newBackendInfo = ch_realloc(backendInfo,
-                               sizeof(BackendInfo) * (nBackendInfo + 1));
-               }
-
-               AC_MEMCPY(&newBackendInfo[nBackendInfo], aBackendInfo,
-                       sizeof(BackendInfo));
-               backendInfo = newBackendInfo;
-               nBackendInfo++;
-               return 0;
-       }
+       LDAP_STAILQ_INSERT_TAIL( &backendInfo, aBackendInfo, bi_next );
+       nBackendInfo++;
+       return 0;
 }
 
 static int
@@ -255,6 +237,7 @@ int backend_startup(Backend *be)
 {
        int i;
        int rc = 0;
+       BackendInfo *bi;
 
        if( ! ( nBackendDB > 0 ) ) {
                /* no databases */
@@ -291,66 +274,43 @@ int backend_startup(Backend *be)
        }
 
        /* open each backend type */
-       for( i = 0; i < nBackendInfo; i++ ) {
-               if( backendInfo[i].bi_nDB == 0) {
+       i = -1;
+       LDAP_STAILQ_FOREACH(bi, &backendInfo, bi_next) {
+               i++;
+               if( bi->bi_nDB == 0) {
                        /* no database of this type, don't open */
                        continue;
                }
 
-               if( backendInfo[i].bi_open ) {
-                       rc = backendInfo[i].bi_open( &backendInfo[i] );
+               if( bi->bi_open ) {
+                       rc = bi->bi_open( bi );
                        if ( rc != 0 ) {
                                Debug( LDAP_DEBUG_ANY,
-                                       "backend_startup: bi_open %d failed!\n",
-                                       i, 0, 0 );
+                                       "backend_startup: bi_open %d (%s) failed!\n",
+                                       i, bi->bi_type, 0 );
                                return rc;
                        }
                }
 
-               (void)backend_init_controls( &backendInfo[i] );
+               (void)backend_init_controls( bi );
        }
 
-       ldap_pvt_thread_mutex_init( &slapd_rq.rq_mutex );
-       LDAP_STAILQ_INIT( &slapd_rq.task_list );
-       LDAP_STAILQ_INIT( &slapd_rq.run_list );
-
        /* open each backend database */
-       for( i = 0; i < nBackendDB; i++ ) {
-               if ( backendDB[i].be_suffix == NULL ) {
+       i = -1;
+       LDAP_STAILQ_FOREACH(be, &backendDB, be_next) {
+               i++;
+               if ( be->be_suffix == NULL ) {
                        Debug( LDAP_DEBUG_ANY,
                                "backend_startup: warning, database %d (%s) "
                                "has no suffix\n",
-                               i, backendDB[i].bd_info->bi_type, 0 );
+                               i, be->bd_info->bi_type, 0 );
                }
                /* append global access controls */
-               acl_append( &backendDB[i].be_acl, frontendDB->be_acl );
+               acl_append( &be->be_acl, frontendDB->be_acl, -1 );
 
-               rc = backend_startup_one( &backendDB[i] );
+               rc = backend_startup_one( be );
 
                if ( rc ) return rc;
-
-
-               if ( backendDB[i].be_syncinfo ) {
-                       syncinfo_t *si;
-
-                       if ( !( backendDB[i].be_search && backendDB[i].be_add &&
-                               backendDB[i].be_modify && backendDB[i].be_delete )) {
-                               Debug( LDAP_DEBUG_ANY,
-                                       "backend_startup: database(%d) does not support "
-                                       "operations required for syncrepl", i, 0, 0 );
-                               continue;
-                       }
-
-                       {
-                               si = backendDB[i].be_syncinfo;
-                               si->si_be = &backendDB[i];
-                               init_syncrepl( si );
-                               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
-                               ldap_pvt_runqueue_insert( &slapd_rq,
-                                               si->si_interval, do_syncrepl, (void *) si );
-                               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
-                       }
-               }
        }
 
        return rc;
@@ -358,12 +318,14 @@ int backend_startup(Backend *be)
 
 int backend_num( Backend *be )
 {
-       int i;
+       int i = 0;
+       BackendDB *b2;
 
        if( be == NULL ) return -1;
 
-       for( i = 0; i < nBackendDB; i++ ) {
-               if( be == &backendDB[i] ) return i;
+       LDAP_STAILQ_FOREACH( b2, &backendDB, be_next ) {
+               if( be == b2 ) return i;
+               i++;
        }
        return -1;
 }
@@ -372,6 +334,7 @@ int backend_shutdown( Backend *be )
 {
        int i;
        int rc = 0;
+       BackendInfo *bi;
 
        if( be != NULL ) {
                /* shutdown a specific backend database */
@@ -393,29 +356,27 @@ int backend_shutdown( Backend *be )
        }
 
        /* close each backend database */
-       for( i = 0; i < nBackendDB; i++ ) {
-               if ( backendDB[i].bd_info->bi_db_close ) {
-                       backendDB[i].bd_info->bi_db_close(
-                               &backendDB[i] );
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+               if ( be->bd_info->bi_db_close ) {
+                       be->bd_info->bi_db_close( be );
                }
 
                if(rc != 0) {
                        Debug( LDAP_DEBUG_ANY,
                                "backend_close: bi_db_close %s failed!\n",
-                               backendDB[i].be_type, 0, 0 );
+                               be->be_type, 0, 0 );
                }
        }
 
        /* close each backend type */
-       for( i = 0; i < nBackendInfo; i++ ) {
-               if( backendInfo[i].bi_nDB == 0 ) {
+       LDAP_STAILQ_FOREACH( bi, &backendInfo, bi_next ) {
+               if( bi->bi_nDB == 0 ) {
                        /* no database of this type */
                        continue;
                }
 
-               if( backendInfo[i].bi_close ) {
-                       backendInfo[i].bi_close(
-                               &backendInfo[i] );
+               if( bi->bi_close ) {
+                       bi->bi_close( bi );
                }
        }
 
@@ -436,10 +397,12 @@ int backend_destroy(void)
 {
        int i;
        BackendDB *bd;
+       BackendInfo *bi;
        struct slap_csn_entry *csne;
 
        /* destroy each backend database */
-       for( i = 0, bd = backendDB; i < nBackendDB; i++, bd++ ) {
+       while (( bd = LDAP_STAILQ_FIRST(&backendDB))) {
+               LDAP_STAILQ_REMOVE_HEAD(&backendDB, be_next);
 
                if ( bd->be_syncinfo ) {
                        syncinfo_free( bd->be_syncinfo );
@@ -472,25 +435,18 @@ int backend_destroy(void)
                        free( bd->be_rootpw.bv_val );
                }
                acl_destroy( bd->be_acl, frontendDB->be_acl );
+               free( bd );
        }
-       free( backendDB );
 
        /* destroy each backend type */
-       for( i = 0; i < nBackendInfo; i++ ) {
-               if( backendInfo[i].bi_destroy ) {
-                       backendInfo[i].bi_destroy(
-                               &backendInfo[i] );
+       LDAP_STAILQ_FOREACH( bi, &backendInfo, bi_next ) {
+               if( bi->bi_destroy ) {
+                       bi->bi_destroy( bi );
                }
        }
 
-#ifdef SLAPD_MODULES
-       if (backendInfo != slap_binfo) {
-          free(backendInfo);
-       }
-#endif /* SLAPD_MODULES */
-
        nBackendInfo = 0;
-       backendInfo = NULL;
+       LDAP_STAILQ_INIT(&backendInfo);
 
        /* destroy frontend database */
        bd = frontendDB;
@@ -517,12 +473,12 @@ int backend_destroy(void)
 
 BackendInfo* backend_info(const char *type)
 {
-       int i;
+       BackendInfo *bi;
 
        /* search for the backend type */
-       for( i = 0; i < nBackendInfo; i++ ) {
-               if( strcasecmp(backendInfo[i].bi_type, type) == 0 ) {
-                       return &backendInfo[i];
+       LDAP_STAILQ_FOREACH(bi,&backendInfo,bi_next) {
+               if( strcasecmp(bi->bi_type, type) == 0 ) {
+                       return bi;
                }
        }
 
@@ -543,23 +499,9 @@ backend_db_init(
                return NULL;
        }
 
-       be = backendDB;
-
-       backendDB = (BackendDB *) ch_realloc(
-                       (char *) backendDB,
-                   (nBackendDB + 1) * sizeof(Backend) );
-
-       memset( &backendDB[nbackends], '\0', sizeof(Backend) );
-
-       /* did realloc move our table? if so, fix up dependent pointers */
-       if ( be != backendDB ) {
-               int i;
-               for ( i=0, be=backendDB; i<nbackends; i++, be++ ) {
-                       be->be_pcl_mutexp = &be->be_pcl_mutex;
-               }
-       }
-
-       be = &backends[nbackends++];
+       be = ch_calloc( 1, sizeof(Backend) );
+       nbackends++;
+       LDAP_STAILQ_INSERT_TAIL(&backendDB, be, be_next);
 
        be->bd_info = bi;
 
@@ -593,11 +535,12 @@ backend_db_init(
 void
 be_db_close( void )
 {
+       BackendDB *be;
        int     i;
 
-       for ( i = 0; i < nbackends; i++ ) {
-               if ( backends[i].bd_info->bi_db_close ) {
-                       (*backends[i].bd_info->bi_db_close)( &backends[i] );
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+               if ( be->bd_info->bi_db_close ) {
+                       be->bd_info->bi_db_close( be );
                }
        }
 
@@ -615,22 +558,21 @@ select_backend(
 {
        int             i, j;
        ber_len_t       len, dnlen = dn->bv_len;
-       Backend         *be = NULL;
+       Backend         *be, *b2 = NULL;
 
-       for ( i = 0; i < nbackends; i++ ) {
-               if ( backends[i].be_nsuffix == NULL ) {
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+               if ( be->be_nsuffix == NULL ) {
                        continue;
                }
 
-               for ( j = 0; !BER_BVISNULL( &backends[i].be_nsuffix[j] ); j++ )
+               for ( j = 0; !BER_BVISNULL( &be->be_nsuffix[j] ); j++ )
                {
-                       if ( ( SLAP_GLUE_SUBORDINATE( &backends[i] ) )
-                               && noSubs )
+                       if ( ( SLAP_GLUE_SUBORDINATE( be ) ) && noSubs )
                        {
                                continue;
                        }
 
-                       len = backends[i].be_nsuffix[j].bv_len;
+                       len = be->be_nsuffix[j].bv_len;
 
                        if ( len > dnlen ) {
                                /* suffix is longer than DN */
@@ -647,25 +589,25 @@ select_backend(
                                continue;
                        }
 
-                       if ( strcmp( backends[i].be_nsuffix[j].bv_val,
+                       if ( strcmp( be->be_nsuffix[j].bv_val,
                                &dn->bv_val[dnlen-len] ) == 0 )
                        {
-                               if( be == NULL ) {
-                                       be = &backends[i];
+                               if( b2 == NULL ) {
+                                       b2 = be;
 
                                        if( manageDSAit && len == dnlen &&
                                                !SLAP_GLUE_SUBORDINATE( be ) ) {
                                                continue;
                                        }
                                } else {
-                                       be = &backends[i];
+                                       b2 = be;
                                }
-                               return be;
+                               return b2;
                        }
                }
        }
 
-       return be;
+       return b2;
 }
 
 int
@@ -780,15 +722,16 @@ be_entry_release_rw(
 int
 backend_unbind( Operation *op, SlapReply *rs )
 {
-       int             i;
+       int             i = 0;
+       BackendDB *be;
 
-       for ( i = 0; i < nbackends; i++ ) {
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
 #if defined( LDAP_SLAPI )
                if ( op->o_pb ) {
                        int rc;
                        if ( i == 0 ) slapi_int_pblock_set_operation( op->o_pb, op );
-                       slapi_pblock_set( op->o_pb, SLAPI_BACKEND, (void *)&backends[i] );
-                       rc = slapi_int_call_plugins( &backends[i],
+                       slapi_pblock_set( op->o_pb, SLAPI_BACKEND, (void *)be );
+                       rc = slapi_int_call_plugins( be,
                                SLAPI_PLUGIN_PRE_UNBIND_FN, (Slapi_PBlock *)op->o_pb );
                        if ( rc < 0 ) {
                                /*
@@ -803,13 +746,13 @@ backend_unbind( Operation *op, SlapReply *rs )
                }
 #endif /* defined( LDAP_SLAPI ) */
 
-               if ( backends[i].be_unbind ) {
-                       op->o_bd = &backends[i];
-                       (*backends[i].be_unbind)( op, rs );
+               if ( be->be_unbind ) {
+                       op->o_bd = be;
+                       be->be_unbind( op, rs );
                }
 
 #if defined( LDAP_SLAPI )
-               if ( op->o_pb != NULL && slapi_int_call_plugins( &backends[i],
+               if ( op->o_pb != NULL && slapi_int_call_plugins( be,
                        SLAPI_PLUGIN_POST_UNBIND_FN, (Slapi_PBlock *)op->o_pb ) < 0 )
                {
                        Debug(LDAP_DEBUG_TRACE,
@@ -817,6 +760,7 @@ backend_unbind( Operation *op, SlapReply *rs )
                                0, 0, 0);
                }
 #endif /* defined( LDAP_SLAPI ) */
+               i++;
        }
 
        return 0;
@@ -826,11 +770,11 @@ int
 backend_connection_init(
        Connection   *conn )
 {
-       int     i;
+       BackendDB *be;
 
-       for ( i = 0; i < nbackends; i++ ) {
-               if ( backends[i].be_connection_init ) {
-                       (*backends[i].be_connection_init)( &backends[i], conn);
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+               if ( be->be_connection_init ) {
+                       be->be_connection_init( be, conn);
                }
        }
 
@@ -841,11 +785,11 @@ int
 backend_connection_destroy(
        Connection   *conn )
 {
-       int     i;
+       BackendDB *be;
 
-       for ( i = 0; i < nbackends; i++ ) {
-               if ( backends[i].be_connection_destroy ) {
-                       (*backends[i].be_connection_destroy)( &backends[i], conn);
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+               if ( be->be_connection_destroy ) {
+                       be->be_connection_destroy( be, conn);
                }
        }
 
@@ -1110,7 +1054,10 @@ backend_check_restrictions(
                        }
 
 #ifdef SLAP_X_LISTENER_MOD
-                       if ( op->o_conn->c_listener && ! ( op->o_conn->c_listener->sl_perms & ( !BER_BVISEMPTY( &op->o_ndn ) ? S_IWUSR : S_IWOTH ) ) ) {
+                       if ( op->o_conn->c_listener &&
+                               ! ( op->o_conn->c_listener->sl_perms & ( !BER_BVISEMPTY( &op->o_ndn )
+                                       ? (S_IWUSR|S_IWOTH) : S_IWOTH ) ) )
+                       {
                                /* no "w" mode means readonly */
                                rs->sr_text = "modifications not allowed on this listener";
                                rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
@@ -1189,7 +1136,8 @@ backend_check_restrictions(
                if ( !starttls && !updateop ) {
                        if ( op->o_conn->c_listener &&
                                !( op->o_conn->c_listener->sl_perms &
-                                       ( !BER_BVISEMPTY( &op->o_dn ) ? S_IRUSR : S_IROTH )))
+                                       ( !BER_BVISEMPTY( &op->o_dn )
+                                               ? (S_IRUSR|S_IROTH) : S_IROTH )))
                        {
                                /* no "r" mode means no read */
                                rs->sr_text = "read not allowed on this listener";
@@ -1546,9 +1494,10 @@ backend_attribute(
                if ( a ) {
                        BerVarray v;
 
-                       if ( op->o_conn && access > ACL_NONE && access_allowed( op,
-                               e, entry_at, NULL, access,
-                               &acl_state ) == 0 ) {
+                       if ( op->o_conn && access > ACL_NONE &&
+                               access_allowed( op, e, entry_at, NULL,
+                                               access, &acl_state ) == 0 )
+                       {
                                rc = LDAP_INSUFFICIENT_ACCESS;
                                goto freeit;
                        }
@@ -1558,11 +1507,10 @@ backend_attribute(
                        
                        v = op->o_tmpalloc( sizeof(struct berval) * ( i + 1 ),
                                op->o_tmpmemctx );
-                       for ( i = 0,j = 0; !BER_BVISNULL( &a->a_vals[i] ); i++ )
+                       for ( i = 0, j = 0; !BER_BVISNULL( &a->a_vals[i] ); i++ )
                        {
                                if ( op->o_conn && access > ACL_NONE && 
-                                               access_allowed( op, e,
-                                                       entry_at,
+                                       access_allowed( op, e, entry_at,
                                                        &a->a_nvals[i],
                                                        access,
                                                        &acl_state ) == 0 )
@@ -1776,14 +1724,14 @@ int backend_operational(
         * add them to the attribute list
         */
        if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
-               ad_inlist( slap_schema.si_ad_entryDN, rs->sr_attrs )))
+               ad_inlist( slap_schema.si_ad_entryDN, rs->sr_attrs ) ) )
        {
                *ap = slap_operational_entryDN( rs->sr_entry );
                ap = &(*ap)->a_next;
        }
 
        if ( SLAP_OPATTRS( rs->sr_attr_flags ) || ( rs->sr_attrs &&
-               ad_inlist( slap_schema.si_ad_subschemaSubentry, rs->sr_attrs )))
+               ad_inlist( slap_schema.si_ad_subschemaSubentry, rs->sr_attrs ) ) )
        {
                *ap = slap_operational_subschemaSubentry( op->o_bd );
                ap = &(*ap)->a_next;
@@ -1791,10 +1739,10 @@ int backend_operational(
 
        /* Let the overlays have a chance at this */
        be_orig = op->o_bd;
-       if ( SLAP_ISOVERLAY( be_orig ))
+       if ( SLAP_ISOVERLAY( be_orig ) )
                op->o_bd = select_backend( be_orig->be_nsuffix, 0, 0 );
 
-       if (( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
+       if ( ( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
                op->o_bd && op->o_bd->be_operational != NULL )
        {
                rc = op->o_bd->be_operational( op, rs );
index e1b31a50c1d6f6817afd4502e376361d11c2d112..ddcc0233c14cb2c247507e973d82bef1a21269e9 100644 (file)
@@ -248,6 +248,77 @@ static int op_rc[] = {
        SLAP_CB_CONTINUE                /* aux_chk_controls; pass to frontend */
 };
 
+#ifdef SLAP_OVERLAY_ACCESS
+static int
+over_access_allowed(
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp )
+{
+       slap_overinfo *oi;
+       slap_overinst *on;
+       BackendInfo *bi = op->o_bd->bd_info;
+       BackendDB *be = op->o_bd, db;
+       int rc = SLAP_CB_CONTINUE;
+
+       /* FIXME: used to happen for instance during abandon
+        * when global overlays are used... */
+       assert( op->o_bd != NULL );
+
+       oi = op->o_bd->bd_info->bi_private;
+       on = oi->oi_list;
+
+       for ( ; on; on = on->on_next ) {
+               if ( on->on_bi.bi_access_allowed ) {
+                       /* NOTE: do not copy the structure until required */
+                       if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
+                               db = *op->o_bd;
+                               db.be_flags |= SLAP_DBFLAG_OVERLAY;
+                               op->o_bd = &db;
+                       }
+
+                       op->o_bd->bd_info = (BackendInfo *)on;
+                       rc = on->on_bi.bi_access_allowed( op, e,
+                               desc, val, access, state, maskp );
+                       if ( rc != SLAP_CB_CONTINUE ) break;
+               }
+       }
+
+       if ( rc == SLAP_CB_CONTINUE ) {
+               BI_access_allowed       *bi_access_allowed;
+
+               /* if the database structure was changed, o_bd points to a
+                * copy of the structure; put the original bd_info in place */
+               if ( SLAP_ISOVERLAY( op->o_bd ) ) {
+                       op->o_bd->bd_info = oi->oi_orig;
+               }
+
+               if ( oi->oi_orig->bi_access_allowed ) {
+                       bi_access_allowed = oi->oi_orig->bi_access_allowed;
+               } else {
+                       bi_access_allowed = slap_access_allowed;
+               }
+
+               rc = bi_access_allowed( op, e,
+                       desc, val, access, state, maskp );
+       }
+       /* should not fall thru this far without anything happening... */
+       if ( rc == SLAP_CB_CONTINUE ) {
+               /* access not allowed */
+               rc = 0;
+       }
+
+       op->o_bd = be;
+       op->o_bd->bd_info = bi;
+
+       return rc;
+}
+#endif /* SLAP_OVERLAY_ACCESS */
+
 static int
 over_op_func(
        Operation *op,
@@ -545,12 +616,10 @@ overlay_register_control( BackendDB *be, const char *oid )
        }
 
        if ( SLAP_DBFLAGS( be ) & SLAP_DBFLAG_GLOBAL_OVERLAY ) {
-               int     i;
+               BackendDB *bd;
                
                /* add to all backends... */
-               for ( i = 0; i < nBackendDB; i++ ) {
-                       BackendDB       *bd = &backendDB[i];
-                       
+               LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
                        if ( be == bd ) {
                                gotit = 1;
                        }
@@ -633,6 +702,11 @@ overlay_config( BackendDB *be, const char *ov )
                bi->bi_operational = over_aux_operational;
                bi->bi_chk_referrals = over_aux_chk_referrals;
                bi->bi_chk_controls = over_aux_chk_controls;
+
+#ifdef SLAP_OVERLAY_ACCESS
+               /* this has a specific arglist */
+               bi->bi_access_allowed = over_access_allowed;
+#endif /* SLAP_OVERLAY_ACCESS */
                
                bi->bi_connection_destroy = over_connection_destroy;
 
index ba7eb64fc3f7676416cdae221c54029a584a5f8f..50e1b8214ea952a170e64b8ec6fece56a6010390 100644 (file)
@@ -24,6 +24,7 @@
 #include <ac/string.h>
 #include <ac/ctype.h>
 #include <ac/errno.h>
+#include <sys/stat.h>
 
 #include "slap.h"
 
@@ -36,6 +37,9 @@
 #include "config.h"
 
 static struct berval config_rdn = BER_BVC("cn=config");
+static struct berval schema_rdn = BER_BVC("cn=schema");
+
+#define        IFMT    "{%d}"
 
 #ifdef SLAPD_MODULES
 typedef struct modpath_s {
@@ -43,39 +47,37 @@ typedef struct modpath_s {
        struct berval mp_path;
        BerVarray mp_loads;
 } ModPaths;
+
+static ModPaths modpaths, *modlast = &modpaths, *modcur = &modpaths;
 #endif
 
 typedef struct ConfigFile {
        struct ConfigFile *c_sibs;
        struct ConfigFile *c_kids;
        struct berval c_file;
-#ifdef SLAPD_MODULES
-       ModPaths c_modpaths;
-       ModPaths *c_modlast;
-#endif
+       AttributeType *c_at_head, *c_at_tail;
+       ContentRule *c_cr_head, *c_cr_tail;
+       ObjectClass *c_oc_head, *c_oc_tail;
+       OidMacro *c_om_head, *c_om_tail;
        BerVarray c_dseFiles;
 } ConfigFile;
 
 typedef struct CfOcInfo {
        struct berval *co_name;
        ConfigTable *co_table;
+       ConfigType co_type;
+       ObjectClass *co_oc;
 } CfOcInfo;
 
-typedef enum {
-       Cf_Global = 1,
-       Cf_Include,
-       Cf_Backend,
-       Cf_Database,
-       Cf_Overlay
-} CfEtypes;
-
 typedef struct CfEntryInfo {
+       struct CfEntryInfo *ce_parent;
        struct CfEntryInfo *ce_sibs;
        struct CfEntryInfo *ce_kids;
        Entry *ce_entry;
-       CfEtypes ce_type;
+       ConfigType ce_type;
        BackendInfo *ce_bi;
        BackendDB *ce_be;
+       void *ce_private;
 } CfEntryInfo;
 
 typedef struct {
@@ -83,6 +85,7 @@ typedef struct {
        CfEntryInfo *cb_root;
        BackendDB       cb_db;  /* underlying database */
        int             cb_got_ldif;
+       int             cb_use_ldif;
 } CfBackInfo;
 
 /* These do nothing in slapd, they're kept only to make them
@@ -101,16 +104,15 @@ static struct berval cfdir;
 static AttributeDescription *cfAd_backend, *cfAd_database, *cfAd_overlay,
        *cfAd_include;
 
-static ObjectClass *cfOc_global, *cfOc_backend, *cfOc_database,
-       *cfOc_include, *cfOc_overlay;
+static ObjectClass *cfOc_schema, *cfOc_global, *cfOc_backend, *cfOc_database,
+       *cfOc_include, *cfOc_overlay, *cfOc_module;
 
 static ConfigFile cf_prv, *cfn = &cf_prv;
 
 static Avlnode *CfOcTree;
 
-static int add_syncrepl LDAP_P(( Backend *, char **, int ));
-static int parse_syncrepl_line LDAP_P(( char **, int, syncinfo_t *));
-static void syncrepl_unparse LDAP_P (( syncinfo_t *, struct berval *));
+static int config_add_internal( CfBackInfo *cfb, Entry *e, SlapReply *rs,
+       int *renumber );
 
 static ConfigDriver config_fname;
 static ConfigDriver config_cfdir;
@@ -133,7 +135,6 @@ static ConfigDriver config_requires;
 static ConfigDriver config_security;
 static ConfigDriver config_referral;
 static ConfigDriver config_loglevel;
-static ConfigDriver config_syncrepl;
 static ConfigDriver config_replica;
 static ConfigDriver config_updatedn;
 static ConfigDriver config_updateref;
@@ -142,6 +143,7 @@ static ConfigDriver config_include;
 static ConfigDriver config_tls_option;
 static ConfigDriver config_tls_config;
 #endif
+extern ConfigDriver syncrepl_config;
 
 enum {
        CFG_ACL = 1,
@@ -155,8 +157,6 @@ enum {
        CFG_TLS_CA_FILE,
        CFG_TLS_VERIFY,
        CFG_TLS_CRLCHECK,
-       CFG_SIZE,
-       CFG_TIME,
        CFG_CONCUR,
        CFG_THREADS,
        CFG_SALT,
@@ -170,7 +170,6 @@ enum {
        CFG_ATTR,
        CFG_ATOPT,
        CFG_CHECK,
-       CFG_AUDITLOG,
        CFG_REPLOG,
        CFG_ROOTDSE,
        CFG_LOGFILE,
@@ -193,9 +192,17 @@ static OidRec OidMacros[] = {
        /* OpenLDAProot:666.11.1 */
        { "OLcfg", "1.3.6.1.4.1.4203.666.11.1" },
        { "OLcfgAt", "OLcfg:3" },
+       { "OLcfgGlAt", "OLcfgAt:0" },
+       { "OLcfgBkAt", "OLcfgAt:1" },
+       { "OLcfgDbAt", "OLcfgAt:2" },
+       { "OLcfgOvAt", "OLcfgAt:3" },
        { "OLcfgOc", "OLcfg:4" },
+       { "OLcfgGlOc", "OLcfgOc:0" },
+       { "OLcfgBkOc", "OLcfgOc:1" },
+       { "OLcfgDbOc", "OLcfgOc:2" },
+       { "OLcfgOvOc", "OLcfgOc:3" },
        { "OMsyn", "1.3.6.1.4.1.1466.115.121.1" },
-       { "OMsInteger", "OMsyn:2" },
+       { "OMsInteger", "OMsyn:27" },
        { "OMsBoolean", "OMsyn:7" },
        { "OMsDN", "OMsyn:12" },
        { "OMsDirectoryString", "OMsyn:15" },
@@ -203,131 +210,145 @@ static OidRec OidMacros[] = {
        { NULL, NULL }
 };
 
+/*
+ * OLcfg{Bk|Db}{Oc|At}:0               -> common
+ * OLcfg{Bk|Db}{Oc|At}:1               -> bdb
+ * OLcfg{Bk|Db}{Oc|At}:2               -> ldif
+ * OLcfg{Bk|Db}{Oc|At}:3               -> ldap?
+ */
+
 /* alphabetical ordering */
 
 ConfigTable config_back_cf_table[] = {
        /* This attr is read-only */
        { "", "", 0, 0, 0, ARG_MAGIC,
-               &config_fname, "( OLcfgAt:78 NAME 'olcConfigFile' "
+               &config_fname, "( OLcfgGlAt:78 NAME 'olcConfigFile' "
                        "DESC 'File for slapd configuration directives' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "", "", 0, 0, 0, ARG_MAGIC,
-               &config_cfdir, "( OLcfgAt:79 NAME 'olcConfigDir' "
+               &config_cfdir, "( OLcfgGlAt:79 NAME 'olcConfigDir' "
                        "DESC 'Directory for slapd configuration backend' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "access",     NULL, 0, 0, 0, ARG_MAY_DB|ARG_MAGIC|CFG_ACL,
-               &config_generic, "( OLcfgAt:1 NAME 'olcAccess' "
+               &config_generic, "( OLcfgGlAt:1 NAME 'olcAccess' "
                        "DESC 'Access Control List' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
        { "allows",     "features", 2, 0, 5, ARG_PRE_DB|ARG_MAGIC,
-               &config_allows, "( OLcfgAt:2 NAME 'olcAllows' "
+               &config_allows, "( OLcfgGlAt:2 NAME 'olcAllows' "
                        "DESC 'Allowed set of deprecated features' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "argsfile", "file", 2, 2, 0, ARG_STRING,
-               &slapd_args_file, "( OLcfgAt:3 NAME 'olcArgsFile' "
+               &slapd_args_file, "( OLcfgGlAt:3 NAME 'olcArgsFile' "
                        "DESC 'File for slapd command line options' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
-       /* Use standard 'attributeTypes' attr */
-       { "attribute",  "attribute", 2, 0, 9, ARG_PAREN|ARG_MAGIC|CFG_ATTR,
-               &config_generic, NULL, NULL, NULL },
+       { "attribute",  "attribute", 2, 0, 9,
+               ARG_PAREN|ARG_MAGIC|CFG_ATTR|ARG_NO_DELETE|ARG_NO_INSERT,
+               &config_generic, "( OLcfgGlAt:4 NAME 'olcAttributeTypes' "
+                       "DESC 'OpenLDAP attributeTypes' "
+                       "EQUALITY caseIgnoreMatch "
+                       "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )",
+                               NULL, NULL },
        { "attributeoptions", NULL, 0, 0, 0, ARG_MAGIC|CFG_ATOPT,
-               &config_generic, "( OLcfgAt:5 NAME 'olcAttributeOptions' "
+               &config_generic, "( OLcfgGlAt:5 NAME 'olcAttributeOptions' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "authid-rewrite", NULL, 2, 0, 0,
 #ifdef SLAP_AUTH_REWRITE
-               ARG_MAGIC|CFG_REWRITE, &config_generic,
+               ARG_MAGIC|CFG_REWRITE|ARG_NO_INSERT, &config_generic,
 #else
                ARG_IGNORED, NULL,
 #endif
-                "( OLcfgAt:6 NAME 'olcAuthIDRewrite' "
+                "( OLcfgGlAt:6 NAME 'olcAuthIDRewrite' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
        { "authz-policy", "policy", 2, 2, 0, ARG_STRING|ARG_MAGIC|CFG_AZPOLICY,
-               &config_generic, "( OLcfgAt:7 NAME 'olcAuthzPolicy' "
+               &config_generic, "( OLcfgGlAt:7 NAME 'olcAuthzPolicy' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
-       { "authz-regexp", NULL, 3, 3, 0, ARG_MAGIC|CFG_AZREGEXP,
-               &config_generic, "( OLcfgAt:8 NAME 'olcAuthzRegexp' "
+       { "authz-regexp", NULL, 3, 3, 0, ARG_MAGIC|CFG_AZREGEXP|ARG_NO_INSERT,
+               &config_generic, "( OLcfgGlAt:8 NAME 'olcAuthzRegexp' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
        { "backend", "type", 2, 2, 0, ARG_PRE_DB|ARG_MAGIC|CFG_BACKEND,
-               &config_generic, "( OLcfgAt:9 NAME 'olcBackend' "
+               &config_generic, "( OLcfgGlAt:9 NAME 'olcBackend' "
                        "DESC 'A type of backend' "
                        "EQUALITY caseIgnoreMatch "
-                       "SYNTAX OMsDirectoryString )", NULL, NULL },
-       { "concurrency", "level", 2, 2, 0, ARG_INT|ARG_NONZERO|ARG_MAGIC|CFG_CONCUR,
-               &config_generic, "( OLcfgAt:10 NAME 'olcConcurrency' "
+                       "SYNTAX OMsDirectoryString SINGLE-VALUE X-ORDERED 'SIBLINGS' )",
+                               NULL, NULL },
+       { "concurrency", "level", 2, 2, 0, ARG_INT|ARG_MAGIC|CFG_CONCUR,
+               &config_generic, "( OLcfgGlAt:10 NAME 'olcConcurrency' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "conn_max_pending", "max", 2, 2, 0, ARG_INT,
-               &slap_conn_max_pending, "( OLcfgAt:11 NAME 'olcConnMaxPending' "
+               &slap_conn_max_pending, "( OLcfgGlAt:11 NAME 'olcConnMaxPending' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "conn_max_pending_auth", "max", 2, 2, 0, ARG_INT,
-               &slap_conn_max_pending_auth, "( OLcfgAt:12 NAME 'olcConnMaxPendingAuth' "
+               &slap_conn_max_pending_auth, "( OLcfgGlAt:12 NAME 'olcConnMaxPendingAuth' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "database", "type", 2, 2, 0, ARG_MAGIC|CFG_DATABASE,
-               &config_generic, "( OLcfgAt:13 NAME 'olcDatabase' "
+               &config_generic, "( OLcfgGlAt:13 NAME 'olcDatabase' "
                        "DESC 'The backend type for a database instance' "
-                       "SUP olcBackend )", NULL, NULL },
+                       "SUP olcBackend SINGLE-VALUE X-ORDERED 'SIBLINGS' )", NULL, NULL },
        { "defaultSearchBase", "dn", 2, 2, 0, ARG_PRE_BI|ARG_PRE_DB|ARG_DN|ARG_MAGIC,
-               &config_search_base, "( OLcfgAt:14 NAME 'olcDefaultSearchBase' "
+               &config_search_base, "( OLcfgGlAt:14 NAME 'olcDefaultSearchBase' "
                        "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
        { "disallows", "features", 2, 0, 8, ARG_PRE_DB|ARG_MAGIC,
-               &config_disallows, "( OLcfgAt:15 NAME 'olcDisallows' "
+               &config_disallows, "( OLcfgGlAt:15 NAME 'olcDisallows' "
                        "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
-       /* use standard schema */
-       { "ditcontentrule",     NULL, 0, 0, 0, ARG_MAGIC|CFG_DIT,
-               &config_generic, NULL, NULL, NULL },
+       { "ditcontentrule",     NULL, 0, 0, 0, ARG_MAGIC|CFG_DIT|ARG_NO_DELETE|ARG_NO_INSERT,
+               &config_generic, "( OLcfgGlAt:16 NAME 'olcDitContentRules' "
+                       "DESC 'OpenLDAP DIT content rules' "
+                       "EQUALITY caseIgnoreMatch "
+                       "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )",
+                       NULL, NULL },
        { "gentlehup", "on|off", 2, 2, 0,
 #ifdef SIGHUP
                ARG_ON_OFF, &global_gentlehup,
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:17 NAME 'olcGentleHUP' "
+               "( OLcfgGlAt:17 NAME 'olcGentleHUP' "
                        "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "idletimeout", "timeout", 2, 2, 0, ARG_INT,
-               &global_idletimeout, "( OLcfgAt:18 NAME 'olcIdleTimeout' "
+               &global_idletimeout, "( OLcfgGlAt:18 NAME 'olcIdleTimeout' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
-/* XXX -- special case? */
        { "include", "file", 2, 2, 0, ARG_MAGIC,
-               &config_include, "( OLcfgAt:19 NAME 'olcInclude' "
+               &config_include, "( OLcfgGlAt:19 NAME 'olcInclude' "
                        "SUP labeledURI )", NULL, NULL },
        { "index_substr_if_minlen", "min", 2, 2, 0, ARG_INT|ARG_NONZERO|ARG_MAGIC|CFG_SSTR_IF_MIN,
-               &config_generic, "( OLcfgAt:20 NAME 'olcIndexSubstrIfMinLen' "
+               &config_generic, "( OLcfgGlAt:20 NAME 'olcIndexSubstrIfMinLen' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "index_substr_if_maxlen", "max", 2, 2, 0, ARG_INT|ARG_NONZERO|ARG_MAGIC|CFG_SSTR_IF_MAX,
-               &config_generic, "( OLcfgAt:21 NAME 'olcIndexSubstrIfMaxLen' "
+               &config_generic, "( OLcfgGlAt:21 NAME 'olcIndexSubstrIfMaxLen' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "index_substr_any_len", "len", 2, 2, 0, ARG_INT|ARG_NONZERO,
-               &index_substr_any_len, "( OLcfgAt:22 NAME 'olcIndexSubstrAnyLen' "
+               &index_substr_any_len, "( OLcfgGlAt:22 NAME 'olcIndexSubstrAnyLen' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "index_substr_step", "step", 2, 2, 0, ARG_INT|ARG_NONZERO,
-               &index_substr_any_step, "( OLcfgAt:23 NAME 'olcIndexSubstrAnyStep' "
+               &index_substr_any_step, "( OLcfgGlAt:23 NAME 'olcIndexSubstrAnyStep' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "lastmod", "on|off", 2, 2, 0, ARG_DB|ARG_ON_OFF|ARG_MAGIC|CFG_LASTMOD,
-               &config_generic, "( OLcfgAt:24 NAME 'olcLastMod' "
+               &config_generic, "( OLcfgDbAt:0.4 NAME 'olcLastMod' "
                        "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "limits", "limits", 2, 0, 0, ARG_DB|ARG_MAGIC|CFG_LIMITS,
-               &config_generic, "( OLcfgAt:25 NAME 'olcLimits' "
+               &config_generic, "( OLcfgDbAt:0.5 NAME 'olcLimits' "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "localSSF", "ssf", 2, 2, 0, ARG_INT,
-               &local_ssf, "( OLcfgAt:26 NAME 'olcLocalSSF' "
+               &local_ssf, "( OLcfgGlAt:26 NAME 'olcLocalSSF' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "logfile", "file", 2, 2, 0, ARG_STRING|ARG_MAGIC|CFG_LOGFILE,
-               &config_generic, "( OLcfgAt:27 NAME 'olcLogFile' "
+               &config_generic, "( OLcfgGlAt:27 NAME 'olcLogFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "loglevel", "level", 2, 0, 0, ARG_MAGIC,
-               &config_loglevel, "( OLcfgAt:28 NAME 'olcLogLevel' "
+               &config_loglevel, "( OLcfgGlAt:28 NAME 'olcLogLevel' "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "maxDerefDepth", "depth", 2, 2, 0, ARG_DB|ARG_INT|ARG_MAGIC|CFG_DEPTH,
-               &config_generic, "( OLcfgAt:29 NAME 'olcMaxDerefDepth' "
+               &config_generic, "( OLcfgDbAt:0.6 NAME 'olcMaxDerefDepth' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "moduleload", "file", 2, 0, 0,
 #ifdef SLAPD_MODULES
@@ -335,33 +356,36 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:30 NAME 'olcModuleLoad' "
+               "( OLcfgGlAt:30 NAME 'olcModuleLoad' "
                        "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
        { "modulepath", "path", 2, 2, 0,
 #ifdef SLAPD_MODULES
-               ARG_MAGIC|CFG_MODPATH, &config_generic,
+               ARG_MAGIC|CFG_MODPATH|ARG_NO_DELETE|ARG_NO_INSERT, &config_generic,
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:31 NAME 'olcModulePath' "
-                       "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
-       /* use standard schema */
-       { "objectclass", "objectclass", 2, 0, 0, ARG_PAREN|ARG_MAGIC|CFG_OC,
-               &config_generic, NULL, NULL, NULL },
+               "( OLcfgGlAt:31 NAME 'olcModulePath' "
+                       "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
+       { "objectclass", "objectclass", 2, 0, 0, ARG_PAREN|ARG_MAGIC|CFG_OC|ARG_NO_DELETE|ARG_NO_INSERT,
+               &config_generic, "( OLcfgGlAt:32 NAME 'olcObjectClasses' "
+               "DESC 'OpenLDAP object classes' "
+               "EQUALITY caseIgnoreMatch "
+               "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )",
+                       NULL, NULL },
        { "objectidentifier", NULL,     0, 0, 0, ARG_MAGIC|CFG_OID,
-               &config_generic, "( OLcfgAt:33 NAME 'olcObjectIdentifier' "
+               &config_generic, "( OLcfgGlAt:33 NAME 'olcObjectIdentifier' "
                        "SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
        { "overlay", "overlay", 2, 2, 0, ARG_MAGIC,
-               &config_overlay, "( OLcfgAt:34 NAME 'olcOverlay' "
-                       "SUP olcDatabase )", NULL, NULL },
+               &config_overlay, "( OLcfgGlAt:34 NAME 'olcOverlay' "
+                       "SUP olcDatabase SINGLE-VALUE X-ORDERED 'SIBLINGS' )", NULL, NULL },
        { "password-crypt-salt-format", "salt", 2, 2, 0, ARG_STRING|ARG_MAGIC|CFG_SALT,
-               &config_generic, "( OLcfgAt:35 NAME 'olcPasswordCryptSaltFormat' "
+               &config_generic, "( OLcfgGlAt:35 NAME 'olcPasswordCryptSaltFormat' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "password-hash", "hash", 2, 2, 0, ARG_MAGIC,
-               &config_passwd_hash, "( OLcfgAt:36 NAME 'olcPasswordHash' "
+               &config_passwd_hash, "( OLcfgGlAt:36 NAME 'olcPasswordHash' "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "pidfile", "file", 2, 2, 0, ARG_STRING,
-               &slapd_pid_file, "( OLcfgAt:37 NAME 'olcPidFile' "
+               &slapd_pid_file, "( OLcfgGlAt:37 NAME 'olcPidFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "plugin", NULL, 0, 0, 0,
 #ifdef LDAP_SLAPI
@@ -369,7 +393,7 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:38 NAME 'olcPlugin' "
+               "( OLcfgGlAt:38 NAME 'olcPlugin' "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "pluginlog", "filename", 2, 2, 0,
 #ifdef LDAP_SLAPI
@@ -377,34 +401,34 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:39 NAME 'olcPluginLogFile' "
+               "( OLcfgGlAt:39 NAME 'olcPluginLogFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "readonly", "on|off", 2, 2, 0, ARG_MAY_DB|ARG_ON_OFF|ARG_MAGIC|CFG_RO,
-               &config_generic, "( OLcfgAt:40 NAME 'olcReadOnly' "
+               &config_generic, "( OLcfgGlAt:40 NAME 'olcReadOnly' "
                        "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "referral", "url", 2, 2, 0, ARG_MAGIC,
-               &config_referral, "( OLcfgAt:41 NAME 'olcReferral' "
+               &config_referral, "( OLcfgGlAt:41 NAME 'olcReferral' "
                        "SUP labeledURI SINGLE-VALUE )", NULL, NULL },
        { "replica", "host or uri", 2, 0, 0, ARG_DB|ARG_MAGIC,
-               &config_replica, "( OLcfgAt:42 NAME 'olcReplica' "
+               &config_replica, "( OLcfgDbAt:0.7 NAME 'olcReplica' "
                        "SUP labeledURI )", NULL, NULL },
        { "replica-argsfile", NULL, 0, 0, 0, ARG_STRING,
-               &replica_argsFile, "( OLcfgAt:43 NAME 'olcReplicaArgsFile' "
+               &replica_argsFile, "( OLcfgGlAt:43 NAME 'olcReplicaArgsFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "replica-pidfile", NULL, 0, 0, 0, ARG_STRING,
-               &replica_pidFile, "( OLcfgAt:44 NAME 'olcReplicaPidFile' "
+               &replica_pidFile, "( OLcfgGlAt:44 NAME 'olcReplicaPidFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "replicationInterval", NULL, 0, 0, 0, ARG_INT,
-               &replicationInterval, "( OLcfgAt:45 NAME 'olcReplicationInterval' "
+               &replicationInterval, "( OLcfgGlAt:45 NAME 'olcReplicationInterval' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "replogfile", "filename", 2, 2, 0, ARG_MAY_DB|ARG_MAGIC|ARG_STRING|CFG_REPLOG,
-               &config_generic, "( OLcfgAt:46 NAME 'olcReplogFile' "
+               &config_generic, "( OLcfgGlAt:46 NAME 'olcReplogFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "require", "features", 2, 0, 7, ARG_MAY_DB|ARG_MAGIC,
-               &config_requires, "( OLcfgAt:47 NAME 'olcRequires' "
+               &config_requires, "( OLcfgGlAt:47 NAME 'olcRequires' "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "restrict", "op_list", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC,
-               &config_restrict, "( OLcfgAt:48 NAME 'olcRestrict' "
+               &config_restrict, "( OLcfgGlAt:48 NAME 'olcRestrict' "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "reverse-lookup", "on|off", 2, 2, 0,
 #ifdef SLAPD_RLOOKUPS
@@ -412,17 +436,17 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:49 NAME 'olcReverseLookup' "
+               "( OLcfgGlAt:49 NAME 'olcReverseLookup' "
                        "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "rootdn", "dn", 2, 2, 0, ARG_DB|ARG_DN|ARG_MAGIC,
-               &config_rootdn, "( OLcfgAt:50 NAME 'olcRootDN' "
+               &config_rootdn, "( OLcfgDbAt:0.8 NAME 'olcRootDN' "
                        "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
        { "rootDSE", "file", 2, 2, 0, ARG_MAGIC|CFG_ROOTDSE,
-               &config_generic, "( OLcfgAt:51 NAME 'olcRootDSE' "
+               &config_generic, "( OLcfgGlAt:51 NAME 'olcRootDSE' "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
-       { "rootpw", "password", 2, 2, 0, ARG_STRING|ARG_DB|ARG_MAGIC,
-               &config_rootpw, "( OLcfgAt:52 NAME 'olcRootPW' "
-                       "SYNTAX OMsOctetString SINGLE-VALUE )", NULL, NULL },
+       { "rootpw", "password", 2, 2, 0, ARG_BERVAL|ARG_DB|ARG_MAGIC,
+               &config_rootpw, "( OLcfgDbAt:0.9 NAME 'olcRootPW' "
+                       "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "sasl-authz-policy", NULL, 2, 2, 0, ARG_MAGIC|CFG_AZPOLICY,
                &config_generic, NULL, NULL, NULL },
        { "sasl-host", "host", 2, 2, 0,
@@ -431,7 +455,7 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:53 NAME 'olcSaslHost' "
+               "( OLcfgGlAt:53 NAME 'olcSaslHost' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "sasl-realm", "realm", 2, 2, 0,
 #ifdef HAVE_CYRUS_SASL
@@ -439,7 +463,7 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:54 NAME 'olcSaslRealm' "
+               "( OLcfgGlAt:54 NAME 'olcSaslRealm' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "sasl-regexp", NULL, 3, 3, 0, ARG_MAGIC|CFG_AZREGEXP,
                &config_generic, NULL, NULL, NULL },
@@ -449,27 +473,27 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:56 NAME 'olcSaslSecProps' "
+               "( OLcfgGlAt:56 NAME 'olcSaslSecProps' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "saslRegexp", NULL, 3, 3, 0, ARG_MAGIC|CFG_AZREGEXP,
                &config_generic, NULL, NULL, NULL },
        { "schemacheck", "on|off", 2, 2, 0, ARG_ON_OFF|ARG_MAGIC|CFG_CHECK,
-               &config_generic, "( OLcfgAt:57 NAME 'olcSchemaCheck' "
+               &config_generic, "( OLcfgGlAt:57 NAME 'olcSchemaCheck' "
                        "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
        { "schemadn", "dn", 2, 2, 0, ARG_MAY_DB|ARG_DN|ARG_MAGIC,
-               &config_schema_dn, "( OLcfgAt:58 NAME 'olcSchemaDN' "
+               &config_schema_dn, "( OLcfgGlAt:58 NAME 'olcSchemaDN' "
                        "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
        { "security", "factors", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC,
-               &config_security, "( OLcfgAt:59 NAME 'olcSecurity' "
+               &config_security, "( OLcfgGlAt:59 NAME 'olcSecurity' "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
-       { "sizelimit", "limit", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC|CFG_SIZE,
-               &config_sizelimit, "( OLcfgAt:60 NAME 'olcSizeLimit' "
-                       "SYNTAX OMsInteger )", NULL, NULL },
+       { "sizelimit", "limit", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC,
+               &config_sizelimit, "( OLcfgGlAt:60 NAME 'olcSizeLimit' "
+                       "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "sockbuf_max_incoming", "max", 2, 2, 0, ARG_BER_LEN_T,
-               &sockbuf_max_incoming, "( OLcfgAt:61 NAME 'olcSockbufMaxIncoming' "
+               &sockbuf_max_incoming, "( OLcfgGlAt:61 NAME 'olcSockbufMaxIncoming' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "sockbuf_max_incoming_auth", "max", 2, 2, 0, ARG_BER_LEN_T,
-               &sockbuf_max_incoming_auth, "( OLcfgAt:62 NAME 'olcSockbufMaxIncomingAuth' "
+               &sockbuf_max_incoming_auth, "( OLcfgGlAt:62 NAME 'olcSockbufMaxIncomingAuth' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "srvtab", "file", 2, 2, 0,
 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
@@ -477,27 +501,27 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:63 NAME 'olcSrvtab' "
+               "( OLcfgGlAt:63 NAME 'olcSrvtab' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "suffix",     "suffix", 2, 2, 0, ARG_DB|ARG_DN|ARG_MAGIC,
-               &config_suffix, "( OLcfgAt:64 NAME 'olcSuffix' "
+               &config_suffix, "( OLcfgDbAt:0.10 NAME 'olcSuffix' "
                        "SYNTAX OMsDN )", NULL, NULL },
        { "syncrepl", NULL, 0, 0, 0, ARG_DB|ARG_MAGIC,
-               &config_syncrepl, "( OLcfgAt:65 NAME 'olcSyncrepl' "
+               &syncrepl_config, "( OLcfgDbAt:0.11 NAME 'olcSyncrepl' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "threads", "count", 2, 2, 0, ARG_INT|ARG_MAGIC|CFG_THREADS,
-               &config_generic, "( OLcfgAt:66 NAME 'olcThreads' "
+               &config_generic, "( OLcfgGlAt:66 NAME 'olcThreads' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
-       { "timelimit", "limit", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC|CFG_TIME,
-               &config_timelimit, "( OLcfgAt:67 NAME 'olcTimeLimit' "
-                       "SYNTAX OMsInteger )", NULL, NULL },
+       { "timelimit", "limit", 2, 0, 0, ARG_MAY_DB|ARG_MAGIC,
+               &config_timelimit, "( OLcfgGlAt:67 NAME 'olcTimeLimit' "
+                       "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "TLSCACertificateFile", NULL, 0, 0, 0,
 #ifdef HAVE_TLS
                CFG_TLS_CA_FILE|ARG_STRING|ARG_MAGIC, &config_tls_option,
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:68 NAME 'olcTLSCACertificateFile' "
+               "( OLcfgGlAt:68 NAME 'olcTLSCACertificateFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "TLSCACertificatePath", NULL, 0, 0, 0,
 #ifdef HAVE_TLS
@@ -505,7 +529,7 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:69 NAME 'olcTLSCACertificatePath' "
+               "( OLcfgGlAt:69 NAME 'olcTLSCACertificatePath' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "TLSCertificateFile", NULL, 0, 0, 0,
 #ifdef HAVE_TLS
@@ -513,7 +537,7 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:70 NAME 'olcTLSCertificateFile' "
+               "( OLcfgGlAt:70 NAME 'olcTLSCertificateFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "TLSCertificateKeyFile", NULL, 0, 0, 0,
 #ifdef HAVE_TLS
@@ -521,7 +545,7 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:71 NAME 'olcTLSCertificateKeyFile' "
+               "( OLcfgGlAt:71 NAME 'olcTLSCertificateKeyFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "TLSCipherSuite",     NULL, 0, 0, 0,
 #ifdef HAVE_TLS
@@ -529,15 +553,15 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:72 NAME 'olcTLSCipherSuite' "
+               "( OLcfgGlAt:72 NAME 'olcTLSCipherSuite' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "TLSCRLCheck", NULL, 0, 0, 0,
-#ifdef HAVE_TLS
+#if defined(HAVE_TLS) && defined(HAVE_OPENSSL_CRL)
                CFG_TLS_CRLCHECK|ARG_STRING|ARG_MAGIC, &config_tls_config,
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:73 NAME 'olcTLSCRLCheck' "
+               "( OLcfgGlAt:73 NAME 'olcTLSCRLCheck' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "TLSRandFile", NULL, 0, 0, 0,
 #ifdef HAVE_TLS
@@ -545,7 +569,7 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:74 NAME 'olcTLSRandFile' "
+               "( OLcfgGlAt:74 NAME 'olcTLSRandFile' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "TLSVerifyClient", NULL, 0, 0, 0,
 #ifdef HAVE_TLS
@@ -553,74 +577,95 @@ ConfigTable config_back_cf_table[] = {
 #else
                ARG_IGNORED, NULL,
 #endif
-               "( OLcfgAt:75 NAME 'olcTLSVerifyClient' "
+               "( OLcfgGlAt:75 NAME 'olcTLSVerifyClient' "
                        "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
        { "ucdata-path", "path", 2, 2, 0, ARG_IGNORED,
                NULL, NULL, NULL, NULL },
        { "updatedn", "dn", 2, 2, 0, ARG_DB|ARG_MAGIC,
-               &config_updatedn, "( OLcfgAt:76 NAME 'olcUpdateDN' "
+               &config_updatedn, "( OLcfgDbAt:0.12 NAME 'olcUpdateDN' "
                        "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
        { "updateref", "url", 2, 2, 0, ARG_DB|ARG_MAGIC,
-               &config_updateref, "( OLcfgAt:77 NAME 'olcUpdateRef' "
+               &config_updateref, "( OLcfgDbAt:0.13 NAME 'olcUpdateRef' "
                        "SUP labeledURI )", NULL, NULL },
        { NULL, NULL, 0, 0, 0, ARG_IGNORED,
                NULL, NULL, NULL, NULL }
 };
 
 static ConfigOCs cf_ocs[] = {
-       { "( OLcfgOc:1 "
+       { "( OLcfgGlOc:1 "
                "NAME 'olcConfig' "
                "DESC 'OpenLDAP configuration object' "
-               "ABSTRACT SUP top "
-               "MAY ( cn $ olcConfigFile ) )", NULL },
-       { "( OLcfgOc:3 "
+               "ABSTRACT SUP top )", Cft_Abstract, NULL },
+       { "( OLcfgGlOc:2 "
                "NAME 'olcGlobal' "
                "DESC 'OpenLDAP Global configuration options' "
                "SUP olcConfig STRUCTURAL "
-               "MAY ( olcConfigDir $ olcAllows $ olcArgsFile $ olcAttributeOptions $ "
-                "olcAuthIDRewrite $ olcAuthzPolicy $ olcAuthzRegexp $ "
-                "olcConcurrency $ olcConnMaxPending $ olcConnMaxPendingAuth $ "
-                "olcDefaultSearchBase $ olcDisallows $ olcGentleHUP $ "
-                "olcIdleTimeout $ olcIndexSubstrIfMaxLen $ olcIndexSubstrIfMinLen $ "
+               "MAY ( cn $ olcConfigFile $ olcConfigDir $ olcAllows $ olcArgsFile $ "
+                "olcAttributeOptions $ olcAuthIDRewrite $ "
+                "olcAuthzPolicy $ olcAuthzRegexp $ olcConcurrency $ "
+                "olcConnMaxPending $ olcConnMaxPendingAuth $ olcDefaultSearchBase $ "
+                "olcDisallows $ olcGentleHUP $ olcIdleTimeout $ "
+                "olcIndexSubstrIfMaxLen $ olcIndexSubstrIfMinLen $ "
                 "olcIndexSubstrAnyLen $ olcIndexSubstrAnyStep $ olcLocalSSF $ "
-                "olcLogLevel $ olcModuleLoad $ olcModulePath $ olcObjectIdentifier $ "
+                "olcLogLevel $ "
                 "olcPasswordCryptSaltFormat $ olcPasswordHash $ olcPidFile $ "
-                "olcPlugin $ olcPluginLogFile $ olcReadOnly $ olcReferral $ "
+                "olcPluginLogFile $ olcReadOnly $ olcReferral $ "
                 "olcReplicaPidFile $ olcReplicaArgsFile $ olcReplicationInterval $ "
                 "olcReplogFile $ olcRequires $ olcRestrict $ olcReverseLookup $ "
-                "olcRootDSE $ olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ "
-                "olcSchemaCheck $ olcSchemaDN $ olcSecurity $ olcSizeLimit $ "
+                "olcRootDSE $ olcRootPW $ "
+                "olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ "
+                "olcSchemaCheck $ olcSecurity $ olcSizeLimit $ "
                 "olcSockbufMaxIncoming $ olcSockbufMaxIncomingAuth $ olcSrvtab $ "
                 "olcThreads $ olcTimeLimit $ olcTLSCACertificateFile $ "
                 "olcTLSCACertificatePath $ olcTLSCertificateFile $ "
                 "olcTLSCertificateKeyFile $ olcTLSCipherSuite $ olcTLSCRLCheck $ "
-                "olcTLSRandFile $ olcTLSVerifyClient ) )", &cfOc_global },
-       { "( OLcfgOc:4 "
+                "olcTLSRandFile $ olcTLSVerifyClient $ "
+                "olcObjectIdentifier $ olcAttributeTypes $ olcObjectClasses $ "
+                "olcDitContentRules ) )", Cft_Global, &cfOc_global },
+       { "( OLcfgGlOc:3 "
+               "NAME 'olcSchemaConfig' "
+               "DESC 'OpenLDAP schema object' "
+               "SUP olcConfig STRUCTURAL "
+               "MAY ( cn $ olcObjectIdentifier $ olcAttributeTypes $ "
+                "olcObjectClasses $ olcDitContentRules ) )",
+                       Cft_Schema, &cfOc_schema },
+       { "( OLcfgGlOc:4 "
                "NAME 'olcBackendConfig' "
                "DESC 'OpenLDAP Backend-specific options' "
                "SUP olcConfig STRUCTURAL "
-               "MAY ( olcBackend ) )", &cfOc_backend },
-       { "( OLcfgOc:5 "
+               "MUST olcBackend )", Cft_Backend, &cfOc_backend },
+       { "( OLcfgGlOc:5 "
                "NAME 'olcDatabaseConfig' "
                "DESC 'OpenLDAP Database-specific options' "
                "SUP olcConfig STRUCTURAL "
-               "MAY ( olcDatabase $ olcAccess $ olcLastMod $ olcLimits $ "
+               "MUST olcDatabase "
+               "MAY ( olcSuffix $ olcAccess $ olcLastMod $ olcLimits $ "
                 "olcMaxDerefDepth $ olcPlugin $ olcReadOnly $ olcReplica $ "
                 "olcReplogFile $ olcRequires $ olcRestrict $ olcRootDN $ olcRootPW $ "
-                "olcSchemaDN $ olcSecurity $ olcSizeLimit $ olcSuffix $ olcSyncrepl $ "
-                "olcTimeLimit $ olcUpdateDN $ olcUpdateRef ) )", &cfOc_database },
-       { "( OLcfgOc:6 "
+                "olcSchemaDN $ olcSecurity $ olcSizeLimit $ olcSyncrepl $ "
+                "olcTimeLimit $ olcUpdateDN $ olcUpdateRef ) )",
+                       Cft_Database, &cfOc_database },
+       { "( OLcfgGlOc:6 "
+               "NAME 'olcOverlayConfig' "
+               "DESC 'OpenLDAP Overlay-specific options' "
+               "SUP olcConfig STRUCTURAL "
+               "MUST olcOverlay )", Cft_Overlay, &cfOc_overlay },
+       { "( OLcfgGlOc:7 "
                "NAME 'olcIncludeFile' "
                "DESC 'OpenLDAP configuration include file' "
                "SUP olcConfig STRUCTURAL "
-               "MAY ( olcInclude $ olcModuleLoad $ olcModulePath $ olcRootDSE ) )",
-               &cfOc_include },
-       { "( OLcfgOc:7 "
-               "NAME 'olcOverlayConfig' "
-               "DESC 'OpenLDAP Overlay-specific options' "
+               "MUST olcInclude "
+               "MAY ( cn $ olcRootDSE ) )",
+               Cft_Include, &cfOc_include },
+#ifdef SLAPD_MODULES
+       { "( OLcfgGlOc:8 "
+               "NAME 'olcModuleList' "
+               "DESC 'OpenLDAP dynamic module info' "
                "SUP olcConfig STRUCTURAL "
-               "MAY ( olcOverlay ) )", &cfOc_overlay },
-       { NULL, NULL }
+               "MUST ( olcModulePath $ olcModuleLoad ) "
+               "MAY cn )", Cft_Module, &cfOc_module },
+#endif
+       { NULL, 0, NULL }
 };
 
 static int
@@ -650,7 +695,7 @@ config_generic(ConfigArgs *c) {
                                int i;
 
                                for ( i=0; c->be->be_limits[i]; i++ ) {
-                                       bv.bv_len = sprintf( buf, "{%d}", i );
+                                       bv.bv_len = sprintf( buf, IFMT, i );
                                        bv.bv_val = buf+bv.bv_len;
                                        limits_unparse( c->be->be_limits[i], &bv );
                                        bv.bv_len += bv.bv_val - buf;
@@ -685,11 +730,51 @@ config_generic(ConfigArgs *c) {
                case CFG_DEPTH:
                        c->value_int = c->be->be_max_deref_depth;
                        break;
-               case CFG_OID:
-                       oidm_unparse( &c->rvalue_vals );
+               case CFG_OID: {
+                       ConfigFile *cf = c->private;
+                       if ( !cf )
+                               oidm_unparse( &c->rvalue_vals, NULL, NULL, 1 );
+                       else if ( cf->c_om_head )
+                               oidm_unparse( &c->rvalue_vals, cf->c_om_head,
+                                       cf->c_om_tail, 0 );
+                       if ( !c->rvalue_vals )
+                               rc = 1;
+                       }
+                       break;
+               case CFG_OC: {
+                       ConfigFile *cf = c->private;
+                       if ( !cf )
+                               oc_unparse( &c->rvalue_vals, NULL, NULL, 1 );
+                       else if ( cf->c_oc_head )
+                               oc_unparse( &c->rvalue_vals, cf->c_oc_head,
+                                       cf->c_oc_tail, 0 );
+                       if ( !c->rvalue_vals )
+                               rc = 1;
+                       }
+                       break;
+               case CFG_ATTR: {
+                       ConfigFile *cf = c->private;
+                       if ( !cf )
+                               at_unparse( &c->rvalue_vals, NULL, NULL, 1 );
+                       else if ( cf->c_at_head )
+                               at_unparse( &c->rvalue_vals, cf->c_at_head,
+                                       cf->c_at_tail, 0 );
+                       if ( !c->rvalue_vals )
+                               rc = 1;
+                       }
+                       break;
+               case CFG_DIT: {
+                       ConfigFile *cf = c->private;
+                       if ( !cf )
+                               cr_unparse( &c->rvalue_vals, NULL, NULL, 1 );
+                       else if ( cf->c_cr_head )
+                               cr_unparse( &c->rvalue_vals, cf->c_cr_head,
+                                       cf->c_cr_tail, 0 );
                        if ( !c->rvalue_vals )
                                rc = 1;
+                       }
                        break;
+                       
                case CFG_CHECK:
                        c->value_int = global_schemacheck;
                        break;
@@ -698,7 +783,7 @@ config_generic(ConfigArgs *c) {
                        char *src, *dst, ibuf[11];
                        struct berval bv, abv;
                        for (i=0, a=c->be->be_acl; a; i++,a=a->acl_next) {
-                               abv.bv_len = sprintf( ibuf, "{%x}", i );
+                               abv.bv_len = sprintf( ibuf, IFMT, i );
                                acl_unparse( a, &bv );
                                abv.bv_val = ch_malloc( abv.bv_len + bv.bv_len + 1 );
                                AC_MEMCPY( abv.bv_val, ibuf, abv.bv_len );
@@ -723,7 +808,7 @@ config_generic(ConfigArgs *c) {
                                c->value_string = ch_strdup( c->be->be_replogfile );
                        break;
                case CFG_ROOTDSE: {
-                       ConfigFile *cf = (ConfigFile *)c->line;
+                       ConfigFile *cf = c->private;
                        if ( cf->c_dseFiles ) {
                                value_add( &c->rvalue_vals, cf->c_dseFiles );
                        } else {
@@ -748,34 +833,25 @@ config_generic(ConfigArgs *c) {
                        break;
 #ifdef SLAPD_MODULES
                case CFG_MODLOAD: {
-                       ConfigFile *cf = (ConfigFile *)c->line;
-                       ModPaths *mp;
-                       for (i=0, mp=&cf->c_modpaths; mp; mp=mp->mp_next, i++) {
-                               int j;
-                               if (!mp->mp_loads) continue;
-                               for (j=0; !BER_BVISNULL(&mp->mp_loads[j]); j++) {
+                       ModPaths *mp = c->private;
+                       if (mp->mp_loads) {
+                               int i;
+                               for (i=0; !BER_BVISNULL(&mp->mp_loads[i]); i++) {
                                        struct berval bv;
                                        bv.bv_val = c->log;
-                                       bv.bv_len = sprintf( bv.bv_val, "{%d}{%d}%s", i, j,
-                                               mp->mp_loads[j].bv_val );
+                                       bv.bv_len = sprintf( bv.bv_val, IFMT "%s", i,
+                                               mp->mp_loads[i].bv_val );
                                        value_add_one( &c->rvalue_vals, &bv );
                                }
                        }
+
                        rc = c->rvalue_vals ? 0 : 1;
                        }
                        break;
                case CFG_MODPATH: {
-                       ConfigFile *cf = (ConfigFile *)c->line;
-                       ModPaths *mp;
-                       for (i=0, mp=&cf->c_modpaths; mp; mp=mp->mp_next, i++) {
-                               struct berval bv;
-                               if ( BER_BVISNULL( &mp->mp_path ) && !mp->mp_loads )
-                                       continue;
-                               bv.bv_val = c->log;
-                               bv.bv_len = sprintf( bv.bv_val, "{%d}%s", i,
-                                       mp->mp_path.bv_val );
-                               value_add_one( &c->rvalue_vals, &bv );
-                       }
+                       ModPaths *mp = c->private;
+                       value_add_one( &c->rvalue_vals, &mp->mp_path );
+
                        rc = c->rvalue_vals ? 0 : 1;
                        }
                        break;
@@ -795,7 +871,7 @@ config_generic(ConfigArgs *c) {
 
                                idx.bv_val = ibuf;
                                for ( i=0; !BER_BVISNULL( &authz_rewrites[i] ); i++ ) {
-                                       idx.bv_len = sprintf( idx.bv_val, "{%d}", i );
+                                       idx.bv_len = sprintf( idx.bv_val, IFMT, i );
                                        bv.bv_len = idx.bv_len + authz_rewrites[i].bv_len;
                                        bv.bv_val = ch_malloc( bv.bv_len + 1 );
                                        strcpy( bv.bv_val, idx.bv_val );
@@ -810,14 +886,94 @@ config_generic(ConfigArgs *c) {
                        rc = 1;
                }
                return rc;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               int rc = 0;
+               switch(c->type) {
+               /* single-valued attrs, no-ops */
+               case CFG_CONCUR:
+               case CFG_THREADS:
+               case CFG_RO:
+               case CFG_AZPOLICY:
+               case CFG_DEPTH:
+               case CFG_CHECK:
+               case CFG_LASTMOD:
+               case CFG_SASLSECP:
+               case CFG_SSTR_IF_MAX:
+               case CFG_SSTR_IF_MIN:
+                       break;
+
+               /* no-ops, requires slapd restart */
+               case CFG_PLUGIN:
+               case CFG_MODLOAD:
+               case CFG_AZREGEXP:
+               case CFG_REWRITE:
+                       sprintf(c->log, "change requires slapd restart");
+                       break;
+
+               case CFG_SALT:
+                       ch_free( passwd_salt );
+                       passwd_salt = NULL;
+                       break;
+
+               case CFG_REPLOG:
+                       ch_free( c->be->be_replogfile );
+                       c->be->be_replogfile = NULL;
+                       break;
+
+               case CFG_LOGFILE:
+                       ch_free( logfileName );
+                       logfileName = NULL;
+                       break;
+
+               case CFG_ACL:
+                       if ( c->valx < 0 ) {
+                               AccessControl *end;
+                               if ( c->be == frontendDB )
+                                       end = NULL;
+                               else
+                                       end = frontendDB->be_acl;
+                               acl_destroy( c->be->be_acl, end );
+                       } else {
+                               AccessControl **prev, *a;
+                               int i;
+                               for (i=0, prev = &c->be->be_acl; i < c->valx;
+                                       i++ ) {
+                                       a = *prev;
+                                       prev = &a->acl_next;
+                               }
+                               a = *prev;
+                               *prev = a->acl_next;
+                               acl_free( a );
+                       }
+                       break;
+
+               case CFG_LIMITS:
+                       /* FIXME: there is no limits_free function */
+               case CFG_ATOPT:
+                       /* FIXME: there is no ad_option_free function */
+               case CFG_ROOTDSE:
+                       /* FIXME: there is no way to remove attributes added by
+                               a DSE file */
+               case CFG_OID:
+               case CFG_OC:
+               case CFG_DIT:
+               case CFG_ATTR:
+               case CFG_MODPATH:
+               default:
+                       rc = 1;
+                       break;
+               }
+               return rc;
        }
 
        p = strchr(c->line,'(' /*')'*/);
+
        switch(c->type) {
                case CFG_BACKEND:
                        if(!(c->bi = backend_info(c->argv[1]))) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "backend %s failed init!\n", c->log, c->argv[1], 0);
+                               sprintf( c->msg, "<%s> failed init", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n",
+                                       c->log, c->msg, c->argv[1] );
                                return(1);
                        }
                        break;
@@ -827,10 +983,13 @@ config_generic(ConfigArgs *c) {
                        /* NOTE: config is always the first backend!
                         */
                        if ( !strcasecmp( c->argv[1], "config" )) {
-                               c->be = backendDB;
+                               c->be = LDAP_STAILQ_FIRST(&backendDB);
+                       } else if ( !strcasecmp( c->argv[1], "frontend" )) {
+                               c->be = frontendDB;
                        } else if(!(c->be = backend_db_init(c->argv[1]))) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "database %s failed init!\n", c->log, c->argv[1], 0);
+                               sprintf( c->msg, "<%s> failed init", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n",
+                                       c->log, c->msg, c->argv[1] );
                                return(1);
                        }
                        break;
@@ -865,9 +1024,9 @@ config_generic(ConfigArgs *c) {
                case CFG_AZPOLICY:
                        ch_free(c->value_string);
                        if (slap_sasl_setpolicy( c->argv[1] )) {
-                               Debug(LDAP_DEBUG_ANY, "%s: unable to parse value \"%s\" in"
-                                       " \"authz-policy <policy>\"\n",
-                                       c->log, c->argv[1], 0 );
+                               sprintf( c->msg, "<%s> unable to parse value", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                                       c->log, c->msg, c->argv[1] );
                                return(1);
                        }
                        break;
@@ -882,8 +1041,9 @@ config_generic(ConfigArgs *c) {
                        {
                        char *txt = slap_sasl_secprops( c->argv[1] );
                        if ( txt ) {
-                               Debug(LDAP_DEBUG_ANY, "%s: sasl-secprops: %s\n",
-                                       c->log, txt, 0 );
+                               snprintf( c->msg, sizeof(c->msg), "<%s> %s",
+                                       c->argv[0], txt );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 );
                                return(1);
                        }
                        break;
@@ -894,20 +1054,41 @@ config_generic(ConfigArgs *c) {
                        c->be->be_max_deref_depth = c->value_int;
                        break;
 
-               case CFG_OID:
-                       if(parse_oidm(c->fname, c->lineno, c->argc, c->argv)) return(1);
+               case CFG_OID: {
+                       OidMacro *om;
+
+                       if(parse_oidm(c->fname, c->lineno, c->argc, c->argv, 1, &om))
+                               return(1);
+                       if (!cfn->c_om_head) cfn->c_om_head = om;
+                       cfn->c_om_tail = om;
+                       }
                        break;
 
-               case CFG_OC:
-                       if(parse_oc(c->fname, c->lineno, p, c->argv)) return(1);
+               case CFG_OC: {
+                       ObjectClass *oc;
+
+                       if(parse_oc(c->fname, c->lineno, p, c->argv, &oc)) return(1);
+                       if (!cfn->c_oc_head) cfn->c_oc_head = oc;
+                       cfn->c_oc_tail = oc;
+                       }
                        break;
 
-               case CFG_DIT:
-                       if(parse_cr(c->fname, c->lineno, p, c->argv)) return(1);
+               case CFG_DIT: {
+                       ContentRule *cr;
+
+                       if(parse_cr(c->fname, c->lineno, p, c->argv, &cr)) return(1);
+                       if (!cfn->c_cr_head) cfn->c_cr_head = cr;
+                       cfn->c_cr_tail = cr;
+                       }
                        break;
 
-               case CFG_ATTR:
-                       if(parse_at(c->fname, c->lineno, p, c->argv)) return(1);
+               case CFG_ATTR: {
+                       AttributeType *at;
+
+                       if(parse_at(c->fname, c->lineno, p, c->argv, &at)) return(1);
+                       if (!cfn->c_at_head) cfn->c_at_head = at;
+                       cfn->c_at_tail = at;
+                       }
                        break;
 
                case CFG_ATOPT:
@@ -925,7 +1106,7 @@ config_generic(ConfigArgs *c) {
                        break;
 
                case CFG_ACL:
-                       parse_acl(c->be, c->fname, c->lineno, c->argc, c->argv);
+                       parse_acl(c->be, c->fname, c->lineno, c->argc, c->argv, c->valx);
                        break;
 
                case CFG_REPLOG:
@@ -942,9 +1123,9 @@ config_generic(ConfigArgs *c) {
 
                case CFG_ROOTDSE:
                        if(read_root_dse_file(c->argv[1])) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "could not read \"rootDSE <filename>\" line\n",
-                                       c->log, 0, 0);
+                               sprintf( c->msg, "<%s> could not read file", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s %s\n",
+                                       c->log, c->msg, c->argv[1] );
                                return(1);
                        }
                        {
@@ -964,9 +1145,10 @@ config_generic(ConfigArgs *c) {
 
                case CFG_LASTMOD:
                        if(SLAP_NOLASTMODCMD(c->be)) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "lastmod not available for %s databases\n",
-                                       c->log, c->be->bd_info->bi_type, 0);
+                               sprintf( c->msg, "<%s> not available for %s database",
+                                       c->argv[0], c->be->bd_info->bi_type );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s\n",
+                                       c->log, c->msg, 0 );
                                return(1);
                        }
                        if(c->value_int)
@@ -977,9 +1159,9 @@ config_generic(ConfigArgs *c) {
 
                case CFG_SSTR_IF_MAX:
                        if (c->value_int < index_substr_if_minlen) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "invalid max value (%d)\n",
-                                       c->log, c->value_int, 0 );
+                               sprintf( c->msg, "<%s> invalid value", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s (%d)\n",
+                                       c->log, c->msg, c->value_int );
                                return(1);
                        }
                        index_substr_if_maxlen = c->value_int;
@@ -987,9 +1169,9 @@ config_generic(ConfigArgs *c) {
 
                case CFG_SSTR_IF_MIN:
                        if (c->value_int > index_substr_if_maxlen) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "invalid min value (%d)\n",
-                                       c->log, c->value_int, 0 );
+                               sprintf( c->msg, "<%s> invalid value", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s (%d)\n",
+                                       c->log, c->msg, c->value_int );
                                return(1);
                        }
                        index_substr_if_minlen = c->value_int;
@@ -1002,8 +1184,16 @@ config_generic(ConfigArgs *c) {
                        /* Record this load on the current path */
                        {
                                struct berval bv;
-                               ber_str2bv(c->line, 0, 1, &bv);
-                               ber_bvarray_add( &cfn->c_modlast->mp_loads, &bv );
+                               ModPaths *mp;
+                               char *ptr = c->line + STRLENOF("moduleload");
+                               while (!isspace(*ptr)) ptr++;
+                               while (isspace(*ptr)) ptr++;
+                               ber_str2bv(ptr, 0, 1, &bv);
+                               if ( c->op == SLAP_CONFIG_ADD )
+                                       mp = modcur;
+                               else
+                                       mp = c->private;
+                               ber_bvarray_add( &mp->mp_loads, &bv );
                        }
                        break;
 
@@ -1013,16 +1203,19 @@ config_generic(ConfigArgs *c) {
                        {
                                ModPaths *mp;
 
-                               if (!cfn->c_modpaths.mp_loads) {
-                                       mp = &cfn->c_modpaths;
+                               if (!modpaths.mp_loads) {
+                                       mp = &modpaths;
                                } else {
                                        mp = ch_malloc( sizeof( ModPaths ));
-                                       cfn->c_modlast->mp_next = mp;
+                                       modlast->mp_next = mp;
                                }
                                ber_str2bv(c->argv[1], 0, 1, &mp->mp_path);
                                mp->mp_next = NULL;
                                mp->mp_loads = NULL;
-                               cfn->c_modlast = mp;
+                               modlast = mp;
+                               c->private = mp;
+                               if ( c->op == SLAP_CONFIG_ADD )
+                                       modcur = mp;
                        }
                        
                        break;
@@ -1059,21 +1252,27 @@ config_generic(ConfigArgs *c) {
 
 static int
 config_fname(ConfigArgs *c) {
-       if(c->op == SLAP_CONFIG_EMIT && c->line) {
-               ConfigFile *cf = (ConfigFile *)c->line;
-               value_add_one( &c->rvalue_vals, &cf->c_file );
-               return 0;
+       if(c->op == SLAP_CONFIG_EMIT) {
+               if (c->private) {
+                       ConfigFile *cf = c->private;
+                       value_add_one( &c->rvalue_vals, &cf->c_file );
+                       return 0;
+               }
+               return 1;
        }
-       return(1);
+       return(0);
 }
 
 static int
 config_cfdir(ConfigArgs *c) {
        if(c->op == SLAP_CONFIG_EMIT) {
-               value_add_one( &c->rvalue_vals, &cfdir );
-               return 0;
+               if ( !BER_BVISEMPTY( &cfdir )) {
+                       value_add_one( &c->rvalue_vals, &cfdir );
+                       return 0;
+               }
+               return 1;
        }
-       return(1);
+       return(0);
 }
 
 static int
@@ -1088,6 +1287,12 @@ config_search_base(ConfigArgs *c) {
                        rc = 0;
                }
                return rc;
+       } else if( c->op == LDAP_MOD_DELETE ) {
+               ch_free( default_search_base.bv_val );
+               ch_free( default_search_nbase.bv_val );
+               BER_BVZERO( &default_search_base );
+               BER_BVZERO( &default_search_nbase );
+               return 0;
        }
 
        if(c->bi || c->be != frontendDB) {
@@ -1098,10 +1303,6 @@ config_search_base(ConfigArgs *c) {
        }
 
        if(default_search_nbase.bv_len) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "default search base \"%s\" already defined "
-                       "(discarding old)\n",
-                       c->log, default_search_base.bv_val, 0);
                free(default_search_base.bv_val);
                free(default_search_nbase.bv_val);
        }
@@ -1121,6 +1322,17 @@ config_passwd_hash(ConfigArgs *c) {
                        value_add_one(&c->rvalue_vals, &bv);
                }
                return i ? 0 : 1;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( c->valx < 0 ) {
+                       ldap_charray_free( default_passwd_hash );
+                       default_passwd_hash = NULL;
+               } else {
+                       i = c->valx;
+                       ch_free( default_passwd_hash[i] );
+                       for (; default_passwd_hash[i]; i++ )
+                               default_passwd_hash[i] = default_passwd_hash[i+1];
+               }
+               return 0;
        }
        if(default_passwd_hash) {
                Debug(LDAP_DEBUG_ANY, "%s: "
@@ -1130,15 +1342,16 @@ config_passwd_hash(ConfigArgs *c) {
        }
        for(i = 1; i < c->argc; i++) {
                if(!lutil_passwd_scheme(c->argv[i])) {
-                       Debug(LDAP_DEBUG_ANY, "%s: "
-                               "password scheme \"%s\" not available\n",
-                               c->log, c->argv[i], 0);
+                       sprintf( c->msg, "<%s> schema not available", c->argv[0] );
+                       Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n",
+                               c->log, c->msg, c->argv[i]);
                } else {
                        ldap_charray_add(&default_passwd_hash, c->argv[i]);
                }
                if(!default_passwd_hash) {
-                       Debug(LDAP_DEBUG_ANY, "%s: no valid hashes found\n",
-                               c->log, 0, 0 );
+                       sprintf( c->msg, "<%s> no valid hashes found", c->argv[0] );
+                       Debug(LDAP_DEBUG_ANY, "%s: %s\n",
+                               c->log, c->msg, 0 );
                        return(1);
                }
        }
@@ -1155,7 +1368,15 @@ config_schema_dn(ConfigArgs *c) {
                        rc = 0;
                }
                return rc;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               ch_free( c->be->be_schemadn.bv_val );
+               ch_free( c->be->be_schemandn.bv_val );
+               BER_BVZERO( &c->be->be_schemadn );
+               BER_BVZERO( &c->be->be_schemandn );
+               return 0;
        }
+       ch_free( c->be->be_schemadn.bv_val );
+       ch_free( c->be->be_schemandn.bv_val );
        c->be->be_schemadn = c->value_dn;
        c->be->be_schemandn = c->value_ndn;
        return(0);
@@ -1177,14 +1398,23 @@ config_sizelimit(ConfigArgs *c) {
                else
                        rc = 1;
                return rc;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               /* Reset to defaults */
+               lim->lms_s_soft = SLAPD_DEFAULT_SIZELIMIT;
+               lim->lms_s_hard = 0;
+               lim->lms_s_unchecked = -1;
+               lim->lms_s_pr = 0;
+               lim->lms_s_pr_hide = 0;
+               lim->lms_s_pr_total = 0;
+               return 0;
        }
        for(i = 1; i < c->argc; i++) {
                if(!strncasecmp(c->argv[i], "size", 4)) {
                        rc = limits_parse_one(c->argv[i], lim);
                        if ( rc ) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "unable to parse value \"%s\" in \"sizelimit <limit>\" line\n",
-                                       c->log, c->argv[i], 0);
+                               sprintf( c->msg, "<%s> unable to parse value", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                                       c->log, c->msg, c->argv[i]);
                                return(1);
                        }
                } else {
@@ -1193,9 +1423,9 @@ config_sizelimit(ConfigArgs *c) {
                        } else {
                                lim->lms_s_soft = strtol(c->argv[i], &next, 0);
                                if(next == c->argv[i]) {
-                                       Debug(LDAP_DEBUG_ANY, "%s: "
-                                               "unable to parse limit \"%s\" in \"sizelimit <limit>\" line\n",
-                                               c->log, c->argv[i], 0);
+                                       sprintf( c->msg, "<%s> unable to parse limit", c->argv[0]);
+                                       Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                                               c->log, c->msg, c->argv[i]);
                                        return(1);
                                } else if(next[0] != '\0') {
                                        Debug(LDAP_DEBUG_ANY, "%s: "
@@ -1225,14 +1455,19 @@ config_timelimit(ConfigArgs *c) {
                else
                        rc = 1;
                return rc;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               /* Reset to defaults */
+               lim->lms_t_soft = SLAPD_DEFAULT_TIMELIMIT;
+               lim->lms_t_hard = 0;
+               return 0;
        }
        for(i = 1; i < c->argc; i++) {
                if(!strncasecmp(c->argv[i], "time", 4)) {
                        rc = limits_parse_one(c->argv[i], lim);
                        if ( rc ) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "unable to parse value \"%s\" in \"timelimit <limit>\" line\n",
-                                       c->log, c->argv[i], 0);
+                               sprintf( c->msg, "<%s> unable to parse value", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                                       c->log, c->msg, c->argv[i]);
                                return(1);
                        }
                } else {
@@ -1241,9 +1476,9 @@ config_timelimit(ConfigArgs *c) {
                        } else {
                                lim->lms_t_soft = strtol(c->argv[i], &next, 0);
                                if(next == c->argv[i]) {
-                                       Debug(LDAP_DEBUG_ANY, "%s: "
-                                               "unable to parse limit \"%s\" in \"timelimit <limit>\" line\n",
-                                               c->log, c->argv[i], 0);
+                                       sprintf( c->msg, "<%s> unable to parse limit", c->argv[0]);
+                                       Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                                               c->log, c->msg, c->argv[i]);
                                        return(1);
                                } else if(next[0] != '\0') {
                                        Debug(LDAP_DEBUG_ANY, "%s: "
@@ -1261,6 +1496,8 @@ static int
 config_overlay(ConfigArgs *c) {
        if (c->op == SLAP_CONFIG_EMIT) {
                return 1;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               assert(0);
        }
        if(c->argv[1][0] == '-' && overlay_config(c->be, &c->argv[1][1])) {
                /* log error */
@@ -1277,20 +1514,43 @@ config_suffix(ConfigArgs *c) {
        Backend *tbe;
        struct berval pdn, ndn;
        int rc;
+
+       if (c->be == frontendDB || SLAP_MONITOR(c->be) ||
+               SLAP_CONFIG(c->be)) return 1;
+
        if (c->op == SLAP_CONFIG_EMIT) {
-               if ( !BER_BVISNULL( &c->be->be_suffix[0] )) {
+               if ( c->be->be_suffix == NULL
+                               || BER_BVISNULL( &c->be->be_suffix[0] ) )
+               {
+                       return 1;
+               } else {
                        value_add( &c->rvalue_vals, c->be->be_suffix );
                        value_add( &c->rvalue_nvals, c->be->be_nsuffix );
                        return 0;
+               }
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( c->valx < 0 ) {
+                       ber_bvarray_free( c->be->be_suffix );
+                       ber_bvarray_free( c->be->be_nsuffix );
+                       c->be->be_suffix = NULL;
+                       c->be->be_nsuffix = NULL;
                } else {
-                       return 1;
+                       int i = c->valx;
+                       ch_free( c->be->be_suffix[i].bv_val );
+                       ch_free( c->be->be_nsuffix[i].bv_val );
+                       for (; c->be->be_suffix[i].bv_val; i++) {
+                               c->be->be_suffix[i] = c->be->be_suffix[i+1];
+                               c->be->be_nsuffix[i] = c->be->be_nsuffix[i+1];
+                       }
                }
+               return 0;
        }
 #ifdef SLAPD_MONITOR_DN
        if(!strcasecmp(c->argv[1], SLAPD_MONITOR_DN)) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "\"%s\" is reserved for monitoring slapd\n",
-                       c->log, SLAPD_MONITOR_DN, 0);
+               sprintf( c->msg, "<%s> DN is reserved for monitoring slapd",
+                       c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n",
+                       c->log, c->msg, SLAPD_MONITOR_DN);
                return(1);
        }
 #endif
@@ -1304,8 +1564,10 @@ config_suffix(ConfigArgs *c) {
                free(pdn.bv_val);
                free(ndn.bv_val);
        } else if(tbe) {
-               Debug(LDAP_DEBUG_ANY, "%s: suffix already served by a preceding backend \"%s\"\n",
-                       c->log, tbe->be_suffix[0].bv_val, 0);
+               sprintf( c->msg, "<%s> suffix already served by a preceding backend",
+                       c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                       c->log, c->msg, tbe->be_suffix[0].bv_val);
                free(pdn.bv_val);
                free(ndn.bv_val);
                return(1);
@@ -1329,6 +1591,16 @@ config_rootdn(ConfigArgs *c) {
                } else {
                        return 1;
                }
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               ch_free( c->be->be_rootdn.bv_val );
+               ch_free( c->be->be_rootndn.bv_val );
+               BER_BVZERO( &c->be->be_rootdn );
+               BER_BVZERO( &c->be->be_rootndn );
+               return 0;
+       }
+       if ( !BER_BVISNULL( &c->be->be_rootdn )) {
+               ch_free( c->be->be_rootdn.bv_val );
+               ch_free( c->be->be_rootndn.bv_val );
        }
        c->be->be_rootdn = c->value_dn;
        c->be->be_rootndn = c->value_ndn;
@@ -1340,20 +1612,27 @@ config_rootpw(ConfigArgs *c) {
        Backend *tbe;
        if (c->op == SLAP_CONFIG_EMIT) {
                if (!BER_BVISEMPTY(&c->be->be_rootpw)) {
-                       c->value_string=ch_strdup("*");
+                       ber_dupbv( &c->value_bv, &c->be->be_rootpw);
                        return 0;
                }
                return 1;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               ch_free( c->be->be_rootpw.bv_val );
+               BER_BVZERO( &c->be->be_rootpw );
+               return 0;
        }
 
        tbe = select_backend(&c->be->be_rootndn, 0, 0);
        if(tbe != c->be) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "rootpw can only be set when rootdn is under suffix\n",
-                       c->log, 0, 0);
+               sprintf( c->msg, "<%s> can only be set when rootdn is under suffix",
+                       c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s\n",
+                       c->log, c->msg, 0);
                return(1);
        }
-       ber_str2bv(c->value_string, 0, 0, &c->be->be_rootpw);
+       if ( !BER_BVISNULL( &c->be->be_rootpw ))
+               ch_free( c->be->be_rootpw.bv_val );
+       c->be->be_rootpw = c->value_bv;
        return(0);
 }
 
@@ -1383,12 +1662,20 @@ config_restrict(ConfigArgs *c) {
        if (c->op == SLAP_CONFIG_EMIT) {
                return mask_to_verbs( restrictable_ops, c->be->be_restrictops,
                        &c->rvalue_vals );
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( !c->line ) {
+                       c->be->be_restrictops = 0;
+               } else {
+                       restrictops = verb_to_mask( c->line, restrictable_ops );
+                       c->be->be_restrictops ^= restrictops;
+               }
+               return 0;
        }
        i = verbs_to_mask( c->argc, c->argv, restrictable_ops, &restrictops );
        if ( i ) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "unknown operation %s in \"restrict <features>\" line\n",
-                       c->log, c->argv[i], 0);
+               sprintf( c->msg, "<%s> unknown operation", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s %s\n",
+                       c->log, c->msg, c->argv[i]);
                return(1);
        }
        if ( restrictops & SLAP_RESTRICT_OP_EXTENDED )
@@ -1410,12 +1697,20 @@ config_allows(ConfigArgs *c) {
        };
        if (c->op == SLAP_CONFIG_EMIT) {
                return mask_to_verbs( allowable_ops, global_allows, &c->rvalue_vals );
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( !c->line ) {
+                       global_allows = 0;
+               } else {
+                       allows = verb_to_mask( c->line, allowable_ops );
+                       global_allows ^= allows;
+               }
+               return 0;
        }
        i = verbs_to_mask(c->argc, c->argv, allowable_ops, &allows);
        if ( i ) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "unknown feature %s in \"allow <features>\" line\n",
-                       c->log, c->argv[i], 0);
+               sprintf( c->msg, "<%s> unknown feature", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s %s\n",
+                       c->log, c->msg, c->argv[i]);
                return(1);
        }
        global_allows |= allows;
@@ -1436,12 +1731,20 @@ config_disallows(ConfigArgs *c) {
        };
        if (c->op == SLAP_CONFIG_EMIT) {
                return mask_to_verbs( disallowable_ops, global_disallows, &c->rvalue_vals );
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( !c->line ) {
+                       global_disallows = 0;
+               } else {
+                       disallows = verb_to_mask( c->line, disallowable_ops );
+                       global_disallows ^= disallows;
+               }
+               return 0;
        }
        i = verbs_to_mask(c->argc, c->argv, disallowable_ops, &disallows);
        if ( i ) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "unknown feature %s in \"disallow <features>\" line\n",
-                       c->log, c->argv[i], 0);
+               sprintf( c->msg, "<%s> unknown feature", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s %s\n",
+                       c->log, c->msg, c->argv[i]);
                return(1);
        }
        global_disallows |= disallows;
@@ -1462,12 +1765,20 @@ config_requires(ConfigArgs *c) {
        };
        if (c->op == SLAP_CONFIG_EMIT) {
                return mask_to_verbs( requires_ops, c->be->be_requires, &c->rvalue_vals );
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( !c->line ) {
+                       c->be->be_requires = 0;
+               } else {
+                       requires = verb_to_mask( c->line, requires_ops );
+                       c->be->be_requires ^= requires;
+               }
+               return 0;
        }
        i = verbs_to_mask(c->argc, c->argv, requires_ops, &requires);
        if ( i ) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "unknown feature %s in \"require <features>\" line\n",
-                       c->log, c->argv[i], 0);
+               sprintf( c->msg, "<%s> unknown feature", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s %s\n",
+                       c->log, c->msg, c->argv[i]);
                return(1);
        }
        c->be->be_requires = requires;
@@ -1499,6 +1810,14 @@ config_loglevel(ConfigArgs *c) {
 
        if (c->op == SLAP_CONFIG_EMIT) {
                return mask_to_verbs( loglevel_ops, ldap_syslog, &c->rvalue_vals );
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( !c->line ) {
+                       ldap_syslog = 0;
+               } else {
+                       int level = verb_to_mask( c->line, loglevel_ops );
+                       ldap_syslog ^= level;
+               }
+               return 0;
        }
 
        ldap_syslog = 0;
@@ -1509,19 +1828,17 @@ config_loglevel(ConfigArgs *c) {
                if ( isdigit( c->argv[i][0] ) ) {
                        level = strtol( c->argv[i], &next, 10 );
                        if ( next == NULL || next[0] != '\0' ) {
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: unable to parse level \"%s\" "
-                                       "in \"loglevel <level> [...]\" line.\n",
-                                       c->log, c->argv[i], 0);
+                               sprintf( c->msg, "<%s> unable to parse level", c->argv[0] );
+                               Debug( LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                                       c->log, c->msg, c->argv[i]);
                                return( 1 );
                        }
                } else {
                        int j = verb_to_mask(c->argv[i], loglevel_ops);
                        if(BER_BVISNULL(&loglevel_ops[j].word)) {
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: unknown level \"%s\" "
-                                       "in \"loglevel <level> [...]\" line.\n",
-                                       c->log, c->argv[i], 0);
+                               sprintf( c->msg, "<%s> unknown level", c->argv[0] );
+                               Debug( LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                                       c->log, c->msg, c->argv[i]);
                                return( 1 );
                        }
                        level = loglevel_ops[j].mask;
@@ -1531,32 +1848,9 @@ config_loglevel(ConfigArgs *c) {
        return(0);
 }
 
-static int
-config_syncrepl(ConfigArgs *c) {
-       if (c->op == SLAP_CONFIG_EMIT) {
-               if ( c->be->be_syncinfo ) {
-                       struct berval bv;
-                       syncrepl_unparse( c->be->be_syncinfo, &bv ); 
-                       ber_bvarray_add( &c->rvalue_vals, &bv );
-                       return 0;
-               }
-               return 1;
-       }
-       if(SLAP_SHADOW(c->be)) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "syncrepl: database already shadowed.\n",
-                       c->log, 0, 0);
-               return(1);
-       } else if(add_syncrepl(c->be, c->argv, c->argc)) {
-               return(1);
-       }
-       SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SYNC_SHADOW);
-       return(0);
-}
-
 static int
 config_referral(ConfigArgs *c) {
-       struct berval vals[2];
+       struct berval val;
        if (c->op == SLAP_CONFIG_EMIT) {
                if ( default_referral ) {
                        value_add( &c->rvalue_vals, default_referral );
@@ -1564,17 +1858,27 @@ config_referral(ConfigArgs *c) {
                } else {
                        return 1;
                }
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( c->valx < 0 ) {
+                       ber_bvarray_free( default_referral );
+                       default_referral = NULL;
+               } else {
+                       int i = c->valx;
+                       ch_free( default_referral[i].bv_val );
+                       for (; default_referral[i].bv_val; i++ )
+                               default_referral[i] = default_referral[i+1];
+               }
+               return 0;
        }
        if(validate_global_referral(c->argv[1])) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "invalid URL (%s) in \"referral\" line.\n",
-                       c->log, c->argv[1], 0);
+               sprintf( c->msg, "<%s> invalid URL", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n",
+                       c->log, c->msg, c->argv[1]);
                return(1);
        }
 
-       ber_str2bv(c->argv[1], 0, 0, &vals[0]);
-       vals[1].bv_val = NULL; vals[1].bv_len = 0;
-       if(value_add(&default_referral, vals)) return(LDAP_OTHER);
+       ber_str2bv(c->argv[1], 0, 0, &val);
+       if(value_add_one(&default_referral, &val)) return(LDAP_OTHER);
        return(0);
 }
 
@@ -1631,24 +1935,24 @@ config_security(ConfigArgs *c) {
                        }
                }
                if ( !tgt ) {
-                       Debug(LDAP_DEBUG_ANY, "%s: "
-                               "unknown factor %s in \"security <factors>\" line\n",
-                               c->log, c->argv[i], 0);
+                       sprintf( c->msg, "<%s> unknown factor", c->argv[0] );
+                       Debug(LDAP_DEBUG_ANY, "%s: %s %s\n",
+                               c->log, c->msg, c->argv[i]);
                        return(1);
                }
 
                *tgt = strtol(src, &next, 10);
                if(next == NULL || next[0] != '\0' ) {
-                       Debug(LDAP_DEBUG_ANY, "%s: "
-                               "unable to parse factor \"%s\" in \"security <factors>\" line\n",
-                               c->log, c->argv[i], 0);
+                       sprintf( c->msg, "<%s> unable to parse factor", c->argv[0] );
+                       Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                               c->log, c->msg, c->argv[i]);
                        return(1);
                }
        }
        return(0);
 }
 
-static char *
+char *
 anlist_unparse( AttributeName *an, char *ptr ) {
        int comma = 0;
 
@@ -1668,7 +1972,7 @@ replica_unparse( struct slap_replica_info *ri, int i, struct berval *bv )
        struct berval bc = {0};
        char numbuf[32];
 
-       len = sprintf(numbuf, "{%d}", i );
+       len = sprintf(numbuf, IFMT, i );
 
        len += strlen( ri->ri_uri ) + STRLENOF("uri=");
        if ( ri->ri_nsuffix ) {
@@ -1728,6 +2032,11 @@ config_replica(ConfigArgs *c) {
                        return 0;
                }
                return 1;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               /* FIXME: there is no replica_free function */
+               if ( c->valx < 0 ) {
+               } else {
+               }
        }
        if(SLAP_MONITOR(c->be)) {
                Debug(LDAP_DEBUG_ANY, "%s: "
@@ -1747,16 +2056,14 @@ config_replica(ConfigArgs *c) {
                        break;
                } else if(!strncasecmp(c->argv[i], "uri=", STRLENOF("uri="))) {
                        if(ldap_url_parse(c->argv[i] + STRLENOF("uri="), &ludp) != LDAP_SUCCESS) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "replica line contains invalid "
-                                       "uri definition.\n", c->log, 0, 0);
+                               sprintf( c->msg, "<%s> invalid uri", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 );
                                return(1);
                        }
                        if(!ludp->lud_host) {
-                               Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "replica line contains invalid "
-                                       "uri definition - missing hostname.\n",
-                                       c->log, 0, 0);
+                               sprintf( c->msg, "<%s> invalid uri - missing hostname",
+                                       c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 );
                                return(1);
                        }
                        ldap_free_urldesc(ludp);
@@ -1769,14 +2076,12 @@ config_replica(ConfigArgs *c) {
                }
        }
        if(i == c->argc) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "missing host or uri in \"replica\" line\n",
-                       c->log, 0, 0);
+               sprintf( c->msg, "<%s> missing host or uri", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 );
                return(1);
        } else if(nr == -1) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "unable to add replica \"%s\"\n",
-                       c->log, replicauri, 0);
+               sprintf( c->msg, "<%s> unable to add replica", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg, replicauri );
                return(1);
        } else {
                for(i = 1; i < c->argc; i++) {
@@ -1805,9 +2110,9 @@ config_replica(ConfigArgs *c) {
                                        continue;
                                }
                                if(add_replica_attrs(c->be, nr, arg + 1, exclude)) {
-                                       Debug(LDAP_DEBUG_ANY, "%s: "
-                                               "attribute \"%s\" in \"replica\" line is unknown\n",
-                                               c->log, arg + 1, 0);
+                                       sprintf( c->msg, "<%s> unknown attribute", c->argv[0] );
+                                       Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n",
+                                               c->log, c->msg, arg + 1);
                                        return(1);
                                }
                        } else if ( bindconf_parse( c->argv[i],
@@ -1830,11 +2135,16 @@ config_updatedn(ConfigArgs *c) {
                        return 0;
                }
                return 1;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               ch_free( c->be->be_update_ndn.bv_val );
+               c->be->be_update_ndn.bv_val = NULL;
+               SLAP_DBFLAGS(c->be) ^= (SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SLURP_SHADOW);
+               return 0;
        }
        if(SLAP_SHADOW(c->be)) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "updatedn: database already shadowed.\n",
-                       c->log, 0, 0);
+               sprintf( c->msg, "<%s> database already shadowed", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s\n",
+                       c->log, c->msg, 0);
                return(1);
        }
 
@@ -1843,9 +2153,10 @@ config_updatedn(ConfigArgs *c) {
        rc = dnNormalize(0, NULL, NULL, &dn, &c->be->be_update_ndn, NULL);
 
        if(rc != LDAP_SUCCESS) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "updatedn DN is invalid: %d (%s)\n",
-                       c->log, rc, ldap_err2string( rc ));
+               sprintf( c->msg, "<%s> invalid DN %d (%s)", c->argv[0],
+                       rc, ldap_err2string(rc));
+               Debug(LDAP_DEBUG_ANY, "%s: %s\n",
+                       c->log, c->msg, 0 );
                return(1);
        }
 
@@ -1855,7 +2166,7 @@ config_updatedn(ConfigArgs *c) {
 
 static int
 config_updateref(ConfigArgs *c) {
-       struct berval vals[2];
+       struct berval val;
        if (c->op == SLAP_CONFIG_EMIT) {
                if ( c->be->be_update_refs ) {
                        value_add( &c->rvalue_vals, c->be->be_update_refs );
@@ -1863,23 +2174,34 @@ config_updateref(ConfigArgs *c) {
                } else {
                        return 1;
                }
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               if ( c->valx < 0 ) {
+                       ber_bvarray_free( c->be->be_update_refs );
+                       c->be->be_update_refs = NULL;
+               } else {
+                       int i = c->valx;
+                       ch_free( c->be->be_update_refs[i].bv_val );
+                       for (; c->be->be_update_refs[i].bv_val; i++)
+                               c->be->be_update_refs[i] = c->be->be_update_refs[i+1];
+               }
+               return 0;
        }
        if(!SLAP_SHADOW(c->be)) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "updateref line must come after syncrepl or updatedn.\n",
-                       c->log, 0, 0);
+               sprintf( c->msg, "<%s> must appear after syncrepl or updatedn",
+                       c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s\n",
+                       c->log, c->msg, 0);
                return(1);
        }
 
        if(validate_global_referral(c->argv[1])) {
-               Debug(LDAP_DEBUG_ANY, "%s: "
-                       "invalid URL (%s) in \"updateref\" line.\n",
-                       c->log, c->argv[1], 0);
+               sprintf( c->msg, "<%s> invalid URL", c->argv[0] );
+               Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n",
+                       c->log, c->msg, c->argv[1]);
                return(1);
        }
-       ber_str2bv(c->argv[1], 0, 0, &vals[0]);
-       vals[1].bv_val = NULL;
-       if(value_add(&c->be->be_update_refs, vals)) return(LDAP_OTHER);
+       ber_str2bv(c->argv[1], 0, 0, &val);
+       if(value_add_one(&c->be->be_update_refs, &val)) return(LDAP_OTHER);
        return(0);
 }
 
@@ -1891,12 +2213,15 @@ config_include(ConfigArgs *c) {
        ConfigFile *cfsave = cfn;
        ConfigFile *cf2 = NULL;
        if (c->op == SLAP_CONFIG_EMIT) {
+               if (c->private) {
+                       ConfigFile *cf = c->private;
+                       value_add_one( &c->rvalue_vals, &cf->c_file );
+                       return 0;
+               }
                return 1;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
        }
        cf = ch_calloc( 1, sizeof(ConfigFile));
-#ifdef SLAPD_MODULES
-       cf->c_modlast = &cf->c_modpaths;
-#endif
        if ( cfn->c_kids ) {
                for (cf2=cfn->c_kids; cf2 && cf2->c_sibs; cf2=cf2->c_sibs) ;
                cf2->c_sibs = cf;
@@ -1904,15 +2229,17 @@ config_include(ConfigArgs *c) {
                cfn->c_kids = cf;
        }
        cfn = cf;
+       ber_str2bv( c->argv[1], 0, 1, &cf->c_file );
        rc = read_config_file(c->argv[1], c->depth + 1, c);
        c->lineno = savelineno - 1;
        cfn = cfsave;
        if ( rc ) {
                if ( cf2 ) cf2->c_sibs = NULL;
                else cfn->c_kids = NULL;
+               ch_free( cf->c_file.bv_val );
                ch_free( cf );
        } else {
-               ber_str2bv( c->argv[1], 0, 1, &cf->c_file );
+               c->private = cf;
        }
        return(rc);
 }
@@ -1922,18 +2249,20 @@ static int
 config_tls_option(ConfigArgs *c) {
        int flag;
        switch(c->type) {
-       case CFG_TLS_RAND:              flag = LDAP_OPT_X_TLS_RANDOM_FILE;      break;
+       case CFG_TLS_RAND:      flag = LDAP_OPT_X_TLS_RANDOM_FILE;      break;
        case CFG_TLS_CIPHER:    flag = LDAP_OPT_X_TLS_CIPHER_SUITE;     break;
        case CFG_TLS_CERT_FILE: flag = LDAP_OPT_X_TLS_CERTFILE;         break;  
        case CFG_TLS_CERT_KEY:  flag = LDAP_OPT_X_TLS_KEYFILE;          break;
        case CFG_TLS_CA_PATH:   flag = LDAP_OPT_X_TLS_CACERTDIR;        break;
        case CFG_TLS_CA_FILE:   flag = LDAP_OPT_X_TLS_CACERTFILE;       break;
        default:                Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "unknown tls_option <%x>\n",
+                                       "unknown tls_option <0x%x>\n",
                                        c->log, c->type, 0);
        }
        if (c->op == SLAP_CONFIG_EMIT) {
                return ldap_pvt_tls_get_option( NULL, flag, &c->value_string );
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               return ldap_pvt_tls_set_option( NULL, flag, NULL );
        }
        ch_free(c->value_string);
        return(ldap_pvt_tls_set_option(NULL, flag, c->argv[1]));
@@ -1957,15 +2286,12 @@ config_tls_config(ConfigArgs *c) {
                { BER_BVNULL, 0 }
        }, *keys;
        switch(c->type) {
-#ifdef HAVE_OPENSSL_CRL
-       case CFG_TLS_CRLCHECK:  flag = LDAP_OPT_X_TLS_CRLCHECK; keys = crlkeys;
-               break;
-#endif
-       case CFG_TLS_VERIFY:    flag = LDAP_OPT_X_TLS_REQUIRE_CERT; keys = vfykeys;
-               break;
-       default:                Debug(LDAP_DEBUG_ANY, "%s: "
-                                       "unknown tls_option <%x>\n",
-                                       c->log, c->type, 0);
+       case CFG_TLS_CRLCHECK:  flag = LDAP_OPT_X_TLS_CRLCHECK;         keys = crlkeys; break;
+       case CFG_TLS_VERIFY:    flag = LDAP_OPT_X_TLS_REQUIRE_CERT;     keys = vfykeys; break;
+       default:
+               Debug(LDAP_DEBUG_ANY, "%s: "
+                               "unknown tls_option <0x%x>\n",
+                               c->log, c->type, 0);
        }
        if (c->op == SLAP_CONFIG_EMIT) {
                ldap_pvt_tls_get_option( NULL, flag, &c->value_int );
@@ -1976,6 +2302,9 @@ config_tls_config(ConfigArgs *c) {
                        }
                }
                return 1;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               int i = 0;
+               return ldap_pvt_tls_set_option( NULL, flag, &i );
        }
        ch_free( c->value_string );
        if(isdigit((unsigned char)c->argv[1][0])) {
@@ -1987,546 +2316,30 @@ config_tls_config(ConfigArgs *c) {
 }
 #endif
 
-static int
-add_syncrepl(
-       Backend *be,
-       char    **cargv,
-       int     cargc
-)
+static CfEntryInfo *
+config_find_base( CfEntryInfo *root, struct berval *dn, CfEntryInfo **last )
 {
-       syncinfo_t *si;
-       int     rc = 0;
-
-       si = (syncinfo_t *) ch_calloc( 1, sizeof( syncinfo_t ) );
+       struct berval cdn;
+       char *c;
 
-       if ( si == NULL ) {
-               Debug( LDAP_DEBUG_ANY, "out of memory in add_syncrepl\n", 0, 0, 0 );
-               return 1;
+       if ( !root ) {
+               *last = NULL;
+               return NULL;
        }
 
-       si->si_bindconf.sb_tls = SB_TLS_OFF;
-       si->si_bindconf.sb_method = LDAP_AUTH_SIMPLE;
-       si->si_schemachecking = 0;
-       ber_str2bv( "(objectclass=*)", STRLENOF("(objectclass=*)"), 1,
-               &si->si_filterstr );
-       si->si_base.bv_val = NULL;
-       si->si_scope = LDAP_SCOPE_SUBTREE;
-       si->si_attrsonly = 0;
-       si->si_anlist = (AttributeName *) ch_calloc( 1, sizeof( AttributeName ));
-       si->si_exanlist = (AttributeName *) ch_calloc( 1, sizeof( AttributeName ));
-       si->si_attrs = NULL;
-       si->si_allattrs = 0;
-       si->si_allopattrs = 0;
-       si->si_exattrs = NULL;
-       si->si_type = LDAP_SYNC_REFRESH_ONLY;
-       si->si_interval = 86400;
-       si->si_retryinterval = NULL;
-       si->si_retrynum_init = NULL;
-       si->si_retrynum = NULL;
-       si->si_manageDSAit = 0;
-       si->si_tlimit = 0;
-       si->si_slimit = 0;
-
-       si->si_presentlist = NULL;
-       LDAP_LIST_INIT( &si->si_nonpresentlist );
-       ldap_pvt_thread_mutex_init( &si->si_mutex );
-
-       rc = parse_syncrepl_line( cargv, cargc, si );
-
-       if ( rc < 0 ) {
-               Debug( LDAP_DEBUG_ANY, "failed to add syncinfo\n", 0, 0, 0 );
-               syncinfo_free( si );    
-               return 1;
-       } else {
-               Debug( LDAP_DEBUG_CONFIG,
-                       "Config: ** successfully added syncrepl \"%s\"\n",
-                       BER_BVISNULL( &si->si_provideruri ) ?
-                       "(null)" : si->si_provideruri.bv_val, 0, 0 );
-               if ( !si->si_schemachecking ) {
-                       SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NO_SCHEMA_CHECK;
-               }
-               si->si_be = be;
-               be->be_syncinfo = si;
-               return 0;
-       }
-}
+       if ( dn_match( &root->ce_entry->e_nname, dn ))
+               return root;
 
-/* NOTE: used & documented in slapd.conf(5) */
-#define IDSTR                  "rid"
-#define PROVIDERSTR            "provider"
-#define TYPESTR                        "type"
-#define INTERVALSTR            "interval"
-#define SEARCHBASESTR          "searchbase"
-#define FILTERSTR              "filter"
-#define SCOPESTR               "scope"
-#define ATTRSSTR               "attrs"
-#define ATTRSONLYSTR           "attrsonly"
-#define SLIMITSTR              "sizelimit"
-#define TLIMITSTR              "timelimit"
-#define SCHEMASTR              "schemachecking"
-
-/* FIXME: undocumented */
-#define OLDAUTHCSTR            "bindprincipal"
-#define EXATTRSSTR             "exattrs"
-#define RETRYSTR               "retry"
-
-/* FIXME: unused */
-#define LASTMODSTR             "lastmod"
-#define LMGENSTR               "gen"
-#define LMNOSTR                        "no"
-#define LMREQSTR               "req"
-#define SRVTABSTR              "srvtab"
-#define SUFFIXSTR              "suffix"
-#define MANAGEDSAITSTR         "manageDSAit"
-
-/* mandatory */
-#define GOT_ID                 0x0001
-#define GOT_PROVIDER           0x0002
-
-/* check */
-#define GOT_ALL                        (GOT_ID|GOT_PROVIDER)
+       c = dn->bv_val+dn->bv_len;
+       for (;*c != ',';c--);
 
-static struct {
-       struct berval key;
-       int val;
-} scopes[] = {
-       { BER_BVC("base"), LDAP_SCOPE_BASE },
-       { BER_BVC("one"), LDAP_SCOPE_ONELEVEL },
-#ifdef LDAP_SCOPE_SUBORDINATE
-       { BER_BVC("children"), LDAP_SCOPE_SUBORDINATE },
-       { BER_BVC("subordinate"), 0 },
-#endif
-       { BER_BVC("sub"), LDAP_SCOPE_SUBTREE },
-       { BER_BVNULL, 0 }
-};
-
-static int
-parse_syncrepl_line(
-       char            **cargv,
-       int             cargc,
-       syncinfo_t      *si
-)
-{
-       int     gots = 0;
-       int     i;
-       char    *val;
-
-       for ( i = 1; i < cargc; i++ ) {
-               if ( !strncasecmp( cargv[ i ], IDSTR "=",
-                                       STRLENOF( IDSTR "=" ) ) )
-               {
-                       int tmp;
-                       /* '\0' string terminator accounts for '=' */
-                       val = cargv[ i ] + STRLENOF( IDSTR "=" );
-                       tmp= atoi( val );
-                       if ( tmp >= 1000 || tmp < 0 ) {
-                               fprintf( stderr, "Error: parse_syncrepl_line: "
-                                        "syncrepl id %d is out of range [0..999]\n", tmp );
-                               return -1;
-                       }
-                       si->si_rid = tmp;
-                       gots |= GOT_ID;
-               } else if ( !strncasecmp( cargv[ i ], PROVIDERSTR "=",
-                                       STRLENOF( PROVIDERSTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( PROVIDERSTR "=" );
-                       ber_str2bv( val, 0, 1, &si->si_provideruri );
-                       gots |= GOT_PROVIDER;
-               } else if ( !strncasecmp( cargv[ i ], SCHEMASTR "=",
-                                       STRLENOF( SCHEMASTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( SCHEMASTR "=" );
-                       if ( !strncasecmp( val, "on", STRLENOF( "on" ) )) {
-                               si->si_schemachecking = 1;
-                       } else if ( !strncasecmp( val, "off", STRLENOF( "off" ) ) ) {
-                               si->si_schemachecking = 0;
-                       } else {
-                               si->si_schemachecking = 1;
-                       }
-               } else if ( !strncasecmp( cargv[ i ], FILTERSTR "=",
-                                       STRLENOF( FILTERSTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( FILTERSTR "=" );
-                       ber_str2bv( val, 0, 1, &si->si_filterstr );
-               } else if ( !strncasecmp( cargv[ i ], SEARCHBASESTR "=",
-                                       STRLENOF( SEARCHBASESTR "=" ) ) )
-               {
-                       struct berval   bv;
-                       int             rc;
-
-                       val = cargv[ i ] + STRLENOF( SEARCHBASESTR "=" );
-                       if ( si->si_base.bv_val ) {
-                               ch_free( si->si_base.bv_val );
-                       }
-                       ber_str2bv( val, 0, 0, &bv );
-                       rc = dnNormalize( 0, NULL, NULL, &bv, &si->si_base, NULL );
-                       if ( rc != LDAP_SUCCESS ) {
-                               fprintf( stderr, "Invalid base DN \"%s\": %d (%s)\n",
-                                       val, rc, ldap_err2string( rc ) );
-                               return -1;
-                       }
-               } else if ( !strncasecmp( cargv[ i ], SCOPESTR "=",
-                                       STRLENOF( SCOPESTR "=" ) ) )
-               {
-                       int j;
-                       val = cargv[ i ] + STRLENOF( SCOPESTR "=" );
-                       for ( j=0; !BER_BVISNULL(&scopes[j].key); j++ ) {
-                               if (!strncasecmp( val, scopes[j].key.bv_val,
-                                       scopes[j].key.bv_len )) {
-                                       while (!scopes[j].val) j--;
-                                       si->si_scope = scopes[j].val;
-                                       break;
-                               }
-                       }
-                       if ( BER_BVISNULL(&scopes[j].key) ) {
-                               fprintf( stderr, "Error: parse_syncrepl_line: "
-                                       "unknown scope \"%s\"\n", val);
-                               return -1;
-                       }
-               } else if ( !strncasecmp( cargv[ i ], ATTRSONLYSTR "=",
-                                       STRLENOF( ATTRSONLYSTR "=" ) ) )
-               {
-                       si->si_attrsonly = 1;
-               } else if ( !strncasecmp( cargv[ i ], ATTRSSTR "=",
-                                       STRLENOF( ATTRSSTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( ATTRSSTR "=" );
-                       if ( !strncasecmp( val, ":include:", STRLENOF(":include:") ) ) {
-                               char *attr_fname;
-                               attr_fname = ch_strdup( val + STRLENOF(":include:") );
-                               si->si_anlist = file2anlist( si->si_anlist, attr_fname, " ,\t" );
-                               if ( si->si_anlist == NULL ) {
-                                       ch_free( attr_fname );
-                                       return -1;
-                               }
-                               si->si_anfile = attr_fname;
-                       } else {
-                               char *str, *s, *next;
-                               char delimstr[] = " ,\t";
-                               str = ch_strdup( val );
-                               for ( s = ldap_pvt_strtok( str, delimstr, &next );
-                                               s != NULL;
-                                               s = ldap_pvt_strtok( NULL, delimstr, &next ) )
-                               {
-                                       if ( strlen(s) == 1 && *s == '*' ) {
-                                               si->si_allattrs = 1;
-                                               *(val + ( s - str )) = delimstr[0];
-                                       }
-                                       if ( strlen(s) == 1 && *s == '+' ) {
-                                               si->si_allopattrs = 1;
-                                               *(val + ( s - str )) = delimstr[0];
-                                       }
-                               }
-                               ch_free( str );
-                               si->si_anlist = str2anlist( si->si_anlist, val, " ,\t" );
-                               if ( si->si_anlist == NULL ) {
-                                       return -1;
-                               }
-                       }
-               } else if ( !strncasecmp( cargv[ i ], EXATTRSSTR "=",
-                                       STRLENOF( EXATTRSSTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( EXATTRSSTR "=" );
-                       if ( !strncasecmp( val, ":include:", STRLENOF(":include:") )) {
-                               char *attr_fname;
-                               attr_fname = ch_strdup( val + STRLENOF(":include:") );
-                               si->si_exanlist = file2anlist(
-                                                                       si->si_exanlist, attr_fname, " ,\t" );
-                               if ( si->si_exanlist == NULL ) {
-                                       ch_free( attr_fname );
-                                       return -1;
-                               }
-                               ch_free( attr_fname );
-                       } else {
-                               si->si_exanlist = str2anlist( si->si_exanlist, val, " ,\t" );
-                               if ( si->si_exanlist == NULL ) {
-                                       return -1;
-                               }
-                       }
-               } else if ( !strncasecmp( cargv[ i ], TYPESTR "=",
-                                       STRLENOF( TYPESTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( TYPESTR "=" );
-                       if ( !strncasecmp( val, "refreshOnly",
-                                               STRLENOF("refreshOnly") ))
-                       {
-                               si->si_type = LDAP_SYNC_REFRESH_ONLY;
-                       } else if ( !strncasecmp( val, "refreshAndPersist",
-                                               STRLENOF("refreshAndPersist") ))
-                       {
-                               si->si_type = LDAP_SYNC_REFRESH_AND_PERSIST;
-                               si->si_interval = 60;
-                       } else {
-                               fprintf( stderr, "Error: parse_syncrepl_line: "
-                                       "unknown sync type \"%s\"\n", val);
-                               return -1;
-                       }
-               } else if ( !strncasecmp( cargv[ i ], INTERVALSTR "=",
-                                       STRLENOF( INTERVALSTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( INTERVALSTR "=" );
-                       if ( si->si_type == LDAP_SYNC_REFRESH_AND_PERSIST ) {
-                               si->si_interval = 0;
-                       } else {
-                               char *hstr;
-                               char *mstr;
-                               char *dstr;
-                               char *sstr;
-                               int dd, hh, mm, ss;
-                               dstr = val;
-                               hstr = strchr( dstr, ':' );
-                               if ( hstr == NULL ) {
-                                       fprintf( stderr, "Error: parse_syncrepl_line: "
-                                               "invalid interval \"%s\"\n", val );
-                                       return -1;
-                               }
-                               *hstr++ = '\0';
-                               mstr = strchr( hstr, ':' );
-                               if ( mstr == NULL ) {
-                                       fprintf( stderr, "Error: parse_syncrepl_line: "
-                                               "invalid interval \"%s\"\n", val );
-                                       return -1;
-                               }
-                               *mstr++ = '\0';
-                               sstr = strchr( mstr, ':' );
-                               if ( sstr == NULL ) {
-                                       fprintf( stderr, "Error: parse_syncrepl_line: "
-                                               "invalid interval \"%s\"\n", val );
-                                       return -1;
-                               }
-                               *sstr++ = '\0';
-
-                               dd = atoi( dstr );
-                               hh = atoi( hstr );
-                               mm = atoi( mstr );
-                               ss = atoi( sstr );
-                               if (( hh > 24 ) || ( hh < 0 ) ||
-                                       ( mm > 60 ) || ( mm < 0 ) ||
-                                       ( ss > 60 ) || ( ss < 0 ) || ( dd < 0 )) {
-                                       fprintf( stderr, "Error: parse_syncrepl_line: "
-                                               "invalid interval \"%s\"\n", val );
-                                       return -1;
-                               }
-                               si->si_interval = (( dd * 24 + hh ) * 60 + mm ) * 60 + ss;
-                       }
-                       if ( si->si_interval < 0 ) {
-                               fprintf( stderr, "Error: parse_syncrepl_line: "
-                                       "invalid interval \"%ld\"\n",
-                                       (long) si->si_interval);
-                               return -1;
-                       }
-               } else if ( !strncasecmp( cargv[ i ], RETRYSTR "=",
-                                       STRLENOF( RETRYSTR "=" ) ) )
-               {
-                       char **retry_list;
-                       int j, k, n;
-
-                       val = cargv[ i ] + STRLENOF( RETRYSTR "=" );
-                       retry_list = (char **) ch_calloc( 1, sizeof( char * ));
-                       retry_list[0] = NULL;
-
-                       slap_str2clist( &retry_list, val, " ,\t" );
-
-                       for ( k = 0; retry_list && retry_list[k]; k++ ) ;
-                       n = k / 2;
-                       if ( k % 2 ) {
-                               fprintf( stderr,
-                                               "Error: incomplete syncrepl retry list\n" );
-                               for ( k = 0; retry_list && retry_list[k]; k++ ) {
-                                       ch_free( retry_list[k] );
-                               }
-                               ch_free( retry_list );
-                               exit( EXIT_FAILURE );
-                       }
-                       si->si_retryinterval = (time_t *) ch_calloc( n + 1, sizeof( time_t ));
-                       si->si_retrynum = (int *) ch_calloc( n + 1, sizeof( int ));
-                       si->si_retrynum_init = (int *) ch_calloc( n + 1, sizeof( int ));
-                       for ( j = 0; j < n; j++ ) {
-                               si->si_retryinterval[j] = atoi( retry_list[j*2] );
-                               if ( *retry_list[j*2+1] == '+' ) {
-                                       si->si_retrynum_init[j] = -1;
-                                       si->si_retrynum[j] = -1;
-                                       j++;
-                                       break;
-                               } else {
-                                       si->si_retrynum_init[j] = atoi( retry_list[j*2+1] );
-                                       si->si_retrynum[j] = atoi( retry_list[j*2+1] );
-                               }
-                       }
-                       si->si_retrynum_init[j] = -2;
-                       si->si_retrynum[j] = -2;
-                       si->si_retryinterval[j] = 0;
-                       
-                       for ( k = 0; retry_list && retry_list[k]; k++ ) {
-                               ch_free( retry_list[k] );
-                       }
-                       ch_free( retry_list );
-               } else if ( !strncasecmp( cargv[ i ], MANAGEDSAITSTR "=",
-                                       STRLENOF( MANAGEDSAITSTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( MANAGEDSAITSTR "=" );
-                       si->si_manageDSAit = atoi( val );
-               } else if ( !strncasecmp( cargv[ i ], SLIMITSTR "=",
-                                       STRLENOF( SLIMITSTR "=") ) )
-               {
-                       val = cargv[ i ] + STRLENOF( SLIMITSTR "=" );
-                       si->si_slimit = atoi( val );
-               } else if ( !strncasecmp( cargv[ i ], TLIMITSTR "=",
-                                       STRLENOF( TLIMITSTR "=" ) ) )
-               {
-                       val = cargv[ i ] + STRLENOF( TLIMITSTR "=" );
-                       si->si_tlimit = atoi( val );
-               } else if ( bindconf_parse( cargv[i], &si->si_bindconf )) {
-                       fprintf( stderr, "Error: parse_syncrepl_line: "
-                               "unknown keyword \"%s\"\n", cargv[ i ] );
-                       return -1;
-               }
-       }
-
-       if ( gots != GOT_ALL ) {
-               fprintf( stderr,
-                       "Error: Malformed \"syncrepl\" line in slapd config file" );
-               return -1;
-       }
-
-       return 0;
-}
-
-static void
-syncrepl_unparse( syncinfo_t *si, struct berval *bv )
-{
-       struct berval bc;
-       char buf[BUFSIZ*2], *ptr;
-       int i, len;
-
-       bindconf_unparse( &si->si_bindconf, &bc );
-       ptr = buf;
-       ptr += sprintf( ptr, IDSTR "=%03d " PROVIDERSTR "=%s",
-               si->si_rid, si->si_provideruri.bv_val );
-       if ( !BER_BVISNULL( &bc )) {
-               ptr = lutil_strcopy( ptr, bc.bv_val );
-               free( bc.bv_val );
-       }
-       if ( !BER_BVISEMPTY( &si->si_filterstr )) {
-               ptr = lutil_strcopy( ptr, " " FILTERSTR "=\"" );
-               ptr = lutil_strcopy( ptr, si->si_filterstr.bv_val );
-               *ptr++ = '"';
-       }
-       if ( !BER_BVISNULL( &si->si_base )) {
-               ptr = lutil_strcopy( ptr, " " SEARCHBASESTR "=\"" );
-               ptr = lutil_strcopy( ptr, si->si_base.bv_val );
-               *ptr++ = '"';
-       }
-       for (i=0; !BER_BVISNULL(&scopes[i].key);i++) {
-               if ( si->si_scope == scopes[i].val ) {
-                       ptr = lutil_strcopy( ptr, " " SCOPESTR "=" );
-                       ptr = lutil_strcopy( ptr, scopes[i].key.bv_val );
-                       break;
-               }
-       }
-       if ( si->si_attrsonly ) {
-               ptr = lutil_strcopy( ptr, " " ATTRSONLYSTR "=yes" );
-       }
-       if ( si->si_anfile ) {
-               ptr = lutil_strcopy( ptr, " " ATTRSSTR "=:include:" );
-               ptr = lutil_strcopy( ptr, si->si_anfile );
-       } else if ( si->si_allattrs || si->si_allopattrs ||
-               ( si->si_anlist && !BER_BVISNULL(&si->si_anlist[0].an_name) )) {
-               char *old;
-               ptr = lutil_strcopy( ptr, " " ATTRSSTR "=\"" );
-               old = ptr;
-               ptr = anlist_unparse( si->si_anlist, ptr );
-               if ( si->si_allattrs ) {
-                       if ( old != ptr ) *ptr++ = ',';
-                       *ptr++ = '*';
-               }
-               if ( si->si_allopattrs ) {
-                       if ( old != ptr ) *ptr++ = ',';
-                       *ptr++ = '+';
-               }
-               *ptr++ = '"';
-       }
-       if ( si->si_exanlist && !BER_BVISNULL(&si->si_exanlist[0].an_name) ) {
-               ptr = lutil_strcopy( ptr, " " EXATTRSSTR "=" );
-               ptr = anlist_unparse( si->si_exanlist, ptr );
-       }
-       ptr = lutil_strcopy( ptr, " " SCHEMASTR "=" );
-       ptr = lutil_strcopy( ptr, si->si_schemachecking ? "on" : "off" );
-       
-       ptr = lutil_strcopy( ptr, " " TYPESTR "=" );
-       ptr = lutil_strcopy( ptr, si->si_type == LDAP_SYNC_REFRESH_AND_PERSIST ?
-               "refreshAndPersist" : "refreshOnly" );
-
-       if ( si->si_type == LDAP_SYNC_REFRESH_ONLY ) {
-               int dd, hh, mm, ss;
-
-               dd = si->si_interval;
-               ss = dd % 60;
-               dd /= 60;
-               mm = dd % 60;
-               dd /= 60;
-               hh = dd % 24;
-               dd /= 24;
-               ptr = lutil_strcopy( ptr, " " INTERVALSTR "=" );
-               ptr += sprintf( ptr, "%02d:%02d:%02d:%02d", dd, hh, mm, ss );
-       } else if ( si->si_retryinterval ) {
-               int space=0;
-               ptr = lutil_strcopy( ptr, " " RETRYSTR "=\"" );
-               for (i=0; si->si_retryinterval[i]; i++) {
-                       if ( space ) *ptr++ = ' ';
-                       space = 1;
-                       ptr += sprintf( ptr, "%d", si->si_retryinterval[i] );
-                       if ( si->si_retrynum_init[i] == -1 )
-                               *ptr++ = '+';
-                       else
-                               ptr += sprintf( ptr, "%d", si->si_retrynum_init );
-               }
-               *ptr++ = '"';
-       }
-
-#if 0 /* FIXME: unused in syncrepl.c, should remove it */
-       ptr = lutil_strcopy( ptr, " " MANAGEDSAITSTR "=" );
-       ptr += sprintf( ptr, "%d", si->si_manageDSAit );
-#endif
-
-       if ( si->si_slimit ) {
-               ptr = lutil_strcopy( ptr, " " SLIMITSTR "=" );
-               ptr += sprintf( ptr, "%d", si->si_slimit );
-       }
-
-       if ( si->si_tlimit ) {
-               ptr = lutil_strcopy( ptr, " " TLIMITSTR "=" );
-               ptr += sprintf( ptr, "%d", si->si_tlimit );
-       }
-       bc.bv_len = ptr - buf;
-       bc.bv_val = buf;
-       ber_dupbv( bv, &bc );
-}
-
-static CfEntryInfo *
-config_find_base( CfEntryInfo *root, struct berval *dn, CfEntryInfo **last )
-{
-       struct berval cdn;
-       char *c;
-
-       if ( !root ) {
-               *last = NULL;
-               return NULL;
-       }
-
-       if ( dn_match( &root->ce_entry->e_nname, dn ))
-               return root;
-
-       c = dn->bv_val+dn->bv_len;
-       for (;*c != ',';c--);
-
-       while(root) {
-               *last = root;
-               for (--c;c>dn->bv_val && *c != ',';c--);
-               if ( *c == ',' )
-                       c++;
-               cdn.bv_val = c;
-               cdn.bv_len = dn->bv_len - (c-dn->bv_val);
+       while(root) {
+               *last = root;
+               for (--c;c>dn->bv_val && *c != ',';c--);
+               cdn.bv_val = c;
+               if ( *c == ',' )
+                       cdn.bv_val++;
+               cdn.bv_len = dn->bv_len - (cdn.bv_val - dn->bv_val);
 
                root = root->ce_kids;
 
@@ -2547,25 +2360,11 @@ config_ldif_resp( Operation *op, SlapReply *rs )
 {
        if ( rs->sr_type == REP_SEARCH ) {
                CfBackInfo *cfb = op->o_callback->sc_private;
-               CfEntryInfo *ce, *last;
 
                cfb->cb_got_ldif = 1;
-               config_find_base( cfb->cb_root, &rs->sr_entry->e_nname, &last );
-               ce = ch_calloc( 1, sizeof(CfEntryInfo) );
-               ce->ce_entry = entry_dup( rs->sr_entry );
-               ce->ce_entry->e_private = ce;
-               if ( !last ) {
-                       cfb->cb_root = ce;
-               } else if ( last->ce_kids ) {
-                       CfEntryInfo *c2;
-
-                       for (c2=last->ce_kids; c2 && c2->ce_sibs; c2 = c2->ce_sibs);
-                       c2->ce_sibs = ce;
-               } else {
-                       last->ce_kids = ce;
-               }
+               rs->sr_err = config_add_internal( cfb, rs->sr_entry, NULL, NULL );
        }
-       return 0;
+       return rs->sr_err;
 }
 
 /* Configure and read the underlying back-ldif store */
@@ -2583,7 +2382,16 @@ config_setup_ldif( BackendDB *be, const char *dir ) {
        SlapReply rs = {REP_RESULT};
        Filter filter = { LDAP_FILTER_PRESENT };
        struct berval filterstr = BER_BVC("(objectclass=*)");
+       struct stat st;
 
+       /* Is the config directory available? */
+       if ( stat( dir, &st ) < 0 ) {
+               /* No, so don't bother using the backing store.
+                * All changes will be in-memory only.
+                */
+               return 0;
+       }
+               
        cfb->cb_db.bd_info = backend_info( "ldif" );
        if ( !cfb->cb_db.bd_info )
                return 0;       /* FIXME: eventually this will be a fatal error */
@@ -2647,6 +2455,8 @@ config_setup_ldif( BackendDB *be, const char *dir ) {
        op->o_bd = &cfb->cb_db;
        op->o_bd->be_search( op, &rs );
        
+       cfb->cb_use_ldif = 1;
+
        return 0;
 }
 
@@ -2673,8 +2483,10 @@ config_register_schema(ConfigTable *ct, ConfigOCs *ocs) {
        for (i=0; ocs[i].def; i++) {
                if ( ocs[i].oc ) {
                        co = ch_malloc( sizeof(CfOcInfo) );
-                       co->co_name = &(*ocs[i].oc)->soc_cname;
+                       co->co_oc = *ocs[i].oc;
+                       co->co_name = &co->co_oc->soc_cname;
                        co->co_table = ct;
+                       co->co_type = ocs[i].cft;
                        avl_insert( &CfOcTree, co, CfOcInfo_cmp, avl_dup_error );
                }
        }
@@ -2684,17 +2496,20 @@ config_register_schema(ConfigTable *ct, ConfigOCs *ocs) {
 int
 read_config(const char *fname, const char *dir) {
        BackendDB *be;
+       CfBackInfo *cfb;
 
        /* Setup the config backend */
        be = backend_db_init( "config" );
        if ( !be )
                return 1;
 
+       cfb = be->be_private;
+
        /* Setup the underlying back-ldif backend */
        if ( config_setup_ldif( be, dir ))
                return 1;
 
-#if 0  /* not yet
+#ifdef SLAP_USE_CONFDIR
        /* If we read the config from back-ldif, nothing to do here */
        if ( cfb->cb_got_ldif )
                return 0;
@@ -2745,15 +2560,827 @@ config_send( Operation *op, SlapReply *rs, CfEntryInfo *ce, int depth )
        return rc;
 }
 
+static ConfigTable *
+config_find_table( CfOcInfo **colst, int nocs, AttributeDescription *ad )
+{
+       int i, j;
+
+       for (j=0; j<nocs; j++) {
+               for (i=0; colst[j]->co_table[i].name; i++)
+                       if ( colst[j]->co_table[i].ad == ad )
+                               return &colst[j]->co_table[i];
+       }
+       return NULL;
+}
+
+/* Sort the attributes of the entry according to the order defined
+ * in the objectclass, with required attributes occurring before
+ * allowed attributes. For any attributes with sequencing dependencies
+ * (e.g., rootDN must be defined after suffix) the objectclass must
+ * list the attributes in the desired sequence.
+ */
+static void
+sort_attrs( Entry *e, CfOcInfo **colst, int nocs )
+{
+       Attribute *a, *head = NULL, *tail = NULL, **prev;
+       int i, j;
+
+       for (i=0; i<nocs; i++) {
+               if ( colst[i]->co_oc->soc_required ) {
+                       AttributeType **at = colst[i]->co_oc->soc_required;
+                       for (j=0; at[j]; j++) {
+                               for (a=e->e_attrs, prev=&e->e_attrs; a;
+                                       prev = &(*prev)->a_next, a=a->a_next) {
+                                       if ( a->a_desc == at[j]->sat_ad ) {
+                                               *prev = a->a_next;
+                                               if (!head) {
+                                                       head = a;
+                                                       tail = a;
+                                               } else {
+                                                       tail->a_next = a;
+                                                       tail = a;
+                                               }
+                                               break;
+                                       }
+                               }
+                       }
+               }
+               if ( colst[i]->co_oc->soc_allowed ) {
+                       AttributeType **at = colst[i]->co_oc->soc_allowed;
+                       for (j=0; at[j]; j++) {
+                               for (a=e->e_attrs, prev=&e->e_attrs; a;
+                                       prev = &(*prev)->a_next, a=a->a_next) {
+                                       if ( a->a_desc == at[j]->sat_ad ) {
+                                               *prev = a->a_next;
+                                               if (!head) {
+                                                       head = a;
+                                                       tail = a;
+                                               } else {
+                                                       tail->a_next = a;
+                                                       tail = a;
+                                               }
+                                               break;
+                                       }
+                               }
+                       }
+               }
+       }
+       if ( tail ) {
+               tail->a_next = e->e_attrs;
+               e->e_attrs = head;
+       }
+}
+
+static int
+check_vals( ConfigTable *ct, ConfigArgs *ca, void *ptr, int isAttr )
+{
+       Attribute *a = NULL;
+       AttributeDescription *ad;
+       BerVarray vals;
+
+       int i, rc = 0, sort = 0;
+
+       if ( isAttr ) {
+               a = ptr;
+               ad = a->a_desc;
+               vals = a->a_vals;
+       } else {
+               Modifications *ml = ptr;
+               ad = ml->sml_desc;
+               vals = ml->sml_values;
+       }
+
+       if ( a && ( ad->ad_type->sat_flags & SLAP_AT_ORDERED_VAL )) {
+               sort = 1;
+               rc = ordered_value_sort( a, 1 );
+               if ( rc )
+                       return rc;
+       }
+       for ( i=0; vals[i].bv_val; i++ ) {
+               ca->line = vals[i].bv_val;
+               if ( sort ) {
+                       char *idx = strchr( ca->line, '}' );
+                       if ( idx ) ca->line = idx+1;
+               }
+               rc = config_parse_vals( ct, ca, i );
+               if ( rc )
+                       break;
+       }
+       return rc;
+}
+
+static int
+check_name_index( CfEntryInfo *parent, ConfigType ce_type, Entry *e,
+       SlapReply *rs, int *renum )
+{
+       CfEntryInfo *ce;
+       int index = -1, gotindex = 0, nsibs;
+       int renumber = 0, tailindex = 0;
+       char *ptr1, *ptr2;
+       struct berval rdn;
+
+       if ( renum ) *renum = 0;
+
+       /* These entries don't get indexed/renumbered */
+       if ( ce_type == Cft_Global ) return 0;
+       if ( ce_type == Cft_Schema && parent->ce_type == Cft_Global ) return 0;
+
+       if ( ce_type == Cft_Include || ce_type == Cft_Module )
+               tailindex = 1;
+
+       /* See if the rdn has an index already */
+       dnRdn( &e->e_name, &rdn );
+       ptr1 = strchr( e->e_name.bv_val, '{' );
+       if ( ptr1 && ptr1 - e->e_name.bv_val < rdn.bv_len ) {
+               ptr2 = strchr( ptr1, '}' );
+               if (!ptr2 || ptr2 - e->e_name.bv_val > rdn.bv_len)
+                       return LDAP_NAMING_VIOLATION;
+               if ( ptr2-ptr1 == 1)
+                       return LDAP_NAMING_VIOLATION;
+               gotindex = 1;
+               index = atoi(ptr1+1);
+               if ( index < 0 )
+                       return LDAP_NAMING_VIOLATION;
+       }
+
+       /* count related kids */
+       for (nsibs=0, ce=parent->ce_kids; ce; ce=ce->ce_sibs) {
+               if ( ce->ce_type == ce_type ) nsibs++;
+       }
+
+       if ( index != nsibs ) {
+               if ( gotindex ) {
+                       if ( index < nsibs ) {
+                               if ( tailindex ) return LDAP_NAMING_VIOLATION;
+                               /* Siblings need to be renumbered */
+                               renumber = 1;
+                       }
+               }
+               if ( !renumber ) {
+                       struct berval ival, newrdn, nnewrdn;
+                       struct berval rtype, rval;
+                       Attribute *a;
+                       AttributeDescription *ad = NULL;
+                       char ibuf[32];
+                       const char *text;
+
+                       rval.bv_val = strchr(rdn.bv_val, '=' ) + 1;
+                       rval.bv_len = rdn.bv_len - (rval.bv_val - rdn.bv_val);
+                       rtype.bv_val = rdn.bv_val;
+                       rtype.bv_len = rval.bv_val - rtype.bv_val - 1;
+
+                       /* Find attr */
+                       slap_bv2ad( &rtype, &ad, &text );
+                       a = attr_find( e->e_attrs, ad );
+                       if (!a ) return LDAP_NAMING_VIOLATION;
+
+                       ival.bv_val = ibuf;
+                       ival.bv_len = sprintf( ibuf, IFMT, nsibs );
+                       
+                       newrdn.bv_len = rdn.bv_len + ival.bv_len;
+                       newrdn.bv_val = ch_malloc( newrdn.bv_len+1 );
+
+                       if ( tailindex ) {
+                               ptr1 = lutil_strncopy( newrdn.bv_val, rdn.bv_val, rdn.bv_len );
+                               ptr1 = lutil_strcopy( ptr1, ival.bv_val );
+                       } else {
+                               int xlen;
+                               if ( !gotindex ) {
+                                       ptr2 = rval.bv_val;
+                                       xlen = rval.bv_len;
+                               } else {
+                                       xlen = rdn.bv_len - (ptr2 - rdn.bv_val);
+                               }
+                               ptr1 = lutil_strncopy( newrdn.bv_val, rtype.bv_val,
+                                       rtype.bv_len );
+                               *ptr1++ = '=';
+                               ptr1 = lutil_strcopy( ptr1, ival.bv_val );
+                               ptr1 = lutil_strncopy( ptr1, ptr2, xlen );
+                               *ptr1 = '\0';
+                       }
+
+                       /* Do the equivalent of ModRDN */
+                       /* Replace DN / NDN */
+                       newrdn.bv_len = ptr1 - newrdn.bv_val;
+                       rdnNormalize( 0, NULL, NULL, &newrdn, &nnewrdn, NULL );
+                       free( e->e_name.bv_val );
+                       build_new_dn( &e->e_name, &parent->ce_entry->e_name,
+                               &newrdn, NULL );
+                       free( e->e_nname.bv_val );
+                       build_new_dn( &e->e_nname, &parent->ce_entry->e_nname,
+                               &nnewrdn, NULL );
+
+                       /* Replace attr */
+                       free( a->a_vals[0].bv_val );
+                       ptr1 = strchr( newrdn.bv_val, '=' ) + 1;
+                       a->a_vals[0].bv_len = newrdn.bv_len - (ptr1 - newrdn.bv_val);
+                       a->a_vals[0].bv_val = ch_malloc( a->a_vals[0].bv_len + 1 );
+                       strcpy( a->a_vals[0].bv_val, ptr1 );
+
+                       if ( a->a_nvals != a->a_vals ) {
+                               free( a->a_nvals[0].bv_val );
+                               ptr1 = strchr( nnewrdn.bv_val, '=' ) + 1;
+                               a->a_nvals[0].bv_len = nnewrdn.bv_len - (ptr1 - nnewrdn.bv_val);
+                               a->a_nvals[0].bv_val = ch_malloc( a->a_nvals[0].bv_len + 1 );
+                               strcpy( a->a_nvals[0].bv_val, ptr1 );
+                       }
+                       free( nnewrdn.bv_val );
+                       free( newrdn.bv_val );
+               }
+       }
+       if ( renum ) *renum = renumber;
+       return 0;
+}
+
+static CfOcInfo **
+count_ocs( Attribute *oc_at, int *nocs )
+{
+       int i, j, n;
+       CfOcInfo co, *coptr, **colst;
+
+       /* count the objectclasses */
+       for ( i=0; oc_at->a_nvals[i].bv_val; i++ );
+       n = i;
+       colst = (CfOcInfo **)ch_malloc( n * sizeof(CfOcInfo *));
+
+       for ( i=0, j=0; i<n; i++) {
+               co.co_name = &oc_at->a_nvals[i];
+               coptr = avl_find( CfOcTree, &co, CfOcInfo_cmp );
+               
+               /* ignore non-config objectclasses. probably should be
+                * an error, general data doesn't belong here.
+                */
+               if ( !coptr ) continue;
+
+               /* Ignore the root objectclass, it has no implementation.
+                */
+               if ( coptr->co_type == Cft_Abstract ) continue;
+               colst[j++] = coptr;
+       }
+       *nocs = j;
+       return colst;
+}
+
+/* Parse an LDAP entry into config directives */
+static int
+config_add_internal( CfBackInfo *cfb, Entry *e, SlapReply *rs, int *renum )
+{
+       CfEntryInfo *ce, *last;
+       CfOcInfo **colst;
+       Attribute *a, *oc_at, *type_attr;
+       AttributeDescription *type_ad = NULL;
+       int i, j, nocs, rc;
+       ConfigArgs ca = {0};
+       struct berval pdn;
+       ConfigTable *ct, *type_ct = NULL;
+       char *ptr;
+
+       /* Make sure parent exists and entry does not */
+       ce = config_find_base( cfb->cb_root, &e->e_nname, &last );
+       if ( ce )
+               return LDAP_ALREADY_EXISTS;
+
+       dnParent( &e->e_nname, &pdn );
+
+       /* If last is NULL, the new entry is the root/suffix entry, 
+        * otherwise last should be the parent.
+        */
+       if ( last && !dn_match( &last->ce_entry->e_nname, &pdn )) {
+               if ( rs )
+                       rs->sr_matched = last->ce_entry->e_name.bv_val;
+               return LDAP_NO_SUCH_OBJECT;
+       }
+
+       oc_at = attr_find( e->e_attrs, slap_schema.si_ad_objectClass );
+       if ( !oc_at ) return LDAP_OBJECT_CLASS_VIOLATION;
+
+       colst = count_ocs( oc_at, &nocs );
+
+       /* Only the root can be Cft_Global, everything else must
+        * have a parent. Only limited nesting arrangements are allowed.
+        */
+       switch( colst[0]->co_type ) {
+       case Cft_Global:
+               if ( last )  {
+                       rc = LDAP_CONSTRAINT_VIOLATION;
+                       goto leave;
+               }
+               break;
+       case Cft_Schema:
+       case Cft_Backend:
+       case Cft_Database:
+       case Cft_Include:
+               if ( !last || ( last->ce_type != Cft_Global &&
+                       last->ce_type != colst[0]->co_type )) {
+                       rc = LDAP_CONSTRAINT_VIOLATION;
+                       goto leave;
+               }
+               break;
+       case Cft_Overlay:
+               if ( !last || ( last->ce_type != Cft_Global &&
+                       last->ce_type != Cft_Database &&
+                       last->ce_type != colst[0]->co_type )) {
+                       rc = LDAP_CONSTRAINT_VIOLATION;
+                       goto leave;
+               }
+               break;
+#ifdef SLAPD_MODULES
+       case Cft_Module:
+               if ( !last || last->ce_type != Cft_Global ) {
+                       rc = LDAP_CONSTRAINT_VIOLATION;
+                       goto leave;
+               }
+#endif
+               break;
+       }
+
+       sort_attrs( e, colst, nocs );
+
+       /* Parse all the values and check for simple syntax errors before
+        * performing any set actions.
+        */
+       switch (colst[0]->co_type) {
+       case Cft_Schema:
+               /* The cn=schema entry is all hardcoded, so never reparse it */
+               if (last->ce_type == Cft_Global )
+                       goto ok;
+               /* FALLTHRU */
+               ca.private = ch_calloc( 1, sizeof(ConfigFile) );
+               cfn = ca.private;
+       case Cft_Global:
+               ca.be = LDAP_STAILQ_FIRST(&backendDB);
+               break;
+
+       case Cft_Backend:
+               if ( last->ce_type == Cft_Backend )
+                       ca.bi = last->ce_bi;
+               else
+                       type_ad = cfAd_backend;
+               break;
+       case Cft_Database:
+               if ( last->ce_type == Cft_Database ) {
+                       ca.be = last->ce_be;
+               } else {
+                       type_ad = cfAd_database;
+                       /* dummy, just to get past check_attr */
+                       ca.be = frontendDB;
+               }
+               break;
+
+       case Cft_Overlay:
+               ca.be = last->ce_be;
+               type_ad = cfAd_overlay;
+               break;
+
+       case Cft_Include:
+               if ( !rs ) {
+                       nocs = 0; /* ignored */
+                       break;
+               }
+               if ( last->ce_type == Cft_Global )
+                       cfn = &cf_prv;
+               else
+                       cfn = last->ce_private;
+               type_ad = cfAd_include;
+               break;
+#ifdef SLAPD_MODULES
+       case Cft_Module: {
+#if 0
+               ModPaths *mp;
+               char *ptr;
+               ptr = strchr( e->e_name.bv_val, '{' );
+               if ( !ptr ) {
+                       rc = LDAP_NAMING_VIOLATION;
+                       goto leave;
+               }
+               j = atoi(ptr+1);
+               for (i=0, mp=&modpaths; mp && i<j; mp=mp->mp_next);
+               /* There is no corresponding modpath for this load? */
+               if ( i != j ) {
+                       rc = LDAP_NAMING_VIOLATION;
+                       goto leave;
+               }
+               module_path( mp->mp_path.bv_val );
+               ca.private = mp;
+#endif
+               }
+               break;
+#endif
+       }
+
+       /* If doing an LDAPadd, check for indexed names and any necessary
+        * renaming/renumbering. Entries that don't need indexed names are
+        * ignored. Entries that need an indexed name and arrive without one
+        * are assigned to the end. Entries that arrive with an index may
+        * cause the following entries to be renumbered/bumped down.
+        *
+        * Note that "pseudo-indexed" entries (cn=Include{xx}, cn=Module{xx})
+        * don't allow Adding an entry with an index that's already in use.
+        * This is flagged as an error (LDAP_ALREADY_EXISTS) up above.
+        *
+        * These entries can have auto-assigned indexes (appended to the end)
+        * but only the other types support auto-renumbering of siblings.
+        */
+       rc = check_name_index( last, colst[0]->co_type, e, rs, renum );
+       if ( rc )
+               goto leave;
+
+       init_config_argv( &ca );
+       if ( type_ad ) {
+               type_attr = attr_find( e->e_attrs, type_ad );
+               if ( !type_attr ) {
+                       rc = LDAP_OBJECT_CLASS_VIOLATION;
+                       goto leave;
+               }
+               type_ct = config_find_table( colst, nocs, type_ad );
+               if ( !type_ct ) {
+                       rc = LDAP_OBJECT_CLASS_VIOLATION;
+                       goto leave;
+               }
+               rc = check_vals( type_ct, &ca, type_attr, 1);
+               if ( rc ) goto leave;
+       }
+       for ( a=e->e_attrs; a; a=a->a_next ) {
+               if ( a == type_attr || a == oc_at ) continue;
+               ct = config_find_table( colst, nocs, a->a_desc );
+               if ( !ct ) continue;    /* user data? */
+               rc = check_vals( ct, &ca, a, 1 );
+               if ( rc ) goto leave;
+       }
+
+       /* Basic syntax checks are OK. Do the actual settings. */
+       if ( type_ct ) {
+               ca.line = type_attr->a_vals[0].bv_val;
+               if ( type_ad->ad_type->sat_flags & SLAP_AT_ORDERED ) {
+                       ptr = strchr( ca.line, '}' );
+                       if ( ptr ) ca.line = ptr+1;
+               }
+               ca.valx = 0;
+               rc = config_parse_add( type_ct, &ca );
+               if ( rc ) {
+                       rc = LDAP_OTHER;
+                       goto leave;
+               }
+       }
+       for ( a=e->e_attrs; a; a=a->a_next ) {
+               if ( a == type_attr || a == oc_at ) continue;
+               ct = config_find_table( colst, nocs, a->a_desc );
+               if ( !ct ) continue;    /* user data? */
+               for (i=0; a->a_vals[i].bv_val; i++) {
+                       ca.line = a->a_vals[i].bv_val;
+                       if ( a->a_desc->ad_type->sat_flags & SLAP_AT_ORDERED ) {
+                               ptr = strchr( ca.line, '}' );
+                               if ( ptr ) ca.line = ptr+1;
+                       }
+                       ca.valx = i;
+                       rc = config_parse_add( ct, &ca );
+                       if ( rc ) {
+                               rc = LDAP_OTHER;
+                               goto leave;
+                       }
+               }
+       }
+ok:
+       ce = ch_calloc( 1, sizeof(CfEntryInfo) );
+       ce->ce_parent = last;
+       ce->ce_entry = entry_dup( e );
+       ce->ce_entry->e_private = ce;
+       ce->ce_type = colst[0]->co_type;
+       ce->ce_be = ca.be;
+       ce->ce_bi = ca.bi;
+       ce->ce_private = ca.private;
+       if ( !last ) {
+               cfb->cb_root = ce;
+       } else if ( last->ce_kids ) {
+               CfEntryInfo *c2;
+
+               for (c2=last->ce_kids; c2 && c2->ce_sibs; c2 = c2->ce_sibs);
+
+               c2->ce_sibs = ce;
+       } else {
+               last->ce_kids = ce;
+       }
+
+leave:
+       ch_free( ca.argv );
+       if ( colst ) ch_free( colst );
+       return rc;
+}
+
+/* Parse an LDAP entry into config directives, then store in underlying
+ * database.
+ */
+static int
+config_back_add( Operation *op, SlapReply *rs )
+{
+       CfBackInfo *cfb;
+       CfEntryInfo *ce, *last;
+       int renumber;
+
+       if ( !be_isroot( op ) ) {
+               rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
+               goto out;
+       }
+
+       cfb = (CfBackInfo *)op->o_bd->be_private;
+
+       ldap_pvt_thread_pool_pause( &connection_pool );
+
+       /* Strategy:
+        * 1) check for existence of entry
+        * 2) check for sibling renumbering
+        * 3) perform internal add
+        * 4) store entry in underlying database
+        * 5) perform any necessary renumbering
+        */
+       rs->sr_err = config_add_internal( cfb, op->ora_e, rs, &renumber );
+       if ( rs->sr_err == LDAP_SUCCESS && cfb->cb_use_ldif ) {
+               BackendDB *be = op->o_bd;
+               slap_callback sc = { NULL, slap_null_cb, NULL, NULL };
+               op->o_bd = &cfb->cb_db;
+               sc.sc_next = op->o_callback;
+               op->o_callback = &sc;
+               op->o_bd->be_add( op, rs );
+               op->o_bd = be;
+               op->o_callback = sc.sc_next;
+       }
+       if ( renumber ) {
+       }
+
+       ldap_pvt_thread_pool_resume( &connection_pool );
+
+out:
+       send_ldap_result( op, rs );
+       return rs->sr_err;
+}
+
+typedef struct delrec {
+       struct delrec *next;
+       int nidx;
+       int idx[0];
+} delrec;
+
+static int
+config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
+       ConfigArgs *ca )
+{
+       CfBackInfo *cfb = (CfBackInfo *)op->o_bd->be_private;
+       int rc = LDAP_UNWILLING_TO_PERFORM;
+       Modifications *ml;
+       Entry *e = ce->ce_entry;
+       Attribute *save_attrs = e->e_attrs, *oc_at;
+       ConfigTable *ct;
+       CfOcInfo **colst;
+       int i, nocs;
+       char *ptr;
+       delrec *dels = NULL, *deltail = NULL;
+
+       oc_at = attr_find( e->e_attrs, slap_schema.si_ad_objectClass );
+       if ( !oc_at ) return LDAP_OBJECT_CLASS_VIOLATION;
+
+       colst = count_ocs( oc_at, &nocs );
+
+       e->e_attrs = attrs_dup( e->e_attrs );
+
+       init_config_argv( ca );
+       ca->be = ce->ce_be;
+       ca->bi = ce->ce_bi;
+       ca->private = ce->ce_private;
+       strcpy( ca->log, "back-config" );
+
+       for (ml = op->orm_modlist; ml; ml=ml->sml_next) {
+               ct = config_find_table( colst, nocs, ml->sml_desc );
+               switch (ml->sml_op) {
+               case LDAP_MOD_DELETE:
+               case LDAP_MOD_REPLACE: {
+                       BerVarray vals = NULL, nvals;
+                       int *idx = NULL;
+                       if ( ct && ( ct->arg_type & ARG_NO_DELETE )) {
+                               rc = LDAP_OTHER;
+                               snprintf( ca->msg, sizeof(ca->msg),
+                                       "<%s> cannot be deleted" );
+                               snprintf(ca->msg, sizeof(ca->msg), "cannot delete %s",
+                                       ml->sml_desc->ad_cname.bv_val );
+                               goto out;
+                       }
+                       if ( ml->sml_op == LDAP_MOD_REPLACE ) {
+                               vals = ml->sml_values;
+                               nvals = ml->sml_nvalues;
+                               ml->sml_values = NULL;
+                               ml->sml_nvalues = NULL;
+                       }
+                       /* If we're deleting by values, remember the indexes of the
+                        * values we deleted.
+                        */
+                       if ( ct && ml->sml_values ) {
+                               delrec *d;
+                               for (i=0; ml->sml_values[i].bv_val; i++);
+                               d = ch_malloc( sizeof(delrec) + i * sizeof(int));
+                               d->nidx = i;
+                               d->next = NULL;
+                               if ( dels ) {
+                                       deltail->next = d;
+                               } else {
+                                       dels = d;
+                               }
+                               deltail = d;
+                               idx = d->idx;
+                       }
+                       rc = modify_delete_vindex(e, &ml->sml_mod,
+                               get_permissiveModify(op),
+                               &rs->sr_text, ca->msg, sizeof(ca->msg), idx );
+                       if ( ml->sml_op == LDAP_MOD_REPLACE ) {
+                               ml->sml_values = vals;
+                               ml->sml_nvalues = nvals;
+                       }
+                       if ( !vals )
+                               break;
+                       }
+                       /* FALLTHRU: LDAP_MOD_REPLACE && vals */
+
+               case LDAP_MOD_ADD:
+               case SLAP_MOD_SOFTADD: {
+                       int mop = ml->sml_op;
+                       int navals = -1;
+                       ml->sml_op = LDAP_MOD_ADD;
+                       if ( ct ) {
+                               if ( ct->arg_type & ARG_NO_INSERT ) {
+                                       Attribute *a = attr_find( e->e_attrs, ml->sml_desc );
+                                       if ( a ) {
+                                               for (i = 0; a->a_vals[i].bv_val; i++ );
+                                               navals = i;
+                                       }
+                               }
+                               for ( i=0; !BER_BVISNULL( &ml->sml_values[i] ); i++ ) {
+                                       if ( ml->sml_values[i].bv_val[0] == '{' &&
+                                               navals >= 0 ) {
+                                               int j = strtol( ml->sml_values[i].bv_val+1, NULL, 0 );
+                                               if ( j < navals ) {
+                                                       rc = LDAP_OTHER;
+                                                       snprintf(ca->msg, sizeof(ca->msg), "cannot insert %s",
+                                                               ml->sml_desc->ad_cname.bv_val );
+                                                       goto out;
+                                               }
+                                       }
+                                       rc = check_vals( ct, ca, ml, 0 );
+                                       if ( rc ) goto out;
+                               }
+                       }
+                       rc = modify_add_values(e, &ml->sml_mod,
+                                  get_permissiveModify(op),
+                                  &rs->sr_text, ca->msg, sizeof(ca->msg) );
+
+                       /* If value already exists, show success here
+                        * and ignore this operation down below.
+                        */
+                       if ( mop == SLAP_MOD_SOFTADD ) {
+                               if ( rc == LDAP_TYPE_OR_VALUE_EXISTS )
+                                       rc = LDAP_SUCCESS;
+                               else
+                                       mop = LDAP_MOD_ADD;
+                       }
+                       ml->sml_op = mop;
+                       break;
+                       }
+
+                       break;
+               case LDAP_MOD_INCREMENT:        /* FIXME */
+                       break;
+               default:
+                       break;
+               }
+               if(rc != LDAP_SUCCESS) break;
+       }
+       
+       if(rc == LDAP_SUCCESS) {
+               /* check that the entry still obeys the schema */
+               rc = entry_schema_check(op->o_bd, e, NULL,
+                                 &rs->sr_text, ca->msg, sizeof(ca->msg) );
+       }
+       if ( rc == LDAP_SUCCESS ) {
+               /* Basic syntax checks are OK. Do the actual settings. */
+               for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
+                       ct = config_find_table( colst, nocs, ml->sml_desc );
+                       if ( !ct ) continue;
+
+                       switch (ml->sml_op) {
+                       case LDAP_MOD_DELETE:
+                       case LDAP_MOD_REPLACE: {
+                               BerVarray vals = NULL, nvals;
+                               Attribute *a;
+                               delrec *d;
+
+                               a = attr_find( e->e_attrs, ml->sml_desc );
+
+                               if ( ml->sml_op == LDAP_MOD_REPLACE ) {
+                                       vals = ml->sml_values;
+                                       nvals = ml->sml_nvalues;
+                                       ml->sml_values = NULL;
+                                       ml->sml_nvalues = NULL;
+                               }
+
+                               if ( ml->sml_values )
+                                       d = dels;
+
+                               /* If we didn't delete the whole attribute */
+                               if ( ml->sml_values && a ) {
+                                       struct berval *mvals;
+                                       int j;
+
+                                       if ( ml->sml_nvalues )
+                                               mvals = ml->sml_nvalues;
+                                       else
+                                               mvals = ml->sml_values;
+
+                                       /* use the indexes we saved up above */
+                                       for (i=0; i < d->nidx; i++) {
+                                               struct berval bv = *mvals++;
+                                               if ( a->a_desc->ad_type->sat_flags & SLAP_AT_ORDERED &&
+                                                       bv.bv_val[0] == '{' ) {
+                                                       ptr = strchr( bv.bv_val, '}' ) + 1;
+                                                       bv.bv_len -= ptr - bv.bv_val;
+                                                       bv.bv_val = ptr;
+                                               }
+                                               ca->line = bv.bv_val;
+                                               ca->valx = d->idx[i];
+                                               rc = config_del_vals( ct, ca );
+                                               if ( rc != LDAP_SUCCESS ) break;
+                                               for (j=i+1; j < d->nidx; j++)
+                                                       if ( d->idx[j] >d->idx[i] )
+                                                               d->idx[j]--;
+                                       }
+                               } else {
+                                       ca->valx = -1;
+                                       ca->line = NULL;
+                                       rc = config_del_vals( ct, ca );
+                                       if ( rc ) rc = LDAP_OTHER;
+                               }
+                               if ( ml->sml_values ) {
+                                       ch_free( dels );
+                                       dels = d->next;
+                               }
+                               if ( ml->sml_op == LDAP_MOD_REPLACE ) {
+                                       ml->sml_values = vals;
+                                       ml->sml_nvalues = nvals;
+                               }
+                               if ( !vals || rc != LDAP_SUCCESS )
+                                       break;
+                               }
+                               /* FALLTHRU: LDAP_MOD_REPLACE && vals */
+
+                       case LDAP_MOD_ADD:
+                               for (i=0; ml->sml_values[i].bv_val; i++) {
+                                       ca->line = ml->sml_values[i].bv_val;
+                                       ca->valx = -1;
+                                       if ( ml->sml_desc->ad_type->sat_flags & SLAP_AT_ORDERED &&
+                                               ca->line[0] == '{' ) {
+                                               ptr = strchr( ca->line, '}' );
+                                               if ( ptr ) {
+                                                       ca->valx = strtol( ca->line+1, NULL, 0 );
+                                                       ca->line = ptr+1;
+                                               }
+                                       }
+                                       rc = config_parse_add( ct, ca );
+                                       if ( rc ) {
+                                               rc = LDAP_OTHER;
+                                               goto out;
+                                       }
+                               }
+
+                               break;
+                       }
+               }
+       }
+
+out:
+       if ( ca->cleanup )
+               ca->cleanup( ca );
+       if ( rc == LDAP_SUCCESS ) {
+               attrs_free( save_attrs );
+       } else {
+               attrs_free( e->e_attrs );
+               e->e_attrs = save_attrs;
+       }
+       ch_free( ca->argv );
+       if ( colst ) ch_free( colst );
+
+       return rc;
+}
+
 static int
 config_back_modify( Operation *op, SlapReply *rs )
 {
        CfBackInfo *cfb;
        CfEntryInfo *ce, *last;
+       Modifications *ml;
+       ConfigArgs ca = {0};
+       struct berval rdn;
+       char *ptr;
+       AttributeDescription *rad = NULL;
 
        if ( !be_isroot( op ) ) {
                rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
-               send_ldap_result( op, rs );
+               goto out;
        }
 
        cfb = (CfBackInfo *)op->o_bd->be_private;
@@ -2765,6 +3392,23 @@ config_back_modify( Operation *op, SlapReply *rs )
                rs->sr_err = LDAP_NO_SUCH_OBJECT;
                goto out;
        }
+
+       /* Get type of RDN */
+       rdn = ce->ce_entry->e_nname;
+       ptr = strchr( rdn.bv_val, '=' );
+       rdn.bv_len = ptr - rdn.bv_val;
+       slap_bv2ad( &rdn, &rad, &rs->sr_text );
+
+       /* Some basic validation... */
+       for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
+               /* Don't allow Modify of RDN; must use ModRdn for that. */
+               if ( ml->sml_desc == rad ) {
+                       rs->sr_err = LDAP_NOT_ALLOWED_ON_RDN;
+                       rs->sr_text = "Use modrdn to change the entry name";
+                       goto out;
+               }
+       }
+
        ldap_pvt_thread_pool_pause( &connection_pool );
 
        /* Strategy:
@@ -2773,6 +3417,56 @@ config_back_modify( Operation *op, SlapReply *rs )
         * 3) perform the individual config operations.
         * 4) store Modified entry in underlying LDIF backend.
         */
+       rs->sr_err = config_modify_internal( ce, op, rs, &ca );
+       if ( rs->sr_err ) {
+               rs->sr_text = ca.msg;
+       } else if ( cfb->cb_use_ldif ) {
+               BackendDB *be = op->o_bd;
+               slap_callback sc = { NULL, slap_null_cb, NULL, NULL };
+               op->o_bd = &cfb->cb_db;
+               sc.sc_next = op->o_callback;
+               op->o_callback = &sc;
+               op->o_bd->be_modify( op, rs );
+               op->o_bd = be;
+               op->o_callback = sc.sc_next;
+       }
+
+       ldap_pvt_thread_pool_resume( &connection_pool );
+out:
+       send_ldap_result( op, rs );
+       return rs->sr_err;
+}
+
+static int
+config_back_modrdn( Operation *op, SlapReply *rs )
+{
+       CfBackInfo *cfb;
+       CfEntryInfo *ce, *last;
+
+       if ( !be_isroot( op ) ) {
+               rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
+               goto out;
+       }
+
+       cfb = (CfBackInfo *)op->o_bd->be_private;
+
+       ce = config_find_base( cfb->cb_root, &op->o_req_ndn, &last );
+       if ( !ce ) {
+               if ( last )
+                       rs->sr_matched = last->ce_entry->e_name.bv_val;
+               rs->sr_err = LDAP_NO_SUCH_OBJECT;
+               goto out;
+       }
+
+       /* We don't allow moving objects to new parents.
+        * Generally we only allow reordering a set of ordered entries.
+        */
+       if ( op->orr_newSup ) {
+               rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+               goto out;
+       }
+       ldap_pvt_thread_pool_pause( &connection_pool );
+
        ldap_pvt_thread_pool_resume( &connection_pool );
 out:
        send_ldap_result( op, rs );
@@ -2788,7 +3482,7 @@ config_back_search( Operation *op, SlapReply *rs )
 
        if ( !be_isroot( op ) ) {
                rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
-               send_ldap_result( op, rs );
+               goto out;
        }
 
        cfb = (CfBackInfo *)op->o_bd->be_private;
@@ -2820,13 +3514,22 @@ out:
 }
 
 static Entry *
-config_alloc_entry( struct berval *pdn, struct berval *rdn )
+config_alloc_entry( CfEntryInfo *parent, struct berval *rdn )
 {
        Entry *e = ch_calloc( 1, sizeof(Entry) );
        CfEntryInfo *ce = ch_calloc( 1, sizeof(CfEntryInfo) );
+       struct berval pdn;
+
        e->e_private = ce;
        ce->ce_entry = e;
-       build_new_dn( &e->e_name, pdn, rdn, NULL );
+       ce->ce_parent = parent;
+       if ( parent ) {
+               pdn = parent->ce_entry->e_nname;
+       } else {
+               BER_BVZERO( &pdn );
+       }
+
+       build_new_dn( &e->e_name, &pdn, rdn, NULL );
        ber_dupbv( &e->e_nname, &e->e_name );
        return e;
 }
@@ -2839,19 +3542,17 @@ static int
 config_build_entry( ConfigArgs *c, Entry *e, ObjectClass *oc,
         struct berval *rdn, ConfigTable *ct, int table )
 {
-       struct berval vals[2];
+       struct berval val;
        struct berval ad_name;
        AttributeDescription *ad = NULL;
        int rc, i;
        char *ptr;
        const char *text;
        AttributeType **at;
+       Attribute *oc_at;
 
-       BER_BVZERO( &vals[1] );
-
-       vals[0] = oc->soc_cname;
-       attr_merge(e, slap_schema.si_ad_objectClass, vals, NULL );
-       attr_merge(e, slap_schema.si_ad_structuralObjectClass, vals, NULL );
+       val = oc->soc_cname;
+       attr_merge_normalize_one(e, slap_schema.si_ad_objectClass, &val, NULL );
        ptr = strchr(rdn->bv_val, '=');
        ad_name.bv_val = rdn->bv_val;
        ad_name.bv_len = ptr - rdn->bv_val;
@@ -2859,9 +3560,9 @@ config_build_entry( ConfigArgs *c, Entry *e, ObjectClass *oc,
        if ( rc ) {
                return rc;
        }
-       vals[0].bv_val = ptr+1;
-       vals[0].bv_len = rdn->bv_len - (vals[0].bv_val - rdn->bv_val);
-       attr_merge(e, ad, vals, NULL );
+       val.bv_val = ptr+1;
+       val.bv_len = rdn->bv_len - (val.bv_val - rdn->bv_val);
+       attr_merge_normalize_one(e, ad, &val, NULL );
 
        for (at=oc->soc_required; at && *at; at++) {
                /* Skip the naming attr */
@@ -2871,7 +3572,12 @@ config_build_entry( ConfigArgs *c, Entry *e, ObjectClass *oc,
                        if (ct[i].ad == (*at)->sat_ad) {
                                rc = config_get_vals(&ct[i], c);
                                if (rc == LDAP_SUCCESS) {
-                                       attr_merge(e, ct[i].ad, c->rvalue_vals, c->rvalue_nvals);
+                                       if ( c->rvalue_nvals )
+                                               attr_merge(e, ct[i].ad, c->rvalue_vals,
+                                                       c->rvalue_nvals);
+                                       else
+                                               attr_merge_normalize(e, ct[i].ad,
+                                                       c->rvalue_vals, NULL);
                                        ber_bvarray_free( c->rvalue_nvals );
                                        ber_bvarray_free( c->rvalue_vals );
                                }
@@ -2888,7 +3594,10 @@ config_build_entry( ConfigArgs *c, Entry *e, ObjectClass *oc,
                        if (ct[i].ad == (*at)->sat_ad) {
                                rc = config_get_vals(&ct[i], c);
                                if (rc == LDAP_SUCCESS) {
-                                       attr_merge(e, ct[i].ad, c->rvalue_vals, c->rvalue_nvals);
+                                       if ( c->rvalue_nvals )
+                                               attr_merge(e, ct[i].ad, c->rvalue_vals, c->rvalue_nvals);
+                                       else
+                                               attr_merge_normalize(e, ct[i].ad, c->rvalue_vals, NULL);
                                        ber_bvarray_free( c->rvalue_nvals );
                                        ber_bvarray_free( c->rvalue_vals );
                                }
@@ -2906,36 +3615,107 @@ config_build_entry( ConfigArgs *c, Entry *e, ObjectClass *oc,
                        if (!ct->ad) continue;
                        rc = config_get_vals(ct, c);
                        if (rc == LDAP_SUCCESS) {
-                               attr_merge(e, ct->ad, c->rvalue_vals, c->rvalue_nvals);
+                               if ( c->rvalue_nvals )
+                                       attr_merge(e, ct->ad, c->rvalue_vals, c->rvalue_nvals);
+                               else
+                                       attr_merge_normalize(e, ct->ad, c->rvalue_vals, NULL);
                        }
                }
        }
+       oc_at = attr_find( e->e_attrs, slap_schema.si_ad_objectClass );
+       rc = structural_class(oc_at->a_vals, &val, NULL, &text, c->msg,
+               sizeof(c->msg));
+       attr_merge_normalize_one(e, slap_schema.si_ad_structuralObjectClass, &val, NULL );
 
        return 0;
 }
 
+static void
+config_build_schema_inc( ConfigArgs *c, CfEntryInfo *ceparent,
+       Operation *op, SlapReply *rs )
+{
+       Entry *e;
+       ConfigFile *cf = c->private;
+       CfEntryInfo *ce, *ceprev;
+       char *ptr;
+       struct berval bv;
+
+       if ( ceparent->ce_kids ) {
+               for ( ceprev = ceparent->ce_kids; ceprev->ce_sibs;
+                       ceprev = ceprev->ce_sibs );
+       }
+
+       for (; cf; cf=cf->c_sibs, c->depth++) {
+               c->value_dn.bv_val = c->log;
+               bv.bv_val = strrchr(cf->c_file.bv_val, LDAP_DIRSEP[0]);
+               if ( !bv.bv_val ) {
+                       bv = cf->c_file;
+               } else {
+                       bv.bv_val++;
+                       bv.bv_len = cf->c_file.bv_len - (bv.bv_val - cf->c_file.bv_val);
+               }
+               ptr = strchr( bv.bv_val, '.' );
+               if ( ptr )
+                       bv.bv_len = ptr - bv.bv_val;
+               c->value_dn.bv_len = sprintf(c->value_dn.bv_val, "cn=" IFMT, c->depth);
+               strncpy( c->value_dn.bv_val + c->value_dn.bv_len, bv.bv_val,
+                       bv.bv_len );
+               c->value_dn.bv_len += bv.bv_len;
+               c->value_dn.bv_val[c->value_dn.bv_len] ='\0';
+
+               e = config_alloc_entry( ceparent, &c->value_dn );
+               c->private = cf;
+               config_build_entry( c, e, cfOc_schema, &c->value_dn,
+                       c->bi->bi_cf_table, NO_TABLE );
+               ce = e->e_private;
+               ce->ce_private = cf;
+               ce->ce_type = Cft_Schema;
+               if ( op ) {
+                       op->ora_e = e;
+                       op->o_bd->be_add( op, rs );
+               }
+               ce->ce_bi = c->bi;
+               if ( !ceparent->ce_kids ) {
+                       ceparent->ce_kids = ce;
+               } else {
+                       ceprev->ce_sibs = ce;
+               }
+               ceprev = ce;
+               if ( cf->c_kids ) {
+                       c->private = cf->c_kids;
+                       config_build_schema_inc( c, ceparent, op, rs );
+               }
+       }
+}
+
 static CfEntryInfo *
-config_build_includes( ConfigArgs *c, Entry *parent,
+config_build_includes( ConfigArgs *c, CfEntryInfo *ceparent,
        Operation *op, SlapReply *rs )
 {
        Entry *e;
        int i;
-       ConfigFile *cf = (ConfigFile *)c->line;
-       CfEntryInfo *ce, *ceparent, *ceprev;
+       ConfigFile *cf = c->private;
+       CfEntryInfo *ce, *ceprev;
 
-       ceparent = parent->e_private;
+       if ( ceparent->ce_kids ) {
+               for ( ceprev = ceparent->ce_kids; ceprev->ce_sibs;
+                       ceprev = ceprev->ce_sibs );
+       }
 
        for (i=0; cf; cf=cf->c_sibs, i++) {
                c->value_dn.bv_val = c->log;
-               c->value_dn.bv_len = sprintf(c->value_dn.bv_val, "cn=include{%d}", i);
-               e = config_alloc_entry( &parent->e_nname, &c->value_dn );
-               c->line = (char *)cf;
+               c->value_dn.bv_len = sprintf(c->value_dn.bv_val, "cn=include" IFMT, i);
+               e = config_alloc_entry( ceparent, &c->value_dn );
+               c->private = cf;
                config_build_entry( c, e, cfOc_include, &c->value_dn,
                        c->bi->bi_cf_table, NO_TABLE );
-               op->ora_e = e;
-               op->o_bd->be_add( op, rs );
+               if ( op ) {
+                       op->ora_e = e;
+                       op->o_bd->be_add( op, rs );
+               }
                ce = e->e_private;
-               ce->ce_type = Cf_Include;
+               ce->ce_private = cf;
+               ce->ce_type = Cft_Include;
                ce->ce_bi = c->bi;
                if ( !ceparent->ce_kids ) {
                        ceparent->ce_kids = ce;
@@ -2944,13 +3724,57 @@ config_build_includes( ConfigArgs *c, Entry *parent,
                }
                ceprev = ce;
                if ( cf->c_kids ) {
-                       c->line = (char *)cf->c_kids;
-                       config_build_includes( c, e, op, rs );
+                       c->private = cf->c_kids;
+                       config_build_includes( c, ce, op, rs );
                }
        }
        return ce;
 }
 
+#ifdef SLAPD_MODULES
+
+static CfEntryInfo *
+config_build_modules( ConfigArgs *c, CfEntryInfo *ceparent,
+       Operation *op, SlapReply *rs )
+{
+       Entry *e;
+       int i;
+       CfEntryInfo *ce, *ceprev;
+       ModPaths *mp;
+
+       if ( ceparent->ce_kids ) {
+               for ( ceprev = ceparent->ce_kids; ceprev->ce_sibs;
+                       ceprev = ceprev->ce_sibs );
+       }
+
+       for (i=0, mp=&modpaths; mp; mp=mp->mp_next, i++) {
+               if ( BER_BVISNULL( &mp->mp_path ) && !mp->mp_loads )
+                       continue;
+               c->value_dn.bv_val = c->log;
+               c->value_dn.bv_len = sprintf(c->value_dn.bv_val, "cn=module" IFMT, i);
+               e = config_alloc_entry( ceparent, &c->value_dn );
+               ce = e->e_private;
+               ce->ce_type = Cft_Include;
+               c->private = mp;
+               ce->ce_private = mp;
+               config_build_entry( c, e, cfOc_module, &c->value_dn,
+                       c->bi->bi_cf_table, NO_TABLE );
+               if ( op ) {
+                       op->ora_e = e;
+                       op->o_bd->be_add( op, rs );
+               }
+               ce->ce_bi = c->bi;
+               if ( !ceparent->ce_kids ) {
+                       ceparent->ce_kids = ce;
+               } else {
+                       ceprev->ce_sibs = ce;
+               }
+               ceprev = ce;
+       }
+       return ce;
+}
+#endif
+
 static int
 config_back_db_open( BackendDB *be )
 {
@@ -2973,60 +3797,99 @@ config_back_db_open( BackendDB *be )
        if ( cfb->cb_got_ldif )
                return 0;
 
-       op = (Operation *)opbuf;
-       connection_fake_init( &conn, op, cfb );
+       if ( cfb->cb_use_ldif ) {
+               op = (Operation *)opbuf;
+               connection_fake_init( &conn, op, cfb );
 
-       op->o_dn = be->be_rootdn;
-       op->o_ndn = be->be_rootndn;
+               op->o_dn = be->be_rootdn;
+               op->o_ndn = be->be_rootndn;
 
-       op->o_tag = LDAP_REQ_ADD;
-       op->o_callback = &cb;
-       op->o_bd = &cfb->cb_db;
+               op->o_tag = LDAP_REQ_ADD;
+               op->o_callback = &cb;
+               op->o_bd = &cfb->cb_db;
+       } else {
+               op = NULL;
+       }
 
        /* create root of tree */
        rdn = config_rdn;
        e = config_alloc_entry( NULL, &rdn );
        ce = e->e_private;
+       ce->ce_type = Cft_Global;
        cfb->cb_root = ce;
        c.be = be;
        c.bi = be->bd_info;
-       c.line = (char *)cfb->cb_config;
+       c.private = cfb->cb_config;
        ct = c.bi->bi_cf_table;
+       ce->ce_private = c.private;
        config_build_entry( &c, e, cfOc_global, &rdn, ct, NO_TABLE );
-       op->ora_e = e;
-       op->o_bd->be_add( op, &rs );
-       ce->ce_type = Cf_Global;
+       if ( op ) {
+               op->ora_e = e;
+               op->o_bd->be_add( op, &rs );
+       }
        ce->ce_bi = c.bi;
 
        parent = e;
        ceparent = ce;
 
-       /* Create includeFile nodes... */
+       /* Create schema nodes... cn=schema will contain the hardcoded core
+        * schema, read-only. Child objects will contain runtime loaded schema
+        * files.
+        */
+       rdn = schema_rdn;
+       e = config_alloc_entry( ceparent, &rdn );
+       ce = e->e_private;
+       ce->ce_type = Cft_Schema;
+       c.private = NULL;
+       config_build_entry( &c, e, cfOc_schema, &rdn, ct, NO_TABLE );
+       if ( op ) {
+               op->ora_e = e;
+               op->o_bd->be_add( op, &rs );
+       }
+       if ( !ceparent->ce_kids ) {
+               ceparent->ce_kids = ce;
+       } else {
+               ceprev->ce_sibs = ce;
+       }
+       ceprev = ce;
+
+       /* Create includeFile nodes and schema nodes for included schema... */
        if ( cfb->cb_config->c_kids ) {
-               c.line = (char *)cfb->cb_config->c_kids;
-               ceprev = config_build_includes( &c, parent, op, &rs );
+               c.depth = 0;
+               c.private = cfb->cb_config->c_kids;
+               config_build_schema_inc( &c, ce, op, &rs );
+               c.private = cfb->cb_config->c_kids;
+               ceprev = config_build_includes( &c, ceparent, op, &rs );
+       }
+
+#ifdef SLAPD_MODULES
+       /* Create Module nodes... */
+       if ( modpaths.mp_loads ) {
+               ceprev = config_build_modules( &c, ceparent, op, &rs );
        }
+#endif
 
        /* Create backend nodes. Skip if they don't provide a cf_table.
         * There usually aren't any of these.
         */
        
        c.line = 0;
-       bi = backendInfo;
-       for (i=0; i<nBackendInfo; i++, bi++) {
+       LDAP_STAILQ_FOREACH( bi, &backendInfo, bi_next) {
                if (!bi->bi_cf_table) continue;
                if (!bi->bi_private) continue;
 
                rdn.bv_val = c.log;
                rdn.bv_len = sprintf(rdn.bv_val, "%s=%s", cfAd_backend->ad_cname.bv_val, bi->bi_type);
-               e = config_alloc_entry( &parent->e_nname, &rdn );
+               e = config_alloc_entry( ceparent, &rdn );
                ce = e->e_private;
-               ce->ce_type = Cf_Backend;
+               ce->ce_type = Cft_Backend;
                ce->ce_bi = bi;
                c.bi = bi;
                config_build_entry( &c, e, cfOc_backend, &rdn, ct, BI_TABLE );
-               op->ora_e = e;
-               op->o_bd->be_add( op, &rs );
+               if ( op ) {
+                       op->ora_e = e;
+                       op->o_bd->be_add( op, &rs );
+               }
                if ( !ceparent->ce_kids ) {
                        ceparent->ce_kids = ce;
                } else {
@@ -3036,12 +3899,14 @@ config_back_db_open( BackendDB *be )
        }
 
        /* Create database nodes... */
-       for (i=0; i<nBackendDB; i++) {
+       i = -1;
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
                slap_overinfo *oi = NULL;
+               i++;
                if ( i == 0 ) {
                        bptr = frontendDB;
                } else {
-                       bptr = &backendDB[i];
+                       bptr = be;
                }
                if ( overlay_is_over( bptr )) {
                        oi = bptr->bd_info->bi_private;
@@ -3050,18 +3915,20 @@ config_back_db_open( BackendDB *be )
                        bi = bptr->bd_info;
                }
                rdn.bv_val = c.log;
-               rdn.bv_len = sprintf(rdn.bv_val, "%s={%0x}%s", cfAd_database->ad_cname.bv_val,
+               rdn.bv_len = sprintf(rdn.bv_val, "%s=" IFMT "%s", cfAd_database->ad_cname.bv_val,
                        i, bi->bi_type);
-               e = config_alloc_entry( &parent->e_nname, &rdn );
+               e = config_alloc_entry( ceparent, &rdn );
                ce = e->e_private;
                c.be = bptr;
                c.bi = bi;
-               ce->ce_type = Cf_Database;
+               ce->ce_type = Cft_Database;
                ce->ce_be = c.be;
                ce->ce_bi = c.bi;
                config_build_entry( &c, e, cfOc_database, &rdn, ct, BE_TABLE );
-               op->ora_e = e;
-               op->o_bd->be_add( op, &rs );
+               if ( op ) {
+                       op->ora_e = e;
+                       op->o_bd->be_add( op, &rs );
+               }
                if ( !ceparent->ce_kids ) {
                        ceparent->ce_kids = ce;
                } else {
@@ -3077,18 +3944,20 @@ config_back_db_open( BackendDB *be )
 
                        for (j=0,on=oi->oi_list; on; j++,on=on->on_next) {
                                rdn.bv_val = c.log;
-                               rdn.bv_len = sprintf(rdn.bv_val, "%s={%0x}%s",
+                               rdn.bv_len = sprintf(rdn.bv_val, "%s=" IFMT "%s",
                                        cfAd_overlay->ad_cname.bv_val, j, on->on_bi.bi_type );
-                               oe = config_alloc_entry( &e->e_nname, &rdn );
+                               oe = config_alloc_entry( opar, &rdn );
                                ce = oe->e_private;
                                c.be = bptr;
                                c.bi = &on->on_bi;
-                               ce->ce_type = Cf_Overlay;
+                               ce->ce_type = Cft_Overlay;
                                ce->ce_be = c.be;
                                ce->ce_bi = c.bi;
                                config_build_entry( &c, oe, cfOc_overlay, &rdn, ct, BI_TABLE );
-                               op->ora_e = oe;
-                               op->o_bd->be_add( op, &rs );
+                               if ( op ) {
+                                       op->ora_e = oe;
+                                       op->o_bd->be_add( op, &rs );
+                               }
                                if ( !opar->ce_kids ) {
                                        opar->ce_kids = ce;
                                } else {
@@ -3132,19 +4001,22 @@ config_back_db_init( Backend *be )
        return 0;
 }
 
+static int
+config_back_destroy( BackendInfo *bi )
+{
+       ldif_must_b64_encode_release();
+       return 0;
+}
+
 static struct {
        char *name;
        AttributeDescription **desc;
-       AttributeDescription *sub;
 } ads[] = {
-       { "attribute", NULL, NULL },
-       { "backend", &cfAd_backend, NULL },
-       { "database", &cfAd_database, NULL },
-       { "ditcontentrule", NULL, NULL },
-       { "include", &cfAd_include, NULL },
-       { "objectclass", NULL, NULL },
-       { "overlay", &cfAd_overlay, NULL },
-       { NULL, NULL, NULL }
+       { "backend", &cfAd_backend },
+       { "database", &cfAd_database },
+       { "include", &cfAd_include },
+       { "overlay", &cfAd_overlay },
+       { NULL, NULL }
 };
 
 /* Notes:
@@ -3173,14 +4045,22 @@ static struct {
 int
 config_back_initialize( BackendInfo *bi )
 {
-       ConfigTable *ct = config_back_cf_table;
-       char *argv[4];
-       int i;
+       ConfigTable             *ct = config_back_cf_table;
+       char                    *argv[4];
+       int                     i;
+       AttributeDescription    *ad = NULL;
+       const char              *text;
+       static char             *controls[] = {
+               LDAP_CONTROL_MANAGEDSAIT,
+               NULL
+       };
+
+       bi->bi_controls = controls;
 
        bi->bi_open = 0;
        bi->bi_close = 0;
        bi->bi_config = 0;
-       bi->bi_destroy = 0;
+       bi->bi_destroy = config_back_destroy;
 
        bi->bi_db_init = config_back_db_init;
        bi->bi_db_config = 0;
@@ -3193,8 +4073,8 @@ config_back_initialize( BackendInfo *bi )
        bi->bi_op_search = config_back_search;
        bi->bi_op_compare = 0;
        bi->bi_op_modify = config_back_modify;
-       bi->bi_op_modrdn = 0;
-       bi->bi_op_add = 0;
+       bi->bi_op_modrdn = config_back_modrdn;
+       bi->bi_op_add = config_back_add;
        bi->bi_op_delete = 0;
        bi->bi_op_abandon = 0;
 
@@ -3202,6 +4082,10 @@ config_back_initialize( BackendInfo *bi )
 
        bi->bi_chk_referrals = 0;
 
+#ifdef SLAP_OVERLAY_ACCESS
+       bi->bi_access_allowed = slap_access_always_allowed;
+#endif /* SLAP_OVERLAY_ACCESS */
+
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = 0;
 
@@ -3209,7 +4093,7 @@ config_back_initialize( BackendInfo *bi )
        for (i=0; OidMacros[i].name; i++ ) {
                argv[1] = OidMacros[i].name;
                argv[2] = OidMacros[i].oid;
-               parse_oidm( "slapd", i, 3, argv );
+               parse_oidm( "slapd", i, 3, argv, 0, NULL );
        }
 
        bi->bi_cf_table = ct;
@@ -3217,19 +4101,24 @@ config_back_initialize( BackendInfo *bi )
        i = config_register_schema( ct, cf_ocs );
        if ( i ) return i;
 
-       /* set up the notable AttributeDescriptions */
-       ads[0].sub = slap_schema.si_ad_attributeTypes;
-       ads[3].sub = slap_schema.si_ad_ditContentRules;
-       ads[5].sub = slap_schema.si_ad_objectClasses;
+       /* setup olcRootPW to be base64-encoded when written in LDIF form;
+        * basically, we don't care if it fails */
+       i = slap_str2ad( "olcRootPW", &ad, &text );
+       if ( i ) {
+               Debug( LDAP_DEBUG_ANY, "config_back_initialize: "
+                       "warning, unable to get \"olcRootPW\" "
+                       "attribute description: %d: %s\n",
+                       i, text, 0 );
+       } else {
+               (void)ldif_must_b64_encode_register( ad->ad_cname.bv_val,
+                       ad->ad_type->sat_oid );
+       }
 
+       /* set up the notable AttributeDescriptions */
        i = 0;
        for (;ct->name;ct++) {
                if (strcmp(ct->name, ads[i].name)) continue;
-               if (ads[i].sub) {
-                       ct->ad = ads[i].sub;
-               } else {
-                       *ads[i].desc = ct->ad;
-               }
+               *ads[i].desc = ct->ad;
                i++;
                if (!ads[i].name) break;
        }
index e1256de909a789cfc43e9371fe3980cb8a6b1bbe..141229b87483be1d596b9d086aefe51242642bff 100644 (file)
@@ -90,8 +90,7 @@ int cancel_extop( Operation *op, SlapReply *rs )
 
                o->o_cancel = SLAP_CANCEL_REQ;
 
-               for ( i = 0; i < nbackends; i++ ) {
-                       op->o_bd = &backends[i];
+               LDAP_STAILQ_FOREACH( op->o_bd, &backendDB, be_next ) {
                        if( !op->o_bd->be_cancel ) continue;
 
                        op->oq_cancel.rs_msgid = opid;
index cd26d60c20cc05119ff8f5b88b5dee93d651a353..d43af1c0164130907484859a7659e3c39a5e40a7 100644 (file)
@@ -47,7 +47,11 @@ do_compare(
        struct berval dn = BER_BVNULL;
        struct berval desc = BER_BVNULL;
        struct berval value = BER_BVNULL;
+#ifdef LDAP_COMP_MATCH
        AttributeAssertion ava = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion ava = { NULL, BER_BVNULL };
+#endif
 
        ava.aa_desc = NULL;
 
@@ -409,19 +413,22 @@ static int compare_entry(
        Entry *e,
        AttributeAssertion *ava )
 {
-       int rc;
+       int rc = LDAP_COMPARE_FALSE;
        Attribute *a;
 
        if ( ! access_allowed( op, e,
                ava->aa_desc, &ava->aa_value, ACL_COMPARE, NULL ) )
        {       
-               return LDAP_INSUFFICIENT_ACCESS;
+               rc = LDAP_INSUFFICIENT_ACCESS;
+               goto done;
        }
 
        a = attrs_find( e->e_attrs, ava->aa_desc );
-       if( a == NULL ) return LDAP_NO_SUCH_ATTRIBUTE;
+       if( a == NULL ) {
+               rc = LDAP_NO_SUCH_ATTRIBUTE;
+               goto done;
+       }
 
-       rc = LDAP_COMPARE_FALSE;
        for(a = attrs_find( e->e_attrs, ava->aa_desc );
                a != NULL;
                a = attrs_find( a->a_next, ava->aa_desc ))
@@ -436,13 +443,23 @@ static int compare_entry(
                if ( value_find_ex( ava->aa_desc,
                        SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
                                SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
-                       a->a_nvals,
-                       &ava->aa_value, op->o_tmpmemctx ) == 0 )
+                       a->a_nvals, &ava->aa_value, op->o_tmpmemctx ) == 0 )
                {
                        rc = LDAP_COMPARE_TRUE;
                        break;
                }
        }
 
+done:
+#ifdef LDAP_ACL_HONOR_DISCLOSE
+       if( rc != LDAP_COMPARE_TRUE && rc != LDAP_COMPARE_FALSE ) {
+               if ( ! access_allowed( op, e,
+                       slap_schema.si_ad_entry, NULL, ACL_DISCLOSE, NULL ) )
+               {
+                       rc = LDAP_NO_SUCH_OBJECT;
+               }
+       }
+#endif
+
        return rc;
 }
index 747df41959a22ff93d3b5d0f4a7a6733f7208460..b91bf6bb40ef7c23d90b7d4179ade58ddb0f5433 100644 (file)
 #include "slapi/slapi.h"
 #endif
 #include "lutil.h"
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif /* HAVE_LIMITS_H */
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif /* ! PATH_MAX */
 #include "config.h"
 
 #define ARGS_STEP      512
@@ -101,6 +95,13 @@ new_config_args( BackendDB *be, const char *fname, int lineno, int argc, char **
        return(c);
 }
 
+void
+init_config_argv( ConfigArgs *c )
+{
+       c->argv = ch_calloc( ARGS_STEP + 1, sizeof( *c->argv ) );
+       c->argv_size = ARGS_STEP + 1;
+}
+
 ConfigTable *config_find_keyword(ConfigTable *Conf, ConfigArgs *c) {
        int i;
 
@@ -111,51 +112,64 @@ ConfigTable *config_find_keyword(ConfigTable *Conf, ConfigArgs *c) {
        return Conf+i;
 }
 
-int config_add_vals(ConfigTable *Conf, ConfigArgs *c) {
-       int i, rc, arg_user, arg_type, iarg;
+int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) {
+       int rc, arg_user, arg_type, iarg;
        long larg;
        ber_len_t barg;
-       void *ptr;
-
+       
        arg_type = Conf->arg_type;
        if(arg_type == ARG_IGNORED) {
                Debug(LDAP_DEBUG_CONFIG, "%s: keyword <%s> ignored\n",
                        c->log, Conf->name, 0);
                return(0);
        }
+       if((arg_type & ARG_DN) && c->argc == 1) {
+               c->argc = 2;
+               c->argv[1] = "";
+       }
        if(Conf->min_args && (c->argc < Conf->min_args)) {
-               Debug(LDAP_DEBUG_CONFIG, "%s: keyword <%s> missing <%s> argument\n",
-                       c->log, Conf->name, Conf->what);
+               sprintf( c->msg, "<%s> missing <%s> argument",
+                       c->argv[0], Conf->what );
+               Debug(LDAP_DEBUG_CONFIG, "%s: keyword %s\n", c->log, c->msg, 0 );
                return(ARG_BAD_CONF);
        }
        if(Conf->max_args && (c->argc > Conf->max_args)) {
-               Debug(LDAP_DEBUG_CONFIG, "%s: extra cruft after <%s> in <%s> line (ignored)\n",
-                       c->log, Conf->what, Conf->name);
+               sprintf( c->msg, "<%s> extra cruft after <%s> ignored",
+                       c->argv[0], Conf->what );
+               Debug(LDAP_DEBUG_CONFIG, "%s: %s\n", c->log, c->msg, 0 );
        }
        if((arg_type & ARG_DB) && !c->be) {
-               Debug(LDAP_DEBUG_CONFIG, "%s: keyword <%s> allowed only within database declaration\n",
-                       c->log, Conf->name, 0);
+               sprintf( c->msg, "<%s> only allowed within database declaration",
+                       c->argv[0] );
+               Debug(LDAP_DEBUG_CONFIG, "%s: keyword %s\n",
+                       c->log, c->msg, 0);
                return(ARG_BAD_CONF);
        }
        if((arg_type & ARG_PRE_BI) && c->bi) {
-               Debug(LDAP_DEBUG_CONFIG, "%s: keyword <%s> must appear before any backend %sdeclaration\n",
-                       c->log, Conf->name, ((arg_type & ARG_PRE_DB)
-                       ? "or database " : "") );
+               sprintf( c->msg, "<%s> must occur before any backend %sdeclaration",
+                       c->argv[0], (arg_type & ARG_PRE_DB) ? "or database " : "" );
+               Debug(LDAP_DEBUG_CONFIG, "%s: keyword %s\n",
+                       c->log, c->msg, 0 );
                return(ARG_BAD_CONF);
        }
        if((arg_type & ARG_PRE_DB) && c->be && c->be != frontendDB) {
-               Debug(LDAP_DEBUG_CONFIG, "%s: keyword <%s> must appear before any database declaration\n",
-                       c->log, Conf->name, 0);
+               sprintf( c->msg, "<%s> must occur before any database declaration",
+                       c->argv[0] );
+               Debug(LDAP_DEBUG_CONFIG, "%s: keyword %s\n",
+                       c->log, c->msg, 0);
                return(ARG_BAD_CONF);
        }
        if((arg_type & ARG_PAREN) && *c->argv[1] != '(' /*')'*/) {
-               Debug(LDAP_DEBUG_CONFIG, "%s: old <%s> format not supported\n",
-                       c->log, Conf->name, 0);
+               sprintf( c->msg, "<%s> old format not supported", c->argv[0] );
+               Debug(LDAP_DEBUG_CONFIG, "%s: %s\n",
+                       c->log, c->msg, 0);
                return(ARG_BAD_CONF);
        }
        if((arg_type & ARGS_POINTER) && !Conf->arg_item && !(arg_type & ARG_OFFSET)) {
-               Debug(LDAP_DEBUG_CONFIG, "%s: null arg_item for <%s>\n",
-                       c->log, Conf->name, 0);
+               sprintf( c->msg, "<%s> invalid config_table, arg_item is NULL",
+                       c->argv[0] );
+               Debug(LDAP_DEBUG_CONFIG, "%s: %s\n",
+                       c->log, c->msg, 0);
                return(ARG_BAD_CONF);
        }
        c->type = arg_user = (arg_type & ARGS_USERLAND);
@@ -177,18 +191,21 @@ int config_add_vals(ConfigTable *Conf, ConfigArgs *c) {
                                        !strcasecmp(c->argv[1], "false")) {
                                        iarg = 0;
                                } else {
-                                       Debug(LDAP_DEBUG_CONFIG, "%s: ignoring ", c->log, 0, 0);
-                                       Debug(LDAP_DEBUG_CONFIG, "invalid %s value (%s) in <%s> line\n",
-                                               Conf->what, c->argv[1], Conf->name);
+                                       sprintf( c->msg, "<%s> invalid value, ignored",
+                                               c->argv[0] );
+                                       Debug(LDAP_DEBUG_CONFIG, "%s: %s\n",
+                                               c->log, c->msg, 0 );
                                        return(0);
                                }
                                break;
                }
                j = (arg_type & ARG_NONZERO) ? 1 : 0;
-               if(iarg < j || larg < j || barg < j ) {
+               if(iarg < j && larg < j && barg < j ) {
                        larg = larg ? larg : (barg ? barg : iarg);
-                       Debug(LDAP_DEBUG_CONFIG, "%s: " , c->log, 0, 0);
-                       Debug(LDAP_DEBUG_CONFIG, "invalid %s value (%ld) in <%s> line\n", Conf->what, larg, Conf->name);
+                       sprintf( c->msg, "<%s> invalid value, ignored",
+                               c->argv[0] );
+                       Debug(LDAP_DEBUG_CONFIG, "%s: %s\n",
+                               c->log, c->msg, 0 );
                        return(ARG_BAD_CONF);
                }
                switch(arg_type & ARGS_NUMERIC) {
@@ -198,27 +215,48 @@ int config_add_vals(ConfigTable *Conf, ConfigArgs *c) {
                        case ARG_BER_LEN_T:     c->value_ber_t = barg;          break;
                }
        } else if(arg_type & ARG_STRING) {
-               c->value_string = ch_strdup(c->argv[1]);
+               if ( !check_only )
+                       c->value_string = ch_strdup(c->argv[1]);
        } else if(arg_type & ARG_BERVAL) {
-               ber_str2bv( c->argv[1], 0, 1, &c->value_bv );
+               if ( !check_only )
+                       ber_str2bv( c->argv[1], 0, 1, &c->value_bv );
        } else if(arg_type & ARG_DN) {
                struct berval bv;
                ber_str2bv( c->argv[1], 0, 0, &bv );
                rc = dnPrettyNormal( NULL, &bv, &c->value_dn, &c->value_ndn, NULL );
                if ( rc != LDAP_SUCCESS ) {
-                       Debug(LDAP_DEBUG_CONFIG, "%s: " , c->log, 0, 0);
-                       Debug(LDAP_DEBUG_CONFIG, "%s DN is invalid %d (%s)\n",
-                               Conf->name, rc, ldap_err2string( rc ));
+                       sprintf( c->msg, "<%s> invalid DN %d (%s)",
+                               c->argv[0], rc, ldap_err2string( rc ));
+                       Debug(LDAP_DEBUG_CONFIG, "%s: %s\n" , c->log, c->msg, 0);
                        return(ARG_BAD_CONF);
                }
+               if ( check_only ) {
+                       ch_free( c->value_ndn.bv_val );
+                       ch_free( c->value_dn.bv_val );
+               }
        }
+       return 0;
+}
+
+int config_set_vals(ConfigTable *Conf, ConfigArgs *c) {
+       int rc, arg_type;
+       void *ptr;
+
+       arg_type = Conf->arg_type;
        if(arg_type & ARG_MAGIC) {
                if(!c->be) c->be = frontendDB;
+               c->msg[0] = '\0';
                rc = (*((ConfigDriver*)Conf->arg_item))(c);
+#if 0
                if(c->be == frontendDB) c->be = NULL;
+#endif
                if(rc) {
-                       Debug(LDAP_DEBUG_CONFIG, "%s: handler for <%s> exited with %d!\n",
-                               c->log, Conf->name, rc);
+                       if ( !c->msg[0] ) {
+                               sprintf( c->msg, "<%s> handler exited with %d",
+                                       c->argv[0], rc );
+                               Debug(LDAP_DEBUG_CONFIG, "%s: %s!\n",
+                                       c->log, c->msg, 0 );
+                       }
                        return(ARG_BAD_CONF);
                }
                return(0);
@@ -229,8 +267,10 @@ int config_add_vals(ConfigTable *Conf, ConfigArgs *c) {
                else if (c->bi)
                        ptr = c->bi->bi_private;
                else {
-                       Debug(LDAP_DEBUG_CONFIG, "%s: offset for <%s> missing base pointer!\n",
-                               c->log, Conf->name, 0);
+                       sprintf( c->msg, "<%s> offset is missing base pointer",
+                               c->argv[0] );
+                       Debug(LDAP_DEBUG_CONFIG, "%s: %s!\n",
+                               c->log, c->msg, 0);
                        return(ARG_BAD_CONF);
                }
                ptr = (void *)((char *)ptr + (int)Conf->arg_item);
@@ -240,18 +280,18 @@ int config_add_vals(ConfigTable *Conf, ConfigArgs *c) {
        if(arg_type & ARGS_POINTER)
                switch(arg_type & ARGS_POINTER) {
                        case ARG_ON_OFF:
-                       case ARG_INT:           *(int*)ptr = iarg;                      break;
-                       case ARG_LONG:          *(long*)ptr = larg;                     break;
-                       case ARG_BER_LEN_T:     *(ber_len_t*)ptr = barg;                        break;
+                       case ARG_INT:           *(int*)ptr = c->value_int;                      break;
+                       case ARG_LONG:          *(long*)ptr = c->value_long;                    break;
+                       case ARG_BER_LEN_T:     *(ber_len_t*)ptr = c->value_ber_t;                      break;
                        case ARG_STRING: {
                                char *cc = *(char**)ptr;
                                if(cc) {
-                                       if (arg_type & ARG_UNIQUE) {
+                                       if ((arg_type & ARG_UNIQUE) && c->op == SLAP_CONFIG_ADD ) {
                                                Debug(LDAP_DEBUG_CONFIG, "%s: already set %s!\n",
                                                        c->log, Conf->name, 0 );
                                                return(ARG_BAD_CONF);
                                        }
-                                       ch_free(cc);    /* potential memory leak */
+                                       ch_free(cc);
                                }
                                *(char **)ptr = c->value_string;
                                break;
@@ -260,13 +300,35 @@ int config_add_vals(ConfigTable *Conf, ConfigArgs *c) {
                                *(struct berval *)ptr = c->value_bv;
                                break;
                }
-       return(arg_user);
+       return(0);
+}
+
+int config_add_vals(ConfigTable *Conf, ConfigArgs *c) {
+       int rc, arg_type;
+
+       arg_type = Conf->arg_type;
+       if(arg_type == ARG_IGNORED) {
+               Debug(LDAP_DEBUG_CONFIG, "%s: keyword <%s> ignored\n",
+                       c->log, Conf->name, 0);
+               return(0);
+       }
+       rc = config_check_vals( Conf, c, 0 );
+       if ( rc ) return rc;
+       return config_set_vals( Conf, c );
 }
 
 int
 config_del_vals(ConfigTable *cf, ConfigArgs *c)
 {
        int rc = 0;
+
+       /* If there is no handler, just ignore it */
+       if ( cf->arg_type & ARG_MAGIC ) {
+               c->op = LDAP_MOD_DELETE;
+               c->type = cf->arg_type & ARGS_USERLAND;
+               rc = (*((ConfigDriver*)cf->arg_item))(c);
+       }
+       return rc;
 }
 
 int
@@ -361,7 +423,7 @@ init_config_attrs(ConfigTable *ct) {
                                ct[i].attribute, ldap_scherr2str(code), err );
                        return code;
                }
-               code = at_add( at, &err );
+               code = at_add( at, 0, NULL, &err );
                if ( code && code != SLAP_SCHERR_ATTR_DUP ) {
                        fprintf( stderr, "init_config_attrs: AttributeType \"%s\": %s, %s\n",
                                ct[i].attribute, scherr2str(code), err );
@@ -395,7 +457,7 @@ init_config_ocs( ConfigOCs *ocs ) {
                                ocs[i].def, ldap_scherr2str(code), err );
                        return code;
                }
-               code = oc_add(oc,0,&err);
+               code = oc_add(oc,0,NULL,&err);
                if ( code && code != SLAP_SCHERR_CLASS_DUP ) {
                        fprintf( stderr, "init_config_ocs: objectclass \"%s\": %s, %s\n",
                                ocs[i].def, scherr2str(code), err );
@@ -409,6 +471,47 @@ init_config_ocs( ConfigOCs *ocs ) {
        return 0;
 }
 
+int
+config_parse_vals(ConfigTable *ct, ConfigArgs *c, int valx)
+{
+       int rc = 0;
+
+       snprintf( c->log, sizeof( c->log ), "%s: value #%d",
+               ct->ad->ad_cname.bv_val, valx );
+       c->argc = 1;
+       c->argv[0] = ct->ad->ad_cname.bv_val;
+       if ( fp_parse_line( c ) ) {
+               rc = 1;
+       } else {
+               rc = config_check_vals( ct, c, 1 );
+       }
+       if ( rc )
+               rc = LDAP_CONSTRAINT_VIOLATION;
+
+       ch_free( c->tline );
+       return rc;
+}
+
+int
+config_parse_add(ConfigTable *ct, ConfigArgs *c)
+{
+       int rc = 0;
+
+       snprintf( c->log, sizeof( c->log ), "%s: value #%d",
+               ct->ad->ad_cname.bv_val, c->valx );
+       c->argc = 1;
+       c->argv[0] = ct->ad->ad_cname.bv_val;
+       if ( fp_parse_line( c ) ) {
+               rc = 1;
+       } else {
+               c->op = LDAP_MOD_ADD;
+               rc = config_add_vals( ct, c );
+       }
+
+       ch_free( c->tline );
+       return rc;
+}
+
 int
 read_config_file(const char *fname, int depth, ConfigArgs *cf)
 {
@@ -430,9 +533,9 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                c->be = NULL;
        }
 
+       c->valx = -1;
        c->fname = fname;
-       c->argv = ch_calloc( ARGS_STEP + 1, sizeof( *c->argv ) );
-       c->argv_size = ARGS_STEP + 1;
+       init_config_argv( c );
 
        fp = fopen( fname, "r" );
        if ( fp == NULL ) {
@@ -447,6 +550,8 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
 
        fp_getline_init(c);
 
+       c->tline = NULL;
+
        while ( fp_getline( fp, c ) ) {
                /* skip comments and blank lines */
                if ( c->line[0] == '#' || c->line[0] == '\0' ) {
@@ -457,8 +562,10 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                                c->fname, c->lineno );
 
                c->argc = 0;
+               ch_free( c->tline );
                if ( fp_parse_line( c ) ) {
-                       goto badline;
+                       rc = 1;
+                       goto leave;
                }
 
                if ( c->argc < 1 ) {
@@ -466,7 +573,7 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                        continue;
                }
 
-               c->op = LDAP_MOD_ADD;
+               c->op = SLAP_CONFIG_ADD;
 
                ct = config_find_keyword( config_back_cf_table, c );
                if ( ct ) {
@@ -477,10 +584,12 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                                /* XXX a usertype would be opaque here */
                                Debug(LDAP_DEBUG_CONFIG, "%s: unknown user type <%s>\n",
                                        c->log, c->argv[0], 0);
-                               goto badline;
+                               rc = 1;
+                               goto leave;
 
                        } else if ( rc == ARG_BAD_CONF ) {
-                               goto badline;
+                               rc = 1;
+                               goto leave;
                        }
                        
                } else if ( c->bi ) {
@@ -503,7 +612,8 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                                                c->log, *c->argv, 0);
                                        continue;
                                default:
-                                       goto badline;
+                                       rc = 1;
+                                       goto leave;
                                }
                        }
 
@@ -528,7 +638,8 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                                                c->log, *c->argv, 0);
                                        continue;
                                default:
-                                       goto badline;
+                                       rc = 1;
+                                       goto leave;
                                }
                        }
 
@@ -542,7 +653,8 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                                                c->log, *c->argv, 0);
                                        continue;
                                default:
-                                       goto badline;
+                                       rc = 1;
+                                       goto leave;
                                }
                        }
                        
@@ -555,8 +667,6 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                }
        }
 
-       fclose(fp);
-
        if ( BER_BVISNULL( &frontendDB->be_schemadn ) ) {
                ber_str2bv( SLAPD_SCHEMA_DN, STRLENOF( SLAPD_SCHEMA_DN ), 1,
                        &frontendDB->be_schemadn );
@@ -569,16 +679,14 @@ read_config_file(const char *fname, int depth, ConfigArgs *cf)
                        assert( 0 );
                }
        }
+       rc = 0;
 
-       ch_free(c->argv);
-       ch_free(c);
-       return(0);
-
-badline:
+leave:
+       ch_free(c->tline);
        fclose(fp);
        ch_free(c->argv);
        ch_free(c);
-       return(1);
+       return(rc);
 }
 
 /* restrictops, allows, disallows, requires, loglevel */
@@ -606,8 +714,7 @@ verbs_to_mask(int argc, char *argv[], slap_verbmasks *v, slap_mask_t *m) {
 
 int
 mask_to_verbs(slap_verbmasks *v, slap_mask_t m, BerVarray *bva) {
-       int i, j;
-       struct berval bv;
+       int i;
 
        if (!m) return 1;
        for (i=0; !BER_BVISNULL(&v[i].word); i++) {
@@ -620,13 +727,16 @@ mask_to_verbs(slap_verbmasks *v, slap_mask_t m, BerVarray *bva) {
 }
 
 static slap_verbmasks tlskey[] = {
-       { BER_BVC("no"),                SB_TLS_OFF },
-       { BER_BVC("yes"),               SB_TLS_ON },
+       { BER_BVC("no"),        SB_TLS_OFF },
+       { BER_BVC("yes"),       SB_TLS_ON },
        { BER_BVC("critical"),  SB_TLS_CRITICAL },
        { BER_BVNULL, 0 }
 };
 
 static slap_verbmasks methkey[] = {
+#if 0
+       { BER_BVC("none"),      LDAP_AUTH_NONE },
+#endif
        { BER_BVC("simple"),    LDAP_AUTH_SIMPLE },
 #ifdef HAVE_CYRUS_SASL
        { BER_BVC("sasl"),      LDAP_AUTH_SASL },
@@ -637,79 +747,112 @@ static slap_verbmasks methkey[] = {
 typedef struct cf_aux_table {
        struct berval key;
        int off;
-       int quote;
+       char type;
+       char quote;
        slap_verbmasks *aux;
 } cf_aux_table;
 
 static cf_aux_table bindkey[] = {
-       { BER_BVC("starttls="), offsetof(slap_bindconf, sb_tls), 0, tlskey },
-       { BER_BVC("bindmethod="), offsetof(slap_bindconf, sb_method), 0, methkey },
-       { BER_BVC("binddn="), offsetof(slap_bindconf, sb_binddn), 1, NULL },
-       { BER_BVC("credentials="), offsetof(slap_bindconf, sb_cred), 1, NULL },
-       { BER_BVC("saslmech="), offsetof(slap_bindconf, sb_saslmech), 0, NULL },
-       { BER_BVC("secprops="), offsetof(slap_bindconf, sb_secprops), 0, NULL },
-       { BER_BVC("realm="), offsetof(slap_bindconf, sb_realm), 0, NULL },
-       { BER_BVC("authcID="), offsetof(slap_bindconf, sb_authcId), 0, NULL },
-       { BER_BVC("authzID="), offsetof(slap_bindconf, sb_authzId), 1, NULL },
-       { BER_BVNULL, 0, 0, NULL }
+       { BER_BVC("starttls="), offsetof(slap_bindconf, sb_tls), 'd', 0, tlskey },
+       { BER_BVC("bindmethod="), offsetof(slap_bindconf, sb_method), 'd', 0, methkey },
+       { BER_BVC("binddn="), offsetof(slap_bindconf, sb_binddn), 'b', 1, NULL },
+       { BER_BVC("credentials="), offsetof(slap_bindconf, sb_cred), 'b', 1, NULL },
+       { BER_BVC("saslmech="), offsetof(slap_bindconf, sb_saslmech), 'b', 0, NULL },
+       { BER_BVC("secprops="), offsetof(slap_bindconf, sb_secprops), 's', 0, NULL },
+       { BER_BVC("realm="), offsetof(slap_bindconf, sb_realm), 'b', 0, NULL },
+       { BER_BVC("authcID="), offsetof(slap_bindconf, sb_authcId), 'b', 0, NULL },
+       { BER_BVC("authzID="), offsetof(slap_bindconf, sb_authzId), 'b', 1, NULL },
+       { BER_BVNULL, 0, 0, 0, NULL }
 };
 
 int bindconf_parse( const char *word, slap_bindconf *bc ) {
-       int i, rc = 0;
-       char **cptr;
+       int rc = 0;
        cf_aux_table *tab;
 
        for (tab = bindkey; !BER_BVISNULL(&tab->key); tab++) {
                if ( !strncasecmp( word, tab->key.bv_val, tab->key.bv_len )) {
-                       cptr = (char **)((char *)bc + tab->off);
-                       if ( tab->aux ) {
-                               int j;
+                       char **cptr;
+                       int *iptr, j;
+                       struct berval *bptr;
+                       const char *val = word + tab->key.bv_len;
+
+                       switch ( tab->type ) {
+                       case 's':
+                               cptr = (char **)((char *)bc + tab->off);
+                               *cptr = ch_strdup( val );
+                               break;
+
+                       case 'b':
+                               bptr = (struct berval *)((char *)bc + tab->off);
+                               ber_str2bv( val, 0, 1, bptr );
+                               break;
+
+                       case 'd':
+                               assert( tab->aux );
+                               iptr = (int *)((char *)bc + tab->off);
+
                                rc = 1;
-                               for (j=0; !BER_BVISNULL(&tab->aux[j].word); j++) {
-                                       if (!strcasecmp(word+tab->key.bv_len, tab->aux[j].word.bv_val)) {
-                                               int *ptr = (int *)cptr;
-                                               *ptr = tab->aux[j].mask;
+                               for ( j = 0; !BER_BVISNULL( &tab->aux[j].word ); j++ ) {
+                                       if ( !strcasecmp( val, tab->aux[j].word.bv_val ) ) {
+                                               *iptr = tab->aux[j].mask;
                                                rc = 0;
                                        }
                                }
-                               if (rc ) {
-                                       Debug(LDAP_DEBUG_ANY, "invalid bind config value %s\n",
-                                               word, 0, 0 );
-                               }
-                               return rc;
+                               break;
                        }
-                       *cptr = ch_strdup(word+tab->key.bv_len);
-                       return 0;
+
+                       if ( rc ) {
+                               Debug( LDAP_DEBUG_ANY, "invalid bind config value %s\n",
+                                       word, 0, 0 );
+                       }
+                       
+                       return rc;
                }
        }
+
        return rc;
 }
 
 int bindconf_unparse( slap_bindconf *bc, struct berval *bv ) {
        char buf[BUFSIZ], *ptr;
        cf_aux_table *tab;
-       char **cptr;
        struct berval tmp;
 
        ptr = buf;
        for (tab = bindkey; !BER_BVISNULL(&tab->key); tab++) {
+               char **cptr;
+               int *iptr, i;
+               struct berval *bptr;
+
                cptr = (char **)((char *)bc + tab->off);
-               if ( tab->aux ) {
-                       int *ip = (int *)cptr, i;
-                       for ( i=0; !BER_BVISNULL(&tab->aux[i].word); i++ ) {
-                               if ( *ip == tab->aux[i].mask ) {
+
+               switch ( tab->type ) {
+               case 'b':
+                       bptr = (struct berval *)((char *)bc + tab->off);
+                       cptr = &bptr->bv_val;
+               case 's':
+                       if ( *cptr ) {
+                               *ptr++ = ' ';
+                               ptr = lutil_strcopy( ptr, tab->key.bv_val );
+                               if ( tab->quote ) *ptr++ = '"';
+                               ptr = lutil_strcopy( ptr, *cptr );
+                               if ( tab->quote ) *ptr++ = '"';
+                       }
+                       break;
+
+               case 'd':
+                       assert( tab->aux );
+                       iptr = (int *)((char *)bc + tab->off);
+               
+                       for ( i = 0; !BER_BVISNULL( &tab->aux[i].word ); i++ ) {
+                               if ( *iptr == tab->aux[i].mask ) {
                                        *ptr++ = ' ';
                                        ptr = lutil_strcopy( ptr, tab->key.bv_val );
                                        ptr = lutil_strcopy( ptr, tab->aux[i].word.bv_val );
                                        break;
                                }
                        }
-               } else if ( *cptr ) {
-                       *ptr++ = ' ';
-                       ptr = lutil_strcopy( ptr, tab->key.bv_val );
-                       if ( tab->quote ) *ptr++ = '"';
-                       ptr = lutil_strcopy( ptr, *cptr );
-                       if ( tab->quote ) *ptr++ = '"';
+                       break;
                }
        }
        tmp.bv_val = buf;
@@ -719,26 +862,33 @@ int bindconf_unparse( slap_bindconf *bc, struct berval *bv ) {
 }
 
 void bindconf_free( slap_bindconf *bc ) {
-       if ( bc->sb_binddn ) {
-               ch_free( bc->sb_binddn );
+       if ( !BER_BVISNULL( &bc->sb_binddn ) ) {
+               ch_free( bc->sb_binddn.bv_val );
+               BER_BVZERO( &bc->sb_binddn );
        }
-       if ( bc->sb_cred ) {
-               ch_free( bc->sb_cred );
+       if ( !BER_BVISNULL( &bc->sb_cred ) ) {
+               ch_free( bc->sb_cred.bv_val );
+               BER_BVZERO( &bc->sb_cred );
        }
-       if ( bc->sb_saslmech ) {
-               ch_free( bc->sb_saslmech );
+       if ( !BER_BVISNULL( &bc->sb_saslmech ) ) {
+               ch_free( bc->sb_saslmech.bv_val );
+               BER_BVZERO( &bc->sb_saslmech );
        }
        if ( bc->sb_secprops ) {
                ch_free( bc->sb_secprops );
+               bc->sb_secprops = NULL;
        }
-       if ( bc->sb_realm ) {
-               ch_free( bc->sb_realm );
+       if ( !BER_BVISNULL( &bc->sb_realm ) ) {
+               ch_free( bc->sb_realm.bv_val );
+               BER_BVZERO( &bc->sb_realm );
        }
-       if ( bc->sb_authcId ) {
-               ch_free( bc->sb_authcId );
+       if ( !BER_BVISNULL( &bc->sb_authcId ) ) {
+               ch_free( bc->sb_authcId.bv_val );
+               BER_BVZERO( &bc->sb_authcId );
        }
-       if ( bc->sb_authzId ) {
-               ch_free( bc->sb_authzId );
+       if ( !BER_BVISNULL( &bc->sb_authzId ) ) {
+               ch_free( bc->sb_authzId.bv_val );
+               BER_BVZERO( &bc->sb_authzId );
        }
 }
 
@@ -874,12 +1024,12 @@ static int
 fp_parse_line(ConfigArgs *c)
 {
        char *token;
-       char *tline = ch_strdup(c->line);
        char *hide[] = { "rootpw", "replica", "bindpw", "pseudorootpw", "dbpasswd", '\0' };
        char *quote_ptr;
        int i;
 
-       token = strtok_quote(tline, " \t", &quote_ptr);
+       c->tline = ch_strdup(c->line);
+       token = strtok_quote(c->tline, " \t", &quote_ptr);
 
        if(token) for(i = 0; hide[i]; i++) if(!strcasecmp(token, hide[i])) break;
        if(quote_ptr) *quote_ptr = ' ';
@@ -981,6 +1131,7 @@ int config_generic_wrapper( Backend *be, const char *fname, int lineno,
        c.lineno = lineno;
        c.argc = argc;
        c.argv = argv;
+       c.valx = -1;
        sprintf( c.log, "%s: line %lu", fname, lineno );
 
        rc = SLAP_CONF_UNKNOWN;
index ac4ceab069a504b8fea58acaa9ddc7d4defe41b8..909314c60ef0149b9535a36a7d45e6f0557ef081 100644 (file)
@@ -27,6 +27,17 @@ typedef struct ConfigTable {
        void *notify;
 } ConfigTable;
 
+typedef enum {
+       Cft_Abstract = 0,
+       Cft_Global,
+       Cft_Schema,
+       Cft_Backend,
+       Cft_Database,
+       Cft_Overlay,
+       Cft_Include,
+       Cft_Module
+} ConfigType;
+
 #define ARGS_USERLAND  0x00000fff
 #define ARGS_TYPES     0x000ff000
 #define ARGS_POINTER   0x0003f000
@@ -47,30 +58,38 @@ typedef struct ConfigTable {
 #define ARG_MAY_DB     0x00800000      /* May apply to DB */
 #define ARG_PAREN      0x01000000
 #define ARG_NONZERO    0x02000000
+#define        ARG_NO_INSERT   0x04000000      /* no arbitrary inserting */
+#define        ARG_NO_DELETE   0x08000000      /* no runtime deletes */
 #define ARG_UNIQUE     0x10000000
-#define ARG_MUTEX      0x20000000      /* modify in single-thread mode */
 #define ARG_OFFSET     0x40000000
 #define ARG_MAGIC      0x80000000
 
 #define ARG_BAD_CONF   0xdead0000      /* overload return values */
-#define ARG_UNKNOWN    0xc0de0000
 
 extern ConfigTable config_back_cf_table[];
 
 typedef struct ConfigOCs {
        char *def;
+       ConfigType cft;
        ObjectClass **oc;
 } ConfigOCs;
 
+struct config_args_s;
+
+typedef int (ConfigDriver)(struct config_args_s *c);
+
 typedef struct config_args_s {
        int argc;
        char **argv;
        int argv_size;
        char *line;
+       char *tline;
        const char *fname;
        unsigned long lineno;
-       char log[PATH_MAX + STRLENOF(": line 18446744073709551615") + 1];
+       char log[MAXPATHLEN + STRLENOF(": line 18446744073709551615") + 1];
+       char msg[SLAP_TEXT_BUFLEN];
        int depth;
+       int valx;       /* multi-valued value index */
        /* parsed first val for simple cases */
        union {
                int v_int;
@@ -87,10 +106,13 @@ typedef struct config_args_s {
        BerVarray rvalue_vals;
        BerVarray rvalue_nvals;
 #define        SLAP_CONFIG_EMIT        0x2000  /* emit instead of set */
+#define SLAP_CONFIG_ADD                0x4000  /* config file add vs LDAP add */
        int op;
        int type;       /* ConfigTable.arg_type & ARGS_USERLAND */
        BackendDB *be;
        BackendInfo *bi;
+       void *private;  /* anything */
+       ConfigDriver *cleanup;
 } ConfigArgs;
 
 #define value_int values.v_int
@@ -101,8 +123,6 @@ typedef struct config_args_s {
 #define value_dn values.v_dn.vdn_dn
 #define value_ndn values.v_dn.vdn_ndn
 
-typedef int (ConfigDriver)(ConfigArgs *c);
-
 int config_register_schema(ConfigTable *ct, ConfigOCs *co);
 int config_get_vals(ConfigTable *ct, ConfigArgs *c);
 int config_add_vals(ConfigTable *ct, ConfigArgs *c);
index 4e7fb9bc5587d60226e852009bf46c5ca65e04ef..2f9ab790610e39ae41a45572783d1e1dfb773728 100644 (file)
@@ -26,7 +26,9 @@
 #include "portable.h"
 
 #include <stdio.h>
+#ifdef HAVE_LIMITS_H
 #include <limits.h>
+#endif
 
 #include <ac/socket.h>
 #include <ac/errno.h>
@@ -609,6 +611,10 @@ void connection2anonymous( Connection *c )
                free(c->c_ndn.bv_val);
        }
        BER_BVZERO( &c->c_ndn );
+       if(c->c_sasl_authz_dn.bv_val != NULL) {
+               free(c->c_sasl_authz_dn.bv_val);
+       }
+       BER_BVZERO( &c->c_sasl_authz_dn );
 
        c->c_authz_backend = NULL;
 }
@@ -761,7 +767,12 @@ void connection_closing( Connection *c )
 
                /* wake write blocked operations */
                slapd_clr_write( sd, 1 );
-               ldap_pvt_thread_cond_signal( &c->c_write_cv );
+               if ( c->c_writewaiter ) {
+                       ldap_pvt_thread_cond_signal( &c->c_write_cv );
+                       ldap_pvt_thread_mutex_unlock( &c->c_mutex );
+                       ldap_pvt_thread_yield();
+                       ldap_pvt_thread_mutex_lock( &c->c_mutex );
+               }
        }
 }
 
@@ -1598,8 +1609,13 @@ static int connection_op_activate( Operation *op )
 
        if (!op->o_dn.bv_len) {
                op->o_authz = op->o_conn->c_authz;
-               ber_dupbv( &op->o_dn, &op->o_conn->c_dn );
-               ber_dupbv( &op->o_ndn, &op->o_conn->c_ndn );
+               if ( BER_BVISNULL( &op->o_conn->c_sasl_authz_dn )) {
+                       ber_dupbv( &op->o_dn, &op->o_conn->c_dn );
+                       ber_dupbv( &op->o_ndn, &op->o_conn->c_ndn );
+               } else {
+                       ber_dupbv( &op->o_dn, &op->o_conn->c_sasl_authz_dn );
+                       ber_dupbv( &op->o_ndn, &op->o_conn->c_sasl_authz_dn );
+               }
        }
        op->o_authtype = op->o_conn->c_authtype;
        ber_dupbv( &op->o_authmech, &op->o_conn->c_authmech );
index 7b1604468369bcb9d44e59409d36207386e2b794..27fe43f1c6161453fbaa8d452283f29f7b05a917 100644 (file)
@@ -32,6 +32,9 @@ static SLAP_CTRL_PARSE_FN parseManageDSAit;
 static SLAP_CTRL_PARSE_FN parseModifyIncrement;
 static SLAP_CTRL_PARSE_FN parseNoOp;
 static SLAP_CTRL_PARSE_FN parsePagedResults;
+#ifdef LDAP_DEVEL
+static SLAP_CTRL_PARSE_FN parseSortedResults;
+#endif
 static SLAP_CTRL_PARSE_FN parseValuesReturnFilter;
 static SLAP_CTRL_PARSE_FN parsePermissiveModify;
 static SLAP_CTRL_PARSE_FN parseDomainScope;
@@ -112,6 +115,12 @@ static struct slap_control control_defs[] = {
                (int)offsetof(struct slap_control_ids, sc_pagedResults),
                SLAP_CTRL_SEARCH, NULL,
                parsePagedResults, LDAP_SLIST_ENTRY_INITIALIZER(next) },
+#ifdef LDAP_DEVEL
+       { LDAP_CONTROL_SORTREQUEST,
+               (int)offsetof(struct slap_control_ids, sc_sortedResults),
+               SLAP_CTRL_GLOBAL|SLAP_CTRL_SEARCH|SLAP_CTRL_HIDE, NULL,
+               parseSortedResults, LDAP_SLIST_ENTRY_INITIALIZER(next) },
+#endif
 #ifdef LDAP_CONTROL_X_DOMAIN_SCOPE
        { LDAP_CONTROL_X_DOMAIN_SCOPE,
                (int)offsetof(struct slap_control_ids, sc_domainScope),
@@ -746,19 +755,17 @@ static int parseProxyAuthz (
                ctrl->ldctl_value.bv_len ?  ctrl->ldctl_value.bv_val : "anonymous",
                0 );
 
-       if( ctrl->ldctl_value.bv_len == 0 ) {
+       if ( ctrl->ldctl_value.bv_len == 0 ) {
                Debug( LDAP_DEBUG_TRACE,
                        "parseProxyAuthz: conn=%lu anonymous\n", 
                        op->o_connid, 0, 0 );
 
                /* anonymous */
-               free( op->o_dn.bv_val );
-               op->o_dn.bv_len = 0;
-               op->o_dn.bv_val = ch_strdup( "" );
-
-               free( op->o_ndn.bv_val );
+               op->o_ndn.bv_val[ 0 ] = '\0';
                op->o_ndn.bv_len = 0;
-               op->o_ndn.bv_val = ch_strdup( "" );
+
+               op->o_dn.bv_val[ 0 ] = '\0';
+               op->o_dn.bv_len = 0;
 
                return LDAP_SUCCESS;
        }
@@ -782,27 +789,26 @@ static int parseProxyAuthz (
 
        rc = slap_sasl_authorized( op, &op->o_ndn, &dn );
 
-       if( rc ) {
+       if ( rc ) {
                ch_free( dn.bv_val );
                rs->sr_text = "not authorized to assume identity";
                return LDAP_PROXY_AUTHZ_FAILURE;
        }
 
-       ch_free( op->o_dn.bv_val );
        ch_free( op->o_ndn.bv_val );
-
-       op->o_dn.bv_val = NULL;
-       op->o_ndn = dn;
-
-       Statslog( LDAP_DEBUG_STATS, "%s PROXYAUTHZ dn=\"%s\"\n",
-           op->o_log_prefix, dn.bv_val, 0, 0, 0 );
+       ch_free( op->o_dn.bv_val );
 
        /*
         * NOTE: since slap_sasl_getdn() returns a normalized dn,
         * from now on op->o_dn is normalized
         */
+       op->o_ndn = dn;
        ber_dupbv( &op->o_dn, &dn );
 
+
+       Statslog( LDAP_DEBUG_STATS, "%s PROXYAUTHZ dn=\"%s\"\n",
+           op->o_log_prefix, dn.bv_val, 0, 0, 0 );
+
        return LDAP_SUCCESS;
 }
 
@@ -950,6 +956,34 @@ done:;
        return rc;
 }
 
+#ifdef LDAP_DEVEL
+static int parseSortedResults (
+       Operation *op,
+       SlapReply *rs,
+       LDAPControl *ctrl )
+{
+       int             rc = LDAP_SUCCESS;
+
+       if ( op->o_sortedresults != SLAP_CONTROL_NONE ) {
+               rs->sr_text = "sorted results control specified multiple times";
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       if ( BER_BVISEMPTY( &ctrl->ldctl_value ) ) {
+               rs->sr_text = "sorted results control value is empty (or absent)";
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       /* blow off parsing the value */
+
+       op->o_sortedresults = ctrl->ldctl_iscritical
+               ? SLAP_CONTROL_CRITICAL
+               : SLAP_CONTROL_NONCRITICAL;
+
+       return rc;
+}
+#endif
+
 static int parseAssert (
        Operation *op,
        SlapReply *rs,
index 4459cb66b0973686a9ff326c5a15cd7a81903b90..a1c6005e93f2fef14d25a0f4b24d5e411f2d9302 100644 (file)
@@ -30,8 +30,8 @@ struct cindexrec {
 };
 
 static Avlnode *cr_index = NULL;
-static LDAP_SLIST_HEAD(CRList, slap_content_rule) cr_list
-       = LDAP_SLIST_HEAD_INITIALIZER(&cr_list);
+static LDAP_STAILQ_HEAD(CRList, slap_content_rule) cr_list
+       = LDAP_STAILQ_HEAD_INITIALIZER(cr_list);
 
 static int
 cr_index_cmp(
@@ -103,9 +103,9 @@ cr_destroy( void )
 
        avl_free(cr_index, ldap_memfree);
 
-       while( !LDAP_SLIST_EMPTY(&cr_list) ) {
-               c = LDAP_SLIST_FIRST(&cr_list);
-               LDAP_SLIST_REMOVE_HEAD(&cr_list, scr_next);
+       while( !LDAP_STAILQ_EMPTY(&cr_list) ) {
+               c = LDAP_STAILQ_FIRST(&cr_list);
+               LDAP_STAILQ_REMOVE_HEAD(&cr_list, scr_next);
 
                cr_destroy_one( c );
        }
@@ -120,9 +120,6 @@ cr_insert(
        struct cindexrec        *cir;
        char                    **names;
 
-       LDAP_SLIST_NEXT( scr, scr_next ) = NULL;
-       LDAP_SLIST_INSERT_HEAD(&cr_list, scr, scr_next);
-
        if ( scr->scr_oid ) {
                cir = (struct cindexrec *)
                        ch_calloc( 1, sizeof(struct cindexrec) );
@@ -171,6 +168,8 @@ cr_insert(
                }
        }
 
+       LDAP_STAILQ_INSERT_TAIL(&cr_list, scr, scr_next);
+
        return 0;
 }
 
@@ -334,12 +333,14 @@ int
 cr_add(
     LDAPContentRule    *cr,
        int user,
+       ContentRule **rscr,
     const char         **err
 )
 {
        ContentRule     *scr;
        int             code;
        int             op = 0;
+       char    *oidm = NULL;
 
        if ( cr->cr_names != NULL ) {
                int i;
@@ -359,7 +360,7 @@ cr_add(
                        return SLAP_SCHERR_OIDM;
                }
                if ( oid != cr->cr_oid ) {
-                       ldap_memfree( cr->cr_oid );
+                       oidm = cr->cr_oid;
                        cr->cr_oid = oid;
                }
        }
@@ -367,6 +368,7 @@ cr_add(
        scr = (ContentRule *) ch_calloc( 1, sizeof(ContentRule) );
        AC_MEMCPY( &scr->scr_crule, cr, sizeof(LDAPContentRule) );
 
+       scr->scr_oidmacro = oidm;
        scr->scr_sclass = oc_find(cr->cr_oid);
        if ( !scr->scr_sclass ) {
                *err = cr->cr_oid;
@@ -399,9 +401,68 @@ cr_add(
        }
 
        code = cr_insert(scr,err);
+       if ( code == 0 && rscr )
+               *rscr = scr;
        return code;
 }
 
+void
+cr_unparse( BerVarray *res, ContentRule *start, ContentRule *end, int sys )
+{
+       ContentRule *cr;
+       int i, num;
+       struct berval bv, *bva = NULL, idx;
+       char ibuf[32], *ptr;
+
+       if ( !start )
+               start = LDAP_STAILQ_FIRST( &cr_list );
+
+       /* count the result size */
+       i = 0;
+       for ( cr=start; cr; cr=LDAP_STAILQ_NEXT(cr, scr_next)) {
+               if ( sys && !(cr->scr_flags & SLAP_CR_HARDCODE)) continue;
+               i++;
+               if ( cr == end ) break;
+       }
+       if (!i) return;
+
+       num = i;
+       bva = ch_malloc( (num+1) * sizeof(struct berval) );
+       BER_BVZERO( bva );
+       idx.bv_val = ibuf;
+       if ( sys ) {
+               idx.bv_len = 0;
+               ibuf[0] = '\0';
+       }
+       i = 0;
+       for ( cr=start; cr; cr=LDAP_STAILQ_NEXT(cr, scr_next)) {
+               LDAPContentRule lcr, *lcrp;
+               if ( sys && !(cr->scr_flags & SLAP_CR_HARDCODE)) continue;
+               if ( cr->scr_oidmacro ) {
+                       lcr = cr->scr_crule;
+                       lcr.cr_oid = cr->scr_oidmacro;
+                       lcrp = &lcr;
+               } else {
+                       lcrp = &cr->scr_crule;
+               }
+               if ( ldap_contentrule2bv( lcrp, &bv ) == NULL ) {
+                       ber_bvarray_free( bva );
+               }
+               if ( !sys ) {
+                       idx.bv_len = sprintf(idx.bv_val, "{%d}", i);
+               }
+               bva[i].bv_len = idx.bv_len + bv.bv_len;
+               bva[i].bv_val = ch_malloc( bva[i].bv_len + 1 );
+               strcpy( bva[i].bv_val, ibuf );
+               strcpy( bva[i].bv_val + idx.bv_len, bv.bv_val );
+               i++;
+               bva[i].bv_val = NULL;
+               ldap_memfree( bv.bv_val );
+               if ( cr == end ) break;
+       }
+       *res = bva;
+}
+
 int
 cr_schema_info( Entry *e )
 {
@@ -412,7 +473,7 @@ cr_schema_info( Entry *e )
        struct berval   val;
        struct berval   nval;
 
-       LDAP_SLIST_FOREACH(cr, &cr_list, scr_next) {
+       LDAP_STAILQ_FOREACH(cr, &cr_list, scr_next) {
                if ( ldap_contentrule2bv( &cr->scr_crule, &val ) == NULL ) {
                        return -1;
                }
index 2893a905f90c1f05de7eb85f2332dd0cd2605439..53819525aa7aee15f56e69fedce1996d6496239b 100644 (file)
@@ -1982,22 +1982,22 @@ slapd_daemon_task(
        }
 
        if( slapd_shutdown == 1 ) {
-               Debug( LDAP_DEBUG_TRACE,
+               Debug( LDAP_DEBUG_ANY,
                        "daemon: shutdown requested and initiated.\n",
                        0, 0, 0 );
 
        } else if ( slapd_shutdown == 2 ) {
 #ifdef HAVE_NT_SERVICE_MANAGER
-                       Debug( LDAP_DEBUG_TRACE,
+                       Debug( LDAP_DEBUG_ANY,
                               "daemon: shutdown initiated by Service Manager.\n",
                               0, 0, 0);
 #else /* !HAVE_NT_SERVICE_MANAGER */
-                       Debug( LDAP_DEBUG_TRACE,
+                       Debug( LDAP_DEBUG_ANY,
                               "daemon: abnormal condition, shutdown initiated.\n",
                               0, 0, 0 );
 #endif /* !HAVE_NT_SERVICE_MANAGER */
        } else {
-               Debug( LDAP_DEBUG_TRACE,
+               Debug( LDAP_DEBUG_ANY,
                       "daemon: no active streams, shutdown initiated.\n",
                       0, 0, 0 );
        }
index 6ed1b0cda032e9a15af34ea0547824779e2a15ea..5da22ac6a44a6f834e4c42eb5bbc03e8d93a3415 100644 (file)
@@ -1002,7 +1002,6 @@ dnRelativeMatch(
 
                *matchp = match;
                return LDAP_SUCCESS;
-
        }
 
        if( mr == slap_schema.si_mr_dnSuperiorMatch ) {
@@ -1098,6 +1097,10 @@ rdnMatch(
  * dnParent - dn's parent, in-place
  * note: the incoming dn is assumed to be normalized/prettyfied,
  * so that escaped rdn/ava separators are in '\'+hexpair form
+ *
+ * note: "dn" and "pdn" can point to the same berval;
+ * beware that, in this case, the pointer to the original buffer
+ * will get lost.
  */
 void
 dnParent( 
@@ -1119,8 +1122,8 @@ dnParent(
        p++;
 
        assert( ATTR_LEADCHAR( p[ 0 ] ) );
-       pdn->bv_val = p;
        pdn->bv_len = dn->bv_len - (p - dn->bv_val);
+       pdn->bv_val = p;
 
        return;
 }
index a9d8bd17a005f3621f89bf208290c6c1dab22d2c..b201fd469d23b2205beab079e27673ec1afa6d0b 100644 (file)
@@ -186,7 +186,7 @@ static int test_mra_filter(
                        const char *text;
 
                        rc = value_match( &ret, slap_schema.si_ad_entryDN, mra->ma_rule,
-                               0, &e->e_nname, &mra->ma_value, &text );
+                               SLAP_MR_EXT, &e->e_nname, &mra->ma_value, &text );
        
        
                        if( rc != LDAP_SUCCESS ) return rc;
@@ -264,7 +264,8 @@ static int test_mra_filter(
                                        if ( !a->a_comp_data->cd_tree[i] ) {
                                                return LDAP_OPERATIONS_ERROR;
                                        }
-                                       rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
+                                       rc = value_match( &ret, a->a_desc, mra->ma_rule,
+                                               SLAP_MR_COMPONENT,
                                                (struct berval*)a->a_comp_data->cd_tree[i++],
                                                (void*)mra, &text );
                                } else 
@@ -308,8 +309,8 @@ static int test_mra_filter(
                                                nbv = *bv;
                                        }
 
-                                       rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
-                                               &nbv, &mra->ma_value, &text );
+                                       rc = value_match( &ret, a->a_desc, mra->ma_rule,
+                                               SLAP_MR_EXT, &nbv, &mra->ma_value, &text );
 
                                        if ( nbv.bv_val != bv->bv_val ) {
                                                memfree( nbv.bv_val, memctx );
@@ -356,7 +357,8 @@ static int test_mra_filter(
                        {
                                int ret;
 
-                               rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
+                               rc = value_match( &ret, a->a_desc, mra->ma_rule,
+                                       SLAP_MR_COMPONENT,
                                        (struct berval*)a, (void*)mra, &text );
                                if ( rc != LDAP_SUCCESS ) break;
        
@@ -397,8 +399,8 @@ static int test_mra_filter(
                                        nbv = *bv;
                                }
 
-                               rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
-                                       &nbv, &value, &text );
+                               rc = value_match( &ret, a->a_desc, mra->ma_rule,
+                                       SLAP_MR_EXT, &nbv, &value, &text );
 
                                if ( nbv.bv_val != bv->bv_val ) {
                                        memfree( nbv.bv_val, memctx );
@@ -494,7 +496,7 @@ static int test_mra_filter(
                                }
 
                                /* check match */
-                               rc = value_match( &ret, ad, mra->ma_rule, 0,
+                               rc = value_match( &ret, ad, mra->ma_rule, SLAP_MR_EXT,
                                        &nbv, &value, &text );
 
 cleanup:;
@@ -588,8 +590,8 @@ test_ava_filter(
                mr = slap_schema.si_ad_entryDN->ad_type->sat_equality;
                assert( mr );
 
-               rc = value_match( &match, slap_schema.si_ad_entryDN, mr, 0,
-                       &e->e_nname, &ava->aa_value, &text );
+               rc = value_match( &match, slap_schema.si_ad_entryDN, mr,
+                       SLAP_MR_EXT, &e->e_nname, &ava->aa_value, &text );
 
                if( rc != LDAP_SUCCESS ) return rc;
                if( match == 0 ) return LDAP_COMPARE_TRUE;
@@ -613,6 +615,7 @@ test_ava_filter(
                a != NULL;
                a = attrs_find( a->a_next, ava->aa_desc ) )
        {
+               int use;
                MatchingRule *mr;
                struct berval *bv;
 
@@ -623,19 +626,24 @@ test_ava_filter(
                        continue;
                }
 
+               use = SLAP_MR_EQUALITY;
+
                switch ( type ) {
                case LDAP_FILTER_APPROX:
+                       use = SLAP_MR_EQUALITY_APPROX;
                        mr = a->a_desc->ad_type->sat_approx;
                        if( mr != NULL ) break;
 
-                       /* use EQUALITY matching rule if no APPROX rule */
+                       /* fallthru: use EQUALITY matching rule if no APPROX rule */
 
                case LDAP_FILTER_EQUALITY:
+                       /* use variable set above so fall thru use is not clobbered */
                        mr = a->a_desc->ad_type->sat_equality;
                        break;
 
                case LDAP_FILTER_GE:
                case LDAP_FILTER_LE:
+                       use = SLAP_MR_ORDERING;
                        mr = a->a_desc->ad_type->sat_ordering;
                        break;
 
@@ -700,8 +708,10 @@ test_ava_filter(
                                        return LDAP_OPERATIONS_ERROR;
                                }
 
-                               ret = value_match( &match, a->a_desc, cf_mr, 0,
-                                       (struct berval*)a->a_comp_data->cd_tree[i++], (void*)&mra, &text );
+                               ret = value_match( &match, a->a_desc, cf_mr,
+                                       SLAP_MR_COMPONENT,
+                                       (struct berval*)a->a_comp_data->cd_tree[i++],
+                                       (void*)&mra, &text );
                                if ( ret == LDAP_INAPPROPRIATE_MATCHING ) {
                                        /* cached component tree is broken, just remove it */
                                        free_ComponentData ( a );
@@ -709,12 +719,11 @@ test_ava_filter(
                                }
                                if ( a_alias )
                                        ava->aa_desc = a_alias->aa_aliasing_ad;
-                       }
-                       else 
+
+                       else 
 #endif
                        {
-
-                               ret = value_match( &match, a->a_desc, mr, 0,
+                               ret = value_match( &match, a->a_desc, mr, use,
                                        bv, &ava->aa_value, &text );
                        }
 
@@ -909,7 +918,7 @@ test_substrings_filter(
                        int ret, match;
                        const char *text;
 
-                       ret = value_match( &match, a->a_desc, mr, 0,
+                       ret = value_match( &match, a->a_desc, mr, SLAP_MR_SUBSTR,
                                bv, f->f_sub, &text );
 
                        if( ret != LDAP_SUCCESS ) {
index b711ef9840610fe7246bae15164966bdbbf86c3a..91c699efc719ab54ff0852f6522022d3f22c91fd 100644 (file)
@@ -38,6 +38,8 @@
 #include "slapi/slapi.h"
 #endif
 
+#include "ldap_rq.h"
+
 /*
  * read-only global variables or variables only written by the listener
  * thread (after they are initialized) - no need to protect them with a mutex.
@@ -126,6 +128,10 @@ slap_init( int mode, const char *name )
                ldap_pvt_mp_init( slap_counters.sc_ops_initiated );
                ldap_pvt_mp_init( slap_counters.sc_ops_completed );
 
+               ldap_pvt_thread_mutex_init( &slapd_rq.rq_mutex );
+               LDAP_STAILQ_INIT( &slapd_rq.task_list );
+               LDAP_STAILQ_INIT( &slapd_rq.run_list );
+
 #ifdef SLAPD_MONITOR
                for ( i = 0; i < SLAP_OP_LAST; i++ ) {
                        ldap_pvt_mp_init( slap_counters.sc_ops_initiated_[ i ] );
index 944faff679c8cefdb3285fe57b004a65dbf3035b..8ba7f78291e550661590d3922acc2fc0a9b89fc2 100644 (file)
@@ -192,11 +192,12 @@ usage( char *name )
        fprintf( stderr,
                "\t-4\t\tIPv4 only\n"
                "\t-6\t\tIPv6 only\n"
-               "\t-T {add|auth|cat|dn|index|passwd|test}\n"
+               "\t-T {acl|add|auth|cat|dn|index|passwd|test}\n"
                "\t\t\tRun in Tool mode\n"
                "\t-c cookie\tSync cookie of consumer\n"
                "\t-d level\tDebug level" "\n"
                "\t-f filename\tConfiguration file\n"
+               "\t-F dir\tConfiguration directory\n"
 #if defined(HAVE_SETUID) && defined(HAVE_SETGID)
                "\t-g group\tGroup (id or name) to run as\n"
 #endif
index 5f7199f4f159e3eab7d41f37beace0754d158f48..f9c64d4c9f9a8a8163f416a4231f33cb5a67a174 100644 (file)
@@ -206,7 +206,7 @@ cleanup:
 
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
        op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
-       if ( modlist != NULL ) slap_mods_free( modlist );
+       if ( op->orm_modlist != NULL ) slap_mods_free( op->orm_modlist );
 
        return rs->sr_err;
 }
@@ -744,59 +744,37 @@ int slap_mods_check(
                                ml->sml_nvalues[nvals].bv_len = 0;
                        }
 
-                       if( nvals ) {
-                               /* check for duplicates */
-                               int             i, j;
+                       /* check for duplicates, but ignore Deletes.
+                        */
+                       if( nvals > 1 && ml->sml_op != LDAP_MOD_DELETE ) {
+                               int             i, j, rc, match;
                                MatchingRule *mr = ad->ad_type->sat_equality;
 
-                               /* check if the values we're adding already exist */
-                               if( mr == NULL || !mr->smr_match ) {
-                                       for ( i = 1; ml->sml_values[i].bv_val != NULL; i++ ) {
-                                               /* test asserted values against themselves */
-                                               for( j = 0; j < i; j++ ) {
-                                                       if ( bvmatch( &ml->sml_values[i],
-                                                               &ml->sml_values[j] ) )
-                                                       {
-                                                               /* value exists already */
-                                                               snprintf( textbuf, textlen,
-                                                                       "%s: value #%d provided more than once",
-                                                                       ml->sml_desc->ad_cname.bv_val, j );
-                                                               *text = textbuf;
-                                                               return LDAP_TYPE_OR_VALUE_EXISTS;
-                                                       }
-                                               }
-                                       }
-
-                               } else {
-                                       int rc;
-                                       int match;
-
-                                       for ( i = 1; ml->sml_values[i].bv_val != NULL; i++ ) {
-                                               /* test asserted values against themselves */
-                                               for( j = 0; j < i; j++ ) {
-                                                       rc = value_match( &match, ml->sml_desc, mr,
-                                                               SLAP_MR_EQUALITY
-                                                                       | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
-                                                                       | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
-                                                                       | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
-                                                               ml->sml_nvalues
-                                                                       ? &ml->sml_nvalues[i]
-                                                                       : &ml->sml_values[i],
-                                                               ml->sml_nvalues
-                                                                       ? &ml->sml_nvalues[j]
-                                                                       : &ml->sml_values[j],
-                                                               text );
-                                                       if ( rc == LDAP_SUCCESS && match == 0 ) {
-                                                               /* value exists already */
-                                                               snprintf( textbuf, textlen,
-                                                                       "%s: value #%d provided more than once",
-                                                                       ml->sml_desc->ad_cname.bv_val, j );
-                                                               *text = textbuf;
-                                                               return LDAP_TYPE_OR_VALUE_EXISTS;
-
-                                                       } else if ( rc != LDAP_SUCCESS ) {
-                                                               return rc;
-                                                       }
+                               for ( i = 1; i < nvals ; i++ ) {
+                                       /* test asserted values against themselves */
+                                       for( j = 0; j < i; j++ ) {
+                                               rc = ordered_value_match( &match, ml->sml_desc, mr,
+                                                       SLAP_MR_EQUALITY
+                                                               | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
+                                                               | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
+                                                               | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
+                                                       ml->sml_nvalues
+                                                               ? &ml->sml_nvalues[i]
+                                                               : &ml->sml_values[i],
+                                                       ml->sml_nvalues
+                                                               ? &ml->sml_nvalues[j]
+                                                               : &ml->sml_values[j],
+                                                       text );
+                                               if ( rc == LDAP_SUCCESS && match == 0 ) {
+                                                       /* value exists already */
+                                                       snprintf( textbuf, textlen,
+                                                               "%s: value #%d provided more than once",
+                                                               ml->sml_desc->ad_cname.bv_val, j );
+                                                       *text = textbuf;
+                                                       return LDAP_TYPE_OR_VALUE_EXISTS;
+
+                                               } else if ( rc != LDAP_SUCCESS ) {
+                                                       return rc;
                                                }
                                        }
                                }
index c9171d709bb52e6d5ebd5d5003a64264095b8e40..b0f8d3e0288d1df4da5271120e3851be50a40d66 100644 (file)
@@ -450,7 +450,7 @@ slap_modrdn2mods(
 
                /* ACL check of newly added attrs */
                if ( op->o_bd && !access_allowed( op, e, desc,
-                       &new_rdn[a_cnt]->la_value, ACL_WRITE, NULL ) ) {
+                       &new_rdn[a_cnt]->la_value, ACL_WADD, NULL ) ) {
                        Debug( LDAP_DEBUG_TRACE,
                                "slap_modrdn2modlist: access to attr \"%s\" "
                                "(new) not allowed\n", 
@@ -500,9 +500,9 @@ slap_modrdn2mods(
                                goto done;              
                        }
 
-                       /* ACL check of newly added attrs */
+                       /* ACL check of old rdn attrs removal */
                        if ( op->o_bd && !access_allowed( op, e, desc,
-                               &old_rdn[d_cnt]->la_value, ACL_WRITE
+                               &old_rdn[d_cnt]->la_value, ACL_WDEL
                                NULL ) ) {
                                Debug( LDAP_DEBUG_TRACE,
                                        "slap_modrdn2modlist: access "
index 6e7d7ec1c5b8e1e42f227d37253cf8a831bac9dd..3ba189856a14dfc7a104208bc335f08b3b6581b3 100644 (file)
@@ -93,14 +93,14 @@ modify_add_values(
                        assert( a->a_vals[0].bv_val );
                        for ( j = 0; !BER_BVISNULL( &a->a_vals[j] ); j++ ) {
                                if ( mod->sm_nvalues ) {
-                                       rc = value_match( &match, mod->sm_desc, mr,
+                                       rc = ordered_value_match( &match, mod->sm_desc, mr,
                                                SLAP_MR_EQUALITY | SLAP_MR_VALUE_OF_ASSERTION_SYNTAX
                                                        | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
                                                        | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
                                                &a->a_nvals[j], &mod->sm_nvalues[i], text );
                                } else {
-                                       rc = value_match( &match, mod->sm_desc, mr,
-                                               SLAP_MR_EQUALITY | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
+                                       rc = ordered_value_match( &match, mod->sm_desc, mr,
+                                               SLAP_MR_EQUALITY | SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
                                                &a->a_vals[j], &mod->sm_values[i], text );
                                }
 
@@ -143,7 +143,12 @@ modify_add_values(
        }
 
        /* no - add them */
-       rc = attr_merge( e, mod->sm_desc, pmod.sm_values, pmod.sm_nvalues );
+       if ( mod->sm_desc->ad_type->sat_flags & SLAP_AT_ORDERED_VAL ) {
+               rc = ordered_value_add( e, mod->sm_desc, a,
+                       pmod.sm_values, pmod.sm_nvalues );
+       } else {
+               rc = attr_merge( e, mod->sm_desc, pmod.sm_values, pmod.sm_nvalues );
+       }
 
        if ( a != NULL && permissive ) {
                ch_free( pmod.sm_values );
@@ -164,11 +169,23 @@ modify_add_values(
 
 int
 modify_delete_values(
+       Entry   *e,
+       Modification    *m,
+       int     perm,
+       const char      **text,
+       char *textbuf, size_t textlen )
+{
+       return modify_delete_vindex( e, m, perm, text, textbuf, textlen, NULL );
+}
+
+int
+modify_delete_vindex(
        Entry   *e,
        Modification    *mod,
        int     permissive,
        const char      **text,
-       char *textbuf, size_t textlen )
+       char *textbuf, size_t textlen,
+       int *idx )
 {
        int             i, j, k, rc = LDAP_SUCCESS;
        Attribute       *a;
@@ -229,22 +246,18 @@ modify_delete_values(
 
                        if( mod->sm_nvalues ) {
                                assert( a->a_nvals );
-                               rc = (*mr->smr_match)( &match,
-                                       SLAP_MR_VALUE_OF_ASSERTION_SYNTAX
+                               rc = ordered_value_match( &match, a->a_desc, mr,
+                                       SLAP_MR_EQUALITY | SLAP_MR_VALUE_OF_ASSERTION_SYNTAX
                                                | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
                                                | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
-                                       a->a_desc->ad_type->sat_syntax,
-                                       mr, &a->a_nvals[j],
-                                       &mod->sm_nvalues[i] );
+                                       &a->a_nvals[j], &mod->sm_nvalues[i], text );
                        } else {
 #if 0
                                assert( a->a_nvals == NULL );
 #endif
-                               rc = (*mr->smr_match)( &match,
-                                       SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
-                                       a->a_desc->ad_type->sat_syntax,
-                                       mr, &a->a_vals[j],
-                                       &mod->sm_values[i] );
+                               rc = ordered_value_match( &match, a->a_desc, mr,
+                                       SLAP_MR_EQUALITY | SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
+                                       &a->a_vals[j], &mod->sm_values[i], text );
                        }
 
                        if ( rc != LDAP_SUCCESS ) {
@@ -261,6 +274,9 @@ modify_delete_values(
 
                        found = 1;
 
+                       if ( idx )
+                               idx[i] = j;
+
                        /* delete value and mark it as dummy */
                        free( a->a_vals[j].bv_val );
                        a->a_vals[j].bv_val = &dummy;
@@ -290,7 +306,7 @@ modify_delete_values(
        for ( k = 0, j = 0; !BER_BVISNULL( &a->a_vals[k] ); k++ ) {
                /* skip dummies */
                if( a->a_vals[k].bv_val == &dummy ) {
-                       assert( a->a_nvals == NULL || a->a_nvals[k].bv_val == &dummy );
+                       assert( a->a_nvals[k].bv_val == &dummy );
                        continue;
                }
                if ( j != k ) {
@@ -317,6 +333,9 @@ modify_delete_values(
                                mod->sm_desc->ad_cname.bv_val );
                        rc = LDAP_NO_SUCH_ATTRIBUTE;
                }
+       } else if ( a->a_desc->ad_type->sat_flags & SLAP_AT_ORDERED_VAL ) {
+       /* For an ordered attribute, renumber the value indices */
+               ordered_value_sort( a, 1 );
        }
 
 return_results:;
index 4afb1e17514476afc4b7b5725ceeb8b713c2af86..cd381f1bf3443d3c69845924aa0cbfc8a32b2e17 100644 (file)
@@ -120,8 +120,8 @@ struct oindexrec {
 
 static Avlnode *oc_index = NULL;
 static Avlnode *oc_cache = NULL;
-static LDAP_SLIST_HEAD(OCList, slap_object_class) oc_list
-       = LDAP_SLIST_HEAD_INITIALIZER(&oc_list);
+static LDAP_STAILQ_HEAD(OCList, slap_object_class) oc_list
+       = LDAP_STAILQ_HEAD_INITIALIZER(oc_list);
 
 static int
 oc_index_cmp(
@@ -179,8 +179,8 @@ oc_bvfind( struct berval *ocname )
        return( NULL );
 }
 
-static LDAP_SLIST_HEAD(OCUList, slap_object_class) oc_undef_list
-       = LDAP_SLIST_HEAD_INITIALIZER(&oc_undef_list);
+static LDAP_STAILQ_HEAD(OCUList, slap_object_class) oc_undef_list
+       = LDAP_STAILQ_HEAD_INITIALIZER(oc_undef_list);
 
 ObjectClass *
 oc_bvfind_undef( struct berval *ocname )
@@ -191,7 +191,7 @@ oc_bvfind_undef( struct berval *ocname )
                return oc;
        }
 
-       LDAP_SLIST_FOREACH( oc, &oc_undef_list, soc_next ) {
+       LDAP_STAILQ_FOREACH( oc, &oc_undef_list, soc_next ) {
                int     d = oc->soc_cname.bv_len - ocname->bv_len;
 
                if ( d ) {
@@ -214,8 +214,8 @@ oc_bvfind_undef( struct berval *ocname )
        oc->soc_cname.bv_val = (char *)&oc[ 1 ];
        AC_MEMCPY( oc->soc_cname.bv_val, ocname->bv_val, ocname->bv_len );
 
-       LDAP_SLIST_NEXT( oc, soc_next ) = NULL;
-       LDAP_SLIST_INSERT_HEAD( &oc_undef_list, oc, soc_next );
+       LDAP_STAILQ_NEXT( oc, soc_next ) = NULL;
+       LDAP_STAILQ_INSERT_HEAD( &oc_undef_list, oc, soc_next );
 
        return oc;
 }
@@ -378,9 +378,9 @@ oc_destroy( void )
        ObjectClass *o;
 
        avl_free(oc_index, ldap_memfree);
-       while( !LDAP_SLIST_EMPTY(&oc_list) ) {
-               o = LDAP_SLIST_FIRST(&oc_list);
-               LDAP_SLIST_REMOVE_HEAD(&oc_list, soc_next);
+       while( !LDAP_STAILQ_EMPTY(&oc_list) ) {
+               o = LDAP_STAILQ_FIRST(&oc_list);
+               LDAP_STAILQ_REMOVE_HEAD(&oc_list, soc_next);
 
                if (o->soc_sups) ldap_memfree(o->soc_sups);
                if (o->soc_required) ldap_memfree(o->soc_required);
@@ -388,14 +388,65 @@ oc_destroy( void )
                ldap_objectclass_free((LDAPObjectClass *)o);
        }
        
-       while( !LDAP_SLIST_EMPTY(&oc_undef_list) ) {
-               o = LDAP_SLIST_FIRST(&oc_undef_list);
-               LDAP_SLIST_REMOVE_HEAD(&oc_undef_list, soc_next);
+       while( !LDAP_STAILQ_EMPTY(&oc_undef_list) ) {
+               o = LDAP_STAILQ_FIRST(&oc_undef_list);
+               LDAP_STAILQ_REMOVE_HEAD(&oc_undef_list, soc_next);
 
                ch_free( (ObjectClass *)o );
        }
 }
 
+/*
+ * check whether the two ObjectClasses actually __are__ identical,
+ * or rather inconsistent
+ */
+static int
+oc_check_dup(
+       ObjectClass     *soc,
+       ObjectClass     *new_soc )
+{
+       if ( new_soc->soc_oid != NULL ) {
+               if ( soc->soc_oid == NULL ) {
+                       return SLAP_SCHERR_CLASS_INCONSISTENT;
+               }
+
+               if ( strcmp( soc->soc_oid, new_soc->soc_oid ) != 0 ) {
+                       return SLAP_SCHERR_CLASS_INCONSISTENT;
+               }
+
+       } else {
+               if ( soc->soc_oid != NULL ) {
+                       return SLAP_SCHERR_CLASS_INCONSISTENT;
+               }
+       }
+
+       if ( new_soc->soc_names ) {
+               int     i;
+
+               if ( soc->soc_names == NULL ) {
+                       return SLAP_SCHERR_CLASS_INCONSISTENT;
+               }
+
+               for ( i = 0; new_soc->soc_names[ i ]; i++ ) {
+                       if ( soc->soc_names[ i ] == NULL ) {
+                               return SLAP_SCHERR_CLASS_INCONSISTENT;
+                       }
+                       
+                       if ( strcasecmp( soc->soc_names[ i ],
+                                       new_soc->soc_names[ i ] ) != 0 )
+                       {
+                               return SLAP_SCHERR_CLASS_INCONSISTENT;
+                       }
+               }
+       } else {
+               if ( soc->soc_names != NULL ) {
+                       return SLAP_SCHERR_CLASS_INCONSISTENT;
+               }
+       }
+
+       return SLAP_SCHERR_CLASS_DUP;
+}
+
 static int
 oc_insert(
     ObjectClass                *soc,
@@ -404,9 +455,6 @@ oc_insert(
        struct oindexrec        *oir;
        char                    **names;
 
-       LDAP_SLIST_NEXT( soc, soc_next ) = NULL;
-       LDAP_SLIST_INSERT_HEAD( &oc_list, soc, soc_next );
-
        if ( soc->soc_oid ) {
                oir = (struct oindexrec *)
                        ch_calloc( 1, sizeof(struct oindexrec) );
@@ -420,13 +468,21 @@ oc_insert(
                if ( avl_insert( &oc_index, (caddr_t) oir,
                        oc_index_cmp, avl_dup_error ) )
                {
+                       ObjectClass     *old_soc;
+                       int             rc;
+
                        *err = soc->soc_oid;
-                       ldap_memfree(oir);
-                       return SLAP_SCHERR_CLASS_DUP;
+
+                       old_soc = oc_bvfind( &oir->oir_name );
+                       assert( old_soc != NULL );
+                       rc = oc_check_dup( old_soc, soc );
+
+                       ldap_memfree( oir );
+                       return rc;
                }
 
                /* FIX: temporal consistency check */
-               assert( oc_bvfind(&oir->oir_name) != NULL );
+               assert( oc_bvfind( &oir->oir_name ) != NULL );
        }
 
        if ( (names = soc->soc_names) ) {
@@ -443,9 +499,17 @@ oc_insert(
                        if ( avl_insert( &oc_index, (caddr_t) oir,
                                oc_index_cmp, avl_dup_error ) )
                        {
+                               ObjectClass     *old_soc;
+                               int             rc;
+
                                *err = *names;
-                               ldap_memfree(oir);
-                               return SLAP_SCHERR_CLASS_DUP;
+
+                               old_soc = oc_bvfind( &oir->oir_name );
+                               assert( old_soc != NULL );
+                               rc = oc_check_dup( old_soc, soc );
+
+                               ldap_memfree( oir );
+                               return rc;
                        }
 
                        /* FIX: temporal consistency check */
@@ -454,6 +518,7 @@ oc_insert(
                        names++;
                }
        }
+       LDAP_STAILQ_INSERT_TAIL( &oc_list, soc, soc_next );
 
        return 0;
 }
@@ -462,11 +527,13 @@ int
 oc_add(
     LDAPObjectClass    *oc,
        int user,
+       ObjectClass             **rsoc,
     const char         **err )
 {
        ObjectClass     *soc;
        int             code;
        int             op = 0;
+       char    *oidm = NULL;
 
        if ( oc->oc_names != NULL ) {
                int i;
@@ -486,7 +553,7 @@ oc_add(
                        return SLAP_SCHERR_OIDM;
                }
                if ( oid != oc->oc_oid ) {
-                       ldap_memfree( oc->oc_oid );
+                       oidm = oc->oc_oid;
                        oc->oc_oid = oid;
                }
        }
@@ -494,6 +561,7 @@ oc_add(
        soc = (ObjectClass *) ch_calloc( 1, sizeof(ObjectClass) );
        AC_MEMCPY( &soc->soc_oclass, oc, sizeof(LDAPObjectClass) );
 
+       soc->soc_oidmacro = oidm;
        if( oc->oc_names != NULL ) {
                soc->soc_cname.bv_val = soc->soc_names[0];
        } else {
@@ -522,10 +590,71 @@ oc_add(
 
        if( user && op ) return SLAP_SCHERR_CLASS_BAD_USAGE;
 
+       if( !user ) soc->soc_flags |= SLAP_OC_HARDCODE;
+
        code = oc_insert(soc,err);
+       if ( code == 0 && rsoc )
+               *rsoc = soc;
        return code;
 }
 
+void
+oc_unparse( BerVarray *res, ObjectClass *start, ObjectClass *end, int sys )
+{
+       ObjectClass *oc;
+       int i, num;
+       struct berval bv, *bva = NULL, idx;
+       char ibuf[32], *ptr;
+
+       if ( !start )
+               start = LDAP_STAILQ_FIRST( &oc_list );
+
+       /* count the result size */
+       i = 0;
+       for ( oc=start; oc; oc=LDAP_STAILQ_NEXT(oc, soc_next)) {
+               if ( sys && !(oc->soc_flags & SLAP_OC_HARDCODE)) continue;
+               i++;
+               if ( oc == end ) break;
+       }
+       if (!i) return;
+
+       num = i;
+       bva = ch_malloc( (num+1) * sizeof(struct berval) );
+       BER_BVZERO( bva );
+       idx.bv_val = ibuf;
+       if ( sys ) {
+               idx.bv_len = 0;
+               ibuf[0] = '\0';
+       }
+       i = 0;
+       for ( oc=start; oc; oc=LDAP_STAILQ_NEXT(oc, soc_next)) {
+               LDAPObjectClass loc, *locp;
+               if ( sys && !(oc->soc_flags & SLAP_OC_HARDCODE)) continue;
+               if ( oc->soc_oidmacro ) {
+                       loc = oc->soc_oclass;
+                       loc.oc_oid = oc->soc_oidmacro;
+                       locp = &loc;
+               } else {
+                       locp = &oc->soc_oclass;
+               }
+               if ( ldap_objectclass2bv( locp, &bv ) == NULL ) {
+                       ber_bvarray_free( bva );
+               }
+               if ( !sys ) {
+                       idx.bv_len = sprintf(idx.bv_val, "{%d}", i);
+               }
+               bva[i].bv_len = idx.bv_len + bv.bv_len;
+               bva[i].bv_val = ch_malloc( bva[i].bv_len + 1 );
+               strcpy( bva[i].bv_val, ibuf );
+               strcpy( bva[i].bv_val + idx.bv_len, bv.bv_val );
+               i++;
+               bva[i].bv_val = NULL;
+               ldap_memfree( bv.bv_val );
+               if ( oc == end ) break;
+       }
+       *res = bva;
+}
+
 int
 oc_schema_info( Entry *e )
 {
@@ -534,7 +663,7 @@ oc_schema_info( Entry *e )
        struct berval   val;
        struct berval   nval;
 
-       LDAP_SLIST_FOREACH( oc, &oc_list, soc_next ) {
+       LDAP_STAILQ_FOREACH( oc, &oc_list, soc_next ) {
                if( oc->soc_flags & SLAP_OC_HIDE ) continue;
 
                if ( ldap_objectclass2bv( &oc->soc_oclass, &val ) == NULL ) {
index 6a2e62c0780acf4addf685fffad151cc8af9ef81..25407644a495490c64e336492fde6bf2b787ec55 100644 (file)
@@ -25,8 +25,8 @@
 #include "slap.h"
 #include "lutil.h"
 
-static LDAP_SLIST_HEAD(OidMacroList, slap_oid_macro) om_list
-       = LDAP_SLIST_HEAD_INITIALIZER(om_list);
+static LDAP_STAILQ_HEAD(OidMacroList, slap_oid_macro) om_list
+       = LDAP_STAILQ_HEAD_INITIALIZER(om_list);
 
 /* Replace an OID Macro invocation with its full numeric OID.
  * If the macro is used with "macroname:suffix" append ".suffix"
@@ -42,7 +42,7 @@ oidm_find(char *oid)
                return oid;
        }
 
-       LDAP_SLIST_FOREACH( om, &om_list, som_next ) {
+       LDAP_STAILQ_FOREACH( om, &om_list, som_next ) {
                BerVarray names = om->som_names;
 
                if( names == NULL ) {
@@ -78,9 +78,9 @@ void
 oidm_destroy()
 {
        OidMacro *om;
-       while( !LDAP_SLIST_EMPTY( &om_list )) {
-               om = LDAP_SLIST_FIRST( &om_list );
-               LDAP_SLIST_REMOVE_HEAD( &om_list, som_next );
+       while( !LDAP_STAILQ_EMPTY( &om_list )) {
+               om = LDAP_STAILQ_FIRST( &om_list );
+               LDAP_STAILQ_REMOVE_HEAD( &om_list, som_next );
 
                ber_bvarray_free(om->som_names);
                ber_bvarray_free(om->som_subs);
@@ -95,7 +95,9 @@ parse_oidm(
     const char *fname,
     int                lineno,
     int                argc,
-    char       **argv )
+    char       **argv,
+       int             user,
+       OidMacro **rom)
 {
        char *oid;
        OidMacro *om;
@@ -123,7 +125,6 @@ usage:      fprintf( stderr, "\tObjectIdentifier <name> <oid>\n");
                return 1;
        }
 
-       LDAP_SLIST_NEXT( om, som_next ) = NULL;
        om->som_names = NULL;
        om->som_subs = NULL;
        ber_str2bv( argv[1], 0, 1, &bv );
@@ -143,41 +144,58 @@ usage:    fprintf( stderr, "\tObjectIdentifier <name> <oid>\n");
        }
 
        om->som_oid.bv_len = strlen( om->som_oid.bv_val );
+       if ( !user )
+               om->som_flags |= SLAP_OM_HARDCODE;
 
-       LDAP_SLIST_INSERT_HEAD( &om_list, om, som_next );
+       LDAP_STAILQ_INSERT_TAIL( &om_list, om, som_next );
+       if ( rom ) *rom = om;
        return 0;
 }
 
-void oidm_unparse( BerVarray *res )
+void oidm_unparse( BerVarray *res, OidMacro *start, OidMacro *end, int sys )
 {
        OidMacro *om;
        int i, j, num;
        struct berval bv, *bva = NULL, idx;
        char ibuf[32], *ptr;
 
+       if ( !start )
+               start = LDAP_STAILQ_FIRST( &om_list );
+
        /* count the result size */
        i = 0;
-       LDAP_SLIST_FOREACH( om, &om_list, som_next ) {
+       for ( om=start; om; om=LDAP_STAILQ_NEXT(om, som_next)) {
+               if ( sys && !(om->som_flags & SLAP_OM_HARDCODE)) continue;
                for ( j=0; !BER_BVISNULL(&om->som_names[j]); j++ );
                i += j;
+               if ( om == end ) break;
        }
        num = i;
+       if (!i) return;
+
        bva = ch_malloc( (num+1) * sizeof(struct berval) );
        BER_BVZERO( bva+num );
        idx.bv_val = ibuf;
-       LDAP_SLIST_FOREACH( om, &om_list, som_next ) {
-               for ( j=0; !BER_BVISNULL(&om->som_names[j]); j++ );
-               for ( i=num-j, j=0; i<num; i++,j++ ) {
-                       idx.bv_len = sprintf(idx.bv_val, "{%d}", i );
+       if ( sys ) {
+               idx.bv_len = 0;
+               ibuf[0] = '\0';
+       }
+       for ( i=0,om=start; om; om=LDAP_STAILQ_NEXT(om, som_next)) {
+               if ( sys && !(om->som_flags & SLAP_OM_HARDCODE)) continue;
+               for ( j=0; !BER_BVISNULL(&om->som_names[j]); i++,j++ ) {
+                       if ( !sys ) {
+                               idx.bv_len = sprintf(idx.bv_val, "{%d}", i );
+                       }
                        bva[i].bv_len = idx.bv_len + om->som_names[j].bv_len +
                                om->som_subs[j].bv_len + 1;
                        bva[i].bv_val = ch_malloc( bva[i].bv_len + 1 );
                        ptr = lutil_strcopy( bva[i].bv_val, ibuf );
                        ptr = lutil_strcopy( ptr, om->som_names[j].bv_val );
                        *ptr++ = ' ';
-                       ptr = lutil_strcopy( ptr, om->som_subs[j].bv_val );
+                       strcpy( ptr, om->som_subs[j].bv_val );
                }
-               num -= j;
+               if ( i>=num ) break;
+               if ( om == end ) break;
        }
        *res = bva;
 }
index e65fd4d7ad9c5e3dd3411d26128e7ce6cdf23077..4946c772fd2986676a0aa633b99c883ff2995100 100644 (file)
@@ -68,13 +68,13 @@ slap_op_free( Operation *op )
        if ( op->o_ber != NULL ) {
                ber_free( op->o_ber, 1 );
        }
-       if ( op->o_dn.bv_val != NULL ) {
+       if ( !BER_BVISNULL( &op->o_dn ) ) {
                free( op->o_dn.bv_val );
        }
-       if ( op->o_ndn.bv_val != NULL ) {
+       if ( !BER_BVISNULL( &op->o_ndn ) ) {
                free( op->o_ndn.bv_val );
        }
-       if ( op->o_authmech.bv_val != NULL ) {
+       if ( !BER_BVISNULL( &op->o_authmech ) ) {
                free( op->o_authmech.bv_val );
        }
        if ( op->o_ctrls != NULL ) {
@@ -89,9 +89,9 @@ slap_op_free( Operation *op )
 
        {
                GroupAssertion *g, *n;
-               for (g = op->o_groups; g; g=n) {
+               for ( g = op->o_groups; g; g = n ) {
                        n = g->ga_next;
-                       slap_sl_free(g, op->o_tmpmemctx);
+                       slap_sl_free( g, op->o_tmpmemctx );
                }
                op->o_groups = NULL;
        }
index f938076f0c5f3de69abb341473209ade25cc4168..44372f596e23fd070c1d58956697c02426f70467 100644 (file)
@@ -53,18 +53,20 @@ slap_operational_entryDN( Entry *e )
 {
        Attribute       *a;
 
+       assert( e );
+       assert( !BER_BVISNULL( &e->e_name ) );
+       assert( !BER_BVISNULL( &e->e_nname ) );
+
        a = ch_malloc( sizeof( Attribute ) );
        a->a_desc = slap_schema.si_ad_entryDN;
 
        a->a_vals = ch_malloc( 2 * sizeof( struct berval ) );
-       ber_dupbv( a->a_vals, &e->e_name );
-       a->a_vals[1].bv_len = 0;
-       a->a_vals[1].bv_val = NULL;
+       ber_dupbv( &a->a_vals[ 0 ], &e->e_name );
+       BER_BVZERO( &a->a_vals[ 1 ] );
 
        a->a_nvals = ch_malloc( 2 * sizeof( struct berval ) );
-       ber_dupbv( a->a_nvals, &e->e_nname );
-       a->a_nvals[1].bv_len = 0;
-       a->a_nvals[1].bv_val = NULL;
+       ber_dupbv( &a->a_nvals[ 0 ], &e->e_nname );
+       BER_BVZERO( &a->a_nvals[ 1 ] );
 
        a->a_next = NULL;
        a->a_flags = 0;
index 7abf065c22d0fe9ae03c175223596eb7baafb50b..04427e89ef1b41db9acb1d43414e4dfb87ecf4ac 100644 (file)
@@ -16,6 +16,7 @@
 SRCS = overlays.c \
        denyop.c \
        dyngroup.c \
+       dynlist.c \
        glue.c \
        lastmod.c \
        pcache.c \
@@ -28,6 +29,7 @@ SRCS = overlays.c \
 OBJS = overlays.lo \
        denyop.lo \
        dyngroup.lo \
+       dynlist.lo \
        glue.lo \
        lastmod.lo \
        pcache.lo \
@@ -59,6 +61,9 @@ denyop.la : denyop.lo $(@PLAT@_LINK_LIBS)
 dyngroup.la : dyngroup.lo $(@PLAT@_LINK_LIBS)
        $(LTLINK_MOD) -module -o $@ dyngroup.lo version.lo $(LINK_LIBS)
 
+dynlist.la : dynlist.lo $(@PLAT@_LINK_LIBS)
+       $(LTLINK_MOD) -module -o $@ dynlist.lo version.lo $(LINK_LIBS)
+
 glue.la : glue.lo $(@PLAT@_LINK_LIBS)
        $(LTLINK_MOD) -module -o $@ glue.lo version.lo $(LINK_LIBS)
 
@@ -69,7 +74,7 @@ pcache.la : pcache.lo $(@PLAT@_LINK_LIBS)
        $(LTLINK_MOD) -module -o $@ pcache.lo version.lo $(LINK_LIBS)
 
 ppolicy.la : ppolicy.lo $(@PLAT@_LINK_LIBS)
-       $(LTLINK_MOD) -module -o $@ ppolicy.lo version.lo $(LINK_LIBS)
+       $(LTLINK_MOD) -module -o $@ ppolicy.lo version.lo $(LINK_LIBS) $(MODULES_LIBS)
 
 refint.la : refint.lo $(@PLAT@_LINK_LIBS)
        $(LTLINK_MOD) -module -o $@ refint.lo version.lo $(LINK_LIBS)
diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c
new file mode 100644 (file)
index 0000000..4fd1ff0
--- /dev/null
@@ -0,0 +1,765 @@
+/* dynlist.c - dynamic list overlay */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2003-2005 The OpenLDAP Foundation.
+ * Portions Copyright 2004-2005 Pierangelo Masarati.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Pierangelo Masarati
+ * for SysNet s.n.c., for inclusion in OpenLDAP Software.
+ */
+
+#include "portable.h"
+
+#ifdef SLAPD_OVER_DYNLIST
+
+#include <stdio.h>
+
+#include <ac/string.h>
+
+#include "slap.h"
+#include "lutil.h"
+
+/* FIXME: the code differs if SLAP_OPATTRS is defined or not;
+ * SLAP_OPATTRS is not defined in 2.2 yet, while this overlay
+ * expects HEAD code at least later than August 6, 2004. */
+/* FIXME: slap_anlist_no_attrs was introduced in 2.3; here it
+ * is anticipated to allow using this overlay with 2.2. */
+
+#if LDAP_VENDOR_VERSION_MINOR != X && LDAP_VENDOR_VERSION_MINOR < 3
+static AttributeName anlist_no_attrs[] = {
+       { BER_BVC( LDAP_NO_ATTRS ), NULL, 0, NULL },
+       { BER_BVNULL, NULL, 0, NULL }
+};
+
+static AttributeName *slap_anlist_no_attrs = anlist_no_attrs;
+#endif
+
+typedef struct dynlist_info {
+       ObjectClass             *dli_oc;
+       AttributeDescription    *dli_ad;
+       AttributeDescription    *dli_member_ad;
+       struct berval           dli_default_filter;
+} dynlist_info;
+
+static int
+dynlist_is_dynlist( Operation *op, SlapReply *rs )
+{
+       slap_overinst   *on = (slap_overinst *)op->o_bd->bd_info;
+       dynlist_info    *dli = (dynlist_info *)on->on_bi.bi_private;
+
+       Attribute       *a;
+
+       a = attrs_find( rs->sr_entry->e_attrs, slap_schema.si_ad_objectClass );
+       if ( a == NULL ) {
+               /* FIXME: objectClass must be present; for non-storage
+                * backends, like back-ldap, it needs to be added
+                * to the requested attributes */
+               return 0;
+       }
+
+       if ( value_find_ex( slap_schema.si_ad_objectClass, 
+                       SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
+                       SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
+                       a->a_nvals, &dli->dli_oc->soc_cname,
+                       op->o_tmpmemctx ) == 0 )
+       {
+               return 1;
+       }
+
+       return 0;
+}
+
+static int
+dynlist_make_filter( Operation *op, struct berval *oldf, struct berval *newf )
+{
+       slap_overinst   *on = (slap_overinst *)op->o_bd->bd_info;
+       dynlist_info    *dli = (dynlist_info *)on->on_bi.bi_private;
+
+       char            *ptr;
+
+       assert( oldf );
+       assert( newf );
+       assert( !BER_BVISNULL( oldf ) );
+       assert( !BER_BVISEMPTY( oldf ) );
+
+       newf->bv_len = STRLENOF( "(&(!(objectClass=" "))" ")" )
+               + dli->dli_oc->soc_cname.bv_len + oldf->bv_len;
+       newf->bv_val = op->o_tmpalloc( newf->bv_len + 1, op->o_tmpmemctx );
+       if ( newf->bv_val == NULL ) {
+               return -1;
+       }
+       ptr = lutil_strcopy( newf->bv_val, "(&(!(objectClass=" );
+       ptr = lutil_strcopy( ptr, dli->dli_oc->soc_cname.bv_val );
+       ptr = lutil_strcopy( ptr, "))" );
+       ptr = lutil_strcopy( ptr, oldf->bv_val );
+       ptr = lutil_strcopy( ptr, ")" );
+       newf->bv_len = ptr - newf->bv_val;
+
+       return 0;
+}
+
+typedef struct dynlist_sc_t {
+       dynlist_info    *dlc_dli;
+       Entry           *dlc_e;
+} dynlist_sc_t;
+
+static int
+dynlist_sc_update( Operation *op, SlapReply *rs )
+{
+       Entry                   *e;
+       Attribute               *a;
+       int                     opattrs,
+                               userattrs;
+       AccessControlState      acl_state = ACL_STATE_INIT;
+
+       dynlist_sc_t            *dlc;
+
+       if ( rs->sr_type != REP_SEARCH ) {
+               return 0;
+       }
+
+       dlc = (dynlist_sc_t *)op->o_callback->sc_private;
+       e = dlc->dlc_e;
+
+       assert( e != NULL );
+       assert( rs->sr_entry != NULL );
+
+       /* test access to entry */
+       if ( !access_allowed( op, rs->sr_entry, slap_schema.si_ad_entry,
+                               NULL, ACL_READ, NULL ) )
+       {
+               goto done;
+       }
+
+       if ( dlc->dlc_dli->dli_member_ad ) {
+
+               /* if access allowed, try to add values, emulating permissive
+                * control to silently ignore duplicates */
+               if ( access_allowed( op, rs->sr_entry, slap_schema.si_ad_entry,
+                                       NULL, ACL_READ, NULL ) )
+               {
+                       Modification    mod;
+                       const char      *text = NULL;
+                       char            textbuf[1024];
+                       struct berval   vals[ 2 ], nvals[ 2 ];
+
+                       vals[ 0 ] = rs->sr_entry->e_name;
+                       BER_BVZERO( &vals[ 1 ] );
+                       nvals[ 0 ] = rs->sr_entry->e_nname;
+                       BER_BVZERO( &nvals[ 1 ] );
+
+                       mod.sm_op = LDAP_MOD_ADD;
+                       mod.sm_desc = dlc->dlc_dli->dli_member_ad;
+                       mod.sm_type = dlc->dlc_dli->dli_member_ad->ad_cname;
+                       mod.sm_values = vals;
+                       mod.sm_nvalues = nvals;
+
+                       (void)modify_add_values( e, &mod, /* permissive */ 1,
+                                       &text, textbuf, sizeof( textbuf ) );
+               }
+
+               goto done;
+       }
+
+#ifndef SLAP_OPATTRS
+       opattrs = ( rs->sr_attrs == NULL ) ? 0 : an_find( rs->sr_attrs, &AllOper );
+       userattrs = ( rs->sr_attrs == NULL ) ? 1 : an_find( rs->sr_attrs, &AllUser );
+#else /* SLAP_OPATTRS */
+       opattrs = SLAP_OPATTRS( rs->sr_attr_flags );
+       userattrs = SLAP_USERATTRS( rs->sr_attr_flags );
+#endif /* SLAP_OPATTRS */
+
+       for ( a = rs->sr_entry->e_attrs; a != NULL; a = a->a_next ) {
+               BerVarray       vals, nvals = NULL;
+               int             i, j;
+
+               /* if attribute is not requested, skip it */
+               if ( rs->sr_attrs == NULL ) {
+                       if ( is_at_operational( a->a_desc->ad_type ) ) {
+                               continue;
+                       }
+
+               } else {
+                       if ( is_at_operational( a->a_desc->ad_type ) ) {
+                               if ( !opattrs && !ad_inlist( a->a_desc, rs->sr_attrs ) )
+                               {
+                                       continue;
+                               }
+
+                       } else {
+                               if ( !userattrs && !ad_inlist( a->a_desc, rs->sr_attrs ) )
+                               {
+                                       continue;
+                               }
+                       }
+               }
+
+               /* test access to attribute */
+               if ( op->ors_attrsonly ) {
+                       if ( !access_allowed( op, rs->sr_entry, a->a_desc, NULL,
+                                               ACL_READ, &acl_state ) )
+                       {
+                               continue;
+                       }
+               }
+
+               /* single-value check: keep first only */
+               if ( is_at_single_value( a->a_desc->ad_type ) ) {
+                       if ( attr_find( e->e_attrs, a->a_desc ) != NULL ) {
+                               continue;
+                       }
+               }
+
+               /* test access to attribute */
+               for ( i = 0; !BER_BVISNULL( &a->a_vals[i] ); i++ )
+                       /* just count */ ;
+
+               vals = op->o_tmpalloc( ( i + 1 ) * sizeof( struct berval ), op->o_tmpmemctx );
+               if ( a->a_nvals != a->a_vals ) {
+                       nvals = op->o_tmpalloc( ( i + 1 ) * sizeof( struct berval ), op->o_tmpmemctx );
+               }
+
+               for ( i = 0, j = 0; !BER_BVISNULL( &a->a_vals[i] ); i++ ) {
+                       if ( access_allowed( op, rs->sr_entry, a->a_desc,
+                                               &a->a_nvals[i], ACL_READ, &acl_state ) )
+                       {
+                               vals[j] = a->a_vals[i];
+                               if ( nvals ) {
+                                       nvals[j] = a->a_nvals[i];
+                               }
+                               j++;
+                       }
+               }
+
+               /* if access allowed, try to add values, emulating permissive
+                * control to silently ignore duplicates */
+               if ( j != 0 ) {
+                       Modification    mod;
+                       const char      *text = NULL;
+                       char            textbuf[1024];
+
+                       BER_BVZERO( &vals[j] );
+                       if ( nvals ) {
+                               BER_BVZERO( &nvals[j] );
+                       }
+
+                       mod.sm_op = LDAP_MOD_ADD;
+                       mod.sm_desc = a->a_desc;
+                       mod.sm_type = a->a_desc->ad_cname;
+                       mod.sm_values = vals;
+                       mod.sm_nvalues = nvals;
+
+                       (void)modify_add_values( e, &mod, /* permissive */ 1,
+                                       &text, textbuf, sizeof( textbuf ) );
+               }
+
+               op->o_tmpfree( vals, op->o_tmpmemctx );
+               if ( nvals ) {
+                       op->o_tmpfree( nvals, op->o_tmpmemctx );
+               }
+       }
+
+done:;
+       if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
+               entry_free( rs->sr_entry );
+       }
+
+       return 0;
+}
+       
+static int
+dynlist_send_entry( Operation *op, SlapReply *rs )
+{
+       slap_overinst   *on = (slap_overinst *)op->o_bd->bd_info;
+       dynlist_info    *dli = (dynlist_info *)on->on_bi.bi_private;
+
+       Attribute       *a;
+       slap_callback   cb;
+       Operation       o = *op;
+       SlapReply       r = { REP_SEARCH };
+       struct berval   *url;
+       Entry           *e;
+       int             e_flags;
+       int             opattrs,
+                       userattrs;
+       dynlist_sc_t    dlc = { 0 };
+
+       a = attrs_find( rs->sr_entry->e_attrs, dli->dli_ad );
+       if ( a == NULL ) {
+               /* FIXME: error? */
+               return SLAP_CB_CONTINUE;
+       }
+
+       e = entry_dup( rs->sr_entry );
+       e_flags = rs->sr_flags | ( REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED );
+
+       dlc.dlc_e = e;
+       dlc.dlc_dli = dli;
+       cb.sc_private = &dlc;
+       cb.sc_response = dynlist_sc_update;
+       cb.sc_cleanup = NULL;
+       cb.sc_next = NULL;
+
+       o.o_callback = &cb;
+       o.ors_deref = LDAP_DEREF_NEVER;
+       o.ors_limit = NULL;
+       o.ors_tlimit = SLAP_NO_LIMIT;
+       o.ors_slimit = SLAP_NO_LIMIT;
+
+#ifndef SLAP_OPATTRS
+       opattrs = ( rs->sr_attrs == NULL ) ? 0 : an_find( rs->sr_attrs, &AllOper );
+       userattrs = ( rs->sr_attrs == NULL ) ? 1 : an_find( rs->sr_attrs, &AllUser );
+#else /* SLAP_OPATTRS */
+       opattrs = SLAP_OPATTRS( rs->sr_attr_flags );
+       userattrs = SLAP_USERATTRS( rs->sr_attr_flags );
+#endif /* SLAP_OPATTRS */
+
+       for ( url = a->a_nvals; !BER_BVISNULL( url ); url++ ) {
+               LDAPURLDesc     *lud = NULL;
+               int             i, j;
+               struct berval   dn;
+               int             rc;
+
+               BER_BVZERO( &o.o_req_dn );
+               BER_BVZERO( &o.o_req_ndn );
+               o.ors_filter = NULL;
+               o.ors_attrs = NULL;
+               BER_BVZERO( &o.ors_filterstr );
+
+               if ( ldap_url_parse( url->bv_val, &lud ) != LDAP_URL_SUCCESS ) {
+                       /* FIXME: error? */
+                       continue;
+               }
+
+               if ( lud->lud_host ) {
+                       /* FIXME: host not allowed; reject as illegal? */
+                       Debug( LDAP_DEBUG_ANY, "dynlist_send_entry(\"%s\"): "
+                               "illegal URI \"%s\"\n",
+                               e->e_name.bv_val, url->bv_val, 0 );
+                       goto cleanup;
+               }
+
+               if ( lud->lud_dn == NULL ) {
+                       /* note that an empty base is not honored in terms
+                        * of defaultSearchBase, because select_backend()
+                        * is not aware of the defaultSearchBase option;
+                        * this can be useful in case of a database serving
+                        * the empty suffix */
+                       BER_BVSTR( &dn, "" );
+               } else {
+                       ber_str2bv( lud->lud_dn, 0, 0, &dn );
+               }
+               rc = dnPrettyNormal( NULL, &dn, &o.o_req_dn, &o.o_req_ndn, op->o_tmpmemctx );
+               if ( rc != LDAP_SUCCESS ) {
+                       /* FIXME: error? */
+                       goto cleanup;
+               }
+               o.ors_scope = lud->lud_scope;
+
+               if ( dli->dli_member_ad != NULL ) {
+                       o.ors_attrs = slap_anlist_no_attrs;
+
+               } else if ( lud->lud_attrs == NULL ) {
+                       o.ors_attrs = rs->sr_attrs;
+
+               } else {
+                       for ( i = 0; lud->lud_attrs[i]; i++)
+                               /* just count */ ;
+
+                       o.ors_attrs = op->o_tmpcalloc( i + 1, sizeof( AttributeName ), op->o_tmpmemctx );
+                       for ( i = 0, j = 0; lud->lud_attrs[i]; i++) {
+                               const char      *text = NULL;
+       
+                               ber_str2bv( lud->lud_attrs[i], 0, 0, &o.ors_attrs[j].an_name );
+                               o.ors_attrs[j].an_desc = NULL;
+                               (void)slap_bv2ad( &o.ors_attrs[j].an_name, &o.ors_attrs[j].an_desc, &text );
+                               /* FIXME: ignore errors... */
+
+                               if ( rs->sr_attrs == NULL ) {
+                                       if ( o.ors_attrs[j].an_desc != NULL &&
+                                                       is_at_operational( o.ors_attrs[j].an_desc->ad_type ) )
+                                       {
+                                               continue;
+                                       }
+
+                               } else {
+                                       if ( o.ors_attrs[j].an_desc != NULL &&
+                                                       is_at_operational( o.ors_attrs[j].an_desc->ad_type ) )
+                                       {
+                                               if ( !opattrs && !ad_inlist( o.ors_attrs[j].an_desc, rs->sr_attrs ) )
+                                               {
+                                                       continue;
+                                               }
+
+                                       } else {
+                                               if ( !userattrs && 
+                                                               o.ors_attrs[j].an_desc != NULL &&
+                                                               !ad_inlist( o.ors_attrs[j].an_desc, rs->sr_attrs ) )
+                                               {
+                                                       continue;
+                                               }
+                                       }
+                               }
+
+                               j++;
+                       }
+
+                       if ( j == 0 ) {
+                               goto cleanup;
+                       }
+               
+                       BER_BVZERO( &o.ors_attrs[j].an_name );
+               }
+
+               if ( lud->lud_filter == NULL ) {
+                       ber_dupbv_x( &o.ors_filterstr,
+                                       &dli->dli_default_filter, op->o_tmpmemctx );
+               } else {
+                       struct berval   flt;
+                       ber_str2bv( lud->lud_filter, 0, 0, &flt );
+                       if ( dynlist_make_filter( op, &flt, &o.ors_filterstr ) ) {
+                               /* error */
+                               goto cleanup;
+                       }
+               }
+               o.ors_filter = str2filter_x( op, o.ors_filterstr.bv_val );
+               if ( o.ors_filter == NULL ) {
+                       goto cleanup;
+               }
+               
+               o.o_bd = select_backend( &o.o_req_ndn, 0, 1 );
+               if ( o.o_bd && o.o_bd->be_search ) {
+#ifdef SLAP_OPATTRS
+                       r.sr_attr_flags = slap_attr_flags( o.ors_attrs );
+#endif /* SLAP_OPATTRS */
+                       (void)o.o_bd->be_search( &o, &r );
+               }
+
+cleanup:;
+               if ( o.ors_filter ) {
+                       filter_free_x( &o, o.ors_filter );
+               }
+               if ( o.ors_attrs && o.ors_attrs != rs->sr_attrs
+                               && o.ors_attrs != slap_anlist_no_attrs )
+               {
+                       op->o_tmpfree( o.ors_attrs, op->o_tmpmemctx );
+               }
+               if ( !BER_BVISNULL( &o.o_req_dn ) ) {
+                       op->o_tmpfree( o.o_req_dn.bv_val, op->o_tmpmemctx );
+               }
+               if ( !BER_BVISNULL( &o.o_req_ndn ) ) {
+                       op->o_tmpfree( o.o_req_ndn.bv_val, op->o_tmpmemctx );
+               }
+               if ( o.ors_filterstr.bv_val != lud->lud_filter ) {
+                       op->o_tmpfree( o.ors_filterstr.bv_val, op->o_tmpmemctx );
+                       lud->lud_filter = NULL;
+               }
+               if ( lud ) {
+                       ldap_free_urldesc( lud );
+               }
+       }
+
+       rs->sr_entry = e;
+       rs->sr_flags = e_flags;
+
+       return SLAP_CB_CONTINUE;
+}
+
+static int
+dynlist_sc_save_entry( Operation *op, SlapReply *rs )
+{
+       /* save the entry in the private field of the callback,
+        * so it doesn't get freed (it's temporary!) */
+       if ( rs->sr_entry != NULL ) {
+               dynlist_sc_t    *dlc = (dynlist_sc_t *)op->o_callback->sc_private;
+               dlc->dlc_e = rs->sr_entry;
+               rs->sr_entry = NULL;
+       }
+
+       return 0;
+}
+
+static int
+dynlist_compare( Operation *op, SlapReply *rs )
+{
+       slap_overinst   *on = (slap_overinst *)op->o_bd->bd_info;
+       dynlist_info    *dli = (dynlist_info *)on->on_bi.bi_private;
+
+       Attribute       *a;
+       slap_callback   cb;
+       Operation       o = *op;
+       SlapReply       r = { REP_SEARCH };
+       AttributeName   an[2];
+       int             rc;
+       dynlist_sc_t    dlc = { 0 };
+
+       dlc.dlc_dli = dli;
+       cb.sc_private = &dlc;
+       cb.sc_response = dynlist_sc_save_entry;
+       cb.sc_cleanup = NULL;
+       cb.sc_next = NULL;
+       o.o_callback = &cb;
+
+       o.o_tag = LDAP_REQ_SEARCH;
+       o.ors_limit = NULL;
+       o.ors_tlimit = SLAP_NO_LIMIT;
+       o.ors_slimit = SLAP_NO_LIMIT;
+
+       o.o_bd = select_backend( &o.o_req_ndn, 0, 1 );
+       if ( !o.o_bd || !o.o_bd->be_search ) {
+               return SLAP_CB_CONTINUE;
+       }
+
+       BER_BVSTR( &o.ors_filterstr, "(objectClass=*)" );
+       o.ors_filter = str2filter_x( op, o.ors_filterstr.bv_val );
+       if ( o.ors_filter == NULL ) {
+               /* FIXME: error? */
+               return SLAP_CB_CONTINUE;
+       }
+
+       o.ors_scope = LDAP_SCOPE_BASE;
+       o.ors_deref = LDAP_DEREF_NEVER;
+       an[0].an_name = op->orc_ava->aa_desc->ad_cname;
+       an[0].an_desc = op->orc_ava->aa_desc;
+       BER_BVZERO( &an[1].an_name );
+       o.ors_attrs = an;
+       o.ors_attrsonly = 0;
+
+       rc = o.o_bd->be_search( &o, &r );
+       filter_free_x( &o, o.ors_filter );
+
+       if ( rc != 0 ) {
+               return rc;
+       }
+
+       if ( dlc.dlc_e != NULL ) {
+               r.sr_entry = dlc.dlc_e;
+       }
+
+       if ( r.sr_err != LDAP_SUCCESS || r.sr_entry == NULL ) {
+               /* error? */
+               return SLAP_CB_CONTINUE;
+       }
+
+       /* if we're here, we got a match... */
+       rs->sr_err = LDAP_COMPARE_FALSE;
+       for ( a = attrs_find( r.sr_entry->e_attrs, op->orc_ava->aa_desc );
+               a != NULL;
+               a = attrs_find( a->a_next, op->orc_ava->aa_desc ) )
+       {
+               if ( value_find_ex( op->orc_ava->aa_desc,
+                       SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
+                               SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
+                       a->a_nvals, &op->orc_ava->aa_value, op->o_tmpmemctx ) == 0 )
+               {
+                       rs->sr_err = LDAP_COMPARE_TRUE;
+                       break;
+               }
+       }
+
+       if ( r.sr_flags & REP_ENTRY_MUSTBEFREED ) {
+               entry_free( r.sr_entry );
+       }
+
+       return SLAP_CB_CONTINUE;
+}
+
+static int
+dynlist_response( Operation *op, SlapReply *rs )
+{
+       switch ( op->o_tag ) {
+       case LDAP_REQ_SEARCH:
+               if ( rs->sr_type == REP_SEARCH && !get_manageDSAit( op ) )
+               {
+                       if ( dynlist_is_dynlist( op, rs ) ) {
+                               return dynlist_send_entry( op, rs );
+                       }
+               }
+               break;
+
+       case LDAP_REQ_COMPARE:
+               if ( rs->sr_err == LDAP_NO_SUCH_ATTRIBUTE ) {
+                       return dynlist_compare( op, rs );
+               }
+               break;
+
+       default:
+               break;
+       }
+
+       return SLAP_CB_CONTINUE;
+}
+
+static int
+dynlist_db_config(
+    BackendDB  *be,
+    const char *fname,
+    int                lineno,
+    int                argc,
+    char       **argv
+)
+{
+       slap_overinst   *on = (slap_overinst *)be->bd_info;
+       dynlist_info    *dli = (dynlist_info *)on->on_bi.bi_private;
+
+       int             rc = 0;
+
+       if ( strcasecmp( argv[0], "dynlist-oc" ) == 0 ) {
+               if ( argc != 2 ) {
+                       fprintf( stderr, "dynlist-oc <oc>\n" );
+                       return 1;
+               }
+               dli->dli_oc = oc_find( argv[1] );
+               if ( dli->dli_oc == NULL ) {
+                       fprintf( stderr, "dynlist-oc <oc>: "
+                                       "unable to find ObjectClass "
+                                       "\"%s\"\n", argv[1] );
+                       return 1;
+               }
+
+       } else if ( strcasecmp( argv[0], "dynlist-ad" ) == 0 ) {
+               const char      *text;
+
+               if ( argc != 2 ) {
+                       fprintf( stderr, "dynlist-ad <ad>\n" );
+                       return 1;
+               }
+               dli->dli_ad = NULL;
+               rc = slap_str2ad( argv[1], &dli->dli_ad, &text );
+               if ( rc != LDAP_SUCCESS ) {
+                       fprintf( stderr, "dynlist-ad <ad>: "
+                                       "unable to find AttributeDescription "
+                                       "\"%s\"\n", argv[1] );
+                       return 1;
+               }
+
+       } else if ( strcasecmp( argv[0], "dynlist-member-ad" ) == 0 ) {
+               const char      *text;
+
+               if ( argc != 2 ) {
+                       fprintf( stderr, "dynlist-member-ad <ad>\n" );
+                       return 1;
+               }
+               dli->dli_member_ad = NULL;
+               rc = slap_str2ad( argv[1], &dli->dli_member_ad, &text );
+               if ( rc != LDAP_SUCCESS ) {
+                       fprintf( stderr, "dynlist-member-ad <ad>: "
+                                       "unable to find AttributeDescription "
+                                       "\"%s\"\n", argv[1] );
+                       return 1;
+               }
+
+       } else {
+               rc = SLAP_CONF_UNKNOWN;
+       }
+
+       return rc;
+}
+
+static int
+dynlist_db_init(
+       BackendDB *be
+)
+{
+       slap_overinst   *on = (slap_overinst *) be->bd_info;
+       dynlist_info    *dli;
+
+       dli = (dynlist_info *)ch_malloc( sizeof( dynlist_info ) );
+       memset( dli, 0, sizeof( dynlist_info ) );
+
+       on->on_bi.bi_private = (void *)dli;
+
+       return 0;
+}
+
+static int
+dynlist_db_open(
+       BackendDB *be
+)
+{
+       slap_overinst   *on = (slap_overinst *) be->bd_info;
+       dynlist_info    *dli = (dynlist_info *)on->on_bi.bi_private;
+       int             rc = 0;
+       ber_len_t       len;
+       char            *ptr;
+
+       if ( dli->dli_oc == NULL ) {
+               fprintf( stderr, "dynlist_db_open(): missing \"dynlist-oc <ObjectClass>\"\n" );
+               rc = -1;
+       }
+
+       if ( dli->dli_ad == NULL ) {
+               fprintf( stderr, "dynlist_db_open(): missing \"dynlist-ad <AttributeDescription>\"\n" );
+               rc = -1;
+       }
+
+       len = STRLENOF( "(!(objectClass=" "))" )
+               + dli->dli_oc->soc_cname.bv_len;
+       dli->dli_default_filter.bv_val = SLAP_MALLOC( len + 1 );
+       if ( dli->dli_default_filter.bv_val == NULL ) {
+               fprintf( stderr, "dynlist_db_open(): malloc failed\n" );
+               return -1;
+       }
+       ptr = lutil_strcopy( dli->dli_default_filter.bv_val, "(!(objectClass=" );
+       ptr = lutil_strcopy( ptr, dli->dli_oc->soc_cname.bv_val );
+       ptr = lutil_strcopy( ptr, "))" );
+       dli->dli_default_filter.bv_len = ptr - dli->dli_default_filter.bv_val;
+
+       return rc;
+}
+
+static int
+dynlist_db_destroy(
+       BackendDB *be
+)
+{
+       slap_overinst   *on = (slap_overinst *) be->bd_info;
+       int             rc = 0;
+
+       if ( on->on_bi.bi_private ) {
+               dynlist_info    *dli = (dynlist_info *)on->on_bi.bi_private;
+
+               dli->dli_oc = NULL;
+               dli->dli_ad = NULL;
+
+               ch_free( dli );
+       }
+
+       return rc;
+}
+
+static slap_overinst dynlist = { { NULL } };
+
+int
+dynlist_init(void)
+{
+       dynlist.on_bi.bi_type = "dynlist";
+       dynlist.on_bi.bi_db_init = dynlist_db_init;
+       dynlist.on_bi.bi_db_config = dynlist_db_config;
+       dynlist.on_bi.bi_db_open = dynlist_db_open;
+       dynlist.on_bi.bi_db_destroy = dynlist_db_destroy;
+
+       dynlist.on_response = dynlist_response;
+
+       return overlay_register( &dynlist );
+}
+
+#if SLAPD_OVER_DYNLIST == SLAPD_MOD_DYNAMIC
+int
+init_module( int argc, char *argv[] )
+{
+       return dynlist_init();
+}
+#endif
+
+#endif /* SLAPD_OVER_DYNLIST */
index 13da05a95285a622f527564a209c6d1a5b6f5dab..965a1e9895c3e7b7f687b040dfd164607f72ac28 100644 (file)
@@ -40,7 +40,6 @@
 
 typedef struct gluenode {
        BackendDB *gn_be;
-       int     gn_bx;
        struct berval gn_pdn;
        int gn_async;
 } gluenode;
@@ -481,7 +480,7 @@ glue_open (
        slap_overinst *on = glue_tool_inst( bi );
        glueinfo                *gi = on->on_bi.bi_private;
        static int glueOpened = 0;
-       int i, rc = 0;
+       int i, j, same, bsame = 0, rc = 0;
 
        if (glueOpened) return 0;
 
@@ -489,7 +488,34 @@ glue_open (
 
        /* If we were invoked in tool mode, open all the underlying backends */
        if (slapMode & SLAP_TOOL_MODE) {
-               rc = backend_startup( NULL );
+               for (i = 0; i<gi->gi_nodes; i++) {
+                       same = 0;
+                       /* Same type as our main backend? */
+                       if ( gi->gi_n[i].gn_be->bd_info == on->on_info->oi_orig )
+                               bsame = 1;
+
+                       /* Loop thru the bd_info's and make sure we only
+                        * invoke their bi_open functions once each.
+                        */
+                       for ( j = 0; j<i; j++ ) {
+                               if ( gi->gi_n[i].gn_be->bd_info ==
+                                       gi->gi_n[j].gn_be->bd_info ) {
+                                       same = 1;
+                                       break;
+                               }
+                       }
+                       /* OK, it's unique and non-NULL, call it. */
+                       if ( !same && gi->gi_n[i].gn_be->bd_info->bi_open )
+                               rc = gi->gi_n[i].gn_be->bd_info->bi_open(
+                                       gi->gi_n[i].gn_be->bd_info );
+                       /* Let backend.c take care of the rest of startup */
+                       if ( !rc )
+                               rc = backend_startup_one( gi->gi_n[i].gn_be );
+                       if ( rc ) break;
+               }
+               if ( !rc && !bsame && on->on_info->oi_orig->bi_open )
+                       rc = on->on_info->oi_orig->bi_open( on->on_info->oi_orig );
+
        } /* other case is impossible */
        return rc;
 }
@@ -730,23 +756,6 @@ glue_db_destroy (
        return SLAP_CB_CONTINUE;
 }
 
-static int
-glue_db_open (
-       BackendDB *be
-)
-{
-       slap_overinst   *on = (slap_overinst *)be->bd_info;
-       glueinfo                *gi = (glueinfo *)on->on_bi.bi_private;
-       int i;
-
-       for ( i=0; i<gi->gi_nodes; i++ ) {
-               int j;
-
-               gi->gi_n[i].gn_be = backendDB + gi->gi_n[i].gn_bx;
-       }
-       return 0;
-}
-
 static int
 glue_db_close( 
        BackendDB *be
@@ -813,7 +822,7 @@ glue_db_config(
                }
                gi = (glueinfo *)ch_realloc( gi, sizeof(glueinfo) +
                        gi->gi_nodes * sizeof(gluenode));
-               gi->gi_n[gi->gi_nodes].gn_bx = b2 - backendDB;
+               gi->gi_n[gi->gi_nodes].gn_be = b2;
                dnParent( &b2->be_nsuffix[0], &gi->gi_n[gi->gi_nodes].gn_pdn );
                gi->gi_n[gi->gi_nodes].gn_async = async;
                gi->gi_nodes++;
@@ -830,7 +839,6 @@ glue_init()
 
        glue.on_bi.bi_db_init = glue_db_init;
        glue.on_bi.bi_db_config = glue_db_config;
-       glue.on_bi.bi_db_open = glue_db_open;
        glue.on_bi.bi_db_close = glue_db_close;
        glue.on_bi.bi_db_destroy = glue_db_destroy;
 
index 454239c0bcf63d8f7f01fed73e4247aad03dd1cd..a645f7d8b49eb425bf22cdc6d7e69a6e21d5b120 100644 (file)
@@ -781,7 +781,7 @@ lastmod_db_init(
                                return -1;
                        }
        
-                       code = at_add(at, &err);
+                       code = at_add(at, 0, NULL, &err);
                        if ( code ) {
                                Debug( LDAP_DEBUG_ANY, "lastmod_init: "
                                        "%s in attributeType '%s'\n",
@@ -824,7 +824,7 @@ lastmod_db_init(
                                return -1;
                        }
 
-                       code = oc_add(oc, 0, &err);
+                       code = oc_add(oc, 0, NULL, &err);
                        if ( code ) {
                                Debug( LDAP_DEBUG_ANY,
                                        "objectClass '%s': %s \"%s\"\n" ,
index 8b1a19ec98c7d366b5fd9dfac732a325f54c90af..e83bf7a152ee396459a7125b01f4088e7a383fd8 100644 (file)
@@ -29,6 +29,9 @@ extern int denyop_init();
 #if SLAPD_OVER_DYNGROUP == SLAPD_MOD_STATIC
 extern int dyngroup_init();
 #endif
+#if SLAPD_OVER_DYNLIST == SLAPD_MOD_STATIC
+extern int dynlist_init();
+#endif
 #if SLAPD_OVER_GLUE == SLAPD_MOD_STATIC
 extern int glue_init();
 #endif
@@ -67,6 +70,9 @@ static struct {
 #if SLAPD_OVER_DYNGROUP == SLAPD_MOD_STATIC
        { "Dynamic Group", dyngroup_init },
 #endif
+#if SLAPD_OVER_DYNLIST == SLAPD_MOD_STATIC
+       { "Dynamic List", dynlist_init },
+#endif
 #if SLAPD_OVER_GLUE == SLAPD_MOD_STATIC
        { "Backend Glue", glue_init },
 #endif
index b078908da5f287bb588fa237c100b08c9eb055bd..8b9a479632e81a5037f90c367003648a312fdca8 100644 (file)
@@ -789,7 +789,11 @@ remove_query_data (
 {
        struct query_info       *qi, *qnext;
        char                    filter_str[64];
-       AttributeAssertion      ava;
+#ifdef LDAP_COMP_MATCH
+       AttributeAssertion      ava = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion      ava = { NULL, BER_BVNULL };
+#endif
        Filter                  filter = {LDAP_FILTER_EQUALITY};
        SlapReply               sreply = {REP_RESULT};
        slap_callback cb = { NULL, remove_func, NULL, NULL };
@@ -1499,18 +1503,19 @@ proxy_cache_config(
        AttributeName*  attr_name;
        AttributeName*  attrarray;
        const char*     text=NULL;
-       char            *save_argv0 = NULL;
+       char            *argv0 = NULL;
 
        int             index, i;
        int             num;
        int             rc = 0;
 
        if ( strncasecmp( argv[0], "proxycache-", STRLENOF( "proxycache-" ) ) == 0 ) {
-               save_argv0 = argv[0];
-               argv[0] += STRLENOF( "proxycache-" );
+               argv0 = argv[0] + STRLENOF( "proxycache-" );
+       } else {
+               argv0 = argv[0];
        }
 
-       if ( strcasecmp( argv[0], "proxycache" ) == 0 ) {
+       if ( strcasecmp( argv0, "proxycache" ) == 0 ) {
                if ( argc < 6 ) {
                        fprintf( stderr, "%s: line %d: missing arguments in \"proxycache"
                                " <backend> <max_entries> <numattrsets> <entry limit> "
@@ -1549,7 +1554,7 @@ proxy_cache_config(
                        qm->attr_sets[i].attrs = NULL;
                }
 
-       } else if ( strcasecmp( argv[0], "proxyattrset" ) == 0 ) {
+       } else if ( strcasecmp( argv0, "proxyattrset" ) == 0 ) {
                if ( argc < 3 ) {
                        fprintf( stderr, "%s: line %d: missing arguments in \"proxyattrset "
                                "<index> <attributes>\"\n", fname, lineno );
@@ -1581,7 +1586,7 @@ proxy_cache_config(
                                attr_name->an_name.bv_len = 0;
                        }
                }
-       } else if ( strcasecmp( argv[0], "proxytemplate" ) == 0 ) {
+       } else if ( strcasecmp( argv0, "proxytemplate" ) == 0 ) {
                if ( argc != 4 ) {
                        fprintf( stderr, "%s: line %d: missing argument(s) in "
                                "\"proxytemplate <filter> <proj attr set> <TTL>\" line\n",
@@ -1625,7 +1630,7 @@ proxy_cache_config(
                temp->querystr.bv_val = NULL;
                cm->numtemplates++;
 
-       } else if ( strcasecmp( argv[0], "response-callback" ) == 0 ) {
+       } else if ( strcasecmp( argv0, "response-callback" ) == 0 ) {
                /* set to "tail" to put the response callback
                 * at the end of the callback list; this is required
                 * in case other overlays are present, so that the
@@ -1656,10 +1661,6 @@ proxy_cache_config(
                rc = cm->db.bd_info->bi_db_config( &cm->db, fname, lineno, argc, argv );
        }
 
-       if ( save_argv0 ) {
-               argv[0] = save_argv0;
-       }
-
        return rc;
 }
 
@@ -1740,7 +1741,8 @@ proxy_cache_open(
        if ( slapMode & SLAP_SERVER_MODE ) {
                ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
                ldap_pvt_runqueue_insert( &slapd_rq, cm->cc_period,
-                       consistency_check, on );
+                       consistency_check, on,
+                       "pcache_consistency", be->be_suffix[0].bv_val );
                ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
 
                /* Cached database must have the rootdn */
@@ -1925,7 +1927,7 @@ int pcache_init()
                        ldap_scherr2str(code), err );
                return code;
        }
-       code = at_add( at, &err );
+       code = at_add( at, 0, NULL, &err );
        if ( !code ) {
                slap_str2ad( at->at_names[0], &ad_queryid, &err );
        }
index f572875fef781615c35a269607984e3babb6149f..322b2b1009711ce4a8129938384275b48abffa2f 100644 (file)
@@ -23,7 +23,7 @@
 #include "portable.h"
 
 /* This file implements "Password Policy for LDAP Directories",
- * based on draft behera-ldap-password-policy-07
+ * based on draft behera-ldap-password-policy-08
  */
 
 #ifdef SLAPD_OVER_PPOLICY
@@ -36,6 +36,7 @@
 #include "lutil.h"
 #include "slap.h"
 #if SLAPD_MODULES
+#define LIBLTDL_DLL_IMPORT     /* Win32: don't re-export libltdl's symbols */
 #include <ltdl.h>
 #endif
 #include <ac/errno.h>
@@ -74,7 +75,7 @@ typedef struct pass_policy {
        int pwdMinLength; /* minimum number of chars in password */
        int pwdExpireWarning; /* number of seconds that warning controls are
                                                        sent before a password expires */
-       int pwdGraceLoginLimit; /* number of times you can log in with an
+       int pwdGraceAuthNLimit; /* number of times you can log in with an
                                                        expired password */
        int pwdLockout; /* 0 = do not lockout passwords, 1 = lock them out */
        int pwdLockoutDuration; /* time in seconds a password is locked out for */
@@ -101,8 +102,8 @@ typedef struct pw_hist {
 
 /* Operational attributes */
 static AttributeDescription *ad_pwdChangedTime, *ad_pwdAccountLockedTime,
-       *ad_pwdExpirationWarned, *ad_pwdFailureTime, *ad_pwdHistory,
-       *ad_pwdGraceUseTime, *ad_pwdReset, *ad_pwdPolicySubentry;
+       *ad_pwdFailureTime, *ad_pwdHistory, *ad_pwdGraceUseTime, *ad_pwdReset,
+       *ad_pwdPolicySubentry;
 
 static struct schema_info {
        char *def;
@@ -114,7 +115,7 @@ static struct schema_info {
                "EQUALITY generalizedTimeMatch "
                "ORDERING generalizedTimeOrderingMatch "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
-               "SINGLE-VALUE USAGE directoryOperation )",
+               "SINGLE-VALUE USAGE directoryOperation NO-USER-MODIFICATION )",
                &ad_pwdChangedTime },
        {       "( 1.3.6.1.4.1.42.2.27.8.1.17 "
                "NAME ( 'pwdAccountLockedTime' ) "
@@ -124,14 +125,6 @@ static struct schema_info {
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
                "SINGLE-VALUE USAGE directoryOperation )",
                &ad_pwdAccountLockedTime },
-       {       "( 1.3.6.1.4.1.42.2.27.8.1.18 "
-               "NAME ( 'pwdExpirationWarned' ) "
-               "DESC 'The time the user was first warned about the coming expiration of the password' "
-               "EQUALITY generalizedTimeMatch "
-               "ORDERING generalizedTimeOrderingMatch "
-               "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
-               "SINGLE-VALUE USAGE directoryOperation )",
-               &ad_pwdExpirationWarned },
        {       "( 1.3.6.1.4.1.42.2.27.8.1.19 "
                "NAME ( 'pwdFailureTime' ) "
                "DESC 'The timestamps of the last consecutive authentication failures' "
@@ -145,14 +138,14 @@ static struct schema_info {
                "DESC 'The history of users passwords' "
                "EQUALITY octetStringMatch "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 "
-               "USAGE directoryOperation )",
+               "USAGE directoryOperation NO-USER-MODIFICATION )",
                &ad_pwdHistory },
        {       "( 1.3.6.1.4.1.42.2.27.8.1.21 "
                "NAME ( 'pwdGraceUseTime' ) "
                "DESC 'The timestamps of the grace login once the password has expired' "
                "EQUALITY generalizedTimeMatch "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
-               "USAGE directoryOperation )",
+               "USAGE directoryOperation NO-USER-MODIFICATION )",
                &ad_pwdGraceUseTime }, 
        {       "( 1.3.6.1.4.1.42.2.27.8.1.22 "
                "NAME ( 'pwdReset' ) "
@@ -174,7 +167,7 @@ static struct schema_info {
 /* User attributes */
 static AttributeDescription *ad_pwdMinAge, *ad_pwdMaxAge, *ad_pwdInHistory,
        *ad_pwdCheckQuality, *ad_pwdMinLength, *ad_pwdMaxFailure, 
-       *ad_pwdGraceLoginLimit, *ad_pwdExpireWarning, *ad_pwdLockoutDuration,
+       *ad_pwdGraceAuthNLimit, *ad_pwdExpireWarning, *ad_pwdLockoutDuration,
        *ad_pwdFailureCountInterval, *ad_pwdCheckModule, *ad_pwdLockout,
        *ad_pwdMustChange, *ad_pwdAllowUserChange, *ad_pwdSafeModify,
        *ad_pwdAttribute;
@@ -189,7 +182,7 @@ static struct schema_info pwd_UsSchema[] = {
        TAB(pwdCheckQuality),
        TAB(pwdMinLength),
        TAB(pwdMaxFailure),
-       TAB(pwdGraceLoginLimit),
+       TAB(pwdGraceAuthNLimit),
        TAB(pwdExpireWarning),
        TAB(pwdLockout),
        TAB(pwdLockoutDuration),
@@ -370,8 +363,8 @@ ppolicy_get( Operation *op, Entry *e, PassPolicy *pp )
                pp->pwdMinLength = atoi(a->a_vals[0].bv_val );
        if ((a = attr_find( pe->e_attrs, ad_pwdMaxFailure )))
                pp->pwdMaxFailure = atoi(a->a_vals[0].bv_val );
-       if ((a = attr_find( pe->e_attrs, ad_pwdGraceLoginLimit )))
-               pp->pwdGraceLoginLimit = atoi(a->a_vals[0].bv_val );
+       if ((a = attr_find( pe->e_attrs, ad_pwdGraceAuthNLimit )))
+               pp->pwdGraceAuthNLimit = atoi(a->a_vals[0].bv_val );
        if ((a = attr_find( pe->e_attrs, ad_pwdExpireWarning )))
                pp->pwdExpireWarning = atoi(a->a_vals[0].bv_val );
        if ((a = attr_find( pe->e_attrs, ad_pwdFailureCountInterval )))
@@ -846,10 +839,10 @@ grace:
                if (!pwExpired) goto check_expiring_password;
                
                if ((a = attr_find( e->e_attrs, ad_pwdGraceUseTime )) == NULL)
-                       ngut = ppb->pp.pwdGraceLoginLimit;
+                       ngut = ppb->pp.pwdGraceAuthNLimit;
                else {
                        for(ngut=0; a->a_nvals[ngut].bv_val; ngut++);
-                       ngut = ppb->pp.pwdGraceLoginLimit - ngut;
+                       ngut = ppb->pp.pwdGraceAuthNLimit - ngut;
                }
 
                /*
@@ -901,19 +894,8 @@ check_expiring_password:
                 */
                if (ppb->pp.pwdMaxAge - age < ppb->pp.pwdExpireWarning ) {
                        /*
-                        * Set the warning value, add expiration warned timestamp to the entry.
+                        * Set the warning value.
                         */
-                       if ((a = attr_find( e->e_attrs, ad_pwdExpirationWarned )) == NULL) {
-                               m = ch_calloc( sizeof(Modifications), 1 );
-                               m->sml_op = LDAP_MOD_ADD;
-                               m->sml_type = ad_pwdExpirationWarned->ad_cname;
-                               m->sml_desc = ad_pwdExpirationWarned;
-                               m->sml_values = ch_calloc( sizeof(struct berval), 2 );
-                               ber_str2bv( nowstr, 0, 1, &m->sml_values[0] );
-                               m->sml_next = mod;
-                               mod = m;
-                       }
-                       
                        warn = ppb->pp.pwdMaxAge - age; /* seconds left until expiry */
                        if (warn < 0) warn = 0; /* something weird here - why is pwExpired not set? */
                        
@@ -1054,7 +1036,7 @@ ppolicy_restrict(
                        rs->sr_ctrls = ctrls;
                }
                op->o_bd->bd_info = (BackendInfo *)on->on_info;
-               send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
+               send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, 
                        "Operations are restricted to bind/unbind/abandon/StartTLS/modify password" );
                return rs->sr_err;
        }
@@ -1258,7 +1240,7 @@ ppolicy_modify( Operation *op, SlapReply *rs )
        if (pwcons[op->o_conn->c_conn_idx].restrict && !mod_pw_only) {
                Debug( LDAP_DEBUG_TRACE,
                        "connection restricted to password changing only\n", 0, 0, 0 );
-               rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+               rs->sr_err = LDAP_INSUFFICIENT_ACCESS; 
                rs->sr_text = "Operations are restricted to bind/unbind/abandon/StartTLS/modify password";
                pErr = PP_changeAfterReset;
                goto return_results;
@@ -1338,14 +1320,14 @@ ppolicy_modify( Operation *op, SlapReply *rs )
                Debug( LDAP_DEBUG_TRACE,
                        "change password must use DELETE followed by ADD/REPLACE\n",
                        0, 0, 0 );
-               rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+               rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
                rs->sr_text = "Must supply old password to be changed as well as new one";
                pErr = PP_mustSupplyOldPassword;
                goto return_results;
        }
 
        if (!pp.pwdAllowUserChange) {
-               rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+               rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
                rs->sr_text = "User alteration of password is not allowed";
                pErr = PP_passwordModNotAllowed;
                goto return_results;
@@ -1360,7 +1342,7 @@ ppolicy_modify( Operation *op, SlapReply *rs )
                now = slap_get_time();
                age = (int)(now - pwtime);
                if ((pwtime != (time_t)-1) && (age < pp.pwdMinAge)) {
-                       rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
+                       rs->sr_err = LDAP_CONSTRAINT_VIOLATION;
                        rs->sr_text = "Password is too young to change";
                        pErr = PP_passwordTooYoung;
                        goto return_results;
@@ -1506,18 +1488,6 @@ do_modify:
                        modtail = mods;
                }
 
-               if (attr_find(e->e_attrs, ad_pwdExpirationWarned )) {
-                       mods = (Modifications *) ch_malloc( sizeof( Modifications ) );
-                       mods->sml_op = LDAP_MOD_DELETE;
-                       mods->sml_type.bv_val = NULL;
-                       mods->sml_desc = ad_pwdExpirationWarned;
-                       mods->sml_values = NULL;
-                       mods->sml_nvalues = NULL;
-                       mods->sml_next = NULL;
-                       modtail->sml_next = mods;
-                       modtail = mods;
-               }
-
                /* Delete the pwdReset attribute, since it's being reset */
                if ((zapReset) && (attr_find(e->e_attrs, ad_pwdReset ))) {
                        mods = (Modifications *) ch_malloc( sizeof( Modifications ) );
@@ -1797,7 +1767,7 @@ int ppolicy_init()
                                ldap_scherr2str(code), err );
                        return code;
                }
-               code = at_add( at, &err );
+               code = at_add( at, 0, NULL, &err );
                if ( !code ) {
                        slap_str2ad( at->at_names[0], pwd_OpSchema[i].ad, &err );
                }
index ff6cb833506bd1c643774c64f89e26c9aad421ae..991b82b28fb5cb02320ce77698327c8f0f41eee1 100644 (file)
@@ -80,7 +80,7 @@ refint_db_init(
 {
        slap_overinst *on = (slap_overinst *)be->bd_info;
        refint_data *id = ch_malloc(sizeof(refint_data));
-       refint_attrs *ip;
+
        id->message = "_init";
        id->attrs = NULL;
        id->newdn.bv_val = NULL;
@@ -242,9 +242,9 @@ refint_delete_cb(
 {
        Attribute *a;
        BerVarray b = NULL;
-       refint_data *id, *dd = op->o_callback->sc_private;
+       refint_data *dd = op->o_callback->sc_private;
        refint_attrs *ia, *da = dd->attrs;
-       dependent_data *ip, *dp = NULL;
+       dependent_data *ip;
        Modifications *mp, *ma;
        int i;
 
@@ -349,11 +349,11 @@ refint_modrdn_cb(
 {
        Attribute *a;
        BerVarray b = NULL;
-       refint_data *id, *dd = op->o_callback->sc_private;
+       refint_data *dd = op->o_callback->sc_private;
        refint_attrs *ia, *da = dd->attrs;
-       dependent_data *ip = NULL, *dp = NULL;
+       dependent_data *ip = NULL;
        Modifications *mp;
-       int i, j, fix;
+       int i, fix;
 
        Debug(LDAP_DEBUG_TRACE, "refint_modrdn_cb <%s>\n",
                rs->sr_entry ? rs->sr_entry->e_name.bv_val : "NOTHING", 0, 0);
@@ -446,10 +446,9 @@ refint_response(
        refint_data dd = *id;
        refint_attrs *ip;
        dependent_data *dp;
-       char *fstr, *key, *kp, **dnpp, **ndnpp, *cp;
-       BerValue ndn, moddn, pdn;
-       BerVarray b = NULL;
-       int rc, ac, i, j, ksize;
+       BerValue pdn;
+       int rc, ac;
+       Filter ftop, *fptr;
 
        id->message = "_refint_response";
 
@@ -519,7 +518,6 @@ refint_response(
        }
 
        /*
-       ** calculate the search key size and allocate it;
        ** build a search filter for all configured attributes;
        ** populate our Operation;
        ** pass our data (attr list, dn) to backend via sc_private;
@@ -529,18 +527,20 @@ refint_response(
        **
        */
 
-       for(ksize = 16, ip = id->attrs; ip; ip = ip->next)
-               ksize += ip->attr->ad_cname.bv_len + op->o_req_dn.bv_len + 3;
-       kp = key = ch_malloc(ksize);
-       if(--ac) kp += sprintf(key, "(|");
-       for(ip = id->attrs; ip; ip = ip->next)
-               kp += sprintf(kp, "(%s=%s)",
-                       ip->attr->ad_cname.bv_val, op->o_req_dn.bv_val);
-       if(ac) *kp++ = ')';
-       *kp = 0;
-
-       nop.ors_filter = str2filter_x(&nop, key);
-       ber_str2bv(key, 0, 0, &nop.ors_filterstr);
+       ftop.f_choice = LDAP_FILTER_OR;
+       ftop.f_next = NULL;
+       ftop.f_or = NULL;
+       nop.ors_filter = &ftop;
+       for(ip = id->attrs; ip; ip = ip->next) {
+               fptr = ch_malloc( sizeof(Filter) + sizeof(AttributeAssertion) );
+               fptr->f_choice = LDAP_FILTER_EQUALITY;
+               fptr->f_ava = (AttributeAssertion *)(fptr+1);
+               fptr->f_ava->aa_desc = ip->attr;
+               fptr->f_ava->aa_value = op->o_req_ndn;
+               fptr->f_next = ftop.f_or;
+               ftop.f_or = fptr;
+       }
+       filter2bv( nop.ors_filter, &nop.ors_filterstr );
 
        /* callback gets the searched dn instead */
        dd.dn = op->o_req_ndn;
@@ -565,8 +565,11 @@ refint_response(
        /* search */
        rc = nop.o_bd->be_search(&nop, &nrs);
 
-       filter_free_x(&nop, nop.ors_filter);
-       ch_free(key);
+       ch_free( nop.ors_filterstr.bv_val );
+       while ( fptr = ftop.f_or ) {
+               ftop.f_or = fptr->f_next;
+               ch_free( fptr );
+       }
        ch_free(dd.nnewdn.bv_val);
        ch_free(dd.newdn.bv_val);
        dd.newdn.bv_val = NULL;
index dd7203c3cdc06ecfa61e7eb77e004df9dc3c5c1a..8b26b9818ad38628eb73dde8d71678eb24b562f9 100644 (file)
@@ -157,13 +157,14 @@ rwm_dn_massage(
 {
        int             rc = 0;
        struct berval   mdn;
+       static char     *dmy = "";
 
        assert( dc );
        assert( in );
        assert( dn );
 
        rc = rewrite_session( dc->rwmap->rwm_rw, dc->ctx,
-                       ( in->bv_len ? in->bv_val : "" ), 
+                       ( in->bv_val ? in->bv_val : dmy ), 
                        dc->conn, &mdn.bv_val );
        switch ( rc ) {
        case REWRITE_REGEXEC_OK:
@@ -197,6 +198,10 @@ rwm_dn_massage(
                break;
        }
 
+       if ( mdn.bv_val == dmy ) {
+               BER_BVZERO( &mdn );
+       }
+
        return rc;
 }
 
index e8a630cce6c57d115d33778ccbe478bf365412c7..62bb845685367631c3a5c3fd739214bfd9455907 100644 (file)
@@ -807,7 +807,8 @@ rwm_referral_rewrite(
        }
 
        for ( i = 0; !BER_BVISNULL( &a_vals[i] ); i++ ) {
-               struct berval   olddn, oldval;
+               struct berval   olddn = BER_BVNULL,
+                               oldval;
                int             rc;
                LDAPURLDesc     *ludp;
 
@@ -1059,7 +1060,8 @@ rwm_referral_result_rewrite(
        last--;
 
        for ( i = 0; !BER_BVISNULL( &a_vals[i] ); i++ ) {
-               struct berval   dn, olddn;
+               struct berval   dn,
+                               olddn = BER_BVNULL;
                int             rc;
                LDAPURLDesc     *ludp;
 
index c406f5b1fa7fe206f4d7c93da9a7aa9c9c9c44da..3309eba85a85310f41f78684052032c260bbca88 100644 (file)
@@ -250,62 +250,6 @@ syncprov_done_ctrl(
        return LDAP_SUCCESS;
 }
 
-#if 0
-/* Generate state based on session log - not implemented yet */
-static int
-syncprov_state_ctrl_from_slog(
-       Operation       *op,
-       SlapReply       *rs,
-       struct slog_entry *slog_e,
-       int                     entry_sync_state,
-       LDAPControl     **ctrls,
-       int                     num_ctrls,
-       int                     send_cookie,
-       struct berval   *cookie)
-{
-       Attribute* a;
-       int ret;
-       int res;
-       const char *text = NULL;
-
-       BerElementBuffer berbuf;
-       BerElement *ber = (BerElement *)&berbuf;
-
-       struct berval entryuuid_bv      = BER_BVNULL;
-
-       ber_init2( ber, NULL, LBER_USE_DER );
-       ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
-
-       ctrls[num_ctrls] = ch_malloc ( sizeof ( LDAPControl ) );
-
-       entryuuid_bv = slog_e->sl_uuid;
-
-       if ( send_cookie && cookie ) {
-               ber_printf( ber, "{eOON}",
-                       entry_sync_state, &entryuuid_bv, cookie );
-       } else {
-               ber_printf( ber, "{eON}",
-                       entry_sync_state, &entryuuid_bv );
-       }
-
-       ctrls[num_ctrls]->ldctl_oid = LDAP_CONTROL_SYNC_STATE;
-       ctrls[num_ctrls]->ldctl_iscritical = (op->o_sync == SLAP_CONTROL_CRITICAL);
-       ret = ber_flatten2( ber, &ctrls[num_ctrls]->ldctl_value, 1 );
-
-       ber_free_buf( ber );
-
-       if ( ret < 0 ) {
-               Debug( LDAP_DEBUG_TRACE,
-                       "slap_build_sync_ctrl: ber_flatten2 failed\n",
-                       0, 0, 0 );
-               send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
-               return ret;
-       }
-
-       return LDAP_SUCCESS;
-}
-#endif
-
 static int
 syncprov_sendinfo(
        Operation       *op,
@@ -470,6 +414,7 @@ syncprov_findbase( Operation *op, fbase_cookie *fc )
        cb.sc_private = fc;
 
        fop.o_sync_mode &= SLAP_CONTROL_MASK;   /* turn off sync mode */
+       fop.o_managedsait = SLAP_CONTROL_CRITICAL;
        fop.o_callback = &cb;
        fop.o_tag = LDAP_REQ_SEARCH;
        fop.ors_scope = LDAP_SCOPE_BASE;
@@ -604,7 +549,11 @@ syncprov_findcsn( Operation *op, int mode )
        char cbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
        struct berval fbuf, maxcsn;
        Filter cf, af;
-       AttributeAssertion eq;
+#ifdef LDAP_COMP_MATCH
+       AttributeAssertion eq = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion eq = { NULL, BER_BVNULL };
+#endif
        int i, rc = LDAP_SUCCESS;
        fpres_cookie pcookie;
        sync_control *srs = NULL;
@@ -619,6 +568,8 @@ syncprov_findcsn( Operation *op, int mode )
 
        fop = *op;
        fop.o_sync_mode &= SLAP_CONTROL_MASK;   /* turn off sync_mode */
+       /* We want pure entries, not referrals */
+       fop.o_managedsait = SLAP_CONTROL_CRITICAL;
 
        fbuf.bv_val = buf;
        cf.f_ava = &eq;
@@ -669,8 +620,6 @@ syncprov_findcsn( Operation *op, int mode )
                fop.ors_attrsonly = 0;
                fop.ors_attrs = uuid_anlist;
                fop.ors_slimit = SLAP_NO_LIMIT;
-               /* We want pure entries, not referrals */
-               fop.o_managedsait = SLAP_CONTROL_CRITICAL;
                cb.sc_private = &pcookie;
                cb.sc_response = findpres_cb;
                pcookie.num = 0;
@@ -711,7 +660,7 @@ syncprov_findcsn( Operation *op, int mode )
        return rc;
 }
 
-/* Queue a persistent search response if still in Refresh stage */
+/* Queue a persistent search response */
 static int
 syncprov_qresp( opcookie *opc, syncops *so, int mode )
 {
@@ -721,13 +670,18 @@ syncprov_qresp( opcookie *opc, syncops *so, int mode )
                opc->sdn.bv_len + 1 + opc->sndn.bv_len + 1 + opc->sctxcsn.bv_len + 1 );
        sr->s_next = NULL;
        sr->s_dn.bv_val = (char *)(sr + 1);
+       sr->s_dn.bv_len = opc->sdn.bv_len;
        sr->s_mode = mode;
        sr->s_isreference = opc->sreference;
        sr->s_ndn.bv_val = lutil_strcopy( sr->s_dn.bv_val, opc->sdn.bv_val );
+       sr->s_ndn.bv_len = opc->sndn.bv_len;
        *(sr->s_ndn.bv_val++) = '\0';
        sr->s_uuid.bv_val = lutil_strcopy( sr->s_ndn.bv_val, opc->sndn.bv_val );
+       sr->s_uuid.bv_len = opc->suuid.bv_len;
        *(sr->s_uuid.bv_val++) = '\0';
        sr->s_csn.bv_val = lutil_strcopy( sr->s_uuid.bv_val, opc->suuid.bv_val );
+       sr->s_csn.bv_len = opc->sctxcsn.bv_len;
+       strcpy( sr->s_csn.bv_val, opc->sctxcsn.bv_val );
 
        if ( !so->s_res ) {
                so->s_res = sr;
@@ -739,9 +693,57 @@ syncprov_qresp( opcookie *opc, syncops *so, int mode )
        return LDAP_SUCCESS;
 }
 
+/* Play back queued responses */
+static int
+syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry **e, int mode, int queue );
+
+static int
+syncprov_qplay( Operation *op, slap_overinst *on, syncops *so )
+{
+       syncres *sr, *srnext;
+       Entry *e;
+       opcookie opc;
+       int rc;
+
+       opc.son = on;
+       op->o_bd->bd_info = (BackendInfo *)on->on_info;
+       for (sr = so->s_res; sr; sr=srnext) {
+               srnext = sr->s_next;
+               opc.sdn = sr->s_dn;
+               opc.sndn = sr->s_ndn;
+               opc.suuid = sr->s_uuid;
+               opc.sctxcsn = sr->s_csn;
+               opc.sreference = sr->s_isreference;
+               e = NULL;
+
+               if ( sr->s_mode != LDAP_SYNC_DELETE ) {
+                       rc = be_entry_get_rw( op, &opc.sndn, NULL, NULL, 0, &e );
+                       if ( rc ) {
+                               ch_free( sr );
+                               so->s_res = srnext;
+                               continue;
+                       }
+               }
+               rc = syncprov_sendresp( op, &opc, so, &e, sr->s_mode, 0 );
+
+               if ( e ) {
+                       be_entry_release_rw( op, e, 0 );
+               }
+               if ( rc )
+                       break;
+
+               ch_free( sr );
+               so->s_res = srnext;
+       }
+       op->o_bd->bd_info = (BackendInfo *)on;
+       if ( !so->s_res )
+               so->s_restail = NULL;
+       return rc;
+}
+
 /* Send a persistent search response */
 static int
-syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry *e, int mode, int queue )
+syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry **e, int mode, int queue )
 {
        slap_overinst *on = opc->son;
        syncprov_info_t *si = on->on_bi.bi_private;
@@ -754,17 +756,43 @@ syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry *e, int mode
        Operation sop = *so->s_op;
        Opheader ohdr;
 
+       if ( so->s_op->o_abandon )
+               return SLAPD_ABANDON;
+
        ohdr = *sop.o_hdr;
        sop.o_hdr = &ohdr;
        sop.o_tmpmemctx = op->o_tmpmemctx;
        sop.o_bd = op->o_bd;
        sop.o_controls = op->o_controls;
+       sop.o_private = op->o_private;
 
-       if ( queue && (so->s_flags & PS_IS_REFRESHING) ) {
+       /* If queueing is allowed */
+       if ( queue ) {
                ldap_pvt_thread_mutex_lock( &so->s_mutex );
-               if ( so->s_flags & PS_IS_REFRESHING )
+               /* If we're still in refresh mode, must queue */
+               if (so->s_flags & PS_IS_REFRESHING) {
                        return syncprov_qresp( opc, so, mode );
+               }
+               /* If connection is free but queue is non-empty,
+                * try to flush the queue.
+                */
+               if ( so->s_res ) {
+                       rs.sr_err = syncprov_qplay( &sop, on, so );
+               }
+               /* If the connection is busy, must queue */
+               if ( sop.o_conn->c_writewaiter || rs.sr_err == LDAP_BUSY ) {
+                       return syncprov_qresp( opc, so, mode );
+               }
                ldap_pvt_thread_mutex_unlock( &so->s_mutex );
+
+               /* If syncprov_qplay returned any other error, bail out. */
+               if ( rs.sr_err ) {
+                       return rs.sr_err;
+               }
+       } else {
+               /* Queueing not allowed and conn is busy, give up */
+               if ( sop.o_conn->c_writewaiter )
+                       return LDAP_BUSY;
        }
 
        ctrls[1] = NULL;
@@ -776,20 +804,30 @@ syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry *e, int mode
        rs.sr_err = syncprov_state_ctrl( &sop, &rs, &e_uuid,
                mode, ctrls, 0, 1, &cookie );
 
-       rs.sr_entry = e;
        rs.sr_ctrls = ctrls;
+       op->o_bd->bd_info = (BackendInfo *)on->on_info;
        switch( mode ) {
        case LDAP_SYNC_ADD:
+               rs.sr_entry = *e;
+               if ( rs.sr_entry->e_private )
+                       rs.sr_flags = REP_ENTRY_MUSTRELEASE;
                if ( opc->sreference ) {
-                       rs.sr_ref = get_entry_referrals( &sop, e );
+                       rs.sr_ref = get_entry_referrals( &sop, rs.sr_entry );
                        send_search_reference( &sop, &rs );
                        ber_bvarray_free( rs.sr_ref );
+                       if ( !rs.sr_entry )
+                               *e = NULL;
                        break;
                }
                /* fallthru */
        case LDAP_SYNC_MODIFY:
+               rs.sr_entry = *e;
+               if ( rs.sr_entry->e_private )
+                       rs.sr_flags = REP_ENTRY_MUSTRELEASE;
                rs.sr_attrs = sop.ors_attrs;
                send_search_entry( &sop, &rs );
+               if ( !rs.sr_entry )
+                       *e = NULL;
                break;
        case LDAP_SYNC_DELETE:
                e_uuid.e_attrs = NULL;
@@ -808,7 +846,20 @@ syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry *e, int mode
                assert(0);
        }
        op->o_tmpfree( rs.sr_ctrls[0], op->o_tmpmemctx );
+       op->o_private = sop.o_private;
        rs.sr_ctrls = NULL;
+       /* Check queue again here; if we were hanging in a send and eventually
+        * recovered, there may be more to send now. But don't check if the
+        * original psearch has been abandoned.
+        */
+       if ( so->s_op->o_abandon )
+               return SLAPD_ABANDON;
+
+       if ( rs.sr_err == LDAP_SUCCESS && queue && so->s_res ) {
+               ldap_pvt_thread_mutex_lock( &so->s_mutex );
+               rs.sr_err = syncprov_qplay( &sop, on, so );
+               ldap_pvt_thread_mutex_unlock( &so->s_mutex );
+       }
        return rs.sr_err;
 }
 
@@ -936,6 +987,12 @@ syncprov_matchops( Operation *op, opcookie *opc, int saveit )
        if ( op->o_tag != LDAP_REQ_ADD ) {
                op->o_bd->bd_info = (BackendInfo *)on->on_info;
                rc = be_entry_get_rw( op, fc.fdn, NULL, NULL, 0, &e );
+               /* If we're sending responses now, make a copy and unlock the DB */
+               if ( e && !saveit ) {
+                       Entry *e2 = entry_dup( e );
+                       be_entry_release_rw( op, e, 0 );
+                       e = e2;
+               }
                op->o_bd->bd_info = (BackendInfo *)on;
                if ( rc ) return;
        } else {
@@ -1002,17 +1059,23 @@ syncprov_matchops( Operation *op, opcookie *opc, int saveit )
                                opc->smatches = sm;
                        } else {
                                /* if found send UPDATE else send ADD */
-                               syncprov_sendresp( op, opc, ss, e,
+                               ss->s_inuse++;
+                               ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
+                               syncprov_sendresp( op, opc, ss, &e,
                                        found ? LDAP_SYNC_MODIFY : LDAP_SYNC_ADD, 1 );
+                               ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
+                               ss->s_inuse--;
                        }
                } else if ( !saveit && found ) {
                        /* send DELETE */
+                       ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
                        syncprov_sendresp( op, opc, ss, NULL, LDAP_SYNC_DELETE, 1 );
+                       ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
                }
        }
        ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
 done:
-       if ( op->o_tag != LDAP_REQ_ADD ) {
+       if ( op->o_tag != LDAP_REQ_ADD && e ) {
                op->o_bd->bd_info = (BackendInfo *)on->on_info;
                be_entry_release_rw( op, e, 0 );
                op->o_bd->bd_info = (BackendInfo *)on;
@@ -1042,7 +1105,6 @@ syncprov_op_cleanup( Operation *op, SlapReply *rs )
        mtdummy.mt_op = op;
        ldap_pvt_thread_mutex_lock( &si->si_mods_mutex );
        mt = avl_find( si->si_mods, &mtdummy, sp_avl_cmp );
-       ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );
        if ( mt ) {
                modinst *mi = mt->mt_mods;
 
@@ -1053,14 +1115,13 @@ syncprov_op_cleanup( Operation *op, SlapReply *rs )
                        mt->mt_op = mt->mt_mods->mi_op;
                        ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
                } else {
-                       ldap_pvt_thread_mutex_lock( &si->si_mods_mutex );
                        avl_delete( &si->si_mods, mt, sp_avl_cmp );
-                       ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );
                        ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
                        ldap_pvt_thread_mutex_destroy( &mt->mt_mutex );
                        ch_free( mt );
                }
        }
+       ldap_pvt_thread_mutex_unlock( &si->si_mods_mutex );
        if ( !BER_BVISNULL( &opc->suuid ))
                op->o_tmpfree( opc->suuid.bv_val, op->o_tmpmemctx );
        if ( !BER_BVISNULL( &opc->sndn ))
@@ -1080,8 +1141,8 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
        Modifications mod;
        Operation opm;
        struct berval bv[2];
-       BackendInfo *orig;
        slap_callback cb = {0};
+       int manage = get_manageDSAit(op);
 
        mod.sml_values = bv;
        bv[1].bv_val = NULL;
@@ -1098,9 +1159,10 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
        opm.orm_modlist = &mod;
        opm.o_req_dn = op->o_bd->be_suffix[0];
        opm.o_req_ndn = op->o_bd->be_nsuffix[0];
-       orig = opm.o_bd->bd_info;
        opm.o_bd->bd_info = on->on_info->oi_orig;
+       opm.o_managedsait = SLAP_CONTROL_NONCRITICAL;
        opm.o_bd->be_modify( &opm, rs );
+       opm.o_managedsait = manage;
 }
 
 static void
@@ -1241,7 +1303,11 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl,
                SlapReply frs = { REP_RESULT };
                int rc;
                Filter mf, af;
+#ifdef LDAP_COMP_MATCH
+               AttributeAssertion eq = { NULL, BER_BVNULL, NULL };
+#else
                AttributeAssertion eq;
+#endif
                slap_callback cb = {0};
 
                fop = *op;
@@ -1354,14 +1420,12 @@ syncprov_op_response( Operation *op, SlapReply *rs )
                                /* for each match in opc->smatches:
                                 *   send DELETE msg
                                 */
-                               ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
                                for ( sm = opc->smatches; sm; sm=sm->sm_next ) {
                                        if ( sm->sm_op->s_op->o_abandon )
                                                continue;
                                        syncprov_sendresp( op, opc, sm->sm_op, NULL,
                                                LDAP_SYNC_DELETE, 1 );
                                }
-                               ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
                                break;
                        }
                }
@@ -1515,7 +1579,6 @@ syncprov_op_mod( Operation *op, SlapReply *rs )
 
        if (( si->si_ops || si->si_logs ) && op->o_tag != LDAP_REQ_ADD )
                syncprov_matchops( op, opc, 1 );
-               
 
        return SLAP_CB_CONTINUE;
 }
@@ -1679,41 +1742,9 @@ syncprov_search_response( Operation *op, SlapReply *rs )
                                &cookie, 1, NULL, 0 );
                        /* Flush any queued persist messages */
                        if ( ss->ss_so->s_res ) {
-                               syncres *sr, *srnext;
-                               Entry *e;
-                               opcookie opc;
-
-                               opc.son = on;
                                ldap_pvt_thread_mutex_lock( &ss->ss_so->s_mutex );
                                locked = 1;
-                               for (sr = ss->ss_so->s_res; sr; sr=srnext) {
-                                       int rc = LDAP_SUCCESS;
-                                       srnext = sr->s_next;
-                                       opc.sdn = sr->s_dn;
-                                       opc.sndn = sr->s_ndn;
-                                       opc.suuid = sr->s_uuid;
-                                       opc.sctxcsn = sr->s_csn;
-                                       opc.sreference = sr->s_isreference;
-                                       e = NULL;
-
-                                       if ( sr->s_mode != LDAP_SYNC_DELETE ) {
-                                               op->o_bd->bd_info = (BackendInfo *)on->on_info;
-                                               rc = be_entry_get_rw( op, &opc.sndn, NULL, NULL, 0, &e );
-                                               op->o_bd->bd_info = (BackendInfo *)on;
-                                       }
-                                       if ( rc == LDAP_SUCCESS )
-                                               syncprov_sendresp( op, &opc, ss->ss_so, e,
-                                                       sr->s_mode, 0 );
-
-                                       if ( e ) {
-                                               op->o_bd->bd_info = (BackendInfo *)on->on_info;
-                                               be_entry_release_rw( op, e, 0 );
-                                               op->o_bd->bd_info = (BackendInfo *)on;
-                                       }
-                                       ch_free( sr );
-                               }
-                               ss->ss_so->s_res = NULL;
-                               ss->ss_so->s_restail = NULL;
+                               syncprov_qplay( op, on, ss->ss_so );
                        }
 
                        /* Turn off the refreshing flag */
@@ -1753,6 +1784,7 @@ syncprov_op_search( Operation *op, SlapReply *rs )
        }
 
        srs = op->o_controls[slap_cids.sc_LDAPsync];
+       op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
 
        /* If this is a persistent search, set it up right away */
        if ( op->o_sync_mode & SLAP_SYNC_PERSIST ) {
@@ -1868,6 +1900,9 @@ shortcut:
        fava->f_choice = LDAP_FILTER_LE;
        fava->f_ava = op->o_tmpalloc( sizeof(AttributeAssertion), op->o_tmpmemctx );
        fava->f_ava->aa_desc = slap_schema.si_ad_entryCSN;
+#ifdef LDAP_COMP_MATCH
+       fava->f_ava->aa_cf = NULL;
+#endif
        ber_dupbv_x( &fava->f_ava->aa_value, &ctxcsn, op->o_tmpmemctx );
        fand->f_and = fava;
        if ( gotstate ) {
@@ -1876,6 +1911,9 @@ shortcut:
                fava->f_choice = LDAP_FILTER_GE;
                fava->f_ava = op->o_tmpalloc( sizeof(AttributeAssertion), op->o_tmpmemctx );
                fava->f_ava->aa_desc = slap_schema.si_ad_entryCSN;
+#ifdef LDAP_COMP_MATCH
+               fava->f_ava->aa_cf = NULL;
+#endif
                ber_dupbv_x( &fava->f_ava->aa_value, &srs->sr_state.ctxcsn, op->o_tmpmemctx );
        }
        fava->f_next = op->ors_filter;
@@ -2043,6 +2081,10 @@ syncprov_db_open(
        Attribute *a;
        int rc;
 
+       if ( slapMode & SLAP_TOOL_MODE ) {
+               return 0;
+       }
+
        rc = overlay_register_control( be, LDAP_CONTROL_SYNC );
        if ( rc ) {
                return rc;
@@ -2076,6 +2118,12 @@ syncprov_db_open(
                op->o_req_ndn = be->be_nsuffix[0];
                op->ors_scope = LDAP_SCOPE_SUBTREE;
                syncprov_findcsn( op, FIND_MAXCSN );
+       } else if ( SLAP_SYNC_SHADOW( op->o_bd )) {
+               /* If we're also a consumer, and we didn't find the context entry,
+                * then don't generate anything, wait for our provider to send it
+                * to us.
+                */
+               goto out;
        }
 
        if ( BER_BVISEMPTY( &si->si_ctxcsn ) ) {
@@ -2091,6 +2139,7 @@ syncprov_db_open(
                syncprov_checkpoint( op, &rs, on );
        }
 
+out:
        op->o_bd->bd_info = (BackendInfo *)on;
        return 0;
 }
@@ -2106,6 +2155,9 @@ syncprov_db_close(
     syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
        int i;
 
+       if ( slapMode & SLAP_TOOL_MODE ) {
+               return 0;
+       }
        if ( si->si_numops ) {
                Connection conn;
                char opbuf[OPERATION_BUFFER_SIZE];
index 38ff0039f66102fcf1bb5f19eb90dd2458bd2e25..9a6483229daaf602a3c35df634460383fdcee394 100644 (file)
@@ -1,5 +1,22 @@
-/* Copyright 2004, Symas Corporation.
- * All Rights Reserved.
+/* translucent.c - translucent proxy module */
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2004-2005 The OpenLDAP Foundation.
+ * Portions Copyright 2005 Symas Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Symas Corp. for inclusion in
+ * OpenLDAP Software.  This work was sponsored by Hewlett-Packard.
  */
 
 #include "portable.h"
index bedbb5a36e2d7e8aceb6d4b729082d8796eb193e..9dff1bda140e224a3eb1536b8adb17f417046a7e 100644 (file)
@@ -41,10 +41,29 @@ LDAP_SLAPD_F (int) access_allowed_mask LDAP_P((
        AccessControlState *state,
        slap_mask_t *mask ));
 #define access_allowed(op,e,desc,val,access,state) access_allowed_mask(op,e,desc,val,access,state,NULL)
+#ifdef SLAP_OVERLAY_ACCESS
+LDAP_SLAPD_F (int) slap_access_allowed LDAP_P((
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp ));
+LDAP_SLAPD_F (int) slap_access_always_allowed LDAP_P((
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp ));
+#endif /* SLAP_OVERLAY_ACCESS */
+
 LDAP_SLAPD_F (int) acl_check_modlist LDAP_P((
        Operation *op, Entry *e, Modifications *ml ));
 
-LDAP_SLAPD_F (void) acl_append( AccessControl **l, AccessControl *a );
+LDAP_SLAPD_F (void) acl_append( AccessControl **l, AccessControl *a, int pos );
 
 #ifdef SLAP_DYNACL
 LDAP_SLAPD_F (int) slap_dynacl_register LDAP_P(( slap_dynacl_t *da ));
@@ -57,7 +76,7 @@ LDAP_SLAPD_F (int) acl_init LDAP_P(( void ));
  */
 LDAP_SLAPD_F (void) parse_acl LDAP_P(( Backend *be,
        const char *fname, int lineno,
-       int argc, char **argv ));
+       int argc, char **argv, int pos ));
 
 LDAP_SLAPD_F (char *) access2str LDAP_P(( slap_access_t access ));
 LDAP_SLAPD_F (slap_access_t) str2access LDAP_P(( const char *str ));
@@ -161,7 +180,8 @@ LDAP_SLAPD_F (int) at_delete_from_list LDAP_P((
        int pos, AttributeType ***listp ));
 LDAP_SLAPD_F (int) at_schema_info LDAP_P(( Entry *e ));
 LDAP_SLAPD_F (int) at_add LDAP_P((
-       LDAPAttributeType *at, const char **err ));
+       LDAPAttributeType *at, int user,
+       AttributeType **sat, const char **err ));
 LDAP_SLAPD_F (void) at_destroy LDAP_P(( void ));
 
 LDAP_SLAPD_F (int) is_at_subtype LDAP_P((
@@ -175,6 +195,9 @@ LDAP_SLAPD_F (int) is_at_syntax LDAP_P((
 LDAP_SLAPD_F (int) at_start LDAP_P(( AttributeType **at ));
 LDAP_SLAPD_F (int) at_next LDAP_P(( AttributeType **at ));
 
+LDAP_SLAPD_F (void) at_unparse LDAP_P((
+       BerVarray *bva, AttributeType *start, AttributeType *end, int system ));
+
 /*
  * attr.c
  */
@@ -456,6 +479,7 @@ LDAP_SLAPD_F (int) bindconf_unparse LDAP_P((
 LDAP_SLAPD_F (void) bindconf_free LDAP_P(( slap_bindconf *bc ));
 LDAP_SLAPD_F (int) config_generic_wrapper LDAP_P(( Backend *be,
        const char *fname, int lineno, int argc, char **argv ));
+LDAP_SLAPD_F (char *) anlist_unparse LDAP_P(( AttributeName *, char * ));
 
 #ifdef LDAP_SLAPI
 LDAP_SLAPD_V (int) slapi_plugins_used;
@@ -512,11 +536,15 @@ LDAP_SLAPD_F (void) connection_assign_nextid LDAP_P((Connection *));
  * cr.c
  */
 LDAP_SLAPD_F (int) cr_schema_info( Entry *e );
+LDAP_SLAPD_F (void) cr_unparse LDAP_P((
+       BerVarray *bva, ContentRule *start, ContentRule *end, int system ));
 
 LDAP_SLAPD_F (int) cr_add LDAP_P((
        LDAPContentRule *oc,
        int user,
+       ContentRule **scr,
        const char **err));
+
 LDAP_SLAPD_F (void) cr_destroy LDAP_P(( void ));
 
 LDAP_SLAPD_F (ContentRule *) cr_find LDAP_P((
@@ -877,6 +905,10 @@ LDAP_SLAPD_F( int ) modify_delete_values( Entry *e,
        Modification *mod,
        int permissive,
        const char **text, char *textbuf, size_t textlen );
+LDAP_SLAPD_F( int ) modify_delete_vindex( Entry *e,
+       Modification *mod,
+       int permissive,
+       const char **text, char *textbuf, size_t textlen, int *idx );
 LDAP_SLAPD_F( int ) modify_replace_values( Entry *e,
        Modification *mod,
        int permissive,
@@ -951,6 +983,7 @@ LDAP_SLAPD_F (void) mra_free LDAP_P((
 LDAP_SLAPD_F (int) oc_add LDAP_P((
        LDAPObjectClass *oc,
        int user,
+       ObjectClass **soc,
        const char **err));
 LDAP_SLAPD_F (void) oc_destroy LDAP_P(( void ));
 
@@ -1000,15 +1033,19 @@ LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
         : is_entry_objectclass((e), slap_schema.si_oc_syncConsumerSubentry, 1))
 
 LDAP_SLAPD_F (int) oc_schema_info( Entry *e );
+LDAP_SLAPD_F (void) oc_unparse LDAP_P((
+       BerVarray *bva, ObjectClass *start, ObjectClass *end, int system ));
 
 /*
  * oidm.c
  */
 LDAP_SLAPD_F(char *) oidm_find(char *oid);
 LDAP_SLAPD_F (void) oidm_destroy LDAP_P(( void ));
-LDAP_SLAPD_F (void) oidm_unparse LDAP_P(( BerVarray *bva ));
+LDAP_SLAPD_F (void) oidm_unparse LDAP_P((
+       BerVarray *bva, OidMacro *start, OidMacro *end, int system ));
 LDAP_SLAPD_F (int) parse_oidm LDAP_P((
-       const char *fname, int lineno, int argc, char **argv ));
+       const char *fname, int lineno, int argc, char **argv, int user,
+       OidMacro **om ));
 
 /*
  * operation.c
@@ -1261,11 +1298,14 @@ LDAP_SLAPD_F (int) slap_schema_check LDAP_P((void));
 LDAP_SLAPD_F( int ) slap_valid_descr( const char * );
 
 LDAP_SLAPD_F (int) parse_cr LDAP_P((
-       const char *fname, int lineno, char *line, char **argv ));
+       const char *fname, int lineno, char *line, char **argv,
+       ContentRule **scr ));
 LDAP_SLAPD_F (int) parse_oc LDAP_P((
-       const char *fname, int lineno, char *line, char **argv ));
+       const char *fname, int lineno, char *line, char **argv,
+       ObjectClass **soc ));
 LDAP_SLAPD_F (int) parse_at LDAP_P((
-       const char *fname, int lineno, char *line, char **argv ));
+       const char *fname, int lineno, char *line, char **argv,
+       AttributeType **sat ));
 LDAP_SLAPD_F (char *) scherr2str LDAP_P((int code)) LDAP_GCCATTR((const));
 LDAP_SLAPD_F (int) dscompare LDAP_P(( const char *s1, const char *s2del,
        char delim ));
@@ -1314,27 +1354,9 @@ LDAP_SLAPD_F (Filter *) str2filter_x LDAP_P(( Operation *op, const char *str ));
  * syncrepl.c
  */
 
-LDAP_SLAPD_F (void) init_syncrepl LDAP_P((syncinfo_t *));
-LDAP_SLAPD_F (void*) do_syncrepl LDAP_P((void *, void *));
-LDAP_SLAPD_F (int) syncrepl_message_to_entry LDAP_P((
-                                       syncinfo_t *, Operation *, LDAPMessage *,
-                                       Modifications **, Entry **, int ));
-LDAP_SLAPD_F (int) syncrepl_entry LDAP_P((
-                                       syncinfo_t *, Operation*, Entry*,
-                                       Modifications**,int, struct berval*,
-                                       struct sync_cookie *,
-                                       struct berval * ));
-LDAP_SLAPD_F (void) syncrepl_updateCookie LDAP_P((
-                                       syncinfo_t *, Operation *, struct berval *,
-                                       struct sync_cookie * ));
 LDAP_SLAPD_F (void)  syncrepl_add_glue LDAP_P(( 
                                        Operation*, Entry* ));
-LDAP_SLAPD_F (Entry*) slap_create_syncrepl_entry LDAP_P((
-                                       Backend *, struct berval *,
-                                       struct berval *, struct berval * ));
-LDAP_SLAPD_F (struct berval *) slap_uuidstr_from_normalized LDAP_P((
-                                       struct berval *, struct berval *, void * ));
-LDAP_SLAPD_F (void) syncinfo_free LDAP_P(( syncinfo_t * ));
+LDAP_SLAPD_F (void) syncinfo_free LDAP_P(( struct syncinfo_s * ));
 
 /* syntax.c */
 LDAP_SLAPD_F (Syntax *) syn_find LDAP_P((
@@ -1386,6 +1408,30 @@ LDAP_SLAPD_F (int) value_find_ex LDAP_P((
        struct berval *value,
        void *ctx ));
 
+LDAP_SLAPD_F (int) ordered_value_add LDAP_P((
+       Entry *e,
+       AttributeDescription *ad,
+       Attribute *a,
+       BerVarray vals,
+       BerVarray nvals ));
+
+LDAP_SLAPD_F (int) ordered_value_match LDAP_P((
+       int *match,
+       AttributeDescription *ad,
+       MatchingRule *mr,
+       unsigned flags,
+       struct berval *v1,
+       struct berval *v2,
+       const char ** text ));
+
+LDAP_SLAPD_F (void) ordered_value_renumber LDAP_P((
+       Attribute *a,
+       int vals ));
+
+LDAP_SLAPD_F (int) ordered_value_sort LDAP_P((
+       Attribute *a,
+       int do_renumber ));
+
 LDAP_SLAPD_F (int) value_add LDAP_P((
        BerVarray *vals,
        BerVarray addvals ));
index f1abb5110b8970cc2a1af9b83cdd7adf807beb4b..aa90811c82b913348025cb73b082e5db5cf0682f 100644 (file)
@@ -254,7 +254,9 @@ send_ldap_controls( Operation *o, BerElement *ber, LDAPControl **c )
         * plugin.
         */
 
-       if ( o->o_pb && slapi_pblock_get( o->o_pb, SLAPI_RESCONTROLS, &sctrls ) != 0 ) {
+       if ( o->o_pb &&
+               slapi_pblock_get( o->o_pb, SLAPI_RESCONTROLS, &sctrls ) != 0 )
+       {
                sctrls = NULL;
        }
 
@@ -269,10 +271,37 @@ send_ldap_controls( Operation *o, BerElement *ber, LDAPControl **c )
 #ifdef LDAP_SLAPI
        if ( c != NULL )
 #endif /* LDAP_SLAPI */
-       for( ; *c != NULL; c++) {
-               rc = send_ldap_control( ber, *c );
+       {
+               for( ; *c != NULL; c++) {
+                       rc = send_ldap_control( ber, *c );
+                       if( rc == -1 ) return rc;
+               }
+       }
+
+#ifdef LDAP_DEVEL
+       /* this is a hack to avoid having to modify op->s_ctrls */
+       if( o->o_sortedresults ) {
+               BerElementBuffer berbuf;
+               BerElement *sber = (BerElement *) &berbuf;
+               LDAPControl sorted;
+               BER_BVZERO( &sorted.ldctl_value );
+               sorted.ldctl_oid = LDAP_CONTROL_SORTRESPONSE;
+               sorted.ldctl_iscritical = 0;
+
+               ber_init2( sber, NULL, LBER_USE_DER );
+
+               ber_printf( sber, "{i}", LDAP_UNWILLING_TO_PERFORM );
+
+               if( ber_flatten2( ber, &sorted.ldctl_value, 0 ) == -1 ) {
+                       return LBER_ERROR;
+               }
+
+               (void) ber_free_buf( ber );
+
+               rc = send_ldap_control( ber, &sorted );
                if( rc == -1 ) return rc;
        }
+#endif
 
 #ifdef LDAP_SLAPI
        if ( sctrls != NULL ) {
@@ -298,6 +327,11 @@ send_ldap_response(
        int             rc = LDAP_SUCCESS;
        long    bytes;
 
+       if ( rs->sr_err == SLAPD_ABANDON ) {
+               rc = SLAPD_ABANDON;
+               goto clean2;
+       }
+
        if ( op->o_callback ) {
                int             first = 1;
                slap_callback   *sc = op->o_callback,
@@ -539,6 +573,10 @@ slap_send_ldap_result( Operation *op, SlapReply *rs )
 
        rs->sr_type = REP_RESULT;
 
+       /* Propagate Abandons so that cleanup callbacks can be processed */
+       if ( rs->sr_err == SLAPD_ABANDON )
+               goto abandon;
+
        assert( !LDAP_API_ERROR( rs->sr_err ));
 
        Debug( LDAP_DEBUG_TRACE,
@@ -602,6 +640,7 @@ slap_send_ldap_result( Operation *op, SlapReply *rs )
        rs->sr_tag = req2res( op->o_tag );
        rs->sr_msgid = (rs->sr_tag != LBER_SEQUENCE) ? op->o_msgid : 0;
 
+abandon:
        if ( send_ldap_response( op, rs ) == SLAP_CB_CONTINUE ) {
                if ( op->o_tag == LDAP_REQ_SEARCH ) {
                        char nbuf[64];
@@ -1163,6 +1202,12 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
                goto error_return;
        }
 
+       if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
+               be_entry_release_rw( op, rs->sr_entry, 0 );
+               rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
+               rs->sr_entry = NULL;
+       }
+
        if ( op->o_res_ber == NULL ) {
                bytes = send_ldap_ber( op->o_conn, ber );
                ber_free_buf( ber );
@@ -1185,7 +1230,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
        }
 
        Statslog( LDAP_DEBUG_STATS2, "%s ENTRY dn=\"%s\"\n",
-           op->o_log_prefix, rs->sr_entry->e_dn, 0, 0, 0 );
+           op->o_log_prefix, edn, 0, 0, 0 );
 
        Debug( LDAP_DEBUG_TRACE,
                "<= send_search_entry: conn %lu exit.\n", op->o_connid, 0, 0 );
@@ -1358,6 +1403,12 @@ slap_send_search_reference( Operation *op, SlapReply *rs )
                goto rel;
        }
 
+       if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
+               be_entry_release_rw( op, rs->sr_entry, 0 );
+               rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
+               rs->sr_entry = NULL;
+       }
+
 #ifdef LDAP_CONNECTIONLESS
        if (!op->o_conn || op->o_conn->c_is_udp == 0) {
 #endif
@@ -1405,8 +1456,7 @@ str2result(
     char       *s,
     int                *code,
     char       **matched,
-    char       **info
-)
+    char       **info )
 {
        int     rc;
        char    *c;
@@ -1567,8 +1617,10 @@ slap_attr_flags( AttributeName *an )
                flags |= ( SLAP_OPATTRS_NO | SLAP_USERATTRS_YES );
 
        } else {
-               flags |= an_find( an, &AllOper ) ?  SLAP_OPATTRS_YES : SLAP_OPATTRS_NO;
-               flags |= an_find( an, &AllUser ) ?  SLAP_USERATTRS_YES : SLAP_USERATTRS_NO;
+               flags |= an_find( an, &AllOper )
+                       ? SLAP_OPATTRS_YES : SLAP_OPATTRS_NO;
+               flags |= an_find( an, &AllUser )
+                       ? SLAP_USERATTRS_YES : SLAP_USERATTRS_NO;
        }
 
        return flags;
index dbe4f371c6abdf5907af62938be800397170115b..a4a0cf6898f95fd9b553d5b84c181db5cfb63e2a 100644 (file)
@@ -52,10 +52,11 @@ root_dse_info(
        const char **text )
 {
        Entry           *e;
-       struct berval vals[2], *bv;
-       struct berval nvals[2];
+       struct berval val, *bv;
+       struct berval nval;
        int             i, j;
        char ** supportedSASLMechanisms;
+       BackendDB *be;
 
        AttributeDescription *ad_structuralObjectClass
                = slap_schema.si_ad_structuralObjectClass;
@@ -78,9 +79,6 @@ root_dse_info(
        AttributeDescription *ad_ref
                = slap_schema.si_ad_ref;
 
-       vals[1].bv_val = NULL;
-       nvals[1].bv_val = NULL;
-
        e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) );
 
        if( e == NULL ) {
@@ -101,50 +99,51 @@ root_dse_info(
 
        e->e_private = NULL;
 
-       vals[0].bv_val = "top";
-       vals[0].bv_len = sizeof("top")-1;
-       if( attr_merge( e, ad_objectClass, vals, NULL ) ) {
+       BER_BVSTR( &val, "top" );
+       if( attr_merge_one( e, ad_objectClass, &val, NULL ) ) {
                return LDAP_OTHER;
        }
 
-       vals[0].bv_val = "OpenLDAProotDSE";
-       vals[0].bv_len = sizeof("OpenLDAProotDSE")-1;
-       if( attr_merge( e, ad_objectClass, vals, NULL ) ) {
+       BER_BVSTR( &val, "OpenLDAProotDSE" );
+       if( attr_merge_one( e, ad_objectClass, &val, NULL ) ) {
                return LDAP_OTHER;
        }
-       if( attr_merge( e, ad_structuralObjectClass, vals, NULL ) ) {
+       if( attr_merge_one( e, ad_structuralObjectClass, &val, NULL ) ) {
                return LDAP_OTHER;
        }
 
-       for ( i = 0; i < nbackends; i++ ) {
-               if ( backends[i].be_suffix == NULL
-                               || backends[i].be_nsuffix == NULL ) {
+       LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+               if ( be->be_suffix == NULL
+                               || be->be_nsuffix == NULL ) {
                        /* no suffix! */
                        continue;
                }
-               if ( SLAP_MONITOR( &backends[i] )) {
-                       vals[0] = backends[i].be_suffix[0];
-                       nvals[0] = backends[i].be_nsuffix[0];
-                       if( attr_merge( e, ad_monitorContext, vals, nvals ) ) {
+               if ( SLAP_MONITOR( be )) {
+                       if( attr_merge_one( e, ad_monitorContext,
+                                       &be->be_suffix[0],
+                                       &be->be_nsuffix[0] ) )
+                       {
                                return LDAP_OTHER;
                        }
                        continue;
                }
-               if ( SLAP_CONFIG( &backends[i] )) {
-                       vals[0] = backends[i].be_suffix[0];
-                       nvals[0] = backends[i].be_nsuffix[0];
-                       if( attr_merge( e, ad_configContext, vals, nvals ) ) {
+               if ( SLAP_CONFIG( be )) {
+                       if( attr_merge_one( e, ad_configContext,
+                                       &be->be_suffix[0],
+                                       & be->be_nsuffix[0] ) )
+                       {
                                return LDAP_OTHER;
                        }
                        continue;
                }
-               if ( SLAP_GLUE_SUBORDINATE( &backends[i] ) && !SLAP_GLUE_ADVERTISE( &backends[i] ) ) {
+               if ( SLAP_GLUE_SUBORDINATE( be ) && !SLAP_GLUE_ADVERTISE( be ) ) {
                        continue;
                }
-               for ( j = 0; backends[i].be_suffix[j].bv_val != NULL; j++ ) {
-                       vals[0] = backends[i].be_suffix[j];
-                       nvals[0] = backends[i].be_nsuffix[0];
-                       if( attr_merge( e, ad_namingContexts, vals, nvals ) ) {
+               for ( j = 0; be->be_suffix[j].bv_val != NULL; j++ ) {
+                       if( attr_merge_one( e, ad_namingContexts,
+                                       &be->be_suffix[j],
+                                       &be->be_nsuffix[0] ) )
+                       {
                                return LDAP_OTHER;
                        }
                }
@@ -165,8 +164,7 @@ root_dse_info(
 #ifdef LDAP_SLAPI
        /* netscape supportedExtension */
        for ( i = 0; (bv = slapi_int_get_supported_extop(i)) != NULL; i++ ) {
-               vals[0] = *bv;
-               if( attr_merge( e, ad_supportedExtension, vals, NULL )) {
+               if( attr_merge_one( e, ad_supportedExtension, bv, NULL ) ) {
                        return LDAP_OTHER;
                }
        }
@@ -187,9 +185,9 @@ root_dse_info(
                        continue;
                }
                snprintf(buf, sizeof buf, "%d", i);
-               vals[0].bv_val = buf;
-               vals[0].bv_len = strlen( vals[0].bv_val );
-               if( attr_merge( e, ad_supportedLDAPVersion, vals, NULL ) ) {
+               val.bv_val = buf;
+               val.bv_len = strlen( val.bv_val );
+               if( attr_merge_one( e, ad_supportedLDAPVersion, &val, NULL ) ) {
                        return LDAP_OTHER;
                }
        }
@@ -199,9 +197,9 @@ root_dse_info(
 
        if( supportedSASLMechanisms != NULL ) {
                for ( i=0; supportedSASLMechanisms[i] != NULL; i++ ) {
-                       vals[0].bv_val = supportedSASLMechanisms[i];
-                       vals[0].bv_len = strlen( vals[0].bv_val );
-                       if( attr_merge( e, ad_supportedSASLMechanisms, vals, NULL ) ) {
+                       val.bv_val = supportedSASLMechanisms[i];
+                       val.bv_len = strlen( val.bv_val );
+                       if( attr_merge_one( e, ad_supportedSASLMechanisms, &val, NULL ) ) {
                                return LDAP_OTHER;
                        }
                }
index bf068e85c1d3b59f76cd296700deec480a8bf76e..091a7d21390a78f0e9351adc76755f85232b5a44 100644 (file)
 #include "portable.h"
 
 #include <stdio.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
 #include <ac/stdlib.h>
 #include <ac/string.h>
 
@@ -24,8 +28,6 @@
 
 #include "slap.h"
 
-#include <limits.h>
-
 #ifdef HAVE_CYRUS_SASL
 # ifdef HAVE_SASL_SASL_H
 #  include <sasl/sasl.h>
@@ -576,7 +578,7 @@ slap_sasl_authorize(
 {
        Connection *conn = (Connection *)context;
        struct propval auxvals[3];
-       struct berval authcDN, authzDN;
+       struct berval authcDN, authzDN=BER_BVNULL;
        int rc;
 
        /* Simple Binds don't support proxy authorization, ignore it */
@@ -601,17 +603,16 @@ slap_sasl_authorize(
        }
 
        AC_MEMCPY( &authcDN, auxvals[0].values[0], sizeof(authcDN) );
+       conn->c_sasl_dn = authcDN;
 
        /* Nothing to do if no authzID was given */
        if ( !auxvals[1].name || !auxvals[1].values ) {
-               conn->c_sasl_dn = authcDN;
                goto ok;
        }
        
        AC_MEMCPY( &authzDN, auxvals[1].values[0], sizeof(authzDN) );
 
        rc = slap_sasl_authorized( conn->c_sasl_bindop, &authcDN, &authzDN );
-       ch_free( authcDN.bv_val );
        if ( rc != LDAP_SUCCESS ) {
                Debug( LDAP_DEBUG_TRACE, "SASL Proxy Authorize [conn=%ld]: "
                        "proxy authorization disallowed (%d)\n",
@@ -622,18 +623,19 @@ slap_sasl_authorize(
                return SASL_NOAUTHZ;
        }
 
-       conn->c_sasl_dn = authzDN;
+       conn->c_sasl_authz_dn = authzDN;
 ok:
        if (conn->c_sasl_bindop) {
                Statslog( LDAP_DEBUG_STATS,
-                       "conn=%lu op=%lu BIND authcid=\"%s\"\n",
+                       "conn=%lu op=%lu BIND authcid=\"%s\" authzid=\"%s\"\n",
                        conn->c_connid, conn->c_sasl_bindop->o_opid, 
-                       auth_identity, 0, 0);
+                       auth_identity, requested_user, 0);
        }
 
        Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
-               " proxy authorization allowed\n",
-               (long) (conn ? conn->c_connid : -1), 0, 0 );
+               " proxy authorization allowed authzDN=\"%s\"\n",
+               (long) (conn ? conn->c_connid : -1), 
+               authzDN.bv_val ? authzDN.bv_val : "", 0 );
        return SASL_OK;
 } 
 #else
@@ -682,11 +684,11 @@ slap_sasl_authorize(
                *errstr = ldap_err2string( rc );
                return SASL_NOAUTHZ;
        }
+       conn->c_sasl_dn = authcDN;
        if( ( authzid == NULL ) || !strcmp( authcid, authzid ) ) {
                Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
                 "Using authcDN=%s\n", (long) (conn ? conn->c_connid : -1), authcDN.bv_val,0 );
 
-               conn->c_sasl_dn = authcDN;
                goto ok;
        }
 
@@ -695,13 +697,11 @@ slap_sasl_authorize(
        rc = slap_sasl_getdn( conn, NULL, &bvauthzid, realm,
                &authzDN, SLAP_GETDN_AUTHZID );
        if( rc != LDAP_SUCCESS ) {
-               ch_free( authcDN.bv_val );
                *errstr = ldap_err2string( rc );
                return SASL_NOAUTHZ;
        }
 
        rc = slap_sasl_authorized(conn->c_sasl_bindop, &authcDN, &authzDN );
-       ch_free( authcDN.bv_val );
        if( rc ) {
                Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
                        "proxy authorization disallowed (%d)\n",
@@ -711,18 +711,19 @@ slap_sasl_authorize(
                ch_free( authzDN.bv_val );
                return SASL_NOAUTHZ;
        }
-       conn->c_sasl_dn = authzDN;
+       conn->c_sasl_authz_dn = authzDN;
 
 ok:
        Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
-               " authorization allowed\n",
-               (long) (conn ? conn->c_connid : -1), 0, 0 );
+               " authorization allowed authzDN=\"%s\"\n",
+               (long) (conn ? conn->c_connid : -1),
+               authzDN.bv_val ? authzDN.bv_val : "", 0 );
 
        if (conn->c_sasl_bindop) {
                Statslog( LDAP_DEBUG_STATS,
-                       "conn=%lu op=%lu BIND authcid=\"%s\"\n",
+                       "conn=%lu op=%lu BIND authcid=\"%s\" authzid=\"%s\"\n",
                        conn->c_connid, conn->c_sasl_bindop->o_opid, 
-                       authcid, 0, 0);
+                       authcid, authzid ? authzid : "", 0);
        }
 
        *errstr = NULL;
index a30340e31aa1101e936388543d7b0a0382b96d9a..001c0ecdb0935eb941f20a96f72d5526e673cad9 100644 (file)
@@ -17,6 +17,9 @@
 #include "portable.h"
 
 #include <stdio.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
 
 #include <ac/stdlib.h>
 #include <ac/string.h>
@@ -24,8 +27,6 @@
 
 #include "slap.h"
 
-#include <limits.h>
-
 #include "lutil.h"
 
 #define SASLREGEX_REPLACE 10
@@ -1059,6 +1060,7 @@ exact_match:
                BER_BVZERO( &base );
        }
        ber_dupbv_x( &op.o_req_dn, &op.o_req_ndn, op.o_tmpmemctx );
+       op.ors_deref = LDAP_DEREF_NEVER;
        op.ors_slimit = 1;
        op.ors_tlimit = SLAP_NO_LIMIT;
        op.ors_attrs = slap_anlist_no_attrs;
index 9a23e7b255ed6ba35d0f903402a17e92d9816312..a06aefa5d64df32032edf7b012ebca98ac8f69cb 100644 (file)
@@ -121,11 +121,12 @@ attributetype ( 2.5.4.12 NAME 'title'
        DESC 'RFC2256: title associated with the entity'
        SUP name )
 
-attributetype ( 2.5.4.13 NAME 'description'
-       DESC 'RFC2256: descriptive information'
-       EQUALITY caseIgnoreMatch
-       SUBSTR caseIgnoreSubstringsMatch
-       SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
+# system schema
+#attributetype ( 2.5.4.13 NAME 'description'
+#      DESC 'RFC2256: descriptive information'
+#      EQUALITY caseIgnoreMatch
+#      SUBSTR caseIgnoreSubstringsMatch
+#      SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
 
 # Deprecated by enhancedSearchGuide
 attributetype ( 2.5.4.14 NAME 'searchGuide'
@@ -231,9 +232,10 @@ attributetype ( 2.5.4.33 NAME 'roleOccupant'
        DESC 'RFC2256: occupant of role'
        SUP distinguishedName )
 
-attributetype ( 2.5.4.34 NAME 'seeAlso'
-       DESC 'RFC2256: DN of related object'
-       SUP distinguishedName )
+# system schema
+#attributetype ( 2.5.4.34 NAME 'seeAlso'
+#      DESC 'RFC2256: DN of related object'
+#      SUP distinguishedName )
 
 # system schema
 #attributetype ( 2.5.4.35 NAME 'userPassword'
index 183dca5754aa880132b0910727aba603c7f0eaaa..c95e44b6304da49d9208e1f66c6875b4c907394a 100644 (file)
 # Not recommended for production use!
 # Use with extreme caution!
 
-# Internet-Draft                                                P. Behera
-# draft behera-ldap-password-policy-07.txt                      L. Poitou
-# Intended Category: Proposed Standard                   Sun Microsystems
-# Expires: August 2004                                     J. Sermersheim
-#                                                                  Novell
-# 
-#                                                           February 2004
-#  
-#  
-#                   Password Policy for LDAP Directories 
-#  
-#  
-# Status of this Memo 
-#  
-#    This document is an Internet-Draft and is in full conformance with 
-#    all provisions of Section 10 of RFC 2026.  
-#     
-#    Internet-Drafts are working documents of the Internet Engineering 
-#    Task Force (IETF), its areas, and its working groups. Note that 
-#    other groups may also distribute working documents as Internet-
-#    Drafts. 
-#     
-#    Internet-Drafts are draft documents valid for a maximum of six 
-#    months and may be updated, replaced, or obsoleted by other documents 
-#    at any time. It is inappropriate to use Internet- Drafts as 
-#    reference material or to cite them other than as "work in progress." 
-#      
-#    The list of current Internet-Drafts can be accessed at 
-#    http://www.ietf.org/ietf/1id-abstracts.txt  
-#     
-#    The list of Internet-Draft Shadow Directories can be accessed at 
-#    http://www.ietf.org/shadow.html. 
-#     
-#    Technical discussions of this draft are held on the LDAPEXT Working 
-#    Group mailing list at ietf-ldapext@netscape.com. Editorial comments 
-#    may be sent to the authors listed in Section 13. 
-#     
-#    Copyright (C) The Internet Society (2004). All rights Reserved. 
-#     
-#    Please see the Copyright Section near the end of this document for 
-#    more information. 
-#     
-#     
-# 1. Abstract 
-#     
-#    Password policy as described in this document is a set of rules that 
-#    controls how passwords are used and administered in LDAP 
-#    directories. In order to improve the security of LDAP directories 
-#    and make it difficult for password cracking programs to break into 
-#    directories, it is desirable to enforce a set of rules on password 
-#    usage.  These rules are made to ensure that users change their 
-#    passwords periodically, passwords meet construction requirements, 
-#    the re-use of old password is restricted, and users are locked out 
-#    after a certain number of failed attempts. 
-#     
-# [trimmed]
-# 
-#     
-# 4.2. Attribute Types used in the pwdPolicy ObjectClass 
-#     
-#    Following are the attribute types used by the pwdPolicy object 
-#    class. 
-#     
-# 4.2.1. pwdAttribute 
-#     
-#    This holds the name of the attribute to which the password policy is 
-#    applied. For example, the password policy may be applied to the 
-#    userPassword attribute. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.1 
-      NAME 'pwdAttribute' 
-      EQUALITY objectIdentifierMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 ) 
-    
-# 4.2.2. pwdMinAge  
-#     
-#    This attribute holds the number of seconds that must elapse between 
-#    modifications to the password. If this attribute is not present, 0 
-#    seconds is assumed. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.2 
-      NAME 'pwdMinAge' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  
-      SINGLE-VALUE ) 
-    
-# 4.2.3. pwdMaxAge 
-#     
-#    This attribute holds the number of seconds after which a modified 
-#    password will expire. 
-#     
-#    If this attribute is not present, or if the value is 0 the password 
-#    does not expire. If not 0, the value must be greater than or equal 
-#    to the value of the pwdMinAge. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.3 
-      NAME 'pwdMaxAge' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
-      SINGLE-VALUE ) 
-    
-# 4.2.4. pwdInHistory 
-#     
-#    This attribute specifies the maximum number of used passwords stored 
-#    in the pwdHistory attribute. 
-#     
-#    If this attribute is not present, or if the value is 0, used 
-#    passwords are not stored in the pwdHistory attribute and thus may be 
-#    reused. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.4 
-      NAME 'pwdInHistory' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
-      SINGLE-VALUE ) 
-    
-# 4.2.5. pwdCheckQuality 
-#     
-#    This attribute indicates how the password quality will be verified 
-#    while being modified or added. If this attribute is not present, or 
-#    if the value is '0', quality checking will not be enforced. A value 
-#    of '1' indicates that the server will check the quality, and if the 
-#    server is unable to check it (due to a hashed password or other 
-#    reasons) it will be accepted. A value of '2' indicates that the 
-#    server will check the quality, and if the server is unable to verify 
-#    it, it will return an error refusing the password. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.5 
-      NAME 'pwdCheckQuality' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  
-      SINGLE-VALUE ) 
-    
-# 4.2.6. pwdMinLength 
-#     
-#    When quality checking is enabled, this attribute holds the minimum 
-#    number of characters that must be used in a password. If this 
-#    attribute is not present, no minimum password length will be 
-#    enforced. If the server is unable to check the length (due to a 
-#    hashed password or otherwise), the server will, depending on the 
-#    value of the pwdCheckQuality attribute, either accept the password 
-#    without checking it ('0' or '1') or refuse it ('2'). 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.6 
-      NAME 'pwdMinLength' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
-      SINGLE-VALUE ) 
-    
-# 4.2.7. pwdExpireWarning 
-#     
-#    This attribute specifies the maximum number of seconds before a 
-#    password is due to expire that expiration warning messages will be 
-#    returned to an authenticating user. If this attribute is not 
-#    present, or if the value is 0 no warnings will be sent. If not 0, 
-#    the value must be smaller than the value of the pwdMaxAge attribute. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.7 
-      NAME 'pwdExpireWarning' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  
-      SINGLE-VALUE ) 
-    
-# 4.2.8. pwdGraceLoginLimit 
-#     
-#    This attribute specifies the number of times an expired password can 
-#    be used to authenticate. If this attribute is not present or if the 
-#    value is 0, authentication will fail. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.8 
-      NAME 'pwdGraceLoginLimit' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  
-      SINGLE-VALUE ) 
-    
-# 4.2.9. pwdLockout 
-#     
-#    This attribute indicates, when its value is "TRUE", that the 
-#    password may not be used to authenticate after a specified number of 
-#    consecutive failed bind attempts. The maximum number of consecutive 
-#    failed bind attempts is specified in pwdMaxFailure. 
-#     
-#    If this attribute is not present, or if the value is "FALSE", the 
-#    password may be used to authenticate when the number of failed bind 
-#    attempts has been reached. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.9 
-      NAME 'pwdLockout' 
-      EQUALITY booleanMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7  
-      SINGLE-VALUE ) 
-
-# 4.2.10. pwdLockoutDuration 
-#     
-#    This attribute holds the number of seconds that the password cannot 
-#    be used to authenticate due to too many failed bind attempts. If 
-#    this attribute is not present, or if the value is 0 the password 
-#    cannot be used to authenticate until reset by an administrator. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.10 
-      NAME 'pwdLockoutDuration' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  
-      SINGLE-VALUE ) 
-    
-# 4.2.11. pwdMaxFailure 
-#     
-#    This attribute specifies the number of consecutive failed bind 
-#    attempts after which the password may not be used to authenticate. 
-#    If this attribute is not present, or if the value is 0, this policy 
-#    is not checked, and the value of pwdLockout will be ignored. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.11 
-      NAME 'pwdMaxFailure' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  
-      SINGLE-VALUE ) 
-    
-# 4.2.12. pwdFailureCountInterval 
-#     
-#    This attribute holds the number of seconds after which the password 
-#    failures are purged from the failure counter, even though no 
-#    successful authentication occurred. 
-#     
-#    If this attribute is not present, or if its value is 0, the failure 
-#    counter is only reset by a successful authentication. 
-     
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.12 
-      NAME 'pwdFailureCountInterval' 
-      EQUALITY integerMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27  
-      SINGLE-VALUE ) 
-    
-# 4.2.13. pwdMustChange 
-#     
-#    This attribute specifies with a value of "TRUE" that users must 
-#    change their passwords when they first bind to the directory after a 
-#    password is set or reset by the administrator. If this attribute is 
-#    not present, or if the value is "FALSE", users are not required to 
-#    change their password upon binding after the administrator sets or 
-#    resets the password. 
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.13 
-      NAME 'pwdMustChange' 
-      EQUALITY booleanMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7  
-      SINGLE-VALUE ) 
-    
-# 4.2.14. pwdAllowUserChange 
-#     
-#    This attribute indicates whether users can change their own 
-#    passwords, although the change operation is still subject to access 
-#    control. If this attribute is not present, a value of "TRUE" is 
-#    assumed. 
-    
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.14 
-      NAME 'pwdAllowUserChange' 
-      EQUALITY booleanMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7  
-      SINGLE-VALUE ) 
-    
-# 4.2.15. pwdSafeModify 
-#     
-#    This attribute specifies whether or not the existing password must 
-#    be sent when changing a password. If this attribute is not present, 
-#    a "FALSE" value is assumed. 
-#     
-attributetype   (  1.3.6.1.4.1.42.2.27.8.1.15 
-      NAME 'pwdSafeModify' 
-      EQUALITY booleanMatch 
-      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7  
-      SINGLE-VALUE ) 
+#Network Working Group                                     J. Sermersheim
+#Internet-Draft                                               Novell, Inc
+#Expires: April 24, 2005                                        L. Poitou
+#                                                        Sun Microsystems
+#                                                        October 24, 2004
+#
+#
+#                  Password Policy for LDAP Directories
+#                draft-behera-ldap-password-policy-08.txt
+#
+#Status of this Memo
+#
+#   This document is an Internet-Draft and is subject to all provisions
+#   of section 3 of RFC 3667.  By submitting this Internet-Draft, each
+#   author represents that any applicable patent or other IPR claims of
+#   which he or she is aware have been or will be disclosed, and any of
+#   which he or she become aware will be disclosed, in accordance with
+#   RFC 3668.
+#
+#   Internet-Drafts are working documents of the Internet Engineering
+#   Task Force (IETF), its areas, and its working groups.  Note that
+#   other groups may also distribute working documents as
+#   Internet-Drafts.
+#
+#   Internet-Drafts are draft documents valid for a maximum of six months
+#   and may be updated, replaced, or obsoleted by other documents at any
+#   time.  It is inappropriate to use Internet-Drafts as reference
+#   material or to cite them other than as "work in progress."
+#
+#   The list of current Internet-Drafts can be accessed at
+#   http://www.ietf.org/ietf/1id-abstracts.txt.
+#
+#   The list of Internet-Draft Shadow Directories can be accessed at
+#   http://www.ietf.org/shadow.html.
+#
+#   This Internet-Draft will expire on April 24, 2005.
+#
+#Copyright Notice
+#
+#   Copyright (C) The Internet Society (2004).
+#
+#Abstract
+#
+#   Password policy as described in this document is a set of rules that
+#   controls how passwords are used and administered in Lightweight
+#   Directory Access Protocol (LDAP) based directories.  In order to
+#   improve the security of LDAP directories and make it difficult for
+#   password cracking programs to break into directories, it is desirable
+#   to enforce a set of rules on password usage.  These rules are made to
+#
+#  [trimmed]
+#
+#5.  Schema used for Password Policy
+#
+#   The schema elements defined here fall into two general categories.  A
+#   password policy object class is defined which contains a set of
+#   administrative password policy attributes, and a set of operational
+#   attributes are defined that hold general password policy state
+#   information for each user.
+#
+#5.2  Attribute Types used in the pwdPolicy ObjectClass
+#
+#   Following are the attribute types used by the pwdPolicy object class.
+#
+#5.2.1  pwdAttribute
+#
+#   This holds the name of the attribute to which the password policy is
+#   applied.  For example, the password policy may be applied to the
+#   userPassword attribute.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.1
+      NAME 'pwdAttribute'
+      EQUALITY objectIdentifierMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )
+
+#5.2.2  pwdMinAge
+#
+#   This attribute holds the number of seconds that must elapse between
+#   modifications to the password.  If this attribute is not present, 0
+#   seconds is assumed.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.2
+      NAME 'pwdMinAge'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.3  pwdMaxAge
+#
+#   This attribute holds the number of seconds after which a modified
+#   password will expire.
+#
+#   If this attribute is not present, or if the value is 0 the password
+#   does not expire.  If not 0, the value must be greater than or equal
+#   to the value of the pwdMinAge.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.3
+      NAME 'pwdMaxAge'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.4  pwdInHistory
+#
+#   This attribute specifies the maximum number of used passwords stored
+#   in the pwdHistory attribute.
+#
+#   If this attribute is not present, or if the value is 0, used
+#   passwords are not stored in the pwdHistory attribute and thus may be
+#   reused.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.4
+      NAME 'pwdInHistory'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.5  pwdCheckQuality
+#
+#   {TODO: Consider changing the syntax to OID.  Each OID will list a
+#   quality rule (like min len, # of special characters, etc).  These
+#   rules can be specified outsid ethis document.}
+#
+#   {TODO: Note that even though this is meant to be a check that happens
+#   during password modification, it may also be allowed to happen during
+#   authN.  This is useful for situations where the password is encrypted
+#   when modified, but decrypted when used to authN.}
+#
+#   This attribute indicates how the password quality will be verified
+#   while being modified or added.  If this attribute is not present, or
+#   if the value is '0', quality checking will not be enforced.  A value
+#   of '1' indicates that the server will check the quality, and if the
+#   server is unable to check it (due to a hashed password or other
+#   reasons) it will be accepted.  A value of '2' indicates that the
+#   server will check the quality, and if the server is unable to verify
+#   it, it will return an error refusing the password.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.5
+      NAME 'pwdCheckQuality'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.6  pwdMinLength
+#
+#   When quality checking is enabled, this attribute holds the minimum
+#   number of characters that must be used in a password.  If this
+#   attribute is not present, no minimum password length will be
+#   enforced.  If the server is unable to check the length (due to a
+#   hashed password or otherwise), the server will, depending on the
+#   value of the pwdCheckQuality attribute, either accept the password
+#   without checking it ('0' or '1') or refuse it ('2').
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.6
+      NAME 'pwdMinLength'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.7  pwdExpireWarning
+#
+#   This attribute specifies the maximum number of seconds before a
+#   password is due to expire that expiration warning messages will be
+#   returned to an authenticating user.
+#
+#   If this attribute is not present, or if the value is 0 no warnings
+#   will be returned.  If not 0, the value must be smaller than the value
+#   of the pwdMaxAge attribute.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.7
+      NAME 'pwdExpireWarning'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.8  pwdGraceAuthNLimit
+#
+#   This attribute specifies the number of times an expired password can
+#   be used to authenticate.  If this attribute is not present or if the
+#   value is 0, authentication will fail.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.8
+      NAME 'pwdGraceAuthNLimit'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.9  pwdLockout
+#
+#   This attribute indicates, when its value is "TRUE", that the password
+#   may not be used to authenticate after a specified number of
+#   consecutive failed bind attempts.  The maximum number of consecutive
+#   failed bind attempts is specified in pwdMaxFailure.
+#
+#   If this attribute is not present, or if the value is "FALSE", the
+#   password may be used to authenticate when the number of failed bind
+#   attempts has been reached.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.9
+      NAME 'pwdLockout'
+      EQUALITY booleanMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
+      SINGLE-VALUE )
+
+#5.2.10  pwdLockoutDuration
+#
+#   This attribute holds the number of seconds that the password cannot
+#   be used to authenticate due to too many failed bind attempts.  If
+#   this attribute is not present, or if the value is 0 the password
+#   cannot be used to authenticate until reset by a password
+#   administrator.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.10
+      NAME 'pwdLockoutDuration'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.11  pwdMaxFailure
+#
+#   This attribute specifies the number of consecutive failed bind
+#   attempts after which the password may not be used to authenticate.
+#   If this attribute is not present, or if the value is 0, this policy
+#   is not checked, and the value of pwdLockout will be ignored.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.11
+      NAME 'pwdMaxFailure'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.12  pwdFailureCountInterval
+#
+#   This attribute holds the number of seconds after which the password
+#   failures are purged from the failure counter, even though no
+#   successful authentication occurred.
+#
+#   If this attribute is not present, or if its value is 0, the failure
+#   counter is only reset by a successful authentication.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.12
+      NAME 'pwdFailureCountInterval'
+      EQUALITY integerMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+      SINGLE-VALUE )
+
+#5.2.13  pwdMustChange
+#
+#   This attribute specifies with a value of "TRUE" that users must
+#   change their passwords when they first bind to the directory after a
+#   password is set or reset by a password administrator.  If this
+#   attribute is not present, or if the value is "FALSE", users are not
+#   required to change their password upon binding after the password
+#   administrator sets or resets the password.  This attribute is not set
+#   due to any actions specified by this document, it is typically set by
+#   a password administrator after resetting a user's password.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.13
+      NAME 'pwdMustChange'
+      EQUALITY booleanMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
+      SINGLE-VALUE )
+
+#5.2.14  pwdAllowUserChange
+#
+#   This attribute indicates whether users can change their own
+#   passwords, although the change operation is still subject to access
+#   control.  If this attribute is not present, a value of "TRUE" is
+#   assumed.  This attribute is intended to be used in the absense of an
+#   access control mechanism.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.14
+      NAME 'pwdAllowUserChange'
+      EQUALITY booleanMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
+      SINGLE-VALUE )
+
+#5.2.15  pwdSafeModify
+#
+#   This attribute specifies whether or not the existing password must be
+#   sent along with the new password when being changed.  If this
+#   attribute is not present, a "FALSE" value is assumed.
+
+attributetype ( 1.3.6.1.4.1.42.2.27.8.1.15
+      NAME 'pwdSafeModify'
+      EQUALITY booleanMatch
+      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
+      SINGLE-VALUE )
 
 # HP extensions
 #
@@ -312,231 +328,204 @@ attributetype   (  1.3.6.1.4.1.42.2.27.8.1.15
 #
 #    The function should return LDAP_SUCCESS for a valid password.
 
-attributetype  (  1.3.6.1.4.1.4754.1.99.1
+attributetype ( 1.3.6.1.4.1.4754.1.99.1
      NAME 'pwdCheckModule'
      EQUALITY caseExactIA5Match
      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
      DESC 'Loadable module that instantiates "check_password() function'
      SINGLE-VALUE )
 
-# 4.1. The pwdPolicy Object Class 
-#     
-#    This object class contains the attributes defining a password policy 
-#    in effect for a set of users. Section 8 describes the administration 
-#    of this object, and the relationship between it and particular 
-#    objects. 
-    
-objectclass   (  1.3.6.1.4.1.42.2.27.8.2.1 
-      NAME 'pwdPolicy'  
-      SUP top 
-      AUXILIARY  
-      MUST ( pwdAttribute ) 
-      MAY ( pwdMinAge $ pwdMaxAge $ pwdInHistory $ pwdCheckQuality $ 
-      pwdMinLength $ pwdExpireWarning $ pwdGraceLoginLimit $ pwdLockout 
-      $ pwdLockoutDuration $ pwdMaxFailure $ pwdFailureCountInterval $ 
-      pwdMustChange $ pwdAllowUserChange $ pwdSafeModify ) ) 
-
-objectclass  (   1.3.6.1.4.1.4754.2.99.1
+objectclass ( 1.3.6.1.4.1.4754.2.99.1
       NAME 'pwdPolicyChecker'
       SUP top
       AUXILIARY
       MAY ( pwdCheckModule ) )
 
-# 4.3. Attribute Types for Password Policy State Information 
-#     
-#    Password policy state information must be maintained for each user. 
-#    The information is located in each user entry as a set of 
-#    operational attributes. These operational attributes are: 
-#    pwdChangedTime, pwdAccountLockedTime, pwdExpirationWarned, 
-#    pwdFailureTime, pwdHistory, pwdGraceUseTime, pwdReset, 
-#    pwdPolicySubEntry. 
-#     
-# 4.3.1. Password Policy State Attribute Option 
-#     
-#    Since the password policy could apply to several attributes used to 
-#    store passwords, each of the above operational attributes must have 
-#    an option to specify which pwdAttribute is applies to.  
-#    The password policy option is defined as the following: 
-#         pwd-<passwordAttribute> 
-#     
-#    where passwordAttribute a string following the OID syntax 
-#    (1.3.6.1.4.1.1466.115.121.1.38). The attribute type descriptor 
-#    (short name) MUST be used. 
-#     
-#    For example, if the pwdPolicy object has for pwdAttribute 
-#    "userPassword" then the pwdChangedTime operational attribute, in a 
-#    user entry, will be: 
-#    pwdChangedTime;pwd-userPassword: 20000103121520Z 
-#     
-#    This attribute option follows sub-typing semantics. If a client 
-#    requests a password policy state attribute to be returned in a 
-#    search operation, and does not specify an option, all subtypes of 
-#    that policy state attribute are returned. 
-#          
-# 4.3.2. pwdChangedTime 
-#     
-#    This attribute specifies the last time the entry's password was 
-#    changed. This is used by the password expiration policy. If this 
-#    attribute does not exist, the password will never expire. 
-#     
-#    (  1.3.6.1.4.1.42.2.27.8.1.16 
-#       NAME 'pwdChangedTime' 
-#       DESC 'The time the password was last changed' 
-#       SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 
-#       EQUALITY generalizedTimeMatch 
-#       ORDERING generalizedTimeOrderingMatch 
-#       SINGLE-VALUE 
-#       USAGE directoryOperation) 
-#     
-# 4.3.3. pwdAccountLockedTime 
-#     
-#    This attribute holds the time that the user's account was locked. A 
-#    locked account means that the password may no longer be used to 
-#    authenticate. A 0 value means that the account has been locked 
-#    permanently, and that only an administrator can unlock the account. 
-#     
-#    (  1.3.6.1.4.1.42.2.27.8.1.17 
-#       NAME 'pwdAccountLockedTime' 
-#       DESC 'The time an user account was locked' 
-#       SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 
-#       EQUALITY generalizedTimeMatch 
-#       ORDERING generalizedTimeOrderingMatch 
-#       SINGLE-VALUE 
-#       USAGE directoryOperation) 
-#      
-# 4.3.4. pwdExpirationWarned 
-#  
-#    This attribute contains the time when the password expiration 
-#    warning was first sent to the client. The password will expire in 
-#    the pwdExpireWarning time. 
-#     
-#    (  1.3.6.1.4.1.42.2.27.8.1.18 
-#       NAME 'pwdExpirationWarned' 
-#       DESC 'The time the user was first warned about the coming 
-#               expiration of the password' 
-#       SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 
-#       EQUALITY generalizedTimeMatch 
-#       ORDERING generalizedTimeOrderingMatch 
-#       SINGLE-VALUE 
-#       USAGE directoryOperation ) 
-#     
-# 4.3.5. pwdFailureTime 
-#     
-#    This attribute holds the timestamps of the consecutive 
-#    authentication failures. 
-#     
-#    (  1.3.6.1.4.1.42.2.27.8.1.19 
-#       NAME 'pwdFailureTime' 
-#       DESC 'The timestamps of the last consecutive authentication 
-#               failures' 
-#       SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 
-#       EQUALITY generalizedTimeMatch 
-#       ORDERING generalizedTimeOrderingMatch 
-#       USAGE directoryOperation ) 
-#     
-# 4.3.6. pwdHistory 
-#     
-#    This attribute holds a history of previously used passwords. 
-#     
-#    Values of this attribute are transmitted in string format as given 
-#    by the following ABNF: 
-#     
-#    pwdHistory = time "#" syntaxOID "#" length "#" data 
-#     
-#    time         = <generalizedTimeString as specified in 6.14 of 
-#                   [RFC2252]> 
-#     
-#    syntaxOID    = numericoid     ; the string representation of the  
-#                                  ; dotted-decimal OID that defines the 
-#                                  ; syntax used to store the password. 
-#                                  ; numericoid is described in 4.1 of 
-#                                  ; [RFC2252]. 
-#       
-#    length       = numericstring  ; the number of octets in data. 
-#                                  ; numericstring is described in 4.1 of 
-#                                  ; [RFC2252]. 
-#     
-#    data         = <octets representing the password in the format      
-#                 specified by syntaxOID>. 
-#     
-#    This format allows the server to store, and transmit a history of 
-#    passwords that have been used. In order for equality matching to 
-#    function properly, the time field needs to adhere to a consistent 
-#    format. For this purpose, the time field MUST be in GMT format. 
-#     
-#    (  1.3.6.1.4.1.42.2.27.8.1.20 
-#       NAME 'pwdHistory' 
-#       DESC 'The history of user s passwords' 
-#       SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 
-#       EQUALITY octetStringMatch 
-#       USAGE directoryOperation) 
-#     
-# 4.3.7. pwdGraceUseTime 
-#     
-#    This attribute holds the timestamps of grace login once a password 
-#    has expired. 
-#     
-#    (  1.3.6.1.4.1.42.2.27.8.1.21 
-#       NAME 'pwdGraceUseTime' 
-#       DESC 'The timestamps of the grace login once the password has 
-#       expired' 
-#       SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 
-#       EQUALITY generalizedTimeMatch 
-#        
-#       USAGE directoryOperation) 
-#     
-# 4.3.8. pwdReset 
-#     
-#    This attribute holds a flag to indicate (when TRUE) that the 
-#    password has been reset and therefore must be changed by the user on 
-#    first authentication. 
-#     
-#    (  1.3.6.1.4.1.42.2.27.8.1.22 
-#       NAME 'pwdReset' 
-#       DESC 'The indication that the password has been reset' 
-#       EQUALITY booleanMatch 
-#       SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
-#       SINGLE-VALUE 
-#       USAGE directoryOperation) 
-#     
-# 4.3.9. pwdPolicySubentry 
-#     
-#    This attribute points to the pwdPolicy subentry in effect for this 
-#    object. 
-#     
-#    (  1.3.6.1.4.1.42.2.27.8.1.23 
-#       NAME 'pwdPolicySubentry' 
-#       DESC 'The pwdPolicy subentry in effect for this object' 
-#       EQUALITY distinguishedNameMatch 
-#       SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 
-#       SINGLE-VALUE 
-#       USAGE directoryOperation) 
-#     
-# 14. Copyright Notice 
-#     
-#    Copyright (C) The Internet Society (2004). All Rights  
-#    Reserved.   
-#      
-#    This document and translations of it may be copied and furnished to 
-#    others, and derivative works that comment on or otherwise explain it 
-#    or assist in its implementation may be prepared, copied, published 
-#    and distributed, in whole or in part, without restriction of any 
-#    kind, provided that the above copyright notice and this paragraph 
-#    are included on all such copies and derivative works. However, this 
-#    document itself may not be modified in any way, such as by removing 
-#    the copyright notice or references to the Internet Society or other 
-#    Internet organizations, except as needed for the purpose of 
-#    developing Internet standards in which case the procedures for 
-#    copyrights defined in the Internet Standards process must be 
-#    followed, or as required to translate it into languages other than 
-#    English.  
-#      
-#    The limited permissions granted above are perpetual and will not be 
-#    revoked by the Internet Society or its successors or assigns.  
-#      
-#    This document and the information contained herein is provided on an 
-#    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 
-#    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 
-#    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 
-#    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF  
-#    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."  
+#5.1  The pwdPolicy Object Class
+#
+#   This object class contains the attributes defining a password policy
+#   in effect for a set of users.  Section 10 describes the
+#   administration of this object, and the relationship between it and
+#   particular objects.
+#
+objectclass ( 1.3.6.1.4.1.42.2.27.8.2.1
+      NAME 'pwdPolicy'
+      SUP top
+      AUXILIARY
+      MUST ( pwdAttribute )
+      MAY ( pwdMinAge $ pwdMaxAge $ pwdInHistory $ pwdCheckQuality $
+      pwdMinLength $ pwdExpireWarning $ pwdGraceAuthNLimit $ pwdLockout
+      $ pwdLockoutDuration $ pwdMaxFailure $ pwdFailureCountInterval $
+      pwdMustChange $ pwdAllowUserChange $ pwdSafeModify ) )
+
+#5.3  Attribute Types for Password Policy State Information
+#
+#   Password policy state information must be maintained for each user.
+#   The information is located in each user entry as a set of operational
+#   attributes.  These operational attributes are: pwdChangedTime,
+#   pwdAccountLockedTime, pwdFailureTime, pwdHistory, pwdGraceUseTime,
+#   pwdReset, pwdPolicySubEntry.
+#
+#5.3.1  Password Policy State Attribute Option
+#
+#   Since the password policy could apply to several attributes used to
+#   store passwords, each of the above operational attributes must have
+#   an option to specify which pwdAttribute it applies to.  The password
+#   policy option is defined as the following:
+#
+#   pwd-<passwordAttribute>
+#
+#   where passwordAttribute a string following the OID syntax
+#   (1.3.6.1.4.1.1466.115.121.1.38).  The attribute type descriptor
+#   (short name) MUST be used.
+#
+#   For example, if the pwdPolicy object has for pwdAttribute
+#   "userPassword" then the pwdChangedTime operational attribute, in a
+#   user entry, will be:
+#
+#   pwdChangedTime;pwd-userPassword: 20000103121520Z
+#
+#   This attribute option follows sub-typing semantics.  If a client
+#   requests a password policy state attribute to be returned in a search
+#   operation, and does not specify an option, all subtypes of that
+#   policy state attribute are returned.
+#
+#5.3.2  pwdChangedTime
+#
+#   This attribute specifies the last time the entry's password was
+#   changed.  This is used by the password expiration policy.  If this
+#   attribute does not exist, the password will never expire.
+#
+#      ( 1.3.6.1.4.1.42.2.27.8.1.16
+#      NAME 'pwdChangedTime'
+#      DESC 'The time the password was last changed'
+#      EQUALITY generalizedTimeMatch
+#      ORDERING generalizedTimeOrderingMatch
+#      SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
+#      SINGLE-VALUE
+#      USAGE directoryOperation )
+#
+#5.3.3  pwdAccountLockedTime
+#
+#   This attribute holds the time that the user's account was locked.  A
+#   locked account means that the password may no longer be used to
+#   authenticate.  A 000001010000Z value means that the account has been
+#   locked permanently, and that only a password administrator can unlock
+#   the account.
+#
+#      ( 1.3.6.1.4.1.42.2.27.8.1.17
+#      NAME 'pwdAccountLockedTime'
+#      DESC 'The time an user account was locked'
+#      EQUALITY generalizedTimeMatch
+#      ORDERING generalizedTimeOrderingMatch
+#      SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
+#      SINGLE-VALUE
+#      USAGE directoryOperation )
+#
+#5.3.4  pwdFailureTime
+#
+#   This attribute holds the timestamps of the consecutive authentication
+#   failures.
+#
+#      ( 1.3.6.1.4.1.42.2.27.8.1.19
+#      NAME 'pwdFailureTime'
+#      DESC 'The timestamps of the last consecutive authentication
+#      failures'
+#      EQUALITY generalizedTimeMatch
+#      ORDERING generalizedTimeOrderingMatch
+#      SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
+#      USAGE directoryOperation )
+#
+#5.3.5  pwdHistory
+#
+#   This attribute holds a history of previously used passwords.  Values
+#   of this attribute are transmitted in string format as given by the
+#   following ABNF:
+#
+#   pwdHistory = time "#" syntaxOID "#" length "#" data
+#
+#   time       = <generalizedTimeString as specified in 6.14
+#                 of [RFC2252]>
+#
+#   syntaxOID  = numericoid    ; the string representation of the
+#                              ; dotted-decimal OID that defines the
+#                              ; syntax used to store the password.
+#                              ; numericoid is described in 4.1
+#                              ; of [RFC2252].
+#
+#   length     = numericstring ; the number of octets in data.
+#                              ; numericstring is described in 4.1
+#                              ; of [RFC2252].
+#
+#   data       = <octets representing the password in the format
+#                 specified by syntaxOID>.
+#
+#   This format allows the server to store, and transmit a history of
+#   passwords that have been used.  In order for equality matching to
+#   function properly, the time field needs to adhere to a consistent
+#   format.  For this purpose, the time field MUST be in GMT format.
+#
+#      ( 1.3.6.1.4.1.42.2.27.8.1.20
+#      NAME 'pwdHistory'
+#      DESC 'The history of user s passwords'
+#      EQUALITY octetStringMatch
+#      SYNTAX 1.3.6.1.4.1.1466.115.121.1.40
+#      USAGE directoryOperation )
+#
+#5.3.6  pwdGraceUseTime
+#
+#   This attribute holds the timestamps of grace authentications after a
+#   password has expired.
+#
+#      ( 1.3.6.1.4.1.42.2.27.8.1.21
+#      NAME 'pwdGraceUseTime'
+#      DESC 'The timestamps of the grace authentication after the
+#      password has expired'
+#      EQUALITY generalizedTimeMatch
+#      SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
+#
+#5.3.7  pwdReset
+#
+#   This attribute holds a flag to indicate (when TRUE) that the password
+#   has been updated by the password administrator and must be changed by
+#   the user on first authentication.
+#
+#      ( 1.3.6.1.4.1.42.2.27.8.1.22
+#      NAME 'pwdReset'
+#      DESC 'The indication that the password has been reset'
+#      EQUALITY booleanMatch
+#      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
+#      SINGLE-VALUE
+#      USAGE directoryOperation )
+#
+#5.3.8  pwdPolicySubentry
+#
+#   This attribute points to the pwdPolicy subentry in effect for this
+#   object.
+#
+#      ( 1.3.6.1.4.1.42.2.27.8.1.23
+#      NAME 'pwdPolicySubentry'
+#      DESC 'The pwdPolicy subentry in effect for this object'
+#      EQUALITY distinguishedNameMatch
+#      SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
+#      SINGLE-VALUE
+#      USAGE directoryOperation )
+#
+#
+#Disclaimer of Validity
+#
+#   This document and the information contained herein are provided on an
+#   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
+#   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
+#   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
+#   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
+#   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
+#   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+#
+#Copyright Statement
+#
+#   Copyright (C) The Internet Society (2004).  This document is subject
+#   to the rights, licenses and restrictions contained in BCP 78, and
+#   except as set forth therein, the authors retain all their rights.
+
index 0cc2b886ed6c90c8dcc05a32d933dd389be5e77e..253849d3780776e9d551622a0ff6ef5d8abaf7ae 100644 (file)
@@ -739,6 +739,10 @@ entry_naming_check(
        ber_len_t       cnt;
        int             rc = LDAP_SUCCESS;
 
+       if ( BER_BVISEMPTY( &e->e_name )) {
+               return LDAP_SUCCESS;
+       }
+
        /*
         * Get attribute type(s) and attribute value(s) of our RDN
         */
index 5d373374397479658ec9cd727cac7c939bc66ae4..8d3feb8874eebf57f037044e92853e069c87527d 100644 (file)
@@ -17,7 +17,9 @@
 #include "portable.h"
 
 #include <stdio.h>
+#ifdef HAVE_LIMITS_H
 #include <limits.h>
+#endif
 
 #include <ac/ctype.h>
 #include <ac/errno.h>
@@ -1060,6 +1062,7 @@ uniqueMemberMatch(
        struct berval assertedUID = BER_BVNULL;
        struct berval valueDN = BER_BVNULL;
        struct berval valueUID = BER_BVNULL;
+       int approx = ((flags & SLAP_MR_EQUALITY_APPROX) == SLAP_MR_EQUALITY_APPROX);
 
        if ( !BER_BVISEMPTY( asserted ) ) {
                assertedUID.bv_val = strrchr( assertedDN.bv_val, '#' );
@@ -1107,11 +1110,109 @@ uniqueMemberMatch(
                        *matchp = match;
                        return LDAP_SUCCESS;
                }
+
+       } else if ( !approx && valueUID.bv_len ) {
+               match = -1;
+               *matchp = match;
+               return LDAP_SUCCESS;
+
+       } else if ( !approx && assertedUID.bv_len ) {
+               match = 1;
+               *matchp = match;
+               return LDAP_SUCCESS;
        }
 
        return dnMatch( matchp, flags, syntax, mr, &valueDN, &assertedDN );
 }
 
+static int 
+uniqueMemberIndexer(
+       slap_mask_t use,
+       slap_mask_t flags,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *prefix,
+       BerVarray values,
+       BerVarray *keysp,
+       void *ctx )
+{
+       BerVarray dnvalues;
+       int rc;
+       int i;
+       for( i=0; !BER_BVISNULL( &values[i] ); i++ ) {
+               /* just count them */                 
+       }
+       assert( i > 0 );
+
+       dnvalues = slap_sl_malloc( sizeof( struct berval ) * (i+1), ctx );
+
+       for( i=0; !BER_BVISNULL( &values[i] ); i++ ) {
+               struct berval assertedDN = values[i];
+               struct berval assertedUID = BER_BVNULL;
+
+               if ( !BER_BVISEMPTY( &assertedDN ) ) {
+                       assertedUID.bv_val = strrchr( assertedDN.bv_val, '#' );
+                       if ( !BER_BVISNULL( &assertedUID ) ) {
+                               assertedUID.bv_val++;
+                               assertedUID.bv_len = assertedDN.bv_len
+                                       - ( assertedUID.bv_val - assertedDN.bv_val );
+       
+                               if ( bitStringValidate( NULL, &assertedUID ) == LDAP_SUCCESS ) {
+                                       assertedDN.bv_len -= assertedUID.bv_len + 1;
+
+                               } else {
+                                       BER_BVZERO( &assertedUID );
+                               }
+                       }
+               }
+
+               dnvalues[i] = assertedDN;
+       }
+       BER_BVZERO( &dnvalues[i] );
+
+       rc = octetStringIndexer( use, flags, syntax, mr, prefix,
+               dnvalues, keysp, ctx );
+
+       slap_sl_free( dnvalues, ctx );
+       return rc;
+}
+
+static int 
+uniqueMemberFilter(
+       slap_mask_t use,
+       slap_mask_t flags,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *prefix,
+       void * assertedValue,
+       BerVarray *keysp,
+       void *ctx )
+{
+       struct berval *asserted = (struct berval *) assertedValue;
+       struct berval assertedDN = *asserted;
+       struct berval assertedUID = BER_BVNULL;
+
+       if ( !BER_BVISEMPTY( asserted ) ) {
+               assertedUID.bv_val = strrchr( assertedDN.bv_val, '#' );
+               if ( !BER_BVISNULL( &assertedUID ) ) {
+                       assertedUID.bv_val++;
+                       assertedUID.bv_len = assertedDN.bv_len
+                               - ( assertedUID.bv_val - assertedDN.bv_val );
+
+                       if ( bitStringValidate( NULL, &assertedUID ) == LDAP_SUCCESS ) {
+                               assertedDN.bv_len -= assertedUID.bv_len + 1;
+
+                       } else {
+                               BER_BVZERO( &assertedUID );
+                       }
+               }
+       }
+
+       return octetStringFilter( use, flags, syntax, mr, prefix,
+               &assertedDN, keysp, ctx );
+}
+
+
 /*
  * Handling boolean syntax and matching is quite rigid.
  * A more flexible approach would be to allow a variety
@@ -1323,7 +1424,10 @@ UTF8StringNormalize(
        nvalue.bv_len = 0;
        nvalue.bv_val = tmp.bv_val;
 
-       wasspace = 1; /* trim leading spaces */
+       /* trim leading spaces? */
+       wasspace = !((( use & SLAP_MR_SUBSTR_ANY ) == SLAP_MR_SUBSTR_ANY ) ||
+               (( use & SLAP_MR_SUBSTR_FINAL ) == SLAP_MR_SUBSTR_FINAL ));
+
        for( i = 0; i < tmp.bv_len; i++) {
                if ( ASCII_SPACE( tmp.bv_val[i] )) {
                        if( wasspace++ == 0 ) {
@@ -1337,8 +1441,11 @@ UTF8StringNormalize(
        }
 
        if( !BER_BVISEMPTY( &nvalue ) ) {
-               if( wasspace ) {
-                       /* last character was a space, trim it */
+               /* trim trailing space? */
+               if( wasspace && (
+                       (( use & SLAP_MR_SUBSTR_INITIAL ) != SLAP_MR_SUBSTR_INITIAL ) &&
+                       ( use & SLAP_MR_SUBSTR_ANY ) != SLAP_MR_SUBSTR_ANY ))
+               {
                        --nvalue.bv_len;
                }
                nvalue.bv_val[nvalue.bv_len] = '\0';
@@ -1354,6 +1461,137 @@ UTF8StringNormalize(
        return LDAP_SUCCESS;
 }
 
+static int
+directoryStringSubstringsMatch(
+       int *matchp,
+       slap_mask_t flags,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *value,
+       void *assertedValue )
+{
+       int match = 0;
+       SubstringsAssertion *sub = assertedValue;
+       struct berval left = *value;
+       int i;
+       int priorspace=0;
+
+       if ( !BER_BVISNULL( &sub->sa_initial ) ) {
+               if ( sub->sa_initial.bv_len > left.bv_len ) {
+                       /* not enough left */
+                       match = 1;
+                       goto done;
+               }
+
+               match = memcmp( sub->sa_initial.bv_val, left.bv_val,
+                       sub->sa_initial.bv_len );
+
+               if ( match != 0 ) {
+                       goto done;
+               }
+
+               left.bv_val += sub->sa_initial.bv_len;
+               left.bv_len -= sub->sa_initial.bv_len;
+
+               priorspace = ASCII_SPACE(
+                       sub->sa_initial.bv_val[sub->sa_initial.bv_len] );
+       }
+
+       if ( sub->sa_any ) {
+               for ( i = 0; !BER_BVISNULL( &sub->sa_any[i] ); i++ ) {
+                       ber_len_t idx;
+                       char *p;
+
+                       if( priorspace && !BER_BVISEMPTY( &sub->sa_any[i] ) 
+                               && ASCII_SPACE( sub->sa_any[i].bv_val[0] ))
+                       { 
+                               /* allow next space to match */
+                               left.bv_val--;
+                               left.bv_len++;
+                       }
+                       priorspace=0;
+
+retry:
+                       if ( BER_BVISEMPTY( &sub->sa_any[i] ) ) {
+                               continue;
+                       }
+
+                       if ( sub->sa_any[i].bv_len > left.bv_len ) {
+                               /* not enough left */
+                               match = 1;
+                               goto done;
+                       }
+
+                       p = memchr( left.bv_val, *sub->sa_any[i].bv_val, left.bv_len );
+
+                       if( p == NULL ) {
+                               match = 1;
+                               goto done;
+                       }
+
+                       idx = p - left.bv_val;
+
+                       if ( idx >= left.bv_len ) {
+                               /* this shouldn't happen */
+                               return LDAP_OTHER;
+                       }
+
+                       left.bv_val = p;
+                       left.bv_len -= idx;
+
+                       if ( sub->sa_any[i].bv_len > left.bv_len ) {
+                               /* not enough left */
+                               match = 1;
+                               goto done;
+                       }
+
+                       match = memcmp( left.bv_val,
+                               sub->sa_any[i].bv_val,
+                               sub->sa_any[i].bv_len );
+
+                       if ( match != 0 ) {
+                               left.bv_val++;
+                               left.bv_len--;
+                               goto retry;
+                       }
+
+                       left.bv_val += sub->sa_any[i].bv_len;
+                       left.bv_len -= sub->sa_any[i].bv_len;
+
+                       priorspace = ASCII_SPACE(
+                               sub->sa_any[i].bv_val[sub->sa_any[i].bv_len] );
+               }
+       }
+
+       if ( !BER_BVISNULL( &sub->sa_final ) ) {
+               if( priorspace && !BER_BVISEMPTY( &sub->sa_final ) 
+                       && ASCII_SPACE( sub->sa_final.bv_val[0] ))
+               { 
+                       /* allow next space to match */
+                       left.bv_val--;
+                       left.bv_len++;
+               }
+
+               if ( sub->sa_final.bv_len > left.bv_len ) {
+                       /* not enough left */
+                       match = 1;
+                       goto done;
+               }
+
+               match = memcmp( sub->sa_final.bv_val,
+                       &left.bv_val[left.bv_len - sub->sa_final.bv_len],
+                       sub->sa_final.bv_len );
+
+               if ( match != 0 ) {
+                       goto done;
+               }
+       }
+
+done:
+       *matchp = match;
+       return LDAP_SUCCESS;
+}
+
 #if defined(SLAPD_APPROX_INITIALS)
 #      define SLAPD_APPROX_DELIMITER "._ "
 #      define SLAPD_APPROX_WORDLEN 2
@@ -1635,7 +1873,7 @@ numericoidValidate(
                        return LDAP_SUCCESS;
                }
 
-               if ( val.bv_val[0] == '0' ) {
+               if ( val.bv_val[0] == '0' && !OID_SEPARATOR( val.bv_val[1] )) {
                        break;
                }
 
@@ -3371,7 +3609,7 @@ static slap_mrule_defs_rec mrule_defs[] = {
        {"( 2.5.13.4 NAME 'caseIgnoreSubstringsMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )",
                SLAP_MR_SUBSTR, directoryStringSyntaxes,
-               NULL, UTF8StringNormalize, octetStringSubstringsMatch,
+               NULL, UTF8StringNormalize, directoryStringSubstringsMatch,
                octetStringSubstringsIndexer, octetStringSubstringsFilter,
                "caseIgnoreMatch" },
 
@@ -3392,7 +3630,7 @@ static slap_mrule_defs_rec mrule_defs[] = {
        {"( 2.5.13.7 NAME 'caseExactSubstringsMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )",
                SLAP_MR_SUBSTR, directoryStringSyntaxes,
-               NULL, UTF8StringNormalize, octetStringSubstringsMatch,
+               NULL, UTF8StringNormalize, directoryStringSubstringsMatch,
                octetStringSubstringsIndexer, octetStringSubstringsFilter,
                "caseExactMatch" },
 
@@ -3501,7 +3739,7 @@ static slap_mrule_defs_rec mrule_defs[] = {
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 )",
                SLAP_MR_EQUALITY | SLAP_MR_EXT, NULL,
                NULL, uniqueMemberNormalize, uniqueMemberMatch,
-               NULL, NULL,
+               uniqueMemberIndexer, uniqueMemberFilter,
                NULL },
 
        {"( 2.5.13.24 NAME 'protocolInformationMatch' "
@@ -3578,14 +3816,14 @@ static slap_mrule_defs_rec mrule_defs[] = {
        {"( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )",
                SLAP_MR_SUBSTR, NULL,
-               NULL, IA5StringNormalize, octetStringSubstringsMatch,
+               NULL, IA5StringNormalize, directoryStringSubstringsMatch,
                octetStringSubstringsIndexer, octetStringSubstringsFilter,
                "caseIgnoreIA5Match" },
 
        {"( 1.3.6.1.4.1.4203.1.2.1 NAME 'caseExactIA5SubstringsMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )",
                SLAP_MR_SUBSTR, NULL,
-               NULL, IA5StringNormalize, octetStringSubstringsMatch,
+               NULL, IA5StringNormalize, directoryStringSubstringsMatch,
                octetStringSubstringsIndexer, octetStringSubstringsFilter,
                "caseExactIA5Match" },
 
index 2b11d0ff34e9664247c7abac6fd372cf9621f288..be956ce1a31665b62c5b4e42f08245e07368955e 100644 (file)
@@ -941,7 +941,7 @@ static struct slap_schema_ad_map {
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_userPassword) },
 
-       { "labeledURI", "(  1.3.6.1.4.1.250.1.57 NAME 'labeledURI' "
+       { "labeledURI", "( 1.3.6.1.4.1.250.1.57 NAME 'labeledURI' "
                        "DESC 'RFC2079: Uniform Resource Identifier with optional label' "
                        "EQUALITY caseExactMatch "
                        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
@@ -983,6 +983,25 @@ static struct slap_schema_ad_map {
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_krbName) },
 #endif
+
+       { "description", "( 2.5.4.13 NAME 'description' "
+                       "DESC 'RFC2256: descriptive information' "
+                       "EQUALITY caseIgnoreMatch "
+                       "SUBSTR caseIgnoreSubstringsMatch "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )",
+               NULL, 0,
+               NULL, NULL,
+               NULL, NULL, NULL, NULL, NULL,
+               offsetof(struct slap_internal_schema, si_ad_description) },
+
+       { "seeAlso", "( 2.5.4.34 NAME 'seeAlso' "
+                       "DESC 'RFC2256: DN of related object' "
+                       "SUP distinguishedName )",
+               NULL, 0,
+               NULL, NULL,
+               NULL, NULL, NULL, NULL, NULL,
+               offsetof(struct slap_internal_schema, si_ad_seeAlso) },
+
        { NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0 }
 };
 
@@ -1124,7 +1143,7 @@ slap_schema_load( void )
                                return LDAP_OTHER;
                        }
 
-                       code = at_add( at, &err );
+                       code = at_add( at, 0, NULL, &err );
                        if ( code ) {
                                fprintf( stderr, "slap_schema_load: AttributeType "
                                        "\"%s\": %s: \"%s\"\n",
@@ -1237,7 +1256,7 @@ slap_schema_load( void )
                                return LDAP_OTHER;
                        }
 
-                       code = oc_add(oc,0,&err);
+                       code = oc_add(oc,0,NULL,&err);
                        if ( code ) {
                                fprintf( stderr, "slap_schema_load: ObjectClass "
                                        "\"%s\": %s: \"%s\"\n",
index a1c6f34f12cf2caee2f5e89334f0fca096568cfd..d0b0d5b77a26c2721048efe64ddafe25bf20ae79 100644 (file)
@@ -37,12 +37,14 @@ static char *const err2text[] = {
        "user-defined ObjectClass includes operational attributes",
        "user-defined ObjectClass has inappropriate SUPerior",
        "Duplicate objectClass",
+       "Inconsistent duplicate objectClass",
        "AttributeType not found",
        "AttributeType inappropriate matching rule",
        "AttributeType inappropriate USAGE",
        "AttributeType inappropriate SUPerior",
        "AttributeType SYNTAX or SUPerior required",
        "Duplicate attributeType",
+       "Inconsistent duplicate attributeType",
        "MatchingRule not found",
        "MatchingRule incomplete",
        "Duplicate matchingRule",
@@ -55,7 +57,8 @@ static char *const err2text[] = {
        "Duplicate Content Rule",
        "Content Rule not for STRUCTURAL object class",
        "Content Rule AUX contains inappropriate object class",
-       "Content Rule attribute type list contains duplicate"
+       "Content Rule attribute type list contains duplicate",
+       NULL
 };
 
 char *
@@ -126,7 +129,8 @@ parse_cr(
     const char *fname,
     int                lineno,
     char       *line,
-    char       **argv )
+    char       **argv,
+       ContentRule **scr )
 {
        LDAPContentRule *cr;
        int             code;
@@ -148,7 +152,7 @@ parse_cr(
                return 1;
        }
 
-       code = cr_add(cr,1,&err);
+       code = cr_add(cr,1,scr,&err);
        if ( code ) {
                fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
                         fname, lineno, scherr2str(code), err);
@@ -164,7 +168,8 @@ parse_oc(
     const char *fname,
     int                lineno,
     char       *line,
-    char       **argv )
+    char       **argv,
+       ObjectClass **soc )
 {
        LDAPObjectClass *oc;
        int             code;
@@ -186,7 +191,7 @@ parse_oc(
                return 1;
        }
 
-       code = oc_add(oc,1,&err);
+       code = oc_add(oc,1,soc,&err);
        if ( code ) {
                fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
                         fname, lineno, scherr2str(code), err);
@@ -245,7 +250,8 @@ parse_at(
     const char *fname,
     int                lineno,
     char       *line,
-    char       **argv )
+    char       **argv,
+       AttributeType **sat )
 {
        LDAPAttributeType *at;
        int             code;
@@ -274,7 +280,7 @@ parse_at(
                return 1;
        }
 
-       code = at_add(at,&err);
+       code = at_add(at,1,sat,&err);
        if ( code ) {
                fprintf( stderr, "%s: line %d: %s: \"%s\"\n",
                         fname, lineno, scherr2str(code), err);
index de36d2c09a36beacd0367a459de09521cb1385fc..237306ebcfa37908745803bf1d9e116fdf2fd1cf 100644 (file)
 
 LDAP_BEGIN_DECL
 
+
 #ifdef LDAP_DEVEL
 #define SLAP_ACL_HONOR_DISCLOSE        /* partially implemented */
 #define SLAP_ACL_HONOR_MANAGE  /* not yet implemented */
 #define SLAP_DYNACL
+#define SLAP_OVERLAY_ACCESS
 #define LDAP_COMP_MATCH
 #define LDAP_DYNAMIC_OBJECTS
 #define LDAP_SYNC_TIMESTAMP
 #define LDAP_COLLECTIVE_ATTRIBUTES
 #define SLAP_CONTROL_X_TREE_DELETE LDAP_CONTROL_X_TREE_DELETE
 
+#define        SLAP_USE_CONFDIR        /* partially implemented */
+
 #ifdef ENABLE_REWRITE
 #define SLAP_AUTH_REWRITE      1 /* use librewrite for sasl-regexp */
 #endif
@@ -188,7 +192,7 @@ LDAP_BEGIN_DECL
 
 #ifdef SLAPD_ACI_ENABLED
 #define SLAPD_ACI_SYNTAX               "1.3.6.1.4.1.4203.666.2.1"
-#endif
+#endif /* SLAPD_ACI_ENABLED */
 
 /* change this to "OpenLDAPset" */
 #define SLAPD_ACI_SET_ATTR             "template"
@@ -276,31 +280,36 @@ typedef struct slap_ssf_set {
 /*
  * represents schema information for a database
  */
-#define SLAP_SCHERR_OUTOFMEM                   1
-#define SLAP_SCHERR_CLASS_NOT_FOUND            2
-#define SLAP_SCHERR_CLASS_BAD_USAGE            3
-#define SLAP_SCHERR_CLASS_BAD_SUP              4
-#define SLAP_SCHERR_CLASS_DUP                  5
-#define SLAP_SCHERR_ATTR_NOT_FOUND             6
-#define SLAP_SCHERR_ATTR_BAD_MR                        7
-#define SLAP_SCHERR_ATTR_BAD_USAGE             8
-#define SLAP_SCHERR_ATTR_BAD_SUP               9
-#define SLAP_SCHERR_ATTR_INCOMPLETE            10
-#define SLAP_SCHERR_ATTR_DUP                   11
-#define SLAP_SCHERR_MR_NOT_FOUND               12
-#define SLAP_SCHERR_MR_INCOMPLETE              13
-#define SLAP_SCHERR_MR_DUP                             14
-#define SLAP_SCHERR_SYN_NOT_FOUND              15
-#define SLAP_SCHERR_SYN_DUP                            16
-#define SLAP_SCHERR_NO_NAME                            17
-#define SLAP_SCHERR_NOT_SUPPORTED              18
-#define SLAP_SCHERR_BAD_DESCR                  19
-#define SLAP_SCHERR_OIDM                               20
-#define SLAP_SCHERR_CR_DUP                             21
-#define SLAP_SCHERR_CR_BAD_STRUCT              22
-#define SLAP_SCHERR_CR_BAD_AUX                 23
-#define SLAP_SCHERR_CR_BAD_AT                  24
-#define SLAP_SCHERR_LAST                               SLAP_SCHERR_CR_BAD_AT
+enum {
+       SLAP_SCHERR_OUTOFMEM = 1,
+       SLAP_SCHERR_CLASS_NOT_FOUND,
+       SLAP_SCHERR_CLASS_BAD_USAGE,
+       SLAP_SCHERR_CLASS_BAD_SUP,
+       SLAP_SCHERR_CLASS_DUP,
+       SLAP_SCHERR_CLASS_INCONSISTENT,
+       SLAP_SCHERR_ATTR_NOT_FOUND,
+       SLAP_SCHERR_ATTR_BAD_MR,
+       SLAP_SCHERR_ATTR_BAD_USAGE,
+       SLAP_SCHERR_ATTR_BAD_SUP,
+       SLAP_SCHERR_ATTR_INCOMPLETE,
+       SLAP_SCHERR_ATTR_DUP,
+       SLAP_SCHERR_ATTR_INCONSISTENT,
+       SLAP_SCHERR_MR_NOT_FOUND,
+       SLAP_SCHERR_MR_INCOMPLETE,
+       SLAP_SCHERR_MR_DUP,
+       SLAP_SCHERR_SYN_NOT_FOUND,
+       SLAP_SCHERR_SYN_DUP,
+       SLAP_SCHERR_NO_NAME,
+       SLAP_SCHERR_NOT_SUPPORTED,
+       SLAP_SCHERR_BAD_DESCR,
+       SLAP_SCHERR_OIDM,
+       SLAP_SCHERR_CR_DUP,
+       SLAP_SCHERR_CR_BAD_STRUCT,
+       SLAP_SCHERR_CR_BAD_AUX,
+       SLAP_SCHERR_CR_BAD_AT,
+
+       SLAP_SCHERR_LAST
+};
 
 typedef union slap_sockaddr {
        struct sockaddr sa_addr;
@@ -322,7 +331,9 @@ typedef struct slap_oid_macro {
        struct berval som_oid;
        BerVarray som_names;
        BerVarray som_subs;
-       LDAP_SLIST_ENTRY(slap_oid_macro) som_next;
+#define        SLAP_OM_HARDCODE        0x10000U        /* This is hardcoded schema */
+       int som_flags;
+       LDAP_STAILQ_ENTRY(slap_oid_macro) som_next;
 } OidMacro;
 
 /* forward declarations */
@@ -636,6 +647,7 @@ typedef struct slap_attribute_type {
        Syntax                                  *sat_syntax;
 
        AttributeTypeSchemaCheckFN      *sat_check;
+       char                                    *sat_oidmacro;
 
 #define SLAP_AT_NONE           0x0000U
 #define SLAP_AT_ABSTRACT       0x0100U /* cannot be instantiated */
@@ -647,9 +659,14 @@ typedef struct slap_attribute_type {
 #endif
 #define        SLAP_AT_DYNAMIC         0x0400U /* dynamically generated */
 
+#define        SLAP_AT_ORDERED_VAL             0x0001U /* values are ordered */
+#define        SLAP_AT_ORDERED_SIB             0x0002U /* siblings are ordered */
+#define        SLAP_AT_ORDERED         0x0003U /* value has order index */
+#define        SLAP_AT_HARDCODE        0x10000U        /* This is hardcoded schema */
+
        slap_mask_t                                     sat_flags;
 
-       LDAP_SLIST_ENTRY(slap_attribute_type) sat_next;
+       LDAP_STAILQ_ENTRY(slap_attribute_type) sat_next;
 
 #define sat_oid                                sat_atype.at_oid
 #define sat_names                      sat_atype.at_names
@@ -692,6 +709,7 @@ typedef struct slap_object_class {
        AttributeType                           **soc_required;
        AttributeType                           **soc_allowed;
        ObjectClassSchemaCheckFN        *soc_check;
+       char                                    *soc_oidmacro;
        slap_mask_t                                     soc_flags;
 #define soc_oid                                soc_oclass.oc_oid
 #define soc_names                      soc_oclass.oc_names
@@ -703,7 +721,7 @@ typedef struct slap_object_class {
 #define soc_at_oids_may                soc_oclass.oc_at_oids_may
 #define soc_extensions         soc_oclass.oc_extensions
 
-       LDAP_SLIST_ENTRY(slap_object_class) soc_next;
+       LDAP_STAILQ_ENTRY(slap_object_class) soc_next;
 } ObjectClass;
 
 #define        SLAP_OC_ALIAS           0x0001
@@ -722,6 +740,7 @@ typedef struct slap_object_class {
 #else
 #define SLAP_OC_HIDE           0x8000
 #endif
+#define        SLAP_OC_HARDCODE        0x10000U        /* This is hardcoded schema */
 
 /*
  * DIT content rule
@@ -742,7 +761,11 @@ typedef struct slap_content_rule {
 #define scr_at_oids_may                scr_crule.cr_at_oids_may
 #define scr_at_oids_not                scr_crule.cr_at_oids_not
 
-       LDAP_SLIST_ENTRY( slap_content_rule ) scr_next;
+       char                            *scr_oidmacro;
+#define        SLAP_CR_HARDCODE        0x10000U
+       int     scr_flags;
+
+       LDAP_STAILQ_ENTRY( slap_content_rule ) scr_next;
 } ContentRule;
 
 /* Represents a recognized attribute description ( type + options ). */
@@ -850,7 +873,7 @@ struct slap_internal_schema {
        AttributeDescription *si_ad_saslAuthzFrom;
 #ifdef SLAPD_ACI_ENABLED
        AttributeDescription *si_ad_aci;
-#endif
+#endif /* SLAPD_ACI_ENABLED */
 
        /* dynamic entries */
        AttributeDescription *si_ad_entryTtl;
@@ -869,6 +892,8 @@ struct slap_internal_schema {
 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
        AttributeDescription *si_ad_krbName;
 #endif
+       AttributeDescription *si_ad_description;
+       AttributeDescription *si_ad_seeAlso;
         
        /* Undefined Attribute Type */
        AttributeType   *si_at_undefined;
@@ -906,7 +931,9 @@ struct slap_internal_schema {
 typedef struct slap_attr_assertion {
        AttributeDescription    *aa_desc;
        struct berval aa_value;
+#ifdef LDAP_COMP_MATCH
        struct slap_component_filter *aa_cf;/* for attribute aliasing */
+#endif
 } AttributeAssertion;
 
 typedef struct slap_ss_assertion {
@@ -1142,7 +1169,19 @@ typedef enum slap_access_e {
        ACL_SEARCH,
        ACL_READ,
        ACL_WRITE,
-       ACL_MANAGE
+       ACL_MANAGE,
+
+       /* ACL level mask and modifiers */
+       ACL_LEVEL_MASK = 0x000f,
+       ACL_QUALIFIER1 = 0x0100,
+       ACL_QUALIFIER2 = 0x0200,
+       ACL_QUALIFIER3 = 0x0400,
+       ACL_QUALIFIER4 = 0x0800,
+       ACL_QUALIFIER_MASK = 0x0f00,
+
+       /* write granularity */
+       ACL_WADD = ACL_WRITE|ACL_QUALIFIER1,
+       ACL_WDEL = ACL_WRITE|ACL_QUALIFIER2
 } slap_access_t;
 
 typedef enum slap_control_e {
@@ -1159,6 +1198,7 @@ typedef enum slap_style_e {
        ACL_STYLE_ONE,
        ACL_STYLE_SUBTREE,
        ACL_STYLE_CHILDREN,
+       ACL_STYLE_LEVEL,
        ACL_STYLE_ATTROF,
        ACL_STYLE_ANONYMOUS,
        ACL_STYLE_USERS,
@@ -1213,11 +1253,29 @@ typedef struct slap_dynacl_t {
 } slap_dynacl_t;
 #endif /* SLAP_DYNACL */
 
+/* the DN portion of the "by" part */
+typedef struct slap_dn_access {
+       /* DN pattern */
+       AuthorizationInformation        a_dnauthz;
+#define        a_pat                   a_dnauthz.sai_dn
+
+       slap_style_t            a_style;
+       int                     a_level;
+       int                     a_self_level;
+       AttributeDescription    *a_at;
+       int                     a_self;
+       int                     a_expand;
+} slap_dn_access;
+
 /* the "by" part */
 typedef struct slap_access {
        slap_control_t a_type;
 
-#define ACL_ACCESS2PRIV(access)        (0x01U << (access))
+/* strip qualifiers */
+#define ACL_LEVEL(p)                   ((p) & ACL_LEVEL_MASK)
+#define ACL_QUALIFIERS(p)              ((p) & ~ACL_LEVEL_MASK)
+
+#define ACL_ACCESS2PRIV(access)                ((0x01U << ACL_LEVEL((access))) | ACL_QUALIFIERS((access)))
 
 #define ACL_PRIV_NONE                  ACL_ACCESS2PRIV( ACL_NONE )
 #define ACL_PRIV_DISCLOSE              ACL_ACCESS2PRIV( ACL_DISCLOSE )
@@ -1225,25 +1283,28 @@ typedef struct slap_access {
 #define ACL_PRIV_COMPARE               ACL_ACCESS2PRIV( ACL_COMPARE )
 #define ACL_PRIV_SEARCH                        ACL_ACCESS2PRIV( ACL_SEARCH )
 #define ACL_PRIV_READ                  ACL_ACCESS2PRIV( ACL_READ )
-#define ACL_PRIV_WRITE                 ACL_ACCESS2PRIV( ACL_WRITE )
+#define ACL_PRIV_WADD                  ACL_ACCESS2PRIV( ACL_WADD )
+#define ACL_PRIV_WDEL                  ACL_ACCESS2PRIV( ACL_WDEL )
+#define ACL_PRIV_WRITE                 ( ACL_PRIV_WADD | ACL_PRIV_WDEL )
 #define ACL_PRIV_MANAGE                        ACL_ACCESS2PRIV( ACL_MANAGE )
 
-#define ACL_PRIV_MASK                  0x00ffUL
+/* NOTE: always use the highest level; current: 0x00ffUL */
+#define ACL_PRIV_MASK                  ((ACL_PRIV_MANAGE - 1) | ACL_QUALIFIER_MASK)
 
 /* priv flags */
 #define ACL_PRIV_LEVEL                 0x1000UL
 #define ACL_PRIV_ADDITIVE              0x2000UL
-#define ACL_PRIV_SUBSTRACTIVE  0x4000UL
+#define ACL_PRIV_SUBSTRACTIVE          0x4000UL
 
 /* invalid privs */
 #define ACL_PRIV_INVALID               0x0UL
 
 #define ACL_PRIV_ISSET(m,p)            (((m) & (p)) == (p))
-#define ACL_PRIV_ASSIGN(m,p)   do { (m)  =  (p); } while(0)
+#define ACL_PRIV_ASSIGN(m,p)           do { (m)  =  (p); } while(0)
 #define ACL_PRIV_SET(m,p)              do { (m) |=  (p); } while(0)
 #define ACL_PRIV_CLR(m,p)              do { (m) &= ~(p); } while(0)
 
-#define ACL_INIT(m)                            ACL_PRIV_ASSIGN(m, ACL_PRIV_NONE)
+#define ACL_INIT(m)                    ACL_PRIV_ASSIGN(m, ACL_PRIV_NONE)
 #define ACL_INVALIDATE(m)              ACL_PRIV_ASSIGN(m, ACL_PRIV_INVALID)
 
 #define ACL_GRANT(m,a)                 ACL_PRIV_ISSET((m),ACL_ACCESS2PRIV(a))
@@ -1252,7 +1313,7 @@ typedef struct slap_access {
 
 #define ACL_IS_LEVEL(m)                        ACL_PRIV_ISSET((m),ACL_PRIV_LEVEL)
 #define ACL_IS_ADDITIVE(m)             ACL_PRIV_ISSET((m),ACL_PRIV_ADDITIVE)
-#define ACL_IS_SUBTRACTIVE(m)  ACL_PRIV_ISSET((m),ACL_PRIV_SUBSTRACTIVE)
+#define ACL_IS_SUBTRACTIVE(m)          ACL_PRIV_ISSET((m),ACL_PRIV_SUBSTRACTIVE)
 
 #define ACL_LVL_NONE                   (ACL_PRIV_NONE|ACL_PRIV_LEVEL)
 #define ACL_LVL_DISCLOSE               (ACL_PRIV_DISCLOSE|ACL_LVL_NONE)
@@ -1260,18 +1321,22 @@ typedef struct slap_access {
 #define ACL_LVL_COMPARE                        (ACL_PRIV_COMPARE|ACL_LVL_AUTH)
 #define ACL_LVL_SEARCH                 (ACL_PRIV_SEARCH|ACL_LVL_COMPARE)
 #define ACL_LVL_READ                   (ACL_PRIV_READ|ACL_LVL_SEARCH)
+#define ACL_LVL_WADD                   (ACL_PRIV_WADD|ACL_LVL_READ)
+#define ACL_LVL_WDEL                   (ACL_PRIV_WDEL|ACL_LVL_READ)
 #define ACL_LVL_WRITE                  (ACL_PRIV_WRITE|ACL_LVL_READ)
 #define ACL_LVL_MANAGE                 (ACL_PRIV_MANAGE|ACL_LVL_WRITE)
 
 #define ACL_LVL(m,l)                   (((m)&ACL_PRIV_MASK) == ((l)&ACL_PRIV_MASK))
 #define ACL_LVL_IS_NONE(m)             ACL_LVL((m),ACL_LVL_NONE)
-#define ACL_LVL_IS_DISCLOSE(m) ACL_LVL((m),ACL_LVL_DISCLOSE)
+#define ACL_LVL_IS_DISCLOSE(m)         ACL_LVL((m),ACL_LVL_DISCLOSE)
 #define ACL_LVL_IS_AUTH(m)             ACL_LVL((m),ACL_LVL_AUTH)
-#define ACL_LVL_IS_COMPARE(m)  ACL_LVL((m),ACL_LVL_COMPARE)
-#define ACL_LVL_IS_SEARCH(m)   ACL_LVL((m),ACL_LVL_SEARCH)
+#define ACL_LVL_IS_COMPARE(m)          ACL_LVL((m),ACL_LVL_COMPARE)
+#define ACL_LVL_IS_SEARCH(m)           ACL_LVL((m),ACL_LVL_SEARCH)
 #define ACL_LVL_IS_READ(m)             ACL_LVL((m),ACL_LVL_READ)
+#define ACL_LVL_IS_WADD(m)             ACL_LVL((m),ACL_LVL_WADD)
+#define ACL_LVL_IS_WDEL(m)             ACL_LVL((m),ACL_LVL_WDEL)
 #define ACL_LVL_IS_WRITE(m)            ACL_LVL((m),ACL_LVL_WRITE)
-#define ACL_LVL_IS_MANAGE(m)   ACL_LVL((m),ACL_LVL_MANAGE)
+#define ACL_LVL_IS_MANAGE(m)           ACL_LVL((m),ACL_LVL_MANAGE)
 
 #define ACL_LVL_ASSIGN_NONE(m)         ACL_PRIV_ASSIGN((m),ACL_LVL_NONE)
 #define ACL_LVL_ASSIGN_DISCLOSE(m)     ACL_PRIV_ASSIGN((m),ACL_LVL_DISCLOSE)
@@ -1279,19 +1344,30 @@ typedef struct slap_access {
 #define ACL_LVL_ASSIGN_COMPARE(m)      ACL_PRIV_ASSIGN((m),ACL_LVL_COMPARE)
 #define ACL_LVL_ASSIGN_SEARCH(m)       ACL_PRIV_ASSIGN((m),ACL_LVL_SEARCH)
 #define ACL_LVL_ASSIGN_READ(m)         ACL_PRIV_ASSIGN((m),ACL_LVL_READ)
+#define ACL_LVL_ASSIGN_WADD(m)         ACL_PRIV_ASSIGN((m),ACL_LVL_WADD)
+#define ACL_LVL_ASSIGN_WDEL(m)         ACL_PRIV_ASSIGN((m),ACL_LVL_WDEL)
 #define ACL_LVL_ASSIGN_WRITE(m)                ACL_PRIV_ASSIGN((m),ACL_LVL_WRITE)
 #define ACL_LVL_ASSIGN_MANAGE(m)       ACL_PRIV_ASSIGN((m),ACL_LVL_MANAGE)
 
        slap_mask_t     a_access_mask;
 
-       AuthorizationInformation        a_authz;
-#define a_dn_pat       a_authz.sai_dn
+       /* DN pattern */
+       slap_dn_access          a_dn;
+#define a_dn_pat               a_dn.a_dnauthz.sai_dn
+#define        a_dn_at                 a_dn.a_at
+#define        a_dn_self               a_dn.a_self
+
+       /* real DN pattern */
+       slap_dn_access          a_realdn;
+#define a_realdn_pat           a_realdn.a_dnauthz.sai_dn
+#define        a_realdn_at             a_realdn.a_at
+#define        a_realdn_self           a_realdn.a_self
 
-       slap_style_t a_dn_style;
-       AttributeDescription    *a_dn_at;
-       int                     a_dn_self;
-       int                     a_dn_expand;
+       /* used for ssf stuff
+        * NOTE: the ssf stuff in a_realdn is ignored */
+#define        a_authz                 a_dn.a_dnauthz
 
+       /* connection related stuff */
        slap_style_t a_peername_style;
        struct berval   a_peername_pat;
        unsigned long   a_peername_addr,
@@ -1314,8 +1390,14 @@ typedef struct slap_access {
        slap_dynacl_t           *a_dynacl;
 #else /* ! SLAP_DYNACL */
 #ifdef SLAPD_ACI_ENABLED
+       /* NOTE: ACIs have been moved under the "dynacl" interface,
+        * which is currently built only when LDAP_DEVEL is defined.
+        *
+        * In any case, SLAPD_ACI_ENABLED, set by --enable-aci,
+        * is required to enable ACI support.
+        */
        AttributeDescription    *a_aci_at;
-#endif
+#endif /* SLAPD_ACI_ENABLED */
 #endif /* SLAP_DYNACL */
 
        /* ACL Groups */
@@ -1375,11 +1457,13 @@ typedef struct slap_acl_state {
 
 typedef struct slap_backend_info BackendInfo;  /* per backend type */
 typedef struct slap_backend_db BackendDB;              /* per backend database */
+typedef LDAP_STAILQ_HEAD(BeI, slap_backend_info) slap_bi_head;
+typedef LDAP_STAILQ_HEAD(BeDB, slap_backend_db) slap_be_head;
 
 LDAP_SLAPD_V (int) nBackendInfo;
 LDAP_SLAPD_V (int) nBackendDB;
-LDAP_SLAPD_V (BackendInfo *) backendInfo;
-LDAP_SLAPD_V (BackendDB *) backendDB;
+LDAP_SLAPD_V (slap_bi_head) backendInfo;
+LDAP_SLAPD_V (slap_be_head) backendDB;
 LDAP_SLAPD_V (BackendDB *) frontendDB;
 
 LDAP_SLAPD_V (int) slapMode;   
@@ -1400,13 +1484,13 @@ LDAP_SLAPD_V (int) slapMode;
 typedef struct slap_bindconf {
        int sb_tls;
        int sb_method;
-       char *sb_binddn;
-       char *sb_cred;
-       char *sb_saslmech;
+       struct berval sb_binddn;
+       struct berval sb_cred;
+       struct berval sb_saslmech;
        char *sb_secprops;
-       char *sb_realm;
-       char *sb_authcId;
-       char *sb_authzId;
+       struct berval sb_realm;
+       struct berval sb_authcId;
+       struct berval sb_authzId;
 } slap_bindconf;
 
 struct slap_replica_info {
@@ -1489,17 +1573,13 @@ typedef BackendDB Backend;
  * syncinfo structure for syncrepl
  */
 
+struct syncinfo_s;
+
 #define SLAP_SYNC_RID_SIZE     3
 #define SLAP_SYNCUUID_SET_SIZE 256
 
 #define        SLAP_SYNC_UPDATE_MSGID  2
 
-struct nonpresent_entry {
-       struct berval *npe_name;
-       struct berval *npe_nname;
-       LDAP_LIST_ENTRY(nonpresent_entry) npe_link;
-};
-
 struct sync_cookie {
        struct berval ctxcsn;
        struct berval octet_str;
@@ -1509,40 +1589,6 @@ struct sync_cookie {
 
 LDAP_STAILQ_HEAD( slap_sync_cookie_s, sync_cookie );
 
-typedef struct syncinfo_s {
-        struct slap_backend_db *si_be;
-        long                           si_rid;
-        struct berval          si_provideruri;
-               slap_bindconf           si_bindconf;
-        struct berval          si_filterstr;
-        struct berval          si_base;
-        int                                    si_scope;
-        int                                    si_attrsonly;
-               char                            *si_anfile;
-               AttributeName           *si_anlist;
-               AttributeName           *si_exanlist;
-               char                            **si_attrs;
-               char                            **si_exattrs;
-               int                                     si_allattrs;
-               int                                     si_allopattrs;
-               int                                     si_schemachecking;
-        int                                    si_type;
-        time_t                         si_interval;
-               time_t                          *si_retryinterval;
-               int                                     *si_retrynum_init;
-               int                                     *si_retrynum;
-               struct sync_cookie      si_syncCookie;
-        int                                    si_manageDSAit;
-        int                                    si_slimit;
-               int                                     si_tlimit;
-               int                                     si_refreshDelete;
-               int                                     si_refreshPresent;
-        Avlnode                                *si_presentlist;
-               LDAP                            *si_ld;
-               LDAP_LIST_HEAD(np, nonpresent_entry) si_nonpresentlist;
-               ldap_pvt_thread_mutex_t si_mutex;
-} syncinfo_t;
-
 LDAP_TAILQ_HEAD( be_pcl, slap_csn_entry );
 
 #ifndef SLAP_MAX_CIDS
@@ -1716,12 +1762,13 @@ struct slap_backend_db {
        struct          be_pcl  *be_pending_csn_list;
        ldap_pvt_thread_mutex_t                                 be_pcl_mutex;
        ldap_pvt_thread_mutex_t                                 *be_pcl_mutexp;
-       syncinfo_t                                                              *be_syncinfo; /* For syncrepl */
+       struct syncinfo_s                                               *be_syncinfo; /* For syncrepl */
 
        void    *be_pb;         /* Netscape plugin */
        struct ConfigTable *be_cf_table;
 
        void    *be_private;    /* anything the backend database needs     */
+       LDAP_STAILQ_ENTRY(slap_backend_db) be_next;
 };
 
 struct slap_conn;
@@ -1868,6 +1915,7 @@ typedef struct slap_rep {
        slap_mask_t sr_flags;
 #define REP_ENTRY_MODIFIABLE   0x0001U
 #define REP_ENTRY_MUSTBEFREED  0x0002U
+#define REP_ENTRY_MUSTRELEASE  0x0004U
 #define REP_MATCHED_MUSTBEFREED        0x0010U
 #define REP_REF_MUSTBEFREED            0x0020U
 } SlapReply;
@@ -1906,6 +1954,11 @@ typedef int (BI_entry_get_rw) LDAP_P(( struct slap_op *op, struct berval *ndn,
 typedef int (BI_operational) LDAP_P(( struct slap_op *op, struct slap_rep *rs ));
 typedef int (BI_has_subordinates) LDAP_P(( struct slap_op *op,
        Entry *e, int *hasSubs ));
+#ifdef SLAP_OVERLAY_ACCESS
+typedef int (BI_access_allowed) LDAP_P(( struct slap_op *op, Entry *e,
+       AttributeDescription *desc, struct berval *val, slap_access_t access,
+       AccessControlState *state, slap_mask_t *maskp ));
+#endif /* SLAP_OVERLAY_ACCESS */
 
 typedef int (BI_connection_init) LDAP_P(( BackendDB *bd,
        struct slap_conn *c ));
@@ -2007,6 +2060,9 @@ struct slap_backend_info {
        BI_entry_release_rw     *bi_entry_release_rw;
 
        BI_has_subordinates     *bi_has_subordinates;
+#ifdef SLAP_OVERLAY_ACCESS
+       BI_access_allowed       *bi_access_allowed;
+#endif /* SLAP_OVERLAY_ACCESS */
 
        BI_connection_init      *bi_connection_init;
        BI_connection_destroy   *bi_connection_destroy;
@@ -2054,6 +2110,7 @@ struct slap_backend_info {
        unsigned int bi_nDB;    /* number of databases of this type */
        struct ConfigTable *bi_cf_table;
        void    *bi_private;    /* anything the backend type needs */
+       LDAP_STAILQ_ENTRY(slap_backend_info) bi_next ;
 };
 
 #define c_authtype     c_authz.sai_method
@@ -2145,6 +2202,9 @@ struct slap_control_ids {
        int sc_modifyIncrement;
        int sc_noOp;
        int sc_pagedResults;
+#ifdef LDAP_DEVEL
+       int sc_sortedResults;
+#endif
        int sc_valuesReturnFilter;
        int sc_permissiveModify;
        int sc_domainScope;
@@ -2349,10 +2409,13 @@ typedef struct slap_op {
 
 #define o_pagedresults o_ctrlflag[slap_cids.sc_pagedResults]
 #define o_pagedresults_state   o_controls[slap_cids.sc_pagedResults]
+#define get_pagedresults(op)                   ((int)(op)->o_pagedresults)
 
-#define o_sync                 o_ctrlflag[slap_cids.sc_LDAPsync]
+#ifdef LDAP_DEVEL
+#define o_sortedresults                o_ctrlflag[slap_cids.sc_sortedResults]
+#endif
 
-#define get_pagedresults(op)                   ((int)(op)->o_pagedresults)
+#define o_sync                 o_ctrlflag[slap_cids.sc_LDAPsync]
 
        AuthorizationInformation o_authz;
 
@@ -2430,6 +2493,7 @@ typedef struct slap_conn {
        int             c_sasl_bind_in_progress;        /* multi-op bind in progress */
        struct berval   c_sasl_bind_mech;                       /* mech in progress */
        struct berval   c_sasl_dn;      /* temporary storage */
+       struct berval   c_sasl_authz_dn;        /* SASL proxy authz */
 
        /* authorization backend */
        Backend *c_authz_backend;
@@ -2907,11 +2971,10 @@ struct zone_heap {
 #endif
 
 #define SLAP_BACKEND_INIT_MODULE(b) \
+       static BackendInfo bi;  \
        int \
        init_module( int argc, char *argv[] ) \
        { \
-               BackendInfo bi; \
-               memset( &bi, '\0', sizeof( bi ) ); \
                bi.bi_type = #b ; \
                bi.bi_init = b ## _back_initialize; \
                backend_add( &bi ); \
index 59d22ecd90e4e32de873f6c7b8d4e23f302268f7..925127d0570a05b99c53f33b62b4e455459785a7 100644 (file)
 
 #include "slapcommon.h"
 
+static int
+print_access(
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       struct berval           *nval )
+{
+       int                     rc;
+       slap_mask_t             mask;
+       char                    accessmaskbuf[ACCESSMASK_MAXLEN];
+
+       rc = access_allowed_mask( op, e, desc, nval, ACL_AUTH, NULL, &mask );
+
+       fprintf( stderr, "%s%s%s: %s\n",
+                       desc->ad_cname.bv_val,
+                       ( val && !BER_BVISNULL( val ) ) ? "=" : "",
+                       ( val && !BER_BVISNULL( val ) ) ?
+                               ( desc == slap_schema.si_ad_userPassword ? "****" : val->bv_val ) : "",
+                       accessmask2str( mask, accessmaskbuf, 1 ) );
+
+       return rc;
+}
+
 int
 slapacl( int argc, char **argv )
 {
        int                     rc = EXIT_SUCCESS;
        const char              *progname = "slapacl";
-       Connection              conn = {0};
-       char opbuf[OPERATION_BUFFER_SIZE];
+       Connection              conn = { 0 };
+       Listener                listener;
+       char                    opbuf[OPERATION_BUFFER_SIZE];
        Operation               *op;
-       Entry                   e = { 0 };
+       Entry                   e = { 0 }, *ep = &e;
        char                    *attr = NULL;
+       int                     doclose = 0;
+       BackendDB               *bd;
 
        slap_tool_init( progname, SLAPACL, argc, argv );
 
+       if ( !dryrun ) {
+               int     i = 0;
+
+               LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
+                       if ( bd != be && backend_startup( bd ) ) {
+                               fprintf( stderr, "backend_startup(#%d%s%s) failed\n",
+                                               i,
+                                               bd->be_suffix ? ": " : "",
+                                               bd->be_suffix ? bd->be_suffix[0].bv_val : "" );
+                               rc = 1;
+                               goto destroy;
+                       }
+
+                       i++;
+               }
+       }
+
        argv = &argv[ optind ];
        argc -= optind;
 
        op = (Operation *)opbuf;
        connection_fake_init( &conn, op, &conn );
 
+       conn.c_listener = &listener;
+       conn.c_listener_url = listener_url;
+       conn.c_peer_domain = peer_domain;
+       conn.c_peer_name = peer_name;
+       conn.c_sock_name = sock_name;
+       op->o_ssf = ssf;
+       op->o_transport_ssf = transport_ssf;
+       op->o_tls_ssf = tls_ssf;
+       op->o_sasl_ssf = sasl_ssf;
+
        if ( !BER_BVISNULL( &authcID ) ) {
+               if ( !BER_BVISNULL( &authcDN ) ) {
+                       fprintf( stderr, "both authcID=\"%s\" "
+                                       "and authcDN=\"%s\" provided\n",
+                                       authcID.bv_val, authcDN.bv_val );
+                       rc = 1;
+                       goto destroy;
+               }
+
                rc = slap_sasl_getdn( &conn, op, &authcID, NULL,
                                &authcDN, SLAP_GETDN_AUTHCID );
                if ( rc != LDAP_SUCCESS ) {
-                       fprintf( stderr, "ID: <%s> check failed %d (%s)\n",
+                       fprintf( stderr, "authcID: <%s> check failed %d (%s)\n",
                                        authcID.bv_val, rc,
                                        ldap_err2string( rc ) );
                        rc = 1;
@@ -79,9 +141,67 @@ slapacl( int argc, char **argv )
                authcDN = ndn;
        }
 
+       if ( !BER_BVISNULL( &authzID ) ) {
+               if ( !BER_BVISNULL( &authzDN ) ) {
+                       fprintf( stderr, "both authzID=\"%s\" "
+                                       "and authzDN=\"%s\" provided\n",
+                                       authzID.bv_val, authzDN.bv_val );
+                       rc = 1;
+                       goto destroy;
+               }
+
+               rc = slap_sasl_getdn( &conn, op, &authzID, NULL,
+                               &authzDN, SLAP_GETDN_AUTHZID );
+               if ( rc != LDAP_SUCCESS ) {
+                       fprintf( stderr, "authzID: <%s> check failed %d (%s)\n",
+                                       authzID.bv_val, rc,
+                                       ldap_err2string( rc ) );
+                       rc = 1;
+                       goto destroy;
+               }
+
+       } else if ( !BER_BVISNULL( &authzDN ) ) {
+               struct berval   ndn;
+
+               rc = dnNormalize( 0, NULL, NULL, &authzDN, &ndn, NULL );
+               if ( rc != LDAP_SUCCESS ) {
+                       fprintf( stderr, "autchDN=\"%s\" normalization failed %d (%s)\n",
+                                       authzDN.bv_val, rc,
+                                       ldap_err2string( rc ) );
+                       rc = 1;
+                       goto destroy;
+               }
+               ch_free( authzDN.bv_val );
+               authzDN = ndn;
+       }
+
 
        if ( !BER_BVISNULL( &authcDN ) ) {
-               fprintf( stderr, "DN: \"%s\"\n", authcDN.bv_val );
+               fprintf( stderr, "authcDN: \"%s\"\n", authcDN.bv_val );
+       }
+
+       if ( !BER_BVISNULL( &authzDN ) ) {
+               fprintf( stderr, "authzDN: \"%s\"\n", authzDN.bv_val );
+       }
+
+       if ( !BER_BVISNULL( &authzDN ) ) {
+               op->o_dn = authzDN;
+               op->o_ndn = authzDN;
+               
+               if ( !BER_BVISNULL( &authcDN ) ) {
+                       op->o_conn->c_dn = authcDN;
+                       op->o_conn->c_ndn = authcDN;
+
+               } else {
+                       op->o_conn->c_dn = authzDN;
+                       op->o_conn->c_ndn = authzDN;
+               }
+
+       } else if ( !BER_BVISNULL( &authcDN ) ) {
+               op->o_conn->c_dn = authcDN;
+               op->o_conn->c_ndn = authcDN;
+               op->o_dn = authcDN;
+               op->o_ndn = authcDN;
        }
 
        assert( !BER_BVISNULL( &baseDN ) );
@@ -95,20 +215,83 @@ slapacl( int argc, char **argv )
        }
 
        op->o_bd = be;
-       if ( !BER_BVISNULL( &authcDN ) ) {
-               op->o_dn = authcDN;
-               op->o_ndn = authcDN;
+       if ( op->o_bd == NULL ) {
+               /* NOTE: if no database could be found (e.g. because
+                * accessing the rootDSE or so), use the frontendDB
+                * rules; might need work */
+               op->o_bd = frontendDB;
        }
 
-       if ( argc == 0 ) {
-               argc = 1;
-               attr = slap_schema.si_ad_entry->ad_cname.bv_val;
+       if ( !dryrun ) {
+               ID      id;
+
+               if ( be == NULL ) {
+                       fprintf( stderr, "%s: no target database "
+                               "has been found for baseDN=\"%s\"; "
+                               "you may try with \"-u\" (dry run).\n",
+                               baseDN.bv_val, progname );
+                       rc = 1;
+                       goto destroy;
+               }
+
+               if ( !be->be_entry_open ||
+                       !be->be_entry_close ||
+                       !be->be_dn2id_get ||
+                       !be->be_entry_get )
+               {
+                       fprintf( stderr, "%s: target database "
+                               "doesn't support necessary operations; "
+                               "you may try with \"-u\" (dry run).\n",
+                               progname );
+                       rc = 1;
+                       goto destroy;
+               }
+
+               if ( be->be_entry_open( be, 0 ) != 0 ) {
+                       fprintf( stderr, "%s: could not open database.\n",
+                               progname );
+                       rc = 1;
+                       goto destroy;
+               }
+
+               doclose = 1;
+
+               id = be->be_dn2id_get( be, &e.e_nname );
+               if ( id == NOID ) {
+                       fprintf( stderr, "%s: unable to fetch ID of DN \"%s\"\n",
+                               progname, e.e_nname.bv_val );
+                       rc = 1;
+                       goto destroy;
+               }
+               if ( be->be_id2entry_get( be, id, &ep ) != 0 ) {
+                       fprintf( stderr, "%s: unable to fetch entry \"%s\" (%lu)\n",
+                               progname, e.e_nname.bv_val, id );
+                       rc = 1;
+                       goto destroy;
+
+               }
+
+               if ( argc == 0 ) {
+                       Attribute       *a;
+
+                       (void)print_access( op, ep, slap_schema.si_ad_entry, NULL, NULL );
+                       (void)print_access( op, ep, slap_schema.si_ad_children, NULL, NULL );
+
+                       for ( a = ep->e_attrs; a; a = a->a_next ) {
+                               int     i;
+
+                               for ( i = 0; !BER_BVISNULL( &a->a_nvals[ i ] ); i++ ) {
+                                       (void)print_access( op, ep, a->a_desc,
+                                                       &a->a_vals[ i ],
+                                                       &a->a_nvals[ i ] );
+                               }
+                       }
+               }
        }
 
        for ( ; argc--; argv++ ) {
                slap_mask_t             mask;
                AttributeDescription    *desc = NULL;
-               int                     rc;
                struct berval           val = BER_BVNULL,
                                        *valp = NULL;
                const char              *text;
@@ -153,7 +336,7 @@ slapacl( int argc, char **argv )
                        break;
                }
 
-               rc = access_allowed_mask( op, &e, desc, valp, access,
+               rc = access_allowed_mask( op, ep, desc, valp, access,
                                NULL, &mask );
 
                if ( accessstr ) {
@@ -176,6 +359,27 @@ slapacl( int argc, char **argv )
        }
 
 destroy:;
+       if ( !BER_BVISNULL( &e.e_name ) ) {
+               ber_memfree( e.e_name.bv_val );
+       }
+       if ( !BER_BVISNULL( &e.e_nname ) ) {
+               ber_memfree( e.e_nname.bv_val );
+       }
+       if ( !dryrun && be ) {
+               if ( ep != &e ) {
+                       be_entry_release_r( op, ep );
+               }
+               if ( doclose ) {
+                       be->be_entry_close( be );
+               }
+
+               LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
+                       if ( bd != be ) {
+                               backend_shutdown( bd );
+                       }
+               }
+       }
+
        slap_tool_destroy();
 
        return rc;
index 8648e2e2bad9f52a508fec333d107f504d15d61c..7aa4ee29310d9b4f277535fc4905b2a23e08cb52 100644 (file)
@@ -115,7 +115,8 @@ slapadd( int argc, char **argv )
                }
 
                /* make sure the DN is not empty */
-               if( !e->e_nname.bv_len ) {
+               if( BER_BVISEMPTY( &e->e_nname ) &&
+                       !BER_BVISEMPTY( be->be_nsuffix )) {
                        fprintf( stderr, "%s: empty dn=\"%s\" (line=%d)\n",
                                progname, e->e_dn, lineno );
                        rc = EXIT_FAILURE;
@@ -161,9 +162,9 @@ slapadd( int argc, char **argv )
                        }
 
                        if( sc == NULL ) {
-                               struct berval vals[2];
+                               struct berval val;
 
-                               rc = structural_class( oc->a_vals, vals,
+                               rc = structural_class( oc->a_vals, &val,
                                        NULL, &text, textbuf, textlen );
 
                                if( rc != LDAP_SUCCESS ) {
@@ -175,11 +176,7 @@ slapadd( int argc, char **argv )
                                        break;
                                }
 
-                               vals[1].bv_len = 0;
-                               vals[1].bv_val = NULL;
-
-                               attr_merge( e, slap_schema.si_ad_structuralObjectClass,
-                                       vals, NULL /* FIXME */ );
+                               attr_merge_one( e, slap_schema.si_ad_structuralObjectClass, &val, NULL );
                        }
 
                        /* check schema */
@@ -235,8 +232,7 @@ slapadd( int argc, char **argv )
                        {
                                vals[0].bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ) );
                                vals[0].bv_val = uuidbuf;
-                               attr_merge_normalize_one( e,
-                                                       slap_schema.si_ad_entryUUID, vals, NULL );
+                               attr_merge_normalize_one( e, slap_schema.si_ad_entryUUID, vals, NULL );
                        }
 
                        if( attr_find( e->e_attrs, slap_schema.si_ad_creatorsName )
@@ -335,15 +331,21 @@ done:;
                        if ( ret == LDAP_SUCCESS ) {
                                attr = attr_find( ctxcsn_e->e_attrs,
                                                                        slap_schema.si_ad_contextCSN );
-                               value_match( &match, slap_schema.si_ad_entryCSN,
-                                       slap_schema.si_ad_entryCSN->ad_type->sat_ordering,
-                                       SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
-                                       &maxcsn, &attr->a_nvals[0], &text );
+                               if ( attr ) {
+                                       value_match( &match, slap_schema.si_ad_entryCSN,
+                                               slap_schema.si_ad_entryCSN->ad_type->sat_ordering,
+                                               SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
+                                               &maxcsn, &attr->a_nvals[0], &text );
+                                       if ( match > 0 ) {
+                                               AC_MEMCPY( attr->a_vals[0].bv_val, maxcsn.bv_val, maxcsn.bv_len );
+                                               attr->a_vals[0].bv_val[maxcsn.bv_len] = '\0';
+                                               attr->a_vals[0].bv_len = maxcsn.bv_len;
+                                       }
+                               } else {
+                                       match = 1;
+                                       attr_merge_one( ctxcsn_e, slap_schema.si_ad_contextCSN, &maxcsn, NULL );
+                               }
                                if ( match > 0 ) {
-                                       AC_MEMCPY( attr->a_vals[0].bv_val, maxcsn.bv_val, maxcsn.bv_len );
-                                       attr->a_vals[0].bv_val[maxcsn.bv_len] = '\0';
-                                       attr->a_vals[0].bv_len = maxcsn.bv_len;
-                               
                                        ctxcsn_id = be->be_entry_modify( be, ctxcsn_e, &bvtext );
                                        if( ctxcsn_id == NOID ) {
                                                fprintf( stderr, "%s: could not modify ctxcsn\n",
index 4a0c55a600dd3c9527f81981c0179877251ea9c1..10a1548ec65dc8520b34022e7ad390e7585ebacf 100644 (file)
@@ -49,17 +49,17 @@ usage( int tool, const char *progname )
 {
        char *options = NULL;
        fprintf( stderr,
-               "usage: %s [-v] [-c] [-d debuglevel] [-f configfile]",
+               "usage: %s [-v] [-d debuglevel] [-f configfile] [-F configdir]",
                progname );
 
        switch( tool ) {
        case SLAPACL:
-               options = "\n\t[-U authcID | -D authcDN]"
-                       " -b DN [attr[/access][:value]] [...]\n";
+               options = "\n\t[-U authcID | -D authcDN] [-X authzID | -o authzDN=<DN>]"
+                       "\n\t-b DN -o <var>[=<val>] [-u] [attr[/access][:value]] [...]\n";
                break;
 
        case SLAPADD:
-               options = "\n\t[-n databasenumber | -b suffix]\n"
+               options = " [-c]\n\t[-n databasenumber | -b suffix]\n"
                        "\t[-l ldiffile] [-q] [-u] [-w]\n";
                break;
 
@@ -68,16 +68,16 @@ usage( int tool, const char *progname )
                break;
 
        case SLAPCAT:
-               options = "\n\t[-n databasenumber | -b suffix]"
+               options = " [-c]\n\t[-n databasenumber | -b suffix]"
                        " [-l ldiffile] [-a filter]\n";
                break;
 
        case SLAPDN:
-               options = " DN [...]\n";
+               options = "\n\t[-N | -P] DN [...]\n";
                break;
 
        case SLAPINDEX:
-               options = "\n\t[-n databasenumber | -b suffix] [-q]\n";
+               options = " [-c]\n\t[-n databasenumber | -b suffix] [-q]\n";
                break;
 
        case SLAPTEST:
@@ -91,6 +91,65 @@ usage( int tool, const char *progname )
        exit( EXIT_FAILURE );
 }
 
+static int
+parse_slapacl( void )
+{
+       size_t  len;
+       char    *p;
+
+       p = strchr( optarg, '=' );
+       if ( p == NULL ) {
+               return -1;
+       }
+
+       len = p - optarg;
+       p++;
+
+       if ( strncasecmp( optarg, "sockurl", len ) == 0 ) {
+               if ( !BER_BVISNULL( &listener_url ) ) {
+                       ber_memfree( listener_url.bv_val );
+               }
+               ber_str2bv( p, 0, 1, &listener_url );
+
+       } else if ( strncasecmp( optarg, "domain", len ) == 0 ) {
+               if ( !BER_BVISNULL( &peer_domain ) ) {
+                       ber_memfree( peer_domain.bv_val );
+               }
+               ber_str2bv( p, 0, 1, &peer_domain );
+
+       } else if ( strncasecmp( optarg, "peername", len ) == 0 ) {
+               if ( !BER_BVISNULL( &peer_name ) ) {
+                       ber_memfree( peer_name.bv_val );
+               }
+               ber_str2bv( p, 0, 1, &peer_name );
+
+       } else if ( strncasecmp( optarg, "sockname", len ) == 0 ) {
+               if ( !BER_BVISNULL( &sock_name ) ) {
+                       ber_memfree( sock_name.bv_val );
+               }
+               ber_str2bv( p, 0, 1, &sock_name );
+
+       } else if ( strncasecmp( optarg, "ssf", len ) == 0 ) {
+               ssf = atoi( p );
+
+       } else if ( strncasecmp( optarg, "transport_ssf", len ) == 0 ) {
+               transport_ssf = atoi( p );
+
+       } else if ( strncasecmp( optarg, "tls_ssf", len ) == 0 ) {
+               tls_ssf = atoi( p );
+
+       } else if ( strncasecmp( optarg, "sasl_ssf", len ) == 0 ) {
+               sasl_ssf = atoi( p );
+
+       } else if ( strncasecmp( optarg, "authzDN", len ) == 0 ) {
+               ber_str2bv( p, 0, 1, &authzDN );
+
+       } else {
+               return -1;
+       }
+
+       return 0;
+}
 
 /*
  * slap_tool_init - initialize slap utility, handle program options.
@@ -137,7 +196,7 @@ slap_tool_init(
                break;
 
        case SLAPDN:
-               options = "d:f:F:v";
+               options = "d:f:F:NPv";
                mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY;
                break;
 
@@ -157,7 +216,7 @@ slap_tool_init(
                break;
 
        case SLAPACL:
-               options = "b:D:d:f:F:U:v";
+               options = "b:D:d:f:F:o:uU:vX:";
                mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY;
                break;
 
@@ -205,10 +264,30 @@ slap_tool_init(
                        ber_str2bv( optarg, 0, 0, &mech );
                        break;
 
+               case 'N':
+                       if ( dn_mode && dn_mode != SLAP_TOOL_LDAPDN_NORMAL ) {
+                               usage( tool, progname );
+                       }
+                       dn_mode = SLAP_TOOL_LDAPDN_NORMAL;
+                       break;
+
                case 'n':       /* which config file db to index */
                        dbnum = atoi( optarg );
                        break;
 
+               case 'o':
+                       if ( parse_slapacl() ) {
+                               usage( tool, progname );
+                       }
+                       break;
+
+               case 'P':
+                       if ( dn_mode && dn_mode != SLAP_TOOL_LDAPDN_PRETTY ) {
+                               usage( tool, progname );
+                       }
+                       dn_mode = SLAP_TOOL_LDAPDN_PRETTY;
+                       break;
+
                case 'q':       /* turn on quick */
                        mode |= SLAP_TOOL_QUICK;
                        break;
@@ -437,7 +516,7 @@ slap_tool_init(
                /* If the named base is a glue master, operate on the
                 * entire context
                 */
-               if (SLAP_GLUE_INSTANCE(be)) {
+               if ( SLAP_GLUE_INSTANCE( be ) ) {
                        nosubordinates = 1;
                }
 
@@ -446,21 +525,24 @@ slap_tool_init(
                        fprintf( stderr, "No available databases\n" );
                        exit( EXIT_FAILURE );
                }
+               LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+                       dbnum++;
+                       if ( dbnum < 1 ) continue;
                
-               be = &backends[dbnum=1];
+                       if ( SLAP_MONITOR(be))
+                               continue;
+
                /* If just doing the first by default and it is a
                 * glue subordinate, find the master.
                 */
-               while (SLAP_GLUE_SUBORDINATE(be) || SLAP_MONITOR(be)) {
-                       if (SLAP_GLUE_SUBORDINATE(be)) {
+                       if ( SLAP_GLUE_SUBORDINATE(be) ) {
                                nosubordinates = 1;
+                               continue;
                        }
-                       be++;
-                       dbnum++;
+                       break;
                }
 
-
-               if ( dbnum >= nbackends ) {
+               if ( !be ) {
                        fprintf( stderr, "Available database(s) "
                                        "do not allow %s\n", progname );
                        exit( EXIT_FAILURE );
@@ -482,7 +564,10 @@ slap_tool_init(
                exit( EXIT_FAILURE );
 
        } else {
-               be = &backends[dbnum];
+               LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
+                       if ( dbnum == 0 ) break;
+                       dbnum--;
+               }
        }
 
 startup:;
@@ -491,8 +576,7 @@ startup:;
        mal_leaktrace(1);
 #endif
 
-       if ( !dryrun && slap_startup( be ) ) {
-
+       if ( !dryrun && be && slap_startup( be ) ) {
                switch ( tool ) {
                case SLAPTEST:
                        fprintf( stderr, "slap_startup failed "
@@ -511,10 +595,10 @@ startup:;
 
 void slap_tool_destroy( void )
 {
-       if ( !dryrun && be != NULL ) {
+       if ( !dryrun ) {
                slap_shutdown( be );
+               slap_destroy();
        }
-       slap_destroy();
 #ifdef SLAPD_MODULES
        if ( slapMode == SLAP_SERVER_MODE ) {
        /* always false. just pulls in necessary symbol references. */
index 8d6c94113f754deade7c5e746a0a1d351735f17c..4dcf7a8cbb15bb68e23ec8705e9bbaef4c2563fc 100644 (file)
@@ -42,12 +42,22 @@ typedef struct tool_vars {
        Filter *tv_filter;
        struct berval tv_sub_ndn;
        FILE    *tv_ldiffp;
-       struct berval tv_authcDN;
        struct berval tv_baseDN;
+       struct berval tv_authcDN;
+       struct berval tv_authzDN;
        struct berval tv_authcID;
        struct berval tv_authzID;
        struct berval tv_mech;
        char    *tv_realm;
+       struct berval tv_listener_url;
+       struct berval tv_peer_domain;
+       struct berval tv_peer_name;
+       struct berval tv_sock_name;
+       slap_ssf_t tv_ssf;
+       slap_ssf_t tv_transport_ssf;
+       slap_ssf_t tv_tls_ssf;
+       slap_ssf_t tv_sasl_ssf;
+       unsigned tv_dn_mode;
 } tool_vars;
 
 extern tool_vars tool_globals;
@@ -61,12 +71,24 @@ extern tool_vars tool_globals;
 #define filter tool_globals.tv_filter
 #define sub_ndn tool_globals.tv_sub_ndn
 #define ldiffp tool_globals.tv_ldiffp
-#define authcDN tool_globals.tv_authcDN
 #define baseDN tool_globals.tv_baseDN
+#define authcDN tool_globals.tv_authcDN
+#define authzDN tool_globals.tv_authzDN
 #define authcID tool_globals.tv_authcID
 #define authzID tool_globals.tv_authzID
 #define mech tool_globals.tv_mech
 #define realm tool_globals.tv_realm
+#define listener_url tool_globals.tv_listener_url
+#define peer_domain tool_globals.tv_peer_domain
+#define peer_name tool_globals.tv_peer_name
+#define sock_name tool_globals.tv_sock_name
+#define ssf tool_globals.tv_ssf
+#define transport_ssf tool_globals.tv_transport_ssf
+#define tls_ssf tool_globals.tv_tls_ssf
+#define sasl_ssf tool_globals.tv_sasl_ssf
+#define dn_mode tool_globals.tv_dn_mode
+#define SLAP_TOOL_LDAPDN_PRETTY                SLAP_LDAPDN_PRETTY
+#define SLAP_TOOL_LDAPDN_NORMAL                (SLAP_LDAPDN_PRETTY << 1)
 
 void slap_tool_init LDAP_P((
        const char* name,
index 400d5071db5b2bfb6fe81c441654cf749ac4c26d..0119e7fab595d4cf500938204fcb1ea57db3e378 100644 (file)
@@ -62,11 +62,24 @@ slapdn( int argc, char **argv )
                        }
                        
                } else {
-                       fprintf( stderr, "DN: <%s> check succeeded\n"
-                                       "normalized: <%s>\n"
-                                       "pretty:     <%s>\n",
-                                       dn.bv_val,
-                                       ndn.bv_val, pdn.bv_val );
+                       switch ( dn_mode ) {
+                       case SLAP_TOOL_LDAPDN_PRETTY:
+                               printf( "%s\n", pdn.bv_val );
+                               break;
+
+                       case SLAP_TOOL_LDAPDN_NORMAL:
+                               printf( "%s\n", ndn.bv_val );
+                               break;
+
+                       default:
+                               printf( "DN: <%s> check succeeded\n"
+                                               "normalized: <%s>\n"
+                                               "pretty:     <%s>\n",
+                                               dn.bv_val,
+                                               ndn.bv_val, pdn.bv_val );
+                               break;
+                       }
+
                        ch_free( ndn.bv_val );
                        ch_free( pdn.bv_val );
                }
index 244ec53701825bf5c76fc650534de223634c6989..7590a93912675a39341fcd935ed42dea638bd9a2 100644 (file)
@@ -3364,6 +3364,7 @@ int slapi_access_allowed( Slapi_PBlock *pb, Slapi_Entry *e, char *attr,
        case SLAPI_ACL_DELETE:
        case SLAPI_ACL_ADD:
        case SLAPI_ACL_SELF:
+               /* FIXME: handle ACL_WADD/ACL_WDEL */
                slap_access = ACL_WRITE;
                break;
        default:
@@ -4000,6 +4001,7 @@ int slapi_int_access_allowed( Operation *op,
 
        switch ( access ) {
        case ACL_WRITE:
+               /* FIXME: handle ACL_WADD/ACL_WDEL */
                slap_access |= SLAPI_ACL_ADD | SLAPI_ACL_DELETE | SLAPI_ACL_WRITE;
                break;
        case ACL_READ:
index 58fca6ce87bf17e73c3ddae56545ec3c58d66460..006cfd1bc002c55b0740581a97f6f7b84e45e3e6 100644 (file)
 #include "slap.h"
 #include "lutil_ldap.h"
 
+#include "config.h"
+
 #include "ldap_rq.h"
 
 /* FIXME: for ldap_ld_free() */
 #undef ldap_debug
 #include "../../libraries/libldap/ldap-int.h"
 
+struct nonpresent_entry {
+       struct berval *npe_name;
+       struct berval *npe_nname;
+       LDAP_LIST_ENTRY(nonpresent_entry) npe_link;
+};
+
+typedef struct syncinfo_s {
+       struct slap_backend_db *si_be;
+       struct re_s                     *si_re;
+       long                            si_rid;
+       struct berval           si_provideruri;
+       slap_bindconf           si_bindconf;
+       struct berval           si_filterstr;
+       struct berval           si_base;
+       int                                     si_scope;
+       int                                     si_attrsonly;
+       char                            *si_anfile;
+       AttributeName           *si_anlist;
+       AttributeName           *si_exanlist;
+       char                            **si_attrs;
+       char                            **si_exattrs;
+       int                                     si_allattrs;
+       int                                     si_allopattrs;
+       int                                     si_schemachecking;
+       int                                     si_type;
+       time_t                          si_interval;
+       time_t                          *si_retryinterval;
+       int                                     *si_retrynum_init;
+       int                                     *si_retrynum;
+       struct sync_cookie      si_syncCookie;
+       int                                     si_manageDSAit;
+       int                                     si_slimit;
+       int                                     si_tlimit;
+       int                                     si_refreshDelete;
+       int                                     si_refreshPresent;
+       Avlnode                         *si_presentlist;
+       LDAP                            *si_ld;
+       LDAP_LIST_HEAD(np, nonpresent_entry) si_nonpresentlist;
+       ldap_pvt_thread_mutex_t si_mutex;
+} syncinfo_t;
+
 static int syncuuid_cmp( const void *, const void * );
 static void avl_ber_bvfree( void * );
 static void syncrepl_del_nonpresent( Operation *, syncinfo_t *, BerVarray );
+static int syncrepl_message_to_entry(
+                                       syncinfo_t *, Operation *, LDAPMessage *,
+                                       Modifications **, Entry **, int );
+static int syncrepl_entry(
+                                       syncinfo_t *, Operation*, Entry*,
+                                       Modifications**,int, struct berval*,
+                                       struct sync_cookie *,
+                                       struct berval * );
+static void syncrepl_updateCookie(
+                                       syncinfo_t *, Operation *, struct berval *,
+                                       struct sync_cookie * );
+static struct berval * slap_uuidstr_from_normalized(
+                                       struct berval *, struct berval *, void * );
 
 /* callback functions */
 static int dn_callback( struct slap_op *, struct slap_rep * );
@@ -44,7 +100,7 @@ static int null_callback( struct slap_op *, struct slap_rep * );
 
 static AttributeDescription *sync_descs[4];
 
-void
+static void
 init_syncrepl(syncinfo_t *si)
 {
        int i, j, k, l, n;
@@ -244,9 +300,9 @@ ldap_sync_search(
        c[0].ldctl_iscritical = si->si_type < 0;
        ctrls[0] = &c[0];
 
-       if ( si->si_bindconf.sb_authzId ) {
+       if ( !BER_BVISNULL( &si->si_bindconf.sb_authzId ) ) {
                c[1].ldctl_oid = LDAP_CONTROL_PROXY_AUTHZ;
-               ber_str2bv( si->si_bindconf.sb_authzId, 0, 0, &c[1].ldctl_value );
+               c[1].ldctl_value = si->si_bindconf.sb_authzId;
                c[1].ldctl_iscritical = 1;
                ctrls[1] = &c[1];
                ctrls[2] = NULL;
@@ -322,13 +378,16 @@ do_syncrep1(
                        }
                }
 
-               defaults = lutil_sasl_defaults( si->si_ld, si->si_bindconf.sb_saslmech,
-                       si->si_bindconf.sb_realm, si->si_bindconf.sb_authcId,
-                       si->si_bindconf.sb_cred, si->si_bindconf.sb_authzId );
+               defaults = lutil_sasl_defaults( si->si_ld,
+                       si->si_bindconf.sb_saslmech.bv_val,
+                       si->si_bindconf.sb_realm.bv_val,
+                       si->si_bindconf.sb_authcId.bv_val,
+                       si->si_bindconf.sb_cred.bv_val,
+                       si->si_bindconf.sb_authzId.bv_val );
 
                rc = ldap_sasl_interactive_bind_s( si->si_ld,
-                               si->si_bindconf.sb_binddn,
-                               si->si_bindconf.sb_saslmech,
+                               si->si_bindconf.sb_binddn.bv_val,
+                               si->si_bindconf.sb_saslmech.bv_val,
                                NULL, NULL,
                                LDAP_SASL_QUIET,
                                lutil_sasl_interact,
@@ -341,13 +400,15 @@ do_syncrep1(
                 *      2) on err policy : exit, retry, backoff ...
                 */
                if ( rc != LDAP_SUCCESS ) {
+                       static struct berval bv_GSSAPI = BER_BVC( "GSSAPI" );
+
                        Debug( LDAP_DEBUG_ANY, "do_syncrep1: "
                                "ldap_sasl_interactive_bind_s failed (%d)\n",
                                rc, 0, 0 );
 
                        /* FIXME (see above comment) */
                        /* if Kerberos credentials cache is not active, retry */
-                       if ( strcmp( si->si_bindconf.sb_saslmech, "GSSAPI" ) == 0 &&
+                       if ( ber_bvcmp( &si->si_bindconf.sb_saslmech, &bv_GSSAPI ) == 0 &&
                                rc == LDAP_LOCAL_ERROR )
                        {
                                rc = LDAP_SERVER_DOWN;
@@ -363,12 +424,13 @@ do_syncrep1(
                goto done;
 #endif
 
-       } else {
-               rc = ldap_bind_s( si->si_ld, si->si_bindconf.sb_binddn,
-                       si->si_bindconf.sb_cred, si->si_bindconf.sb_method );
+       } else if ( si->si_bindconf.sb_method == LDAP_AUTH_SIMPLE ) {
+               rc = ldap_sasl_bind_s( si->si_ld,
+                       si->si_bindconf.sb_binddn.bv_val, LDAP_SASL_SIMPLE,
+                       &si->si_bindconf.sb_cred, NULL, NULL, NULL );
                if ( rc != LDAP_SUCCESS ) {
                        Debug( LDAP_DEBUG_ANY, "do_syncrep1: "
-                               "ldap_bind_s failed (%d)\n", rc, 0, 0 );
+                               "ldap_sasl_bind_s failed (%d)\n", rc, 0, 0 );
                        goto done;
                }
        }
@@ -392,7 +454,6 @@ do_syncrep1(
        if ( BER_BVISNULL( &si->si_syncCookie.octet_str )) {
                /* get contextCSN shadow replica from database */
                BerVarray csn = NULL;
-               struct berval newcookie;
 
                assert( si->si_rid < 1000 );
                op->o_req_ndn = op->o_bd->be_nsuffix[0];
@@ -445,7 +506,7 @@ do_syncrep1(
 done:
        if ( rc ) {
                if ( si->si_ld ) {
-                       ldap_unbind( si->si_ld );
+                       ldap_unbind_ext( si->si_ld, NULL, NULL );
                        si->si_ld = NULL;
                }
        }
@@ -815,14 +876,14 @@ done:
        if ( res ) ldap_msgfree( res );
 
        if ( rc && si->si_ld ) {
-               ldap_unbind( si->si_ld );
+               ldap_unbind_ext( si->si_ld, NULL, NULL );
                si->si_ld = NULL;
        }
 
        return rc;
 }
 
-void *
+static void *
 do_syncrepl(
        void    *ctx,
        void    *arg )
@@ -859,7 +920,7 @@ do_syncrepl(
                if ( si->si_ld ) {
                        ldap_get_option( si->si_ld, LDAP_OPT_DESC, &s );
                        connection_client_stop( s );
-                       ldap_unbind( si->si_ld );
+                       ldap_unbind_ext( si->si_ld, NULL, NULL );
                        si->si_ld = NULL;
                }
                ldap_pvt_thread_mutex_unlock( &si->si_mutex );
@@ -1153,7 +1214,11 @@ syncrepl_entry(
        SlapReply       rs_add = {REP_RESULT};
        SlapReply       rs_modify = {REP_RESULT};
        Filter f = {0};
+#ifdef LDAP_COMP_MATCH
        AttributeAssertion ava = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion ava = { NULL, BER_BVNULL };
+#endif
        int rc = LDAP_SUCCESS;
        int ret = LDAP_SUCCESS;
 
@@ -1222,6 +1287,7 @@ syncrepl_entry(
 
        op->o_tag = LDAP_REQ_SEARCH;
        op->ors_scope = LDAP_SCOPE_SUBTREE;
+       op->ors_deref = LDAP_DEREF_NEVER;
 
        /* get the entry for this UUID */
        op->o_req_dn = si->si_base;
@@ -1329,6 +1395,7 @@ retry_add:;
                                        op2.o_req_dn = entry->e_name;
                                        op2.o_req_ndn = entry->e_nname;
                                        op2.ors_scope = LDAP_SCOPE_BASE;
+                                       op2.ors_deref = LDAP_DEREF_NEVER;
                                        op2.ors_attrs = slap_anlist_all_attributes;
                                        op2.ors_attrsonly = 0;
                                        op2.ors_limit = NULL;
@@ -1529,8 +1596,6 @@ syncrepl_del_nonpresent(
        AttributeName   an[2];
 
        struct berval pdn = BER_BVNULL;
-       struct berval org_req_dn = BER_BVNULL;
-       struct berval org_req_ndn = BER_BVNULL;
 
        op->o_req_dn = si->si_base;
        op->o_req_ndn = si->si_base;
@@ -1548,7 +1613,11 @@ syncrepl_del_nonpresent(
 
        if ( uuids ) {
                Filter uf;
+#ifdef LDAP_COMP_MATCH
                AttributeAssertion eq = { NULL, BER_BVNULL, NULL };
+#else
+               AttributeAssertion eq = { NULL, BER_BVNULL };
+#endif
                int i;
 
                op->ors_attrsonly = 1;
@@ -1795,10 +1864,6 @@ syncrepl_updateCookie(
        Modifications mod = {0};
        struct berval vals[2];
 
-       const char      *text;
-       char txtbuf[SLAP_TEXT_BUFLEN];
-       size_t textlen = sizeof txtbuf;
-
        int rc;
 
        slap_callback cb = { NULL };
@@ -1839,7 +1904,6 @@ syncrepl_updateCookie(
                        "be_modify failed (%d)\n", rs_modify.sr_err, 0, 0 );
        }
 
-done :
        slap_graduate_commit_csn( op );
 
        return;
@@ -2165,3 +2229,566 @@ syncinfo_free( syncinfo_t *sie )
        }
        ch_free( sie );
 }
+
+
+
+/* NOTE: used & documented in slapd.conf(5) */
+#define IDSTR                  "rid"
+#define PROVIDERSTR            "provider"
+#define TYPESTR                        "type"
+#define INTERVALSTR            "interval"
+#define SEARCHBASESTR          "searchbase"
+#define FILTERSTR              "filter"
+#define SCOPESTR               "scope"
+#define ATTRSSTR               "attrs"
+#define ATTRSONLYSTR           "attrsonly"
+#define SLIMITSTR              "sizelimit"
+#define TLIMITSTR              "timelimit"
+#define SCHEMASTR              "schemachecking"
+
+/* FIXME: undocumented */
+#define OLDAUTHCSTR            "bindprincipal"
+#define EXATTRSSTR             "exattrs"
+#define RETRYSTR               "retry"
+
+/* FIXME: unused */
+#define LASTMODSTR             "lastmod"
+#define LMGENSTR               "gen"
+#define LMNOSTR                        "no"
+#define LMREQSTR               "req"
+#define SRVTABSTR              "srvtab"
+#define SUFFIXSTR              "suffix"
+#define MANAGEDSAITSTR         "manageDSAit"
+
+/* mandatory */
+#define GOT_ID                 0x0001
+#define GOT_PROVIDER           0x0002
+
+/* check */
+#define GOT_ALL                        (GOT_ID|GOT_PROVIDER)
+
+static struct {
+       struct berval key;
+       int val;
+} scopes[] = {
+       { BER_BVC("base"), LDAP_SCOPE_BASE },
+       { BER_BVC("one"), LDAP_SCOPE_ONELEVEL },
+#ifdef LDAP_SCOPE_SUBORDINATE
+       { BER_BVC("children"), LDAP_SCOPE_SUBORDINATE },
+       { BER_BVC("subordinate"), 0 },
+#endif
+       { BER_BVC("sub"), LDAP_SCOPE_SUBTREE },
+       { BER_BVNULL, 0 }
+};
+
+static int
+parse_syncrepl_line(
+       char            **cargv,
+       int             cargc,
+       syncinfo_t      *si
+)
+{
+       int     gots = 0;
+       int     i;
+       char    *val;
+
+       for ( i = 1; i < cargc; i++ ) {
+               if ( !strncasecmp( cargv[ i ], IDSTR "=",
+                                       STRLENOF( IDSTR "=" ) ) )
+               {
+                       int tmp;
+                       /* '\0' string terminator accounts for '=' */
+                       val = cargv[ i ] + STRLENOF( IDSTR "=" );
+                       tmp= atoi( val );
+                       if ( tmp >= 1000 || tmp < 0 ) {
+                               fprintf( stderr, "Error: parse_syncrepl_line: "
+                                        "syncrepl id %d is out of range [0..999]\n", tmp );
+                               return -1;
+                       }
+                       si->si_rid = tmp;
+                       gots |= GOT_ID;
+               } else if ( !strncasecmp( cargv[ i ], PROVIDERSTR "=",
+                                       STRLENOF( PROVIDERSTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( PROVIDERSTR "=" );
+                       ber_str2bv( val, 0, 1, &si->si_provideruri );
+                       gots |= GOT_PROVIDER;
+               } else if ( !strncasecmp( cargv[ i ], SCHEMASTR "=",
+                                       STRLENOF( SCHEMASTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( SCHEMASTR "=" );
+                       if ( !strncasecmp( val, "on", STRLENOF( "on" ) )) {
+                               si->si_schemachecking = 1;
+                       } else if ( !strncasecmp( val, "off", STRLENOF( "off" ) ) ) {
+                               si->si_schemachecking = 0;
+                       } else {
+                               si->si_schemachecking = 1;
+                       }
+               } else if ( !strncasecmp( cargv[ i ], FILTERSTR "=",
+                                       STRLENOF( FILTERSTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( FILTERSTR "=" );
+                       ber_str2bv( val, 0, 1, &si->si_filterstr );
+               } else if ( !strncasecmp( cargv[ i ], SEARCHBASESTR "=",
+                                       STRLENOF( SEARCHBASESTR "=" ) ) )
+               {
+                       struct berval   bv;
+                       int             rc;
+
+                       val = cargv[ i ] + STRLENOF( SEARCHBASESTR "=" );
+                       if ( si->si_base.bv_val ) {
+                               ch_free( si->si_base.bv_val );
+                       }
+                       ber_str2bv( val, 0, 0, &bv );
+                       rc = dnNormalize( 0, NULL, NULL, &bv, &si->si_base, NULL );
+                       if ( rc != LDAP_SUCCESS ) {
+                               fprintf( stderr, "Invalid base DN \"%s\": %d (%s)\n",
+                                       val, rc, ldap_err2string( rc ) );
+                               return -1;
+                       }
+               } else if ( !strncasecmp( cargv[ i ], SCOPESTR "=",
+                                       STRLENOF( SCOPESTR "=" ) ) )
+               {
+                       int j;
+                       val = cargv[ i ] + STRLENOF( SCOPESTR "=" );
+                       for ( j=0; !BER_BVISNULL(&scopes[j].key); j++ ) {
+                               if (!strncasecmp( val, scopes[j].key.bv_val,
+                                       scopes[j].key.bv_len )) {
+                                       while (!scopes[j].val) j--;
+                                       si->si_scope = scopes[j].val;
+                                       break;
+                               }
+                       }
+                       if ( BER_BVISNULL(&scopes[j].key) ) {
+                               fprintf( stderr, "Error: parse_syncrepl_line: "
+                                       "unknown scope \"%s\"\n", val);
+                               return -1;
+                       }
+               } else if ( !strncasecmp( cargv[ i ], ATTRSONLYSTR "=",
+                                       STRLENOF( ATTRSONLYSTR "=" ) ) )
+               {
+                       si->si_attrsonly = 1;
+               } else if ( !strncasecmp( cargv[ i ], ATTRSSTR "=",
+                                       STRLENOF( ATTRSSTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( ATTRSSTR "=" );
+                       if ( !strncasecmp( val, ":include:", STRLENOF(":include:") ) ) {
+                               char *attr_fname;
+                               attr_fname = ch_strdup( val + STRLENOF(":include:") );
+                               si->si_anlist = file2anlist( si->si_anlist, attr_fname, " ,\t" );
+                               if ( si->si_anlist == NULL ) {
+                                       ch_free( attr_fname );
+                                       return -1;
+                               }
+                               si->si_anfile = attr_fname;
+                       } else {
+                               char *str, *s, *next;
+                               char delimstr[] = " ,\t";
+                               str = ch_strdup( val );
+                               for ( s = ldap_pvt_strtok( str, delimstr, &next );
+                                               s != NULL;
+                                               s = ldap_pvt_strtok( NULL, delimstr, &next ) )
+                               {
+                                       if ( strlen(s) == 1 && *s == '*' ) {
+                                               si->si_allattrs = 1;
+                                               *(val + ( s - str )) = delimstr[0];
+                                       }
+                                       if ( strlen(s) == 1 && *s == '+' ) {
+                                               si->si_allopattrs = 1;
+                                               *(val + ( s - str )) = delimstr[0];
+                                       }
+                               }
+                               ch_free( str );
+                               si->si_anlist = str2anlist( si->si_anlist, val, " ,\t" );
+                               if ( si->si_anlist == NULL ) {
+                                       return -1;
+                               }
+                       }
+               } else if ( !strncasecmp( cargv[ i ], EXATTRSSTR "=",
+                                       STRLENOF( EXATTRSSTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( EXATTRSSTR "=" );
+                       if ( !strncasecmp( val, ":include:", STRLENOF(":include:") )) {
+                               char *attr_fname;
+                               attr_fname = ch_strdup( val + STRLENOF(":include:") );
+                               si->si_exanlist = file2anlist(
+                                                                       si->si_exanlist, attr_fname, " ,\t" );
+                               if ( si->si_exanlist == NULL ) {
+                                       ch_free( attr_fname );
+                                       return -1;
+                               }
+                               ch_free( attr_fname );
+                       } else {
+                               si->si_exanlist = str2anlist( si->si_exanlist, val, " ,\t" );
+                               if ( si->si_exanlist == NULL ) {
+                                       return -1;
+                               }
+                       }
+               } else if ( !strncasecmp( cargv[ i ], TYPESTR "=",
+                                       STRLENOF( TYPESTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( TYPESTR "=" );
+                       if ( !strncasecmp( val, "refreshOnly",
+                                               STRLENOF("refreshOnly") ))
+                       {
+                               si->si_type = LDAP_SYNC_REFRESH_ONLY;
+                       } else if ( !strncasecmp( val, "refreshAndPersist",
+                                               STRLENOF("refreshAndPersist") ))
+                       {
+                               si->si_type = LDAP_SYNC_REFRESH_AND_PERSIST;
+                               si->si_interval = 60;
+                       } else {
+                               fprintf( stderr, "Error: parse_syncrepl_line: "
+                                       "unknown sync type \"%s\"\n", val);
+                               return -1;
+                       }
+               } else if ( !strncasecmp( cargv[ i ], INTERVALSTR "=",
+                                       STRLENOF( INTERVALSTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( INTERVALSTR "=" );
+                       if ( si->si_type == LDAP_SYNC_REFRESH_AND_PERSIST ) {
+                               si->si_interval = 0;
+                       } else {
+                               char *hstr;
+                               char *mstr;
+                               char *dstr;
+                               char *sstr;
+                               int dd, hh, mm, ss;
+                               dstr = val;
+                               hstr = strchr( dstr, ':' );
+                               if ( hstr == NULL ) {
+                                       fprintf( stderr, "Error: parse_syncrepl_line: "
+                                               "invalid interval \"%s\"\n", val );
+                                       return -1;
+                               }
+                               *hstr++ = '\0';
+                               mstr = strchr( hstr, ':' );
+                               if ( mstr == NULL ) {
+                                       fprintf( stderr, "Error: parse_syncrepl_line: "
+                                               "invalid interval \"%s\"\n", val );
+                                       return -1;
+                               }
+                               *mstr++ = '\0';
+                               sstr = strchr( mstr, ':' );
+                               if ( sstr == NULL ) {
+                                       fprintf( stderr, "Error: parse_syncrepl_line: "
+                                               "invalid interval \"%s\"\n", val );
+                                       return -1;
+                               }
+                               *sstr++ = '\0';
+
+                               dd = atoi( dstr );
+                               hh = atoi( hstr );
+                               mm = atoi( mstr );
+                               ss = atoi( sstr );
+                               if (( hh > 24 ) || ( hh < 0 ) ||
+                                       ( mm > 60 ) || ( mm < 0 ) ||
+                                       ( ss > 60 ) || ( ss < 0 ) || ( dd < 0 )) {
+                                       fprintf( stderr, "Error: parse_syncrepl_line: "
+                                               "invalid interval \"%s\"\n", val );
+                                       return -1;
+                               }
+                               si->si_interval = (( dd * 24 + hh ) * 60 + mm ) * 60 + ss;
+                       }
+                       if ( si->si_interval < 0 ) {
+                               fprintf( stderr, "Error: parse_syncrepl_line: "
+                                       "invalid interval \"%ld\"\n",
+                                       (long) si->si_interval);
+                               return -1;
+                       }
+               } else if ( !strncasecmp( cargv[ i ], RETRYSTR "=",
+                                       STRLENOF( RETRYSTR "=" ) ) )
+               {
+                       char **retry_list;
+                       int j, k, n;
+
+                       val = cargv[ i ] + STRLENOF( RETRYSTR "=" );
+                       retry_list = (char **) ch_calloc( 1, sizeof( char * ));
+                       retry_list[0] = NULL;
+
+                       slap_str2clist( &retry_list, val, " ,\t" );
+
+                       for ( k = 0; retry_list && retry_list[k]; k++ ) ;
+                       n = k / 2;
+                       if ( k % 2 ) {
+                               fprintf( stderr,
+                                               "Error: incomplete syncrepl retry list\n" );
+                               for ( k = 0; retry_list && retry_list[k]; k++ ) {
+                                       ch_free( retry_list[k] );
+                               }
+                               ch_free( retry_list );
+                               exit( EXIT_FAILURE );
+                       }
+                       si->si_retryinterval = (time_t *) ch_calloc( n + 1, sizeof( time_t ));
+                       si->si_retrynum = (int *) ch_calloc( n + 1, sizeof( int ));
+                       si->si_retrynum_init = (int *) ch_calloc( n + 1, sizeof( int ));
+                       for ( j = 0; j < n; j++ ) {
+                               si->si_retryinterval[j] = atoi( retry_list[j*2] );
+                               if ( *retry_list[j*2+1] == '+' ) {
+                                       si->si_retrynum_init[j] = -1;
+                                       si->si_retrynum[j] = -1;
+                                       j++;
+                                       break;
+                               } else {
+                                       si->si_retrynum_init[j] = atoi( retry_list[j*2+1] );
+                                       si->si_retrynum[j] = atoi( retry_list[j*2+1] );
+                               }
+                       }
+                       si->si_retrynum_init[j] = -2;
+                       si->si_retrynum[j] = -2;
+                       si->si_retryinterval[j] = 0;
+                       
+                       for ( k = 0; retry_list && retry_list[k]; k++ ) {
+                               ch_free( retry_list[k] );
+                       }
+                       ch_free( retry_list );
+               } else if ( !strncasecmp( cargv[ i ], MANAGEDSAITSTR "=",
+                                       STRLENOF( MANAGEDSAITSTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( MANAGEDSAITSTR "=" );
+                       si->si_manageDSAit = atoi( val );
+               } else if ( !strncasecmp( cargv[ i ], SLIMITSTR "=",
+                                       STRLENOF( SLIMITSTR "=") ) )
+               {
+                       val = cargv[ i ] + STRLENOF( SLIMITSTR "=" );
+                       si->si_slimit = atoi( val );
+               } else if ( !strncasecmp( cargv[ i ], TLIMITSTR "=",
+                                       STRLENOF( TLIMITSTR "=" ) ) )
+               {
+                       val = cargv[ i ] + STRLENOF( TLIMITSTR "=" );
+                       si->si_tlimit = atoi( val );
+               } else if ( bindconf_parse( cargv[i], &si->si_bindconf )) {
+                       fprintf( stderr, "Error: parse_syncrepl_line: "
+                               "unknown keyword \"%s\"\n", cargv[ i ] );
+                       return -1;
+               }
+       }
+
+       if ( gots != GOT_ALL ) {
+               fprintf( stderr,
+                       "Error: Malformed \"syncrepl\" line in slapd config file" );
+               return -1;
+       }
+
+       return 0;
+}
+
+static int
+add_syncrepl(
+       Backend *be,
+       char    **cargv,
+       int     cargc
+)
+{
+       syncinfo_t *si;
+       int     rc = 0;
+
+       if ( !( be->be_search && be->be_add && be->be_modify && be->be_delete )) {
+               Debug( LDAP_DEBUG_ANY, "database %s does not support operations "
+                       "required for syncrepl\n", be->be_type, 0, 0 );
+               return 1;
+       }
+       si = (syncinfo_t *) ch_calloc( 1, sizeof( syncinfo_t ) );
+
+       if ( si == NULL ) {
+               Debug( LDAP_DEBUG_ANY, "out of memory in add_syncrepl\n", 0, 0, 0 );
+               return 1;
+       }
+
+       si->si_bindconf.sb_tls = SB_TLS_OFF;
+       si->si_bindconf.sb_method = LDAP_AUTH_SIMPLE;
+       si->si_schemachecking = 0;
+       ber_str2bv( "(objectclass=*)", STRLENOF("(objectclass=*)"), 1,
+               &si->si_filterstr );
+       si->si_base.bv_val = NULL;
+       si->si_scope = LDAP_SCOPE_SUBTREE;
+       si->si_attrsonly = 0;
+       si->si_anlist = (AttributeName *) ch_calloc( 1, sizeof( AttributeName ));
+       si->si_exanlist = (AttributeName *) ch_calloc( 1, sizeof( AttributeName ));
+       si->si_attrs = NULL;
+       si->si_allattrs = 0;
+       si->si_allopattrs = 0;
+       si->si_exattrs = NULL;
+       si->si_type = LDAP_SYNC_REFRESH_ONLY;
+       si->si_interval = 86400;
+       si->si_retryinterval = NULL;
+       si->si_retrynum_init = NULL;
+       si->si_retrynum = NULL;
+       si->si_manageDSAit = 0;
+       si->si_tlimit = 0;
+       si->si_slimit = 0;
+
+       si->si_presentlist = NULL;
+       LDAP_LIST_INIT( &si->si_nonpresentlist );
+       ldap_pvt_thread_mutex_init( &si->si_mutex );
+
+       rc = parse_syncrepl_line( cargv, cargc, si );
+
+       if ( rc == 0 ) {
+               si->si_be = be;
+               init_syncrepl( si );
+               si->si_re = ldap_pvt_runqueue_insert( &slapd_rq, si->si_interval,
+                       do_syncrepl, si, "do_syncrepl", be->be_suffix[0].bv_val );
+               if ( !si->si_re )
+                       rc = -1;
+       }
+       if ( rc < 0 ) {
+               Debug( LDAP_DEBUG_ANY, "failed to add syncinfo\n", 0, 0, 0 );
+               syncinfo_free( si );    
+               return 1;
+       } else {
+               Debug( LDAP_DEBUG_CONFIG,
+                       "Config: ** successfully added syncrepl \"%s\"\n",
+                       BER_BVISNULL( &si->si_provideruri ) ?
+                       "(null)" : si->si_provideruri.bv_val, 0, 0 );
+               if ( !si->si_schemachecking ) {
+                       SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NO_SCHEMA_CHECK;
+               }
+               be->be_syncinfo = si;
+               return 0;
+       }
+}
+
+static void
+syncrepl_unparse( syncinfo_t *si, struct berval *bv )
+{
+       struct berval bc;
+       char buf[BUFSIZ*2], *ptr;
+       int i, len;
+
+       bindconf_unparse( &si->si_bindconf, &bc );
+       ptr = buf;
+       ptr += sprintf( ptr, IDSTR "=%03d " PROVIDERSTR "=%s",
+               si->si_rid, si->si_provideruri.bv_val );
+       if ( !BER_BVISNULL( &bc )) {
+               ptr = lutil_strcopy( ptr, bc.bv_val );
+               free( bc.bv_val );
+       }
+       if ( !BER_BVISEMPTY( &si->si_filterstr )) {
+               ptr = lutil_strcopy( ptr, " " FILTERSTR "=\"" );
+               ptr = lutil_strcopy( ptr, si->si_filterstr.bv_val );
+               *ptr++ = '"';
+       }
+       if ( !BER_BVISNULL( &si->si_base )) {
+               ptr = lutil_strcopy( ptr, " " SEARCHBASESTR "=\"" );
+               ptr = lutil_strcopy( ptr, si->si_base.bv_val );
+               *ptr++ = '"';
+       }
+       for (i=0; !BER_BVISNULL(&scopes[i].key);i++) {
+               if ( si->si_scope == scopes[i].val ) {
+                       ptr = lutil_strcopy( ptr, " " SCOPESTR "=" );
+                       ptr = lutil_strcopy( ptr, scopes[i].key.bv_val );
+                       break;
+               }
+       }
+       if ( si->si_attrsonly ) {
+               ptr = lutil_strcopy( ptr, " " ATTRSONLYSTR "=yes" );
+       }
+       if ( si->si_anfile ) {
+               ptr = lutil_strcopy( ptr, " " ATTRSSTR "=:include:" );
+               ptr = lutil_strcopy( ptr, si->si_anfile );
+       } else if ( si->si_allattrs || si->si_allopattrs ||
+               ( si->si_anlist && !BER_BVISNULL(&si->si_anlist[0].an_name) )) {
+               char *old;
+               ptr = lutil_strcopy( ptr, " " ATTRSSTR "=\"" );
+               old = ptr;
+               ptr = anlist_unparse( si->si_anlist, ptr );
+               if ( si->si_allattrs ) {
+                       if ( old != ptr ) *ptr++ = ',';
+                       *ptr++ = '*';
+               }
+               if ( si->si_allopattrs ) {
+                       if ( old != ptr ) *ptr++ = ',';
+                       *ptr++ = '+';
+               }
+               *ptr++ = '"';
+       }
+       if ( si->si_exanlist && !BER_BVISNULL(&si->si_exanlist[0].an_name) ) {
+               ptr = lutil_strcopy( ptr, " " EXATTRSSTR "=" );
+               ptr = anlist_unparse( si->si_exanlist, ptr );
+       }
+       ptr = lutil_strcopy( ptr, " " SCHEMASTR "=" );
+       ptr = lutil_strcopy( ptr, si->si_schemachecking ? "on" : "off" );
+       
+       ptr = lutil_strcopy( ptr, " " TYPESTR "=" );
+       ptr = lutil_strcopy( ptr, si->si_type == LDAP_SYNC_REFRESH_AND_PERSIST ?
+               "refreshAndPersist" : "refreshOnly" );
+
+       if ( si->si_type == LDAP_SYNC_REFRESH_ONLY ) {
+               int dd, hh, mm, ss;
+
+               dd = si->si_interval;
+               ss = dd % 60;
+               dd /= 60;
+               mm = dd % 60;
+               dd /= 60;
+               hh = dd % 24;
+               dd /= 24;
+               ptr = lutil_strcopy( ptr, " " INTERVALSTR "=" );
+               ptr += sprintf( ptr, "%02d:%02d:%02d:%02d", dd, hh, mm, ss );
+       } else if ( si->si_retryinterval ) {
+               int space=0;
+               ptr = lutil_strcopy( ptr, " " RETRYSTR "=\"" );
+               for (i=0; si->si_retryinterval[i]; i++) {
+                       if ( space ) *ptr++ = ' ';
+                       space = 1;
+                       ptr += sprintf( ptr, "%d", si->si_retryinterval[i] );
+                       if ( si->si_retrynum_init[i] == -1 )
+                               *ptr++ = '+';
+                       else
+                               ptr += sprintf( ptr, "%d", si->si_retrynum_init );
+               }
+               *ptr++ = '"';
+       }
+
+       if ( si->si_slimit ) {
+               ptr = lutil_strcopy( ptr, " " SLIMITSTR "=" );
+               ptr += sprintf( ptr, "%d", si->si_slimit );
+       }
+
+       if ( si->si_tlimit ) {
+               ptr = lutil_strcopy( ptr, " " TLIMITSTR "=" );
+               ptr += sprintf( ptr, "%d", si->si_tlimit );
+       }
+       bc.bv_len = ptr - buf;
+       bc.bv_val = buf;
+       ber_dupbv( bv, &bc );
+}
+
+int
+syncrepl_config(ConfigArgs *c) {
+       if (c->op == SLAP_CONFIG_EMIT) {
+               if ( c->be->be_syncinfo ) {
+                       struct berval bv;
+                       syncrepl_unparse( c->be->be_syncinfo, &bv ); 
+                       ber_bvarray_add( &c->rvalue_vals, &bv );
+                       return 0;
+               }
+               return 1;
+       } else if ( c->op == LDAP_MOD_DELETE ) {
+               struct re_s *re;
+
+               if ( c->be->be_syncinfo ) {
+                       re = c->be->be_syncinfo->si_re;
+                       if ( re ) {
+                               if ( ldap_pvt_runqueue_isrunning( &slapd_rq, re ))
+                                       ldap_pvt_runqueue_stoptask( &slapd_rq, re );
+                               ldap_pvt_runqueue_remove( &slapd_rq, re );
+                       }
+                       syncinfo_free( c->be->be_syncinfo );
+                       c->be->be_syncinfo = NULL;
+               }
+               SLAP_DBFLAGS(c->be) &= ~(SLAP_DBFLAG_SHADOW|SLAP_DBFLAG_SYNC_SHADOW);
+               return 0;
+       }
+       if(SLAP_SHADOW(c->be)) {
+               Debug(LDAP_DEBUG_ANY, "%s: "
+                       "syncrepl: database already shadowed.\n",
+                       c->log, 0, 0);
+               return(1);
+       } else if(add_syncrepl(c->be, c->argv, c->argc)) {
+               return(1);
+       }
+       SLAP_DBFLAGS(c->be) |= (SLAP_DBFLAG_SHADOW | SLAP_DBFLAG_SYNC_SHADOW);
+       return(0);
+}
index 4dec901ce9a2c4a0974a5c71f8ddfd84ed4c09a1..0a9d4e4fd4d282b46147c2bdb4394342e1a176fe 100644 (file)
@@ -47,8 +47,15 @@ do_unbind( Operation *op, SlapReply *rs )
        Statslog( LDAP_DEBUG_STATS, "%s UNBIND\n", op->o_log_prefix,
                0, 0, 0, 0 );
 
+       if ( frontendDB->be_unbind ) {
+               op->o_bd = frontendDB;
+               (void)frontendDB->be_unbind( op, rs );
+               op->o_bd = NULL;
+       }
+
        /* pass the unbind to all backends */
-       backend_unbind( op, rs );
+       (void)backend_unbind( op, rs );
 
        return 0;
 }
+
index ebec9e348174b90c23b9ce1af187296a4c6e2fbd..ef5c8b571de8f77c663c180d8f3fcf7a45017c9e 100644 (file)
@@ -256,3 +256,303 @@ int value_find_ex(
        slap_sl_free( nval.bv_val, ctx );
        return LDAP_NO_SUCH_ATTRIBUTE;
 }
+
+/* assign new indexes to an attribute's ordered values */
+void
+ordered_value_renumber( Attribute *a, int vals )
+{
+       char *ptr, ibuf[64];    /* many digits */
+       struct berval ibv, tmp, vtmp;
+       int i;
+
+       ibv.bv_val = ibuf;
+
+       for (i=0; i<vals; i++) {
+               ibv.bv_len = sprintf(ibv.bv_val, "{%d}", i);
+               vtmp = a->a_vals[i];
+               if ( vtmp.bv_val[0] == '{' ) {
+                       ptr = strchr(vtmp.bv_val, '}') + 1;
+                       vtmp.bv_len -= ptr - vtmp.bv_val;
+                       vtmp.bv_val = ptr;
+               }
+               tmp.bv_len = ibv.bv_len + vtmp.bv_len;
+               tmp.bv_val = ch_malloc( tmp.bv_len + 1 );
+               strcpy( tmp.bv_val, ibv.bv_val );
+               AC_MEMCPY( tmp.bv_val + ibv.bv_len, vtmp.bv_val, vtmp.bv_len );
+               tmp.bv_val[tmp.bv_len] = '\0';
+               ch_free( a->a_vals[i].bv_val );
+               a->a_vals[i] = tmp;
+
+               if ( a->a_nvals && a->a_nvals != a->a_vals ) {
+                       vtmp = a->a_nvals[i];
+                       if ( vtmp.bv_val[0] == '{' ) {
+                               ptr = strchr(vtmp.bv_val, '}') + 1;
+                               vtmp.bv_len -= ptr - vtmp.bv_val;
+                               vtmp.bv_val = ptr;
+                       }
+                       tmp.bv_len = ibv.bv_len + vtmp.bv_len;
+                       tmp.bv_val = ch_malloc( tmp.bv_len + 1 );
+                       strcpy( tmp.bv_val, ibv.bv_val );
+                       AC_MEMCPY( tmp.bv_val + ibv.bv_len, vtmp.bv_val, vtmp.bv_len );
+                       tmp.bv_val[tmp.bv_len] = '\0';
+                       ch_free( a->a_nvals[i].bv_val );
+                       a->a_nvals[i] = tmp;
+               }
+       }
+}
+
+/* Sort the values in an X-ORDERED VALUES attribute.
+ * If the values have no index, index them in their given order.
+ * If the values have indexes, sort them.
+ * If some are indexed and some are not, return Error.
+ */
+int
+ordered_value_sort( Attribute *a, int do_renumber )
+{
+       int i, vals;
+       int index = 0, noindex = 0, renumber = 0, gotnvals = 0;
+       struct berval tmp;
+       char *ptr;
+
+       if ( a->a_nvals && a->a_nvals != a->a_vals )
+               gotnvals = 1;
+
+       /* count attrs, look for index */
+       for (i=0; a->a_vals[i].bv_val; i++) {
+               if ( a->a_vals[i].bv_val[0] == '{' ) {
+                       char *ptr;
+                       index = 1;
+                       ptr = strchr( a->a_vals[i].bv_val, '}' );
+                       if ( !ptr || !ptr[1] )
+                               return LDAP_INVALID_SYNTAX;
+                       if ( noindex )
+                               return LDAP_INVALID_SYNTAX;
+               } else {
+                       noindex = 1;
+                       if ( index )
+                               return LDAP_INVALID_SYNTAX;
+               }
+       }
+       vals = i;
+
+       /* If values have indexes, sort the values */
+       if ( index ) {
+               int *indexes, j, idx;
+               struct berval ntmp;
+
+#if 0
+               /* Strip index from normalized values */
+               if ( !a->a_nvals || a->a_vals == a->a_nvals ) {
+                       a->a_nvals = ch_malloc( (vals+1)*sizeof(struct berval));
+                       BER_BVZERO(a->a_nvals+vals);
+                       for ( i=0; i<vals; i++ ) {
+                               ptr = strchr(a->a_vals[i].bv_val, '}') + 1;
+                               a->a_nvals[i].bv_len = a->a_vals[i].bv_len -
+                                       (ptr - a->a_vals[i].bv_val);
+                               a->a_nvals[i].bv_val = ch_malloc( a->a_nvals[i].bv_len + 1);
+                               strcpy(a->a_nvals[i].bv_val, ptr );
+                       }
+               } else {
+                       for ( i=0; i<vals; i++ ) {
+                               ptr = strchr(a->a_nvals[i].bv_val, '}') + 1;
+                               a->a_nvals[i].bv_len -= ptr - a->a_nvals[i].bv_val;
+                               strcpy(a->a_nvals[i].bv_val, ptr);
+                       }
+               }
+#endif
+                               
+               indexes = ch_malloc( vals * sizeof(int) );
+               for ( i=0; i<vals; i++)
+                       indexes[i] = strtol(a->a_vals[i].bv_val+1, NULL, 0);
+
+               /* Insertion sort */
+               for ( i=1; i<vals; i++ ) {
+                       idx = indexes[i];
+                       tmp = a->a_vals[i];
+                       if ( gotnvals ) ntmp = a->a_nvals[i];
+                       j = i;
+                       while ((j > 0) && (indexes[j-1] > idx)) {
+                               indexes[j] = indexes[j-1];
+                               a->a_vals[j] = a->a_vals[j-1];
+                               if ( gotnvals ) a->a_nvals[j] = a->a_nvals[j-1];
+                               j--;
+                       }
+                       indexes[j] = idx;
+                       a->a_vals[j] = tmp;
+                       if ( gotnvals ) a->a_nvals[j] = ntmp;
+               }
+
+               /* If range is not contiguous, must renumber */
+               if ( indexes[0] != 0 || indexes[vals-1] != vals-1 ) {
+                       renumber = 1;
+               }
+       } else {
+               renumber = 1;
+       }
+
+       if ( do_renumber && renumber )
+               ordered_value_renumber( a, vals );
+
+       return 0;
+}
+
+/* A wrapper for value match, handles Equality matches for attributes
+ * with ordered values.
+ */
+int
+ordered_value_match(
+       int *match,
+       AttributeDescription *ad,
+       MatchingRule *mr,
+       unsigned flags,
+       struct berval *v1, /* stored value */
+       struct berval *v2, /* assertion */
+       const char ** text )
+{
+       struct berval bv1, bv2;
+
+       /* X-ORDERED VALUES equality matching:
+        * If (SLAP_MR_IS_VALUE_OF_ATTRIBUTE_SYNTAX) that means we are
+        * comparing two attribute values. In this case, we want to ignore
+        * the ordering index of both values, we just want to know if their
+        * main values are equal.
+        *
+        * If (SLAP_MR_IS_VALUE_OF_ASSERTION_SYNTAX) then we are comparing
+        * an assertion against an attribute value.
+        *    If the assertion has no index, the index of the value is ignored. 
+        *    If the assertion has only an index, the remainder of the value is
+        *      ignored.
+        *    If the assertion has index and value, both are compared.
+        */
+       if ( ad->ad_type->sat_flags & SLAP_AT_ORDERED ) {
+               char *ptr;
+               struct berval iv;
+
+               bv1 = *v1;
+               bv2 = *v2;
+               iv = bv2;
+
+               /* Skip past the assertion index */
+               if ( bv2.bv_val[0] == '{' ) {
+                       ptr = strchr( bv2.bv_val, '}' ) + 1;
+                       bv2.bv_len -= ptr - bv2.bv_val;
+                       bv2.bv_val = ptr;
+                       v2 = &bv2;
+               }
+
+               if ( SLAP_MR_IS_VALUE_OF_ASSERTION_SYNTAX( flags )) {
+                       if ( iv.bv_val[0] == '{' && bv1.bv_val[0] == '{' ) {
+                       /* compare index values first */
+                               long l1, l2, ret;
+
+                               l1 = strtol( bv1.bv_val+1, NULL, 0 );
+                               l2 = strtol( iv.bv_val+1, &ptr, 0 );
+
+                               ret = l1 - l2;
+
+                               /* If not equal, or we're only comparing the index,
+                                * return result now.
+                                */
+                               if ( ret || ptr == iv.bv_val + iv.bv_len - 1 ) {
+                                       *match = ( ret < 0 ) ? -1 : (ret > 0 );
+                                       return LDAP_SUCCESS;
+                               }
+                       }
+               }
+               /* Skip past the attribute index */
+               if ( bv1.bv_val[0] == '{' ) {
+                       ptr = strchr( bv1.bv_val, '}' ) + 1;
+                       bv1.bv_len -= ptr - bv1.bv_val;
+                       bv1.bv_val = ptr;
+                       v1 = &bv1;
+               }
+       }
+
+       if ( !mr || !mr->smr_match ) {
+               *match = ber_bvcmp( v1, v2 );
+               return LDAP_SUCCESS;
+       }
+
+       return value_match( match, ad, mr, flags, v1, v2, text );
+}
+
+int
+ordered_value_add(
+       Entry *e,
+       AttributeDescription *ad,
+       Attribute *a,
+       BerVarray vals,
+       BerVarray nvals
+)
+{
+       int i, j, k, anum, vnum;
+       BerVarray new, nnew = NULL;
+
+       /* count new vals */
+       for (i=0; !BER_BVISNULL( vals+i ); i++) ;
+       vnum = i;
+
+       if ( a ) {
+               for (i=0; !BER_BVISNULL( a->a_vals+i ); i++) ;
+               anum = i;
+               ordered_value_sort( a, 0 );
+       } else {
+               Attribute **ap;
+               anum = 0;
+               for ( ap=&e->e_attrs; *ap; ap = &(*ap)->a_next ) ;
+               a = ch_calloc( 1, sizeof(Attribute) );
+               a->a_desc = ad;
+               *ap = a;
+       }
+
+       new = ch_malloc( (anum+vnum+1) * sizeof(struct berval));
+       if ( a->a_nvals && a->a_nvals != a->a_vals ) {
+               nnew = ch_malloc( (anum+vnum+1) * sizeof(struct berval));
+               /* Shouldn't happen... */
+               if ( !nvals ) nvals = vals;
+       }
+       if ( anum ) {
+               AC_MEMCPY( new, a->a_vals, anum * sizeof(struct berval));
+               if ( nnew )
+                       AC_MEMCPY( nnew, a->a_nvals, anum * sizeof(struct berval));
+       }
+
+       for (i=0; i<vnum; i++) {
+               k = -1;
+               if ( vals[i].bv_val[0] == '{' ) {
+                       k = strtol( vals[i].bv_val+1, NULL, 0 );
+                       if ( k > anum ) k = -1;
+               }
+               /* No index, or index is greater than current number of
+                * values, just tack onto the end
+                */
+               if ( k < 0 ) {
+                       ber_dupbv( new+anum, vals+i );
+                       if ( nnew ) ber_dupbv( nnew+anum, nvals+i );
+
+               /* Indexed, push everything else down one and insert */
+               } else {
+                       for (j=anum; j>k; j--) {
+                               new[j] = new[j-1];
+                               if ( nnew ) nnew[j] = nnew[j-1];
+                       }
+                       ber_dupbv( new+k, vals+i );
+                       if ( nnew ) ber_dupbv( nnew+k, nvals+i );
+               }
+               anum++;
+       }
+       BER_BVZERO( new+anum );
+       ch_free( a->a_vals );
+       a->a_vals = new;
+       if ( nnew ) {
+               BER_BVZERO( nnew+anum );
+               ch_free( a->a_nvals );
+               a->a_nvals = nnew;
+       } else {
+               a->a_nvals = a->a_vals;
+       }
+
+       ordered_value_renumber( a, anum );
+
+       return 0;
+}
index ea2abb2317113e4ad36801ddde2759bbd72ae49b..8b0134895ee751095fa43bc914354553707ea795 100644 (file)
@@ -21,6 +21,22 @@ facsimileTelephoneNumber: +1 313 555 4332
 telephoneNumber: +1 313 555 0895
 
 # Using ldapsearch to retrieve all the entries...
+dn: ou=Add/Delete,dc=example,dc=com
+objectClass: organizationalUnit
+ou: Add/Delete
+
+dn: cn=Added by Bjorn (must succeed),ou=Add/Delete,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: Added by Bjorn (must succeed)
+sn: None
+description: this attribute value has been added __after__entry creation
+description: Bjorn will try to delete this attribute value (should fail)
+
+dn: cn=Added by Bjorn (renamed by Jaj),ou=Add/Delete,dc=example,dc=com
+objectClass: inetOrgPerson
+sn: None
+cn: Added by Bjorn (renamed by Jaj)
+
 dn: cn=All Staff,ou=Groups,dc=example,dc=com
 member: cn=Manager,dc=example,dc=com
 member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=exam
index 85bf04e49e77cdf37973935a88d66f95b2277fcb..bc97e96018e13ccb32f83b83b5e71b4cedb725fe 100644 (file)
@@ -170,3 +170,18 @@ description: #'0010'B // empty "" DN with leading '0's
 description: dc=example,dc=com#'1000'B // with DN portion
 description: dc=example,dc=com#'0'B // with DN portion and just one '0'
 
+dn: cn=Name and Optional UID,ou=Related Syntaxes,dc=example,dc=com
+objectClass: groupOfUniqueNames
+cn: Name and Optional UID
+uniqueMember: cn=Name and Optional UID,ou=Related Syntaxes,dc=example,dc=com
+uniqueMember: #'1'B
+uniqueMember: #'10'B
+uniqueMember: dc=example,dc=com#'1000'B
+uniqueMember: dc=example,dc=com#'0'B
+description: cn=Name and Optional UID,ou=Related Syntaxes,dc=example,dc=com //
+  only DN portion
+description: #'1'B // empty "" DN
+description: #'0010'B // empty "" DN with leading '0's
+description: dc=example,dc=com#'1000'B // with DN portion
+description: dc=example,dc=com#'0'B // with DN portion and just one '0'
+
diff --git a/tests/data/gluesync.out b/tests/data/gluesync.out
new file mode 100644 (file)
index 0000000..3d53473
--- /dev/null
@@ -0,0 +1,410 @@
+dn: cn=All Staff,ou=Groups,dc=example,dc=com
+member: cn=Manager,dc=example,dc=com
+member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=exam
+ ple,dc=com
+member: cn=Jane Doe,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=John Doe,ou=Information Technology Division,ou=People,dc=example,dc
+ =com
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=James A Jones 2,ou=Information Technology Division,ou=People,dc=exa
+ mple,dc=com
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=exampl
+ e,dc=com
+owner: cn=Manager,dc=example,dc=com
+cn: All Staff
+description: Everyone in the sample data
+objectClass: groupOfNames
+
+dn: cn=Alumni Assoc Staff,ou=Groups,dc=example,dc=com
+member: cn=Manager,dc=example,dc=com
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=Jane Doe,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,dc=example,dc=com
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,dc=example,dc=com
+owner: cn=Manager,dc=example,dc=com
+description: All Alumni Assoc Staff
+cn: Alumni Assoc Staff
+objectClass: groupOfNames
+
+dn: ou=Alumni Association,ou=People,dc=example,dc=com
+objectClass: organizationalUnit
+ou: Alumni Association
+
+dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=example,
+ dc=com
+objectClass: OpenLDAPperson
+cn: Barbara Jensen
+cn: Babs Jensen
+sn:: IEplbnNlbiA=
+uid: bjensen
+title: Mythical Manager, Research Systems
+postalAddress: ITD Prod Dev & Deployment $ 535 W. William St. Room 4212 $ Anyt
+ own, MI 48103-4943
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+userPassword:: YmplbnNlbg==
+mail: bjensen@mailgw.example.com
+homePostalAddress: 123 Wesley $ Anytown, MI 48103
+description: Mythical manager of the rsdd unix project
+drink: water
+homePhone: +1 313 555 2333
+pager: +1 313 555 3233
+facsimileTelephoneNumber: +1 313 555 2274
+telephoneNumber: +1 313 555 9022
+
+dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc
+ =com
+objectClass: OpenLDAPperson
+cn: Bjorn Jensen
+cn: Biiff Jensen
+sn: Jensen
+uid: bjorn
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+userPassword:: Ympvcm4=
+homePostalAddress: 19923 Seven Mile Rd. $ South Lyon, MI 49999
+drink: Iced Tea
+description: Hiker, biker
+title: Director, Embedded Systems
+postalAddress: Info Tech Division $ 535 W. William St. $ Anytown, MI 48103
+mail: bjorn@mailgw.example.com
+homePhone: +1 313 555 5444
+pager: +1 313 555 4474
+facsimileTelephoneNumber: +1 313 555 2177
+telephoneNumber: +1 313 555 0355
+
+dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,dc=example,dc=com
+objectClass: OpenLDAPperson
+cn: Dorothy Stevens
+cn: Dot Stevens
+sn: Stevens
+uid: dots
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+drink: Lemonade
+homePostalAddress: 377 White St. Apt. 3 $ Anytown, MI 48104
+description: Very tall
+facsimileTelephoneNumber: +1 313 555 3223
+telephoneNumber: +1 313 555 3664
+mail: dots@mail.alumni.example.com
+homePhone: +1 313 555 0454
+
+dn: dc=example,dc=com
+objectClass: top
+objectClass: organization
+objectClass: domainRelatedObject
+objectClass: dcObject
+dc: example
+l: Anytown, Michigan
+st: Michigan
+o: Example, Inc.
+o: EX
+o: Ex.
+description: The Example, Inc. at Anytown
+postalAddress: Example, Inc. $ 535 W. William St. $ Anytown, MI 48109 $ US
+telephoneNumber: +1 313 555 1817
+associatedDomain: example.com
+
+dn: ou=Groups,dc=example,dc=com
+objectClass: organizationalUnit
+ou: Groups
+
+dn: ou=Information Technology Division,ou=People,dc=example,dc=com
+objectClass: organizationalUnit
+ou: Information Technology Division
+description:: aMODwoPDgsKCw4PCgsOCwotFVlZQw4PCg8OCwoPDg8KCw4LCv0zDg8KDw4LCgsOD
+ woLDgsKKT8ODwoPDgsKDw4PCgsOCwqs6w4PCg8OCwoLDg8KCw4LCjUQkw4PCg8OCwoLDg8KCw4LCi
+ 01QUcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4
+ LCgsODwoLDgsKLRCQoZitEJMODwoPDgsKCw4PCgsOCwrfDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoP
+ Dg8KCw4LCgcODwoPDgsKDw4PCgsOCwqHDg8KDw4LCgsODwoLDgsKLRCQkZitEJMODwoPDgsKCw4PC
+ gsOCwrfDg8KDw4LCg8ODwoLDgsKQw4PCg8OCwoPDg8KCw4LCisODwoPDgsKCw4PCgsOCwotFUVZqU
+ MODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKAw4PCg8OCwoLDg8KCw4LCik85dCTDg8KDw4
+ LCgsODwoLDgsKFQ8ODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4L
+ Cvzl0JMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPD
+ gsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKLRCTDg8KDw4LCgsODwoLDgsKDw4PCg8OCwoLDg8KCw
+ 4LCuMODwoPDgsKDw4PCgsOCwoR0Q8ODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LChMODwo
+ PDgsKDw4PCgsOCwoFOdTrDg8KDw4LCg8ODwoLDgsKHw4PCg8OCwoPDg8KCw4LChMODwoPDgsKDw4P
+ CgsOCwoFOw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwrtHw4PCg8OCwoLDg8KCw4LChcOD
+ woPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsK4dMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODw
+ oLDgsKtR8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwo
+ PDgsKDw4PCgsOCwr9SfGrDg8KDw4LCgsODwoLDgsKLQGgxw4PCg8OCwoPDg8KCw4LCoWhQw4PCg8O
+ CwoPDg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKT8ODwoPDgsKCw4PCgsOC
+ wotEJDDDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHTDg8KDw4LCgsODwoLDgsKDw4PCg
+ 8OCwoPDg8KCw4LCuHXDg8KDw4LCgsODwoLDgsKLRCRqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4
+ PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpPDg8K
+ Dw4LCg8ODwoLDgsKQXV9eW8ODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoPD
+ g8KCw4LCgsODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODw
+ oPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgs
+ OCwoxWV8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKxw4PCg8OCwoLDg8KCw4LCi3wkw4P
+ Cg8OCwoLDg8KCw4LCjcODwoPDgsKCw4PCgsOCwofDg8KDw4LCg8ODwoLDgsKof8ODwoPDgsKDw4PC
+ gsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCg8ODwoPDgsKDw4PCgsOCwrh5w4PCg
+ 8OCwoLDg8KCw4LChzQzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PCgsOCworDg8KDw4LCgsODwo
+ LDgsKIw4PCg8OCwoLDg8KCw4LCuDFBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNdDF
+ Bw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPD
+ gsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw
+ 4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgs
+ KCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKAdcODwoPDgsKDw4PCgsOCwqhtw4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCsMODwoPDgsKC
+ w4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCt
+ sODwoPDgsKDw4PCgsOCwq7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4
+ PCgsOCwoPDg8KDw4LCg8ODwoLDgsKoZsODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4w4P
+ Cg8OCwoLDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwpUzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PC
+ gsOCworDg8KDw4LCgsODwoLDgsKISDJBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNN
+ DJBw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwo
+ PDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8O
+ DwoPDgsKDw4PCgsOCwojDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCnEzDg8KDw4LCgsOD
+ woLDgsKLSEBmw4PCg8OCwoLDg8KCw4LCg3lwdSTDg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw
+ 4LCv8ODwoPDgsKCw4PCgsOCwobDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwp/Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwoj
+ Dg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCwpPDg8KDw4LCgsOD
+ woLDgsKBw4PCg8OCwoPDg8KCw4LCv1rDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODw
+ oPDgsKCw4PCgsOCwodqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwoBqaMODwoPDgsKCw4
+ PCgsOCwpBQw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDIMODwoPDgsKCw4PCgsOCwopPw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKOacODwoPDgsKCw4PCgsOCwrhf
+ XsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCw
+ oLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKGw4PCg8OCwoLDg8KCw4LCgM
+ ODwoPDgsKCw4PCgsOCwoRJw4PCg8OCwoLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsO
+ DwoLDgsKIw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQ9w4PCg8OCwoLDg8KCw4LCgcOD
+ woPDgsKDw4PCgsOCwr9aw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQxw4PCg8OCwoLDg
+ 8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LCm0
+ 7Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsK
+ Cw4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODw
+ oPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgs
+ OCwo7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCkMODwoPDgsKDw4PCgsOCwojDg8KDw4L
+ CgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsK+
+ S8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKww4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDw
+ 4PCgsOCwoTDg8KDw4LCgsODwoLDgsKKT1DDg8KDw4LCg8ODwoLDgsKoRsODwoPDgsKCw4PCgsOCwo
+ vDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwrZ0Y8ODwoPDgsK
+ Cw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/dF/Dg8KDw4LCgsODwoLDgsKhdHpPw4PCg8OCwoLDg8KC
+ w4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PCg8OCwoPDg8KCw4LCqC1Jw4PCg8OCwoLDg8KCw4LChcODw
+ oPDgsKDw4PCgsOCwoB1RMODwoPDgsKCw4PCgsOCwqFwek/Dg8KDw4LCgsODwoLDgsKLw4PCg8OCwo
+ PDg8KCw4LCj1DDg8KDw4LCg8ODwoLDgsKoScODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK
+ AdTPDg8KDw4LCgsODwoLDgsKhbHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PC
+ g8OCwoPDg8KCw4LCqEnDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHXDg8KDw4LCgsODw
+ oLDgsKhaHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo9Qw4PCg8OCwoPDg8KCw4LCqM
+ ODwoPDgsKDw4PCgsOCwrpIw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoB1M8ODwoPDgsK
+ Dw4PCgsOCwoBfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgjPDg8KDw4LCg8ODwoLDgsKAX17Dg
+ 8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCg8ODwo
+ LDgsKoJ8ODwoPDgsKDw4PCgsOCwq3Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoP
+ DgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4aHU5w4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PC
+ gsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw
+ 4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgs
+ KIw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpLDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoB0IcODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKA
+ w4PCg8OCwoPDg8KCw4LCtMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKAdGbDg8KDw4LCg
+ sODwoLDgsKLQGY9dGY9dTPDg8KDw4LCg8ODwoLDgsKAX17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwo
+ LDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPDgsKDw4PCgsO
+ CwoIzw4PCg8OCwoPDg8KCw4LCgF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwovDg8KD
+ w4LCg8ODwoLDgsK/Ri9BUC9BRi9BWi9BZC9BWzBBZC9BZTBBZC9BZC9BbzBBZC9BeTBBw4PCg8OCw
+ oLDg8KCw4LCgzBBMUFhMUFrMUE=
+description:: UF7Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOC
+ wozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg
+ 8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCqFDDg8KDw4LCg8ODwoLDgsKpRsODwoPDgsKDw4PCgsOCwo
+ zDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8O
+ DwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKCw4PCgsOCwotEJCDDg8KDw4LCgsODwoLDgsKD
+ w4PCg8OCwoPDg8KCw4LCrMODwoPDgsKCw4PCgsOCwotUJCRTw4PCg8OCwoLDg8KCw4LCi1wkJFbDg
+ 8KDw4LCgsODwoLDgsKJTCRXVVBSU8ODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsKdT8ODwo
+ PDgsKCw4PCgsOCwoN8JDB1w4PCg8OCwoPDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8O
+ DwoLDgsKBTsODwoPDgsKDw4PCgsOCwqktw4PCg8OCwoLDg8KCw4LCg3wkMHTDg8KDw4LCgsODwoLD
+ gsKDfCQww4PCg8OCwoLDg8KCw4LChTPDg8KDw4LCg8ODwoLDgsK2OTXDg8KDw4LCg8ODwoLDgsKAw
+ 4PCg8OCwoPDg8KCw4LCgU7Dg8KDw4LCgsODwoLDgsKEIMODwoPDgsKCw4PCgsOCwqFIw4PCg8OCwo
+ PDg8KCw4LChU7Dg8KDw4LCgsODwoLDgsKJNcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8ODwoLDgsK
+ BTsODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKD
+ w4PCgsOCwr9TXMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw
+ 4LChMODwoPDgsKCw4PCgsOCwpHDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLIEjDg8
+ KDw4LCg8ODwoLDgsKFTlDDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ngw4PCg8OCwoL
+ Dg8KCw4LCi8ODwoPDgsKDw4PCgsOCwpjDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCm3Rx
+ w4PCg8OCwoLDg8KCw4LCizvDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi8ODwoPDgsKDw
+ 4PCgsOCwr9XaMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGdGLDg8KDw4LCgsODwo
+ LDgsKLf2zDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi1D
+ Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8OD
+ woLDgsKow4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwq10SmgoT03Dg8KDw4LCgsODwoLDg
+ sKLw4PCg8OCwoPDg8KCw4LCjcODwoPDgsKDw4PCgsOCwqggTMODwoPDgsKCw4PCgsOCwoXDg8KDw4
+ LCg8ODwoLDgsKAdDrDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLTSBQUcODwoPDgsK
+ Dw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKL
+ RCQoZitEJCDDg8KDw4LCgsODwoLDgsK3w4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwoHDg
+ 8KDw4LCg8ODwoLDgsKhw4PCg8OCwoLDg8KCw4LCi0QkJGYrRCTDg8KDw4LCgsODwoLDgsK3w4PCg8
+ OCwoPDg8KCw4LCkMODwoPDgsKDw4PCgsOCworDg8KDw4LCgsODwoLDgsKLRSBRVmpQw4PCg8OCwoP
+ Dg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKTzl0JHXDg8KDw4LCgsODwoLD
+ gsKhOXQkw4PCg8OCwoLDg8KCw4LChW/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODw
+ oPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKhRMODwoPDgsKDw4PCgsOCwoVOw4PCg8OCwoLDg8
+ KCw4LCi8ODwoPDgsKDw4PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ncw4P
+ Cg8OCwoLDg8KCw4LCiUQkw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsOD
+ woLDgsKEw4PCg8OCwoPDg8KCw4LCtjPDg8KDw4LCg8ODwoLDgsK2w4PCg8OCwoLDg8KCw4LCjUQkw
+ 4PCg8OCwoLDg8KCw4LCiyBEw4PCg8OCwoPDg8KCw4LChU5Qw4PCg8OCwoLDg8KCw4LCi8ODwoPDgs
+ KDw4PCgsOCwr9TYMODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCkMODwoPDgsKC
+ w4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCj8ODwoPDgsKDw4PCgsOCwr9Ta
+ MODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwr3Dg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4L
+ Cj1DDg8KDw4LCg8ODwoLDgsK/U2zDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCqMODwoPD
+ gsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKtw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCw
+ p9oMMODwoPDgsKDw4PCgsOCwolMw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4
+ LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCq0vDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4L
+ CgMODwoPDgsKCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi0QkOcODwoPD
+ gsKCw4PCgsOCwrDDg8KDw4LCg8ODwoLDgsKEdEU5w4PCg8OCwoLDg8KCw4LCtTR0PcODwoPDgsKCw
+ 4PCgsOCwovDg8KDw4LCg8ODwoLDgsKNw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwo5Lw4
+ PCg8OCwoLDg8KCw4LCi0AgUMODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKsw4PCg8OCwoL
+ Dg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHUow4PCg8OCwoLDg8KCw4LC
+ i8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCgsODwoLDgsKJw4PCg8OCwoLDg8KCw4LCtTTDg8KDw4LCg
+ 8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKDw4PCgsOCwrtWw4PCg8OCwoLDg8KCw4LCi8
+ ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCnw==
+
+dn: cn=ITD Staff,ou=Groups,dc=example,dc=com
+owner: cn=Manager,dc=example,dc=com
+description: All ITD Staff
+cn: ITD Staff
+objectClass: groupOfUniqueNames
+uniqueMember: cn=Manager,dc=example,dc=com
+uniqueMember: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=
+ example,dc=com
+uniqueMember: cn=James A Jones 2,ou=Information Technology Division,ou=People,
+ dc=example,dc=com
+uniqueMember: cn=John Doe,ou=Information Technology Division,ou=People,dc=exam
+ ple,dc=com
+
+dn: cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com
+objectClass: OpenLDAPperson
+cn: James A Jones 1
+cn: James Jones
+cn: Jim Jones
+sn: Jones
+uid: jaj
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+userPassword:: amFq
+homePostalAddress: 3882 Beverly Rd. $ Anytown, MI 48105
+homePhone: +1 313 555 4772
+description: Outstanding
+title: Mad Cow Researcher, UM Alumni Association
+pager: +1 313 555 3923
+mail: jaj@mail.alumni.example.com
+facsimileTelephoneNumber: +1 313 555 4332
+telephoneNumber: +1 313 555 0895
+
+dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,dc=example
+ ,dc=com
+objectClass: OpenLDAPperson
+cn: James A Jones 2
+cn: James Jones
+cn: Jim Jones
+sn: Doe
+uid: jjones
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+homePostalAddress: 933 Brooks $ Anytown, MI 48104
+homePhone: +1 313 555 8838
+title: Senior Manager, Information Technology Division
+description: Not around very much
+mail: jjones@mailgw.example.com
+postalAddress: Info Tech Division $ 535 W William $ Anytown, MI 48103
+pager: +1 313 555 2833
+facsimileTelephoneNumber: +1 313 555 8688
+telephoneNumber: +1 313 555 7334
+
+dn: cn=Jane Doe,ou=Alumni Association,ou=People,dc=example,dc=com
+objectClass: OpenLDAPperson
+cn: Jane Doe
+cn: Jane Alverson
+sn: Doe
+uid: jdoe
+title: Programmer Analyst, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+drink: diet coke
+description: Enthusiastic
+mail: jdoe@woof.net
+homePhone: +1 313 555 5445
+pager: +1 313 555 1220
+facsimileTelephoneNumber: +1 313 555 2311
+telephoneNumber: +1 313 555 4774
+
+dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,dc=example,dc=com
+objectClass: OpenLDAPperson
+cn: Jennifer Smith
+cn: Jen Smith
+sn: Smith
+uid: jen
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+drink: Sam Adams
+homePostalAddress: 1000 Maple #44 $ Anytown, MI 48103
+title: Telemarketer, UM Alumni Association
+mail: jen@mail.alumni.example.com
+homePhone: +1 313 555 2333
+pager: +1 313 555 6442
+facsimileTelephoneNumber: +1 313 555 2756
+telephoneNumber: +1 313 555 8232
+
+dn: cn=John Doe,ou=Information Technology Division,ou=People,dc=example,dc=com
+objectClass: OpenLDAPperson
+cn: John Doe
+cn: Jonathon Doe
+sn: Doe
+uid: johnd
+postalAddress: ITD $ 535 W. William $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+homePostalAddress: 912 East Bllvd $ Anytown, MI 48104
+title: System Administrator, Information Technology Division
+description: overworked!
+mail: johnd@mailgw.example.com
+homePhone: +1 313 555 3774
+pager: +1 313 555 6573
+facsimileTelephoneNumber: +1 313 555 4544
+telephoneNumber: +1 313 555 9394
+
+dn: cn=Manager,dc=example,dc=com
+objectClass: person
+cn: Manager
+cn: Directory Manager
+cn: Dir Man
+sn: Manager
+description: Manager of the directory
+userPassword:: c2VjcmV0
+
+dn: cn=Mark Elliot,ou=Alumni Association,ou=People,dc=example,dc=com
+objectClass: OpenLDAPperson
+cn: Mark Elliot
+cn: Mark A Elliot
+sn: Elliot
+uid: melliot
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+homePostalAddress: 199 Outer Drive $ Ypsilanti, MI 48198
+homePhone: +1 313 555 0388
+drink: Gasoline
+title: Director, UM Alumni Association
+mail: melliot@mail.alumni.example.com
+pager: +1 313 555 7671
+facsimileTelephoneNumber: +1 313 555 7762
+telephoneNumber: +1 313 555 4177
+
+dn: ou=People,dc=example,dc=com
+objectClass: organizationalUnit
+objectClass: extensibleObject
+ou: People
+uidNumber: 0
+gidNumber: 0
+
+dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,dc=example,dc=com
+objectClass: OpenLDAPperson
+cn: Ursula Hampster
+sn: Hampster
+uid: uham
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+mail: uham@mail.alumni.example.com
+homePhone: +1 313 555 8421
+pager: +1 313 555 2844
+facsimileTelephoneNumber: +1 313 555 9700
+telephoneNumber: +1 313 555 5331
+
diff --git a/tests/data/meta.out b/tests/data/meta.out
new file mode 100644 (file)
index 0000000..e443909
--- /dev/null
@@ -0,0 +1,1413 @@
+# searching base="o=Example,c=US"...
+dn: cn=All Staff,ou=Groups,o=Example,c=US
+member: cn=Manager,o=Example,c=US
+member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Examp
+ le,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Exam
+ ple,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example
+ ,c=US
+owner: cn=Manager,o=Example,c=US
+cn: All Staff
+description: Everyone in the sample data
+objectClass: groupOfNames
+
+dn: cn=Alumni Assoc Staff,ou=Groups,o=Example,c=US
+member: cn=Manager,o=Example,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+owner: cn=Manager,o=Example,c=US
+description: All Alumni Assoc Staff
+cn: Alumni Assoc Staff
+objectClass: groupOfNames
+
+dn: ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: organizationalUnit
+ou: Alumni Association
+
+dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Example,c
+ =US
+objectClass: OpenLDAPperson
+cn: Barbara Jensen
+cn: Babs Jensen
+sn:: IEplbnNlbiA=
+uid: bjensen
+title: Mythical Manager, Research Systems
+postalAddress: ITD Prod Dev & Deployment $ 535 W. William St. Room 4212 $ Anyt
+ own, MI 48103-4943
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: YmplbnNlbg==
+mail: bjensen@mailgw.example.com
+homePostalAddress: 123 Wesley $ Anytown, MI 48103
+description: Mythical manager of the rsdd unix project
+drink: water
+homePhone: +1 313 555 2333
+pager: +1 313 555 3233
+facsimileTelephoneNumber: +1 313 555 2274
+telephoneNumber: +1 313 555 9022
+
+dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+objectClass: OpenLDAPperson
+cn: Bjorn Jensen
+cn: Biiff Jensen
+sn: Jensen
+uid: bjorn
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: Ympvcm4=
+homePostalAddress: 19923 Seven Mile Rd. $ South Lyon, MI 49999
+drink: Iced Tea
+description: Hiker, biker
+title: Director, Embedded Systems
+postalAddress: Info Tech Division $ 535 W. William St. $ Anytown, MI 48103
+mail: bjorn@mailgw.example.com
+homePhone: +1 313 555 5444
+pager: +1 313 555 4474
+facsimileTelephoneNumber: +1 313 555 2177
+telephoneNumber: +1 313 555 0355
+
+dn: cn=Dan Aykroyd,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: Dan Aykroyd
+sn: Aykroyd
+userPassword:: ZWx3b29k
+description: Elwood Blues
+
+dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Dorothy Stevens
+cn: Dot Stevens
+sn: Stevens
+uid: dots
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+drink: Lemonade
+homePostalAddress: 377 White St. Apt. 3 $ Anytown, MI 48104
+description: Very tall
+facsimileTelephoneNumber: +1 313 555 3223
+telephoneNumber: +1 313 555 3664
+mail: dots@mail.alumni.example.com
+homePhone: +1 313 555 0454
+
+dn: o=Example,c=US
+objectClass: top
+objectClass: organization
+objectClass: domainRelatedObject
+objectClass: dcObject
+dc: example
+l: Anytown, Michigan
+st: Michigan
+o: Example, Inc.
+o: EX
+o: Ex.
+description: The Example, Inc. at Anytown
+postalAddress: Example, Inc. $ 535 W. William St. $ Anytown, MI 48109 $ US
+telephoneNumber: +1 313 555 1817
+associatedDomain: example.com
+
+dn: ou=Groups,o=Example,c=US
+objectClass: organizationalUnit
+ou: Groups
+
+dn: ou=Information Technology Division,ou=People,o=Example,c=US
+objectClass: organizationalUnit
+ou: Information Technology Division
+description:: aMODwoPDgsKCw4PCgsOCwotFVlZQw4PCg8OCwoPDg8KCw4LCv0zDg8KDw4LCgsOD
+ woLDgsKKT8ODwoPDgsKDw4PCgsOCwqs6w4PCg8OCwoLDg8KCw4LCjUQkw4PCg8OCwoLDg8KCw4LCi
+ 01QUcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4
+ LCgsODwoLDgsKLRCQoZitEJMODwoPDgsKCw4PCgsOCwrfDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoP
+ Dg8KCw4LCgcODwoPDgsKDw4PCgsOCwqHDg8KDw4LCgsODwoLDgsKLRCQkZitEJMODwoPDgsKCw4PC
+ gsOCwrfDg8KDw4LCg8ODwoLDgsKQw4PCg8OCwoPDg8KCw4LCisODwoPDgsKCw4PCgsOCwotFUVZqU
+ MODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKAw4PCg8OCwoLDg8KCw4LCik85dCTDg8KDw4
+ LCgsODwoLDgsKFQ8ODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4L
+ Cvzl0JMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPD
+ gsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKLRCTDg8KDw4LCgsODwoLDgsKDw4PCg8OCwoLDg8KCw
+ 4LCuMODwoPDgsKDw4PCgsOCwoR0Q8ODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LChMODwo
+ PDgsKDw4PCgsOCwoFOdTrDg8KDw4LCg8ODwoLDgsKHw4PCg8OCwoPDg8KCw4LChMODwoPDgsKDw4P
+ CgsOCwoFOw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwrtHw4PCg8OCwoLDg8KCw4LChcOD
+ woPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsK4dMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODw
+ oLDgsKtR8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwo
+ PDgsKDw4PCgsOCwr9SfGrDg8KDw4LCgsODwoLDgsKLQGgxw4PCg8OCwoPDg8KCw4LCoWhQw4PCg8O
+ CwoPDg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKT8ODwoPDgsKCw4PCgsOC
+ wotEJDDDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHTDg8KDw4LCgsODwoLDgsKDw4PCg
+ 8OCwoPDg8KCw4LCuHXDg8KDw4LCgsODwoLDgsKLRCRqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4
+ PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpPDg8K
+ Dw4LCg8ODwoLDgsKQXV9eW8ODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoPD
+ g8KCw4LCgsODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODw
+ oPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgs
+ OCwoxWV8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKxw4PCg8OCwoLDg8KCw4LCi3wkw4P
+ Cg8OCwoLDg8KCw4LCjcODwoPDgsKCw4PCgsOCwofDg8KDw4LCg8ODwoLDgsKof8ODwoPDgsKDw4PC
+ gsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCg8ODwoPDgsKDw4PCgsOCwrh5w4PCg
+ 8OCwoLDg8KCw4LChzQzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PCgsOCworDg8KDw4LCgsODwo
+ LDgsKIw4PCg8OCwoLDg8KCw4LCuDFBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNdDF
+ Bw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPD
+ gsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw
+ 4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgs
+ KCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKAdcODwoPDgsKDw4PCgsOCwqhtw4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCsMODwoPDgsKC
+ w4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCt
+ sODwoPDgsKDw4PCgsOCwq7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4
+ PCgsOCwoPDg8KDw4LCg8ODwoLDgsKoZsODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4w4P
+ Cg8OCwoLDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwpUzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PC
+ gsOCworDg8KDw4LCgsODwoLDgsKISDJBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNN
+ DJBw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwo
+ PDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8O
+ DwoPDgsKDw4PCgsOCwojDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCnEzDg8KDw4LCgsOD
+ woLDgsKLSEBmw4PCg8OCwoLDg8KCw4LCg3lwdSTDg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw
+ 4LCv8ODwoPDgsKCw4PCgsOCwobDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwp/Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwoj
+ Dg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCwpPDg8KDw4LCgsOD
+ woLDgsKBw4PCg8OCwoPDg8KCw4LCv1rDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODw
+ oPDgsKCw4PCgsOCwodqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwoBqaMODwoPDgsKCw4
+ PCgsOCwpBQw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDIMODwoPDgsKCw4PCgsOCwopPw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKOacODwoPDgsKCw4PCgsOCwrhf
+ XsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCw
+ oLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKGw4PCg8OCwoLDg8KCw4LCgM
+ ODwoPDgsKCw4PCgsOCwoRJw4PCg8OCwoLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsO
+ DwoLDgsKIw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQ9w4PCg8OCwoLDg8KCw4LCgcOD
+ woPDgsKDw4PCgsOCwr9aw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQxw4PCg8OCwoLDg
+ 8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LCm0
+ 7Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsK
+ Cw4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODw
+ oPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgs
+ OCwo7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCkMODwoPDgsKDw4PCgsOCwojDg8KDw4L
+ CgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsK+
+ S8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKww4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDw
+ 4PCgsOCwoTDg8KDw4LCgsODwoLDgsKKT1DDg8KDw4LCg8ODwoLDgsKoRsODwoPDgsKCw4PCgsOCwo
+ vDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwrZ0Y8ODwoPDgsK
+ Cw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/dF/Dg8KDw4LCgsODwoLDgsKhdHpPw4PCg8OCwoLDg8KC
+ w4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PCg8OCwoPDg8KCw4LCqC1Jw4PCg8OCwoLDg8KCw4LChcODw
+ oPDgsKDw4PCgsOCwoB1RMODwoPDgsKCw4PCgsOCwqFwek/Dg8KDw4LCgsODwoLDgsKLw4PCg8OCwo
+ PDg8KCw4LCj1DDg8KDw4LCg8ODwoLDgsKoScODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK
+ AdTPDg8KDw4LCgsODwoLDgsKhbHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PC
+ g8OCwoPDg8KCw4LCqEnDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHXDg8KDw4LCgsODw
+ oLDgsKhaHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo9Qw4PCg8OCwoPDg8KCw4LCqM
+ ODwoPDgsKDw4PCgsOCwrpIw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoB1M8ODwoPDgsK
+ Dw4PCgsOCwoBfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgjPDg8KDw4LCg8ODwoLDgsKAX17Dg
+ 8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCg8ODwo
+ LDgsKoJ8ODwoPDgsKDw4PCgsOCwq3Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoP
+ DgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4aHU5w4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PC
+ gsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw
+ 4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgs
+ KIw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpLDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoB0IcODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKA
+ w4PCg8OCwoPDg8KCw4LCtMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKAdGbDg8KDw4LCg
+ sODwoLDgsKLQGY9dGY9dTPDg8KDw4LCg8ODwoLDgsKAX17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwo
+ LDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPDgsKDw4PCgsO
+ CwoIzw4PCg8OCwoPDg8KCw4LCgF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwovDg8KD
+ w4LCg8ODwoLDgsK/Ri9BUC9BRi9BWi9BZC9BWzBBZC9BZTBBZC9BZC9BbzBBZC9BeTBBw4PCg8OCw
+ oLDg8KCw4LCgzBBMUFhMUFrMUE=
+description:: UF7Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOC
+ wozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg
+ 8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCqFDDg8KDw4LCg8ODwoLDgsKpRsODwoPDgsKDw4PCgsOCwo
+ zDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8O
+ DwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKCw4PCgsOCwotEJCDDg8KDw4LCgsODwoLDgsKD
+ w4PCg8OCwoPDg8KCw4LCrMODwoPDgsKCw4PCgsOCwotUJCRTw4PCg8OCwoLDg8KCw4LCi1wkJFbDg
+ 8KDw4LCgsODwoLDgsKJTCRXVVBSU8ODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsKdT8ODwo
+ PDgsKCw4PCgsOCwoN8JDB1w4PCg8OCwoPDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8O
+ DwoLDgsKBTsODwoPDgsKDw4PCgsOCwqktw4PCg8OCwoLDg8KCw4LCg3wkMHTDg8KDw4LCgsODwoLD
+ gsKDfCQww4PCg8OCwoLDg8KCw4LChTPDg8KDw4LCg8ODwoLDgsK2OTXDg8KDw4LCg8ODwoLDgsKAw
+ 4PCg8OCwoPDg8KCw4LCgU7Dg8KDw4LCgsODwoLDgsKEIMODwoPDgsKCw4PCgsOCwqFIw4PCg8OCwo
+ PDg8KCw4LChU7Dg8KDw4LCgsODwoLDgsKJNcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8ODwoLDgsK
+ BTsODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKD
+ w4PCgsOCwr9TXMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw
+ 4LChMODwoPDgsKCw4PCgsOCwpHDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLIEjDg8
+ KDw4LCg8ODwoLDgsKFTlDDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ngw4PCg8OCwoL
+ Dg8KCw4LCi8ODwoPDgsKDw4PCgsOCwpjDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCm3Rx
+ w4PCg8OCwoLDg8KCw4LCizvDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi8ODwoPDgsKDw
+ 4PCgsOCwr9XaMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGdGLDg8KDw4LCgsODwo
+ LDgsKLf2zDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi1D
+ Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8OD
+ woLDgsKow4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwq10SmgoT03Dg8KDw4LCgsODwoLDg
+ sKLw4PCg8OCwoPDg8KCw4LCjcODwoPDgsKDw4PCgsOCwqggTMODwoPDgsKCw4PCgsOCwoXDg8KDw4
+ LCg8ODwoLDgsKAdDrDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLTSBQUcODwoPDgsK
+ Dw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKL
+ RCQoZitEJCDDg8KDw4LCgsODwoLDgsK3w4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwoHDg
+ 8KDw4LCg8ODwoLDgsKhw4PCg8OCwoLDg8KCw4LCi0QkJGYrRCTDg8KDw4LCgsODwoLDgsK3w4PCg8
+ OCwoPDg8KCw4LCkMODwoPDgsKDw4PCgsOCworDg8KDw4LCgsODwoLDgsKLRSBRVmpQw4PCg8OCwoP
+ Dg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKTzl0JHXDg8KDw4LCgsODwoLD
+ gsKhOXQkw4PCg8OCwoLDg8KCw4LChW/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODw
+ oPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKhRMODwoPDgsKDw4PCgsOCwoVOw4PCg8OCwoLDg8
+ KCw4LCi8ODwoPDgsKDw4PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ncw4P
+ Cg8OCwoLDg8KCw4LCiUQkw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsOD
+ woLDgsKEw4PCg8OCwoPDg8KCw4LCtjPDg8KDw4LCg8ODwoLDgsK2w4PCg8OCwoLDg8KCw4LCjUQkw
+ 4PCg8OCwoLDg8KCw4LCiyBEw4PCg8OCwoPDg8KCw4LChU5Qw4PCg8OCwoLDg8KCw4LCi8ODwoPDgs
+ KDw4PCgsOCwr9TYMODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCkMODwoPDgsKC
+ w4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCj8ODwoPDgsKDw4PCgsOCwr9Ta
+ MODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwr3Dg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4L
+ Cj1DDg8KDw4LCg8ODwoLDgsK/U2zDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCqMODwoPD
+ gsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKtw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCw
+ p9oMMODwoPDgsKDw4PCgsOCwolMw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4
+ LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCq0vDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4L
+ CgMODwoPDgsKCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi0QkOcODwoPD
+ gsKCw4PCgsOCwrDDg8KDw4LCg8ODwoLDgsKEdEU5w4PCg8OCwoLDg8KCw4LCtTR0PcODwoPDgsKCw
+ 4PCgsOCwovDg8KDw4LCg8ODwoLDgsKNw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwo5Lw4
+ PCg8OCwoLDg8KCw4LCi0AgUMODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKsw4PCg8OCwoL
+ Dg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHUow4PCg8OCwoLDg8KCw4LC
+ i8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCgsODwoLDgsKJw4PCg8OCwoLDg8KCw4LCtTTDg8KDw4LCg
+ 8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKDw4PCgsOCwrtWw4PCg8OCwoLDg8KCw4LCi8
+ ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCnw==
+
+dn: cn=ITD Staff,ou=Groups,o=Example,c=US
+owner: cn=Manager,o=Example,c=US
+description: All ITD Staff
+cn: ITD Staff
+objectClass: groupOfUniqueNames
+uniqueMember: cn=Manager,dc=example,dc=com
+uniqueMember: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=
+ example,dc=com
+uniqueMember: cn=James A Jones 2,ou=Information Technology Division,ou=People,
+ dc=example,dc=com
+uniqueMember: cn=John Doe,ou=Information Technology Division,ou=People,dc=exam
+ ple,dc=com
+
+dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 1
+cn: James Jones
+cn: Jim Jones
+sn: Jones
+uid: jaj
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: amFq
+homePostalAddress: 3882 Beverly Rd. $ Anytown, MI 48105
+homePhone: +1 313 555 4772
+description: Outstanding
+title: Mad Cow Researcher, UM Alumni Association
+pager: +1 313 555 3923
+mail: jaj@mail.alumni.example.com
+facsimileTelephoneNumber: +1 313 555 4332
+telephoneNumber: +1 313 555 0895
+
+dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Example,
+ c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 2
+cn: James Jones
+cn: Jim Jones
+sn: Doe
+uid: jjones
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 933 Brooks $ Anytown, MI 48104
+homePhone: +1 313 555 8838
+title: Senior Manager, Information Technology Division
+description: Not around very much
+mail: jjones@mailgw.example.com
+postalAddress: Info Tech Division $ 535 W William $ Anytown, MI 48103
+pager: +1 313 555 2833
+facsimileTelephoneNumber: +1 313 555 8688
+telephoneNumber: +1 313 555 7334
+
+dn: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Jane Doe
+cn: Jane Alverson
+sn: Doe
+uid: jdoe
+title: Programmer Analyst, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+drink: diet coke
+description: Enthusiastic
+mail: jdoe@woof.net
+homePhone: +1 313 555 5445
+pager: +1 313 555 1220
+facsimileTelephoneNumber: +1 313 555 2311
+telephoneNumber: +1 313 555 4774
+
+dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Jennifer Smith
+cn: Jen Smith
+sn: Smith
+uid: jen
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+drink: Sam Adams
+homePostalAddress: 1000 Maple #44 $ Anytown, MI 48103
+title: Telemarketer, UM Alumni Association
+mail: jen@mail.alumni.example.com
+homePhone: +1 313 555 2333
+pager: +1 313 555 6442
+facsimileTelephoneNumber: +1 313 555 2756
+telephoneNumber: +1 313 555 8232
+
+dn: cn=John Belushi,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: John Belushi
+sn: Belushi
+userPassword:: amFjaw==
+description: Joliet Jack Blues
+
+dn: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: John Doe
+cn: Jonathon Doe
+sn: Doe
+uid: johnd
+postalAddress: ITD $ 535 W. William $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 912 East Bllvd $ Anytown, MI 48104
+title: System Administrator, Information Technology Division
+description: overworked!
+mail: johnd@mailgw.example.com
+homePhone: +1 313 555 3774
+pager: +1 313 555 6573
+facsimileTelephoneNumber: +1 313 555 4544
+telephoneNumber: +1 313 555 9394
+
+dn: cn=Manager,o=Example,c=US
+objectClass: person
+cn: Manager
+cn: Directory Manager
+cn: Dir Man
+sn: Manager
+description: Manager of the directory
+userPassword:: c2VjcmV0
+
+dn: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Mark Elliot
+cn: Mark A Elliot
+sn: Elliot
+uid: melliot
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 199 Outer Drive $ Ypsilanti, MI 48198
+homePhone: +1 313 555 0388
+drink: Gasoline
+title: Director, UM Alumni Association
+mail: melliot@mail.alumni.example.com
+pager: +1 313 555 7671
+facsimileTelephoneNumber: +1 313 555 7762
+telephoneNumber: +1 313 555 4177
+
+dn: ou=Meta,o=Example,c=US
+objectClass: organizationalUnit
+ou: Meta
+
+dn: ou=People,o=Example,c=US
+objectClass: organizationalUnit
+objectClass: extensibleObject
+ou: People
+uidNumber: 0
+gidNumber: 0
+
+dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Ursula Hampster
+sn: Hampster
+uid: uham
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+mail: uham@mail.alumni.example.com
+homePhone: +1 313 555 8421
+pager: +1 313 555 2844
+facsimileTelephoneNumber: +1 313 555 9700
+telephoneNumber: +1 313 555 5331
+
+# refldap://:9010/cn=Somewhere,ou=Meta,dc=example,dc=com??sub
+
+# searching base="o=Example,c=US"...
+dn: cn=Added Group,ou=Groups,o=Example,c=US
+objectClass: groupOfNames
+cn: Added Group
+member: cn=Added Group,ou=Groups,o=Example,c=US
+
+dn: cn=Added User,ou=Same as above,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: Added User
+sn: User
+userPassword:: c2VjcmV0
+
+dn: cn=All Staff,ou=Groups,o=Example,c=US
+member: cn=Manager,o=Example,c=US
+member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Examp
+ le,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Exam
+ ple,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example
+ ,c=US
+owner: cn=Manager,o=Example,c=US
+cn: All Staff
+description: Everyone in the sample data
+objectClass: groupOfNames
+
+dn: cn=Alumni Assoc Staff,ou=Groups,o=Example,c=US
+member: cn=Manager,o=Example,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+owner: cn=Manager,o=Example,c=US
+description: All Alumni Assoc Staff
+cn: Alumni Assoc Staff
+objectClass: groupOfNames
+
+dn: ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: organizationalUnit
+ou: Alumni Association
+
+dn: cn=Another Added Group,ou=Groups,o=Example,c=US
+objectClass: groupOfNames
+objectClass: uidObject
+cn: Another Added Group
+member: cn=Added Group,ou=Groups,o=Example,c=US
+member: cn=Another Added Group,ou=Groups,o=Example,c=US
+uid: added
+
+dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Example,c
+ =US
+objectClass: OpenLDAPperson
+cn: Barbara Jensen
+cn: Babs Jensen
+sn:: IEplbnNlbiA=
+uid: bjensen
+title: Mythical Manager, Research Systems
+postalAddress: ITD Prod Dev & Deployment $ 535 W. William St. Room 4212 $ Anyt
+ own, MI 48103-4943
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: YmplbnNlbg==
+mail: bjensen@mailgw.example.com
+homePostalAddress: 123 Wesley $ Anytown, MI 48103
+description: Mythical manager of the rsdd unix project
+drink: water
+homePhone: +1 313 555 2333
+pager: +1 313 555 3233
+facsimileTelephoneNumber: +1 313 555 2274
+telephoneNumber: +1 313 555 9022
+
+dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+objectClass: OpenLDAPperson
+cn: Bjorn Jensen
+cn: Biiff Jensen
+sn: Jensen
+uid: bjorn
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: Ympvcm4=
+homePostalAddress: 19923 Seven Mile Rd. $ South Lyon, MI 49999
+drink: Iced Tea
+description: Hiker, biker
+title: Director, Embedded Systems
+postalAddress: Info Tech Division $ 535 W. William St. $ Anytown, MI 48103
+mail: bjorn@mailgw.example.com
+homePhone: +1 313 555 5444
+pager: +1 313 555 4474
+facsimileTelephoneNumber: +1 313 555 2177
+telephoneNumber: +1 313 555 0355
+
+dn: cn=Dan Aykroyd,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: Dan Aykroyd
+sn: Aykroyd
+userPassword:: ZWx3b29k
+description: Elwood Blues
+
+dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Dorothy Stevens
+cn: Dot Stevens
+sn: Stevens
+uid: dots
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+drink: Lemonade
+homePostalAddress: 377 White St. Apt. 3 $ Anytown, MI 48104
+description: Very tall
+facsimileTelephoneNumber: +1 313 555 3223
+telephoneNumber: +1 313 555 3664
+mail: dots@mail.alumni.example.com
+homePhone: +1 313 555 0454
+
+dn: o=Example,c=US
+objectClass: top
+objectClass: organization
+objectClass: domainRelatedObject
+objectClass: dcObject
+dc: example
+l: Anytown, Michigan
+st: Michigan
+o: Example, Inc.
+o: EX
+o: Ex.
+description: The Example, Inc. at Anytown
+postalAddress: Example, Inc. $ 535 W. William St. $ Anytown, MI 48109 $ US
+telephoneNumber: +1 313 555 1817
+associatedDomain: example.com
+
+dn: ou=Groups,o=Example,c=US
+objectClass: organizationalUnit
+ou: Groups
+
+dn: ou=Information Technology Division,ou=People,o=Example,c=US
+objectClass: organizationalUnit
+ou: Information Technology Division
+description:: aMODwoPDgsKCw4PCgsOCwotFVlZQw4PCg8OCwoPDg8KCw4LCv0zDg8KDw4LCgsOD
+ woLDgsKKT8ODwoPDgsKDw4PCgsOCwqs6w4PCg8OCwoLDg8KCw4LCjUQkw4PCg8OCwoLDg8KCw4LCi
+ 01QUcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4
+ LCgsODwoLDgsKLRCQoZitEJMODwoPDgsKCw4PCgsOCwrfDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoP
+ Dg8KCw4LCgcODwoPDgsKDw4PCgsOCwqHDg8KDw4LCgsODwoLDgsKLRCQkZitEJMODwoPDgsKCw4PC
+ gsOCwrfDg8KDw4LCg8ODwoLDgsKQw4PCg8OCwoPDg8KCw4LCisODwoPDgsKCw4PCgsOCwotFUVZqU
+ MODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKAw4PCg8OCwoLDg8KCw4LCik85dCTDg8KDw4
+ LCgsODwoLDgsKFQ8ODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4L
+ Cvzl0JMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPD
+ gsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKLRCTDg8KDw4LCgsODwoLDgsKDw4PCg8OCwoLDg8KCw
+ 4LCuMODwoPDgsKDw4PCgsOCwoR0Q8ODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LChMODwo
+ PDgsKDw4PCgsOCwoFOdTrDg8KDw4LCg8ODwoLDgsKHw4PCg8OCwoPDg8KCw4LChMODwoPDgsKDw4P
+ CgsOCwoFOw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwrtHw4PCg8OCwoLDg8KCw4LChcOD
+ woPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsK4dMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODw
+ oLDgsKtR8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwo
+ PDgsKDw4PCgsOCwr9SfGrDg8KDw4LCgsODwoLDgsKLQGgxw4PCg8OCwoPDg8KCw4LCoWhQw4PCg8O
+ CwoPDg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKT8ODwoPDgsKCw4PCgsOC
+ wotEJDDDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHTDg8KDw4LCgsODwoLDgsKDw4PCg
+ 8OCwoPDg8KCw4LCuHXDg8KDw4LCgsODwoLDgsKLRCRqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4
+ PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpPDg8K
+ Dw4LCg8ODwoLDgsKQXV9eW8ODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoPD
+ g8KCw4LCgsODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODw
+ oPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgs
+ OCwoxWV8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKxw4PCg8OCwoLDg8KCw4LCi3wkw4P
+ Cg8OCwoLDg8KCw4LCjcODwoPDgsKCw4PCgsOCwofDg8KDw4LCg8ODwoLDgsKof8ODwoPDgsKDw4PC
+ gsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCg8ODwoPDgsKDw4PCgsOCwrh5w4PCg
+ 8OCwoLDg8KCw4LChzQzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PCgsOCworDg8KDw4LCgsODwo
+ LDgsKIw4PCg8OCwoLDg8KCw4LCuDFBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNdDF
+ Bw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPD
+ gsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw
+ 4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgs
+ KCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKAdcODwoPDgsKDw4PCgsOCwqhtw4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCsMODwoPDgsKC
+ w4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCt
+ sODwoPDgsKDw4PCgsOCwq7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4
+ PCgsOCwoPDg8KDw4LCg8ODwoLDgsKoZsODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4w4P
+ Cg8OCwoLDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwpUzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PC
+ gsOCworDg8KDw4LCgsODwoLDgsKISDJBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNN
+ DJBw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwo
+ PDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8O
+ DwoPDgsKDw4PCgsOCwojDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCnEzDg8KDw4LCgsOD
+ woLDgsKLSEBmw4PCg8OCwoLDg8KCw4LCg3lwdSTDg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw
+ 4LCv8ODwoPDgsKCw4PCgsOCwobDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwp/Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwoj
+ Dg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCwpPDg8KDw4LCgsOD
+ woLDgsKBw4PCg8OCwoPDg8KCw4LCv1rDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODw
+ oPDgsKCw4PCgsOCwodqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwoBqaMODwoPDgsKCw4
+ PCgsOCwpBQw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDIMODwoPDgsKCw4PCgsOCwopPw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKOacODwoPDgsKCw4PCgsOCwrhf
+ XsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCw
+ oLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKGw4PCg8OCwoLDg8KCw4LCgM
+ ODwoPDgsKCw4PCgsOCwoRJw4PCg8OCwoLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsO
+ DwoLDgsKIw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQ9w4PCg8OCwoLDg8KCw4LCgcOD
+ woPDgsKDw4PCgsOCwr9aw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQxw4PCg8OCwoLDg
+ 8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LCm0
+ 7Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsK
+ Cw4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODw
+ oPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgs
+ OCwo7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCkMODwoPDgsKDw4PCgsOCwojDg8KDw4L
+ CgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsK+
+ S8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKww4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDw
+ 4PCgsOCwoTDg8KDw4LCgsODwoLDgsKKT1DDg8KDw4LCg8ODwoLDgsKoRsODwoPDgsKCw4PCgsOCwo
+ vDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwrZ0Y8ODwoPDgsK
+ Cw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/dF/Dg8KDw4LCgsODwoLDgsKhdHpPw4PCg8OCwoLDg8KC
+ w4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PCg8OCwoPDg8KCw4LCqC1Jw4PCg8OCwoLDg8KCw4LChcODw
+ oPDgsKDw4PCgsOCwoB1RMODwoPDgsKCw4PCgsOCwqFwek/Dg8KDw4LCgsODwoLDgsKLw4PCg8OCwo
+ PDg8KCw4LCj1DDg8KDw4LCg8ODwoLDgsKoScODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK
+ AdTPDg8KDw4LCgsODwoLDgsKhbHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PC
+ g8OCwoPDg8KCw4LCqEnDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHXDg8KDw4LCgsODw
+ oLDgsKhaHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo9Qw4PCg8OCwoPDg8KCw4LCqM
+ ODwoPDgsKDw4PCgsOCwrpIw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoB1M8ODwoPDgsK
+ Dw4PCgsOCwoBfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgjPDg8KDw4LCg8ODwoLDgsKAX17Dg
+ 8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCg8ODwo
+ LDgsKoJ8ODwoPDgsKDw4PCgsOCwq3Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoP
+ DgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4aHU5w4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PC
+ gsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw
+ 4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgs
+ KIw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpLDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoB0IcODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKA
+ w4PCg8OCwoPDg8KCw4LCtMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKAdGbDg8KDw4LCg
+ sODwoLDgsKLQGY9dGY9dTPDg8KDw4LCg8ODwoLDgsKAX17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwo
+ LDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPDgsKDw4PCgsO
+ CwoIzw4PCg8OCwoPDg8KCw4LCgF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwovDg8KD
+ w4LCg8ODwoLDgsK/Ri9BUC9BRi9BWi9BZC9BWzBBZC9BZTBBZC9BZC9BbzBBZC9BeTBBw4PCg8OCw
+ oLDg8KCw4LCgzBBMUFhMUFrMUE=
+description:: UF7Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOC
+ wozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg
+ 8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCqFDDg8KDw4LCg8ODwoLDgsKpRsODwoPDgsKDw4PCgsOCwo
+ zDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8O
+ DwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKCw4PCgsOCwotEJCDDg8KDw4LCgsODwoLDgsKD
+ w4PCg8OCwoPDg8KCw4LCrMODwoPDgsKCw4PCgsOCwotUJCRTw4PCg8OCwoLDg8KCw4LCi1wkJFbDg
+ 8KDw4LCgsODwoLDgsKJTCRXVVBSU8ODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsKdT8ODwo
+ PDgsKCw4PCgsOCwoN8JDB1w4PCg8OCwoPDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8O
+ DwoLDgsKBTsODwoPDgsKDw4PCgsOCwqktw4PCg8OCwoLDg8KCw4LCg3wkMHTDg8KDw4LCgsODwoLD
+ gsKDfCQww4PCg8OCwoLDg8KCw4LChTPDg8KDw4LCg8ODwoLDgsK2OTXDg8KDw4LCg8ODwoLDgsKAw
+ 4PCg8OCwoPDg8KCw4LCgU7Dg8KDw4LCgsODwoLDgsKEIMODwoPDgsKCw4PCgsOCwqFIw4PCg8OCwo
+ PDg8KCw4LChU7Dg8KDw4LCgsODwoLDgsKJNcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8ODwoLDgsK
+ BTsODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKD
+ w4PCgsOCwr9TXMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw
+ 4LChMODwoPDgsKCw4PCgsOCwpHDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLIEjDg8
+ KDw4LCg8ODwoLDgsKFTlDDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ngw4PCg8OCwoL
+ Dg8KCw4LCi8ODwoPDgsKDw4PCgsOCwpjDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCm3Rx
+ w4PCg8OCwoLDg8KCw4LCizvDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi8ODwoPDgsKDw
+ 4PCgsOCwr9XaMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGdGLDg8KDw4LCgsODwo
+ LDgsKLf2zDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi1D
+ Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8OD
+ woLDgsKow4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwq10SmgoT03Dg8KDw4LCgsODwoLDg
+ sKLw4PCg8OCwoPDg8KCw4LCjcODwoPDgsKDw4PCgsOCwqggTMODwoPDgsKCw4PCgsOCwoXDg8KDw4
+ LCg8ODwoLDgsKAdDrDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLTSBQUcODwoPDgsK
+ Dw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKL
+ RCQoZitEJCDDg8KDw4LCgsODwoLDgsK3w4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwoHDg
+ 8KDw4LCg8ODwoLDgsKhw4PCg8OCwoLDg8KCw4LCi0QkJGYrRCTDg8KDw4LCgsODwoLDgsK3w4PCg8
+ OCwoPDg8KCw4LCkMODwoPDgsKDw4PCgsOCworDg8KDw4LCgsODwoLDgsKLRSBRVmpQw4PCg8OCwoP
+ Dg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKTzl0JHXDg8KDw4LCgsODwoLD
+ gsKhOXQkw4PCg8OCwoLDg8KCw4LChW/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODw
+ oPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKhRMODwoPDgsKDw4PCgsOCwoVOw4PCg8OCwoLDg8
+ KCw4LCi8ODwoPDgsKDw4PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ncw4P
+ Cg8OCwoLDg8KCw4LCiUQkw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsOD
+ woLDgsKEw4PCg8OCwoPDg8KCw4LCtjPDg8KDw4LCg8ODwoLDgsK2w4PCg8OCwoLDg8KCw4LCjUQkw
+ 4PCg8OCwoLDg8KCw4LCiyBEw4PCg8OCwoPDg8KCw4LChU5Qw4PCg8OCwoLDg8KCw4LCi8ODwoPDgs
+ KDw4PCgsOCwr9TYMODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCkMODwoPDgsKC
+ w4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCj8ODwoPDgsKDw4PCgsOCwr9Ta
+ MODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwr3Dg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4L
+ Cj1DDg8KDw4LCg8ODwoLDgsK/U2zDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCqMODwoPD
+ gsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKtw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCw
+ p9oMMODwoPDgsKDw4PCgsOCwolMw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4
+ LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCq0vDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4L
+ CgMODwoPDgsKCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi0QkOcODwoPD
+ gsKCw4PCgsOCwrDDg8KDw4LCg8ODwoLDgsKEdEU5w4PCg8OCwoLDg8KCw4LCtTR0PcODwoPDgsKCw
+ 4PCgsOCwovDg8KDw4LCg8ODwoLDgsKNw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwo5Lw4
+ PCg8OCwoLDg8KCw4LCi0AgUMODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKsw4PCg8OCwoL
+ Dg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHUow4PCg8OCwoLDg8KCw4LC
+ i8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCgsODwoLDgsKJw4PCg8OCwoLDg8KCw4LCtTTDg8KDw4LCg
+ 8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKDw4PCgsOCwrtWw4PCg8OCwoLDg8KCw4LCi8
+ ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCnw==
+
+dn: cn=ITD Staff,ou=Groups,o=Example,c=US
+owner: cn=Manager,o=Example,c=US
+description: All ITD Staff
+cn: ITD Staff
+objectClass: groupOfUniqueNames
+uniqueMember: cn=Manager,dc=example,dc=com
+uniqueMember: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=
+ example,dc=com
+uniqueMember: cn=James A Jones 2,ou=Information Technology Division,ou=People,
+ dc=example,dc=com
+uniqueMember: cn=John Doe,ou=Information Technology Division,ou=People,dc=exam
+ ple,dc=com
+
+dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 1
+cn: James Jones
+cn: Jim Jones
+sn: Jones
+uid: jaj
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: amFq
+homePostalAddress: 3882 Beverly Rd. $ Anytown, MI 48105
+homePhone: +1 313 555 4772
+description: Outstanding
+title: Mad Cow Researcher, UM Alumni Association
+pager: +1 313 555 3923
+mail: jaj@mail.alumni.example.com
+facsimileTelephoneNumber: +1 313 555 4332
+telephoneNumber: +1 313 555 0895
+
+dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Example,
+ c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 2
+cn: James Jones
+cn: Jim Jones
+sn: Doe
+uid: jjones
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 933 Brooks $ Anytown, MI 48104
+homePhone: +1 313 555 8838
+title: Senior Manager, Information Technology Division
+description: Not around very much
+mail: jjones@mailgw.example.com
+postalAddress: Info Tech Division $ 535 W William $ Anytown, MI 48103
+pager: +1 313 555 2833
+facsimileTelephoneNumber: +1 313 555 8688
+telephoneNumber: +1 313 555 7334
+
+dn: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Jane Doe
+cn: Jane Alverson
+sn: Doe
+uid: jdoe
+title: Programmer Analyst, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+drink: diet coke
+description: Enthusiastic
+mail: jdoe@woof.net
+homePhone: +1 313 555 5445
+pager: +1 313 555 1220
+facsimileTelephoneNumber: +1 313 555 2311
+telephoneNumber: +1 313 555 4774
+
+dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Jennifer Smith
+cn: Jen Smith
+sn: Smith
+uid: jen
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+drink: Sam Adams
+homePostalAddress: 1000 Maple #44 $ Anytown, MI 48103
+title: Telemarketer, UM Alumni Association
+mail: jen@mail.alumni.example.com
+homePhone: +1 313 555 2333
+pager: +1 313 555 6442
+facsimileTelephoneNumber: +1 313 555 2756
+telephoneNumber: +1 313 555 8232
+
+dn: cn=John Belushi,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: John Belushi
+sn: Belushi
+userPassword:: amFjaw==
+description: Joliet Jack Blues
+
+dn: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: John Doe
+cn: Jonathon Doe
+sn: Doe
+uid: johnd
+postalAddress: ITD $ 535 W. William $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 912 East Bllvd $ Anytown, MI 48104
+title: System Administrator, Information Technology Division
+description: overworked!
+mail: johnd@mailgw.example.com
+homePhone: +1 313 555 3774
+pager: +1 313 555 6573
+facsimileTelephoneNumber: +1 313 555 4544
+telephoneNumber: +1 313 555 9394
+
+dn: cn=Manager,o=Example,c=US
+objectClass: person
+cn: Manager
+cn: Directory Manager
+cn: Dir Man
+sn: Manager
+description: Manager of the directory
+userPassword:: c2VjcmV0
+
+dn: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Mark Elliot
+cn: Mark A Elliot
+sn: Elliot
+uid: melliot
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 199 Outer Drive $ Ypsilanti, MI 48198
+homePhone: +1 313 555 0388
+drink: Gasoline
+title: Director, UM Alumni Association
+mail: melliot@mail.alumni.example.com
+pager: +1 313 555 7671
+facsimileTelephoneNumber: +1 313 555 7762
+telephoneNumber: +1 313 555 4177
+
+dn: ou=Meta,o=Example,c=US
+objectClass: organizationalUnit
+ou: Meta
+description: added to "ou=Meta,o=Example,c=US"
+
+dn: ou=People,o=Example,c=US
+objectClass: organizationalUnit
+objectClass: extensibleObject
+ou: People
+uidNumber: 0
+gidNumber: 0
+
+dn: ou=Same as above,o=Example,c=US
+objectClass: organizationalUnit
+ou: Same as above
+description: added right after "Who's going to handle this?"
+description: will be preserved
+
+dn: ou=Same as above,ou=Meta,o=Example,c=US
+objectClass: organizationalUnit
+ou: Same as above
+description: added right after "Who's going to handle this?"
+description: will be preserved
+
+dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Ursula Hampster
+sn: Hampster
+uid: uham
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+mail: uham@mail.alumni.example.com
+homePhone: +1 313 555 8421
+pager: +1 313 555 2844
+facsimileTelephoneNumber: +1 313 555 9700
+telephoneNumber: +1 313 555 5331
+
+# refldap://:9010/cn=Somewhere,ou=Meta,dc=example,dc=com??sub
+
+#      base="o=Example,c=US"...
+dn: cn=Added Group,ou=Groups,o=Example,c=US
+objectClass: groupOfNames
+cn: Added Group
+member: cn=Added Group,ou=Groups,o=Example,c=US
+
+dn: cn=Added User,ou=Same as above,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: Added User
+sn: User
+userPassword:: c2VjcmV0
+
+dn: cn=All Staff,ou=Groups,o=Example,c=US
+member: cn=Manager,o=Example,c=US
+member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Examp
+ le,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Exam
+ ple,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example
+ ,c=US
+owner: cn=Manager,o=Example,c=US
+cn: All Staff
+description: Everyone in the sample data
+objectClass: groupOfNames
+
+dn: cn=Alumni Assoc Staff,ou=Groups,o=Example,c=US
+member: cn=Manager,o=Example,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+owner: cn=Manager,o=Example,c=US
+description: All Alumni Assoc Staff
+cn: Alumni Assoc Staff
+objectClass: groupOfNames
+
+dn: ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: organizationalUnit
+ou: Alumni Association
+
+dn: cn=Another Added Group,ou=Groups,o=Example,c=US
+objectClass: groupOfNames
+objectClass: uidObject
+cn: Another Added Group
+member: cn=Added Group,ou=Groups,o=Example,c=US
+member: cn=Another Added Group,ou=Groups,o=Example,c=US
+uid: added
+
+dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Example,c
+ =US
+objectClass: OpenLDAPperson
+cn: Barbara Jensen
+cn: Babs Jensen
+sn:: IEplbnNlbiA=
+uid: bjensen
+title: Mythical Manager, Research Systems
+postalAddress: ITD Prod Dev & Deployment $ 535 W. William St. Room 4212 $ Anyt
+ own, MI 48103-4943
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: YmplbnNlbg==
+mail: bjensen@mailgw.example.com
+homePostalAddress: 123 Wesley $ Anytown, MI 48103
+description: Mythical manager of the rsdd unix project
+drink: water
+homePhone: +1 313 555 2333
+pager: +1 313 555 3233
+facsimileTelephoneNumber: +1 313 555 2274
+telephoneNumber: +1 313 555 9022
+
+dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+objectClass: OpenLDAPperson
+cn: Bjorn Jensen
+cn: Biiff Jensen
+sn: Jensen
+uid: bjorn
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: Ympvcm4=
+homePostalAddress: 19923 Seven Mile Rd. $ South Lyon, MI 49999
+drink: Iced Tea
+description: Hiker, biker
+title: Director, Embedded Systems
+postalAddress: Info Tech Division $ 535 W. William St. $ Anytown, MI 48103
+mail: bjorn@mailgw.example.com
+homePhone: +1 313 555 5444
+pager: +1 313 555 4474
+facsimileTelephoneNumber: +1 313 555 2177
+telephoneNumber: +1 313 555 0355
+
+dn: cn=Dan Aykroyd,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: Dan Aykroyd
+sn: Aykroyd
+userPassword:: ZWx3b29k
+description: Elwood Blues
+
+dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Dorothy Stevens
+cn: Dot Stevens
+sn: Stevens
+uid: dots
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+drink: Lemonade
+homePostalAddress: 377 White St. Apt. 3 $ Anytown, MI 48104
+description: Very tall
+facsimileTelephoneNumber: +1 313 555 3223
+telephoneNumber: +1 313 555 3664
+mail: dots@mail.alumni.example.com
+homePhone: +1 313 555 0454
+
+dn: o=Example,c=US
+objectClass: top
+objectClass: organization
+objectClass: domainRelatedObject
+objectClass: dcObject
+dc: example
+l: Anytown, Michigan
+st: Michigan
+o: Example, Inc.
+o: EX
+o: Ex.
+description: The Example, Inc. at Anytown
+postalAddress: Example, Inc. $ 535 W. William St. $ Anytown, MI 48109 $ US
+telephoneNumber: +1 313 555 1817
+associatedDomain: example.com
+
+dn: ou=Groups,o=Example,c=US
+objectClass: organizationalUnit
+ou: Groups
+
+dn: ou=Information Technology Division,ou=People,o=Example,c=US
+objectClass: organizationalUnit
+ou: Information Technology Division
+description:: aMODwoPDgsKCw4PCgsOCwotFVlZQw4PCg8OCwoPDg8KCw4LCv0zDg8KDw4LCgsOD
+ woLDgsKKT8ODwoPDgsKDw4PCgsOCwqs6w4PCg8OCwoLDg8KCw4LCjUQkw4PCg8OCwoLDg8KCw4LCi
+ 01QUcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4
+ LCgsODwoLDgsKLRCQoZitEJMODwoPDgsKCw4PCgsOCwrfDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoP
+ Dg8KCw4LCgcODwoPDgsKDw4PCgsOCwqHDg8KDw4LCgsODwoLDgsKLRCQkZitEJMODwoPDgsKCw4PC
+ gsOCwrfDg8KDw4LCg8ODwoLDgsKQw4PCg8OCwoPDg8KCw4LCisODwoPDgsKCw4PCgsOCwotFUVZqU
+ MODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKAw4PCg8OCwoLDg8KCw4LCik85dCTDg8KDw4
+ LCgsODwoLDgsKFQ8ODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4L
+ Cvzl0JMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPD
+ gsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKLRCTDg8KDw4LCgsODwoLDgsKDw4PCg8OCwoLDg8KCw
+ 4LCuMODwoPDgsKDw4PCgsOCwoR0Q8ODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LChMODwo
+ PDgsKDw4PCgsOCwoFOdTrDg8KDw4LCg8ODwoLDgsKHw4PCg8OCwoPDg8KCw4LChMODwoPDgsKDw4P
+ CgsOCwoFOw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwrtHw4PCg8OCwoLDg8KCw4LChcOD
+ woPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsK4dMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODw
+ oLDgsKtR8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwo
+ PDgsKDw4PCgsOCwr9SfGrDg8KDw4LCgsODwoLDgsKLQGgxw4PCg8OCwoPDg8KCw4LCoWhQw4PCg8O
+ CwoPDg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKT8ODwoPDgsKCw4PCgsOC
+ wotEJDDDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHTDg8KDw4LCgsODwoLDgsKDw4PCg
+ 8OCwoPDg8KCw4LCuHXDg8KDw4LCgsODwoLDgsKLRCRqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4
+ PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpPDg8K
+ Dw4LCg8ODwoLDgsKQXV9eW8ODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoPD
+ g8KCw4LCgsODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODw
+ oPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgs
+ OCwoxWV8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKxw4PCg8OCwoLDg8KCw4LCi3wkw4P
+ Cg8OCwoLDg8KCw4LCjcODwoPDgsKCw4PCgsOCwofDg8KDw4LCg8ODwoLDgsKof8ODwoPDgsKDw4PC
+ gsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCg8ODwoPDgsKDw4PCgsOCwrh5w4PCg
+ 8OCwoLDg8KCw4LChzQzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PCgsOCworDg8KDw4LCgsODwo
+ LDgsKIw4PCg8OCwoLDg8KCw4LCuDFBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNdDF
+ Bw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPD
+ gsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw
+ 4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgs
+ KCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKAdcODwoPDgsKDw4PCgsOCwqhtw4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCsMODwoPDgsKC
+ w4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCt
+ sODwoPDgsKDw4PCgsOCwq7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4
+ PCgsOCwoPDg8KDw4LCg8ODwoLDgsKoZsODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4w4P
+ Cg8OCwoLDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwpUzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PC
+ gsOCworDg8KDw4LCgsODwoLDgsKISDJBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNN
+ DJBw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwo
+ PDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8O
+ DwoPDgsKDw4PCgsOCwojDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCnEzDg8KDw4LCgsOD
+ woLDgsKLSEBmw4PCg8OCwoLDg8KCw4LCg3lwdSTDg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw
+ 4LCv8ODwoPDgsKCw4PCgsOCwobDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwp/Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwoj
+ Dg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCwpPDg8KDw4LCgsOD
+ woLDgsKBw4PCg8OCwoPDg8KCw4LCv1rDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODw
+ oPDgsKCw4PCgsOCwodqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwoBqaMODwoPDgsKCw4
+ PCgsOCwpBQw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDIMODwoPDgsKCw4PCgsOCwopPw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKOacODwoPDgsKCw4PCgsOCwrhf
+ XsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCw
+ oLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKGw4PCg8OCwoLDg8KCw4LCgM
+ ODwoPDgsKCw4PCgsOCwoRJw4PCg8OCwoLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsO
+ DwoLDgsKIw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQ9w4PCg8OCwoLDg8KCw4LCgcOD
+ woPDgsKDw4PCgsOCwr9aw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQxw4PCg8OCwoLDg
+ 8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LCm0
+ 7Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsK
+ Cw4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODw
+ oPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgs
+ OCwo7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCkMODwoPDgsKDw4PCgsOCwojDg8KDw4L
+ CgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsK+
+ S8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKww4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDw
+ 4PCgsOCwoTDg8KDw4LCgsODwoLDgsKKT1DDg8KDw4LCg8ODwoLDgsKoRsODwoPDgsKCw4PCgsOCwo
+ vDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwrZ0Y8ODwoPDgsK
+ Cw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/dF/Dg8KDw4LCgsODwoLDgsKhdHpPw4PCg8OCwoLDg8KC
+ w4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PCg8OCwoPDg8KCw4LCqC1Jw4PCg8OCwoLDg8KCw4LChcODw
+ oPDgsKDw4PCgsOCwoB1RMODwoPDgsKCw4PCgsOCwqFwek/Dg8KDw4LCgsODwoLDgsKLw4PCg8OCwo
+ PDg8KCw4LCj1DDg8KDw4LCg8ODwoLDgsKoScODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK
+ AdTPDg8KDw4LCgsODwoLDgsKhbHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PC
+ g8OCwoPDg8KCw4LCqEnDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHXDg8KDw4LCgsODw
+ oLDgsKhaHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo9Qw4PCg8OCwoPDg8KCw4LCqM
+ ODwoPDgsKDw4PCgsOCwrpIw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoB1M8ODwoPDgsK
+ Dw4PCgsOCwoBfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgjPDg8KDw4LCg8ODwoLDgsKAX17Dg
+ 8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCg8ODwo
+ LDgsKoJ8ODwoPDgsKDw4PCgsOCwq3Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoP
+ DgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4aHU5w4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PC
+ gsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw
+ 4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgs
+ KIw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpLDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoB0IcODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKA
+ w4PCg8OCwoPDg8KCw4LCtMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKAdGbDg8KDw4LCg
+ sODwoLDgsKLQGY9dGY9dTPDg8KDw4LCg8ODwoLDgsKAX17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwo
+ LDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPDgsKDw4PCgsO
+ CwoIzw4PCg8OCwoPDg8KCw4LCgF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwovDg8KD
+ w4LCg8ODwoLDgsK/Ri9BUC9BRi9BWi9BZC9BWzBBZC9BZTBBZC9BZC9BbzBBZC9BeTBBw4PCg8OCw
+ oLDg8KCw4LCgzBBMUFhMUFrMUE=
+description:: UF7Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOC
+ wozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg
+ 8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCqFDDg8KDw4LCg8ODwoLDgsKpRsODwoPDgsKDw4PCgsOCwo
+ zDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8O
+ DwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKCw4PCgsOCwotEJCDDg8KDw4LCgsODwoLDgsKD
+ w4PCg8OCwoPDg8KCw4LCrMODwoPDgsKCw4PCgsOCwotUJCRTw4PCg8OCwoLDg8KCw4LCi1wkJFbDg
+ 8KDw4LCgsODwoLDgsKJTCRXVVBSU8ODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsKdT8ODwo
+ PDgsKCw4PCgsOCwoN8JDB1w4PCg8OCwoPDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8O
+ DwoLDgsKBTsODwoPDgsKDw4PCgsOCwqktw4PCg8OCwoLDg8KCw4LCg3wkMHTDg8KDw4LCgsODwoLD
+ gsKDfCQww4PCg8OCwoLDg8KCw4LChTPDg8KDw4LCg8ODwoLDgsK2OTXDg8KDw4LCg8ODwoLDgsKAw
+ 4PCg8OCwoPDg8KCw4LCgU7Dg8KDw4LCgsODwoLDgsKEIMODwoPDgsKCw4PCgsOCwqFIw4PCg8OCwo
+ PDg8KCw4LChU7Dg8KDw4LCgsODwoLDgsKJNcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8ODwoLDgsK
+ BTsODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKD
+ w4PCgsOCwr9TXMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw
+ 4LChMODwoPDgsKCw4PCgsOCwpHDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLIEjDg8
+ KDw4LCg8ODwoLDgsKFTlDDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ngw4PCg8OCwoL
+ Dg8KCw4LCi8ODwoPDgsKDw4PCgsOCwpjDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCm3Rx
+ w4PCg8OCwoLDg8KCw4LCizvDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi8ODwoPDgsKDw
+ 4PCgsOCwr9XaMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGdGLDg8KDw4LCgsODwo
+ LDgsKLf2zDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi1D
+ Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8OD
+ woLDgsKow4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwq10SmgoT03Dg8KDw4LCgsODwoLDg
+ sKLw4PCg8OCwoPDg8KCw4LCjcODwoPDgsKDw4PCgsOCwqggTMODwoPDgsKCw4PCgsOCwoXDg8KDw4
+ LCg8ODwoLDgsKAdDrDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLTSBQUcODwoPDgsK
+ Dw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKL
+ RCQoZitEJCDDg8KDw4LCgsODwoLDgsK3w4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwoHDg
+ 8KDw4LCg8ODwoLDgsKhw4PCg8OCwoLDg8KCw4LCi0QkJGYrRCTDg8KDw4LCgsODwoLDgsK3w4PCg8
+ OCwoPDg8KCw4LCkMODwoPDgsKDw4PCgsOCworDg8KDw4LCgsODwoLDgsKLRSBRVmpQw4PCg8OCwoP
+ Dg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKTzl0JHXDg8KDw4LCgsODwoLD
+ gsKhOXQkw4PCg8OCwoLDg8KCw4LChW/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODw
+ oPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKhRMODwoPDgsKDw4PCgsOCwoVOw4PCg8OCwoLDg8
+ KCw4LCi8ODwoPDgsKDw4PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ncw4P
+ Cg8OCwoLDg8KCw4LCiUQkw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsOD
+ woLDgsKEw4PCg8OCwoPDg8KCw4LCtjPDg8KDw4LCg8ODwoLDgsK2w4PCg8OCwoLDg8KCw4LCjUQkw
+ 4PCg8OCwoLDg8KCw4LCiyBEw4PCg8OCwoPDg8KCw4LChU5Qw4PCg8OCwoLDg8KCw4LCi8ODwoPDgs
+ KDw4PCgsOCwr9TYMODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCkMODwoPDgsKC
+ w4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCj8ODwoPDgsKDw4PCgsOCwr9Ta
+ MODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwr3Dg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4L
+ Cj1DDg8KDw4LCg8ODwoLDgsK/U2zDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCqMODwoPD
+ gsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKtw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCw
+ p9oMMODwoPDgsKDw4PCgsOCwolMw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4
+ LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCq0vDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4L
+ CgMODwoPDgsKCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi0QkOcODwoPD
+ gsKCw4PCgsOCwrDDg8KDw4LCg8ODwoLDgsKEdEU5w4PCg8OCwoLDg8KCw4LCtTR0PcODwoPDgsKCw
+ 4PCgsOCwovDg8KDw4LCg8ODwoLDgsKNw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwo5Lw4
+ PCg8OCwoLDg8KCw4LCi0AgUMODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKsw4PCg8OCwoL
+ Dg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHUow4PCg8OCwoLDg8KCw4LC
+ i8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCgsODwoLDgsKJw4PCg8OCwoLDg8KCw4LCtTTDg8KDw4LCg
+ 8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKDw4PCgsOCwrtWw4PCg8OCwoLDg8KCw4LCi8
+ ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCnw==
+
+dn: cn=ITD Staff,ou=Groups,o=Example,c=US
+owner: cn=Manager,o=Example,c=US
+description: All ITD Staff
+cn: ITD Staff
+objectClass: groupOfUniqueNames
+uniqueMember: cn=Manager,dc=example,dc=com
+uniqueMember: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=
+ example,dc=com
+uniqueMember: cn=James A Jones 2,ou=Information Technology Division,ou=People,
+ dc=example,dc=com
+uniqueMember: cn=John Doe,ou=Information Technology Division,ou=People,dc=exam
+ ple,dc=com
+
+dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 1
+cn: James Jones
+cn: Jim Jones
+sn: Jones
+uid: jaj
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: amFq
+homePostalAddress: 3882 Beverly Rd. $ Anytown, MI 48105
+homePhone: +1 313 555 4772
+description: Outstanding
+title: Mad Cow Researcher, UM Alumni Association
+pager: +1 313 555 3923
+mail: jaj@mail.alumni.example.com
+facsimileTelephoneNumber: +1 313 555 4332
+telephoneNumber: +1 313 555 0895
+
+dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Example,
+ c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 2
+cn: James Jones
+cn: Jim Jones
+sn: Doe
+uid: jjones
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 933 Brooks $ Anytown, MI 48104
+homePhone: +1 313 555 8838
+title: Senior Manager, Information Technology Division
+description: Not around very much
+mail: jjones@mailgw.example.com
+postalAddress: Info Tech Division $ 535 W William $ Anytown, MI 48103
+pager: +1 313 555 2833
+facsimileTelephoneNumber: +1 313 555 8688
+telephoneNumber: +1 313 555 7334
+
+dn: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Jane Doe
+cn: Jane Alverson
+sn: Doe
+uid: jdoe
+title: Programmer Analyst, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+drink: diet coke
+description: Enthusiastic
+mail: jdoe@woof.net
+homePhone: +1 313 555 5445
+pager: +1 313 555 1220
+facsimileTelephoneNumber: +1 313 555 2311
+telephoneNumber: +1 313 555 4774
+
+dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Jennifer Smith
+cn: Jen Smith
+sn: Smith
+uid: jen
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+drink: Sam Adams
+homePostalAddress: 1000 Maple #44 $ Anytown, MI 48103
+title: Telemarketer, UM Alumni Association
+mail: jen@mail.alumni.example.com
+homePhone: +1 313 555 2333
+pager: +1 313 555 6442
+facsimileTelephoneNumber: +1 313 555 2756
+telephoneNumber: +1 313 555 8232
+
+dn: cn=John Belushi,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: John Belushi
+sn: Belushi
+userPassword:: amFjaw==
+description: Joliet Jack Blues
+
+dn: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: John Doe
+cn: Jonathon Doe
+sn: Doe
+uid: johnd
+postalAddress: ITD $ 535 W. William $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 912 East Bllvd $ Anytown, MI 48104
+title: System Administrator, Information Technology Division
+description: overworked!
+mail: johnd@mailgw.example.com
+homePhone: +1 313 555 3774
+pager: +1 313 555 6573
+facsimileTelephoneNumber: +1 313 555 4544
+telephoneNumber: +1 313 555 9394
+
+dn: cn=Manager,o=Example,c=US
+objectClass: person
+cn: Manager
+cn: Directory Manager
+cn: Dir Man
+sn: Manager
+description: Manager of the directory
+userPassword:: c2VjcmV0
+
+dn: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Mark Elliot
+cn: Mark A Elliot
+sn: Elliot
+uid: melliot
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 199 Outer Drive $ Ypsilanti, MI 48198
+homePhone: +1 313 555 0388
+drink: Gasoline
+title: Director, UM Alumni Association
+mail: melliot@mail.alumni.example.com
+pager: +1 313 555 7671
+facsimileTelephoneNumber: +1 313 555 7762
+telephoneNumber: +1 313 555 4177
+
+dn: ou=Meta,o=Example,c=US
+objectClass: organizationalUnit
+ou: Meta
+description: added to "ou=Meta,o=Example,c=US"
+
+dn: ou=People,o=Example,c=US
+objectClass: organizationalUnit
+objectClass: extensibleObject
+ou: People
+uidNumber: 0
+gidNumber: 0
+
+dn: ou=Same as above,o=Example,c=US
+objectClass: organizationalUnit
+ou: Same as above
+description: added right after "Who's going to handle this?"
+description: will be preserved
+
+dn: ou=Same as above,ou=Meta,o=Example,c=US
+objectClass: organizationalUnit
+ou: Same as above
+description: added right after "Who's going to handle this?"
+description: will be preserved
+
+dn: cn=Somewhere,ou=Meta,o=Example,c=US
+objectClass: referral
+objectClass: extensibleObject
+cn: Somewhere
+ref: ldap://:9010
+
+dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Ursula Hampster
+sn: Hampster
+uid: uham
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+mail: uham@mail.alumni.example.com
+homePhone: +1 313 555 8421
+pager: +1 313 555 2844
+facsimileTelephoneNumber: +1 313 555 9700
+telephoneNumber: +1 313 555 5331
+
+# searching filter="(seeAlso=cn=all staff,ou=Groups,o=Example,c=US)"
+#      attrs="seeAlso"
+#      base="o=Example,c=US"...
+dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Example,c
+ =US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Example,
+ c=US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+
+# refldap://:9010/cn=Somewhere,ou=Meta,dc=example,dc=com??sub
+
+# searching filter="(uid=example)"
+#      attrs="uid"
+#      base="o=Example,c=US"...
+# refldap://:9010/cn=Somewhere,ou=Meta,dc=example,dc=com??sub
+
+# searching filter="(member=cn=Another Added Group,ou=Groups,o=Example,c=US)"
+#      attrs="member"
+#      base="o=Example,c=US"...
+dn: cn=Another Added Group,ou=Groups,o=Example,c=US
+member: cn=Added Group,ou=Groups,o=Example,c=US
+member: cn=Another Added Group,ou=Groups,o=Example,c=US
+
+# refldap://:9010/cn=Somewhere,ou=Meta,dc=example,dc=com??sub
+
diff --git a/tests/data/metaconcurrency.out b/tests/data/metaconcurrency.out
new file mode 100644 (file)
index 0000000..ca8d796
--- /dev/null
@@ -0,0 +1,430 @@
+dn: cn=All Staff,ou=Groups,o=Example,c=US
+member: cn=Manager,o=Example,c=US
+member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Examp
+ le,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Exam
+ ple,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example
+ ,c=US
+owner: cn=Manager,o=Example,c=US
+cn: All Staff
+description: Everyone in the sample data
+objectClass: groupOfNames
+
+dn: cn=Alumni Assoc Staff,ou=Groups,o=Example,c=US
+member: cn=Manager,o=Example,c=US
+member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+member: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+owner: cn=Manager,o=Example,c=US
+description: All Alumni Assoc Staff
+cn: Alumni Assoc Staff
+objectClass: groupOfNames
+
+dn: ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: organizationalUnit
+ou: Alumni Association
+
+dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Example,c
+ =US
+objectClass: OpenLDAPperson
+cn: Barbara Jensen
+cn: Babs Jensen
+sn:: IEplbnNlbiA=
+uid: bjensen
+title: Mythical Manager, Research Systems
+postalAddress: ITD Prod Dev & Deployment $ 535 W. William St. Room 4212 $ Anyt
+ own, MI 48103-4943
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: YmplbnNlbg==
+mail: bjensen@mailgw.example.com
+homePostalAddress: 123 Wesley $ Anytown, MI 48103
+description: Mythical manager of the rsdd unix project
+drink: water
+homePhone: +1 313 555 2333
+pager: +1 313 555 3233
+facsimileTelephoneNumber: +1 313 555 2274
+telephoneNumber: +1 313 555 9022
+
+dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=Example,c=U
+ S
+objectClass: OpenLDAPperson
+cn: Bjorn Jensen
+cn: Biiff Jensen
+sn: Jensen
+uid: bjorn
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: Ympvcm4=
+homePostalAddress: 19923 Seven Mile Rd. $ South Lyon, MI 49999
+drink: Iced Tea
+description: Hiker, biker
+title: Director, Embedded Systems
+postalAddress: Info Tech Division $ 535 W. William St. $ Anytown, MI 48103
+mail: bjorn@mailgw.example.com
+homePhone: +1 313 555 5444
+pager: +1 313 555 4474
+facsimileTelephoneNumber: +1 313 555 2177
+telephoneNumber: +1 313 555 0355
+
+dn: cn=Dan Aykroyd,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: Dan Aykroyd
+sn: Aykroyd
+userPassword:: ZWx3b29k
+description: Elwood Blues
+
+dn: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Dorothy Stevens
+cn: Dot Stevens
+sn: Stevens
+uid: dots
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+drink: Lemonade
+homePostalAddress: 377 White St. Apt. 3 $ Anytown, MI 48104
+description: Very tall
+facsimileTelephoneNumber: +1 313 555 3223
+telephoneNumber: +1 313 555 3664
+mail: dots@mail.alumni.example.com
+homePhone: +1 313 555 0454
+
+dn: o=Example,c=US
+objectClass: top
+objectClass: organization
+objectClass: domainRelatedObject
+objectClass: dcObject
+dc: example
+l: Anytown, Michigan
+st: Michigan
+o: Example, Inc.
+o: EX
+o: Ex.
+description: The Example, Inc. at Anytown
+postalAddress: Example, Inc. $ 535 W. William St. $ Anytown, MI 48109 $ US
+telephoneNumber: +1 313 555 1817
+associatedDomain: example.com
+
+dn: ou=Groups,o=Example,c=US
+objectClass: organizationalUnit
+ou: Groups
+
+dn: ou=Information Technology Division,ou=People,o=Example,c=US
+objectClass: organizationalUnit
+ou: Information Technology Division
+description:: aMODwoPDgsKCw4PCgsOCwotFVlZQw4PCg8OCwoPDg8KCw4LCv0zDg8KDw4LCgsOD
+ woLDgsKKT8ODwoPDgsKDw4PCgsOCwqs6w4PCg8OCwoLDg8KCw4LCjUQkw4PCg8OCwoLDg8KCw4LCi
+ 01QUcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4
+ LCgsODwoLDgsKLRCQoZitEJMODwoPDgsKCw4PCgsOCwrfDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoP
+ Dg8KCw4LCgcODwoPDgsKDw4PCgsOCwqHDg8KDw4LCgsODwoLDgsKLRCQkZitEJMODwoPDgsKCw4PC
+ gsOCwrfDg8KDw4LCg8ODwoLDgsKQw4PCg8OCwoPDg8KCw4LCisODwoPDgsKCw4PCgsOCwotFUVZqU
+ MODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKAw4PCg8OCwoLDg8KCw4LCik85dCTDg8KDw4
+ LCgsODwoLDgsKFQ8ODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4L
+ Cvzl0JMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPD
+ gsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKLRCTDg8KDw4LCgsODwoLDgsKDw4PCg8OCwoLDg8KCw
+ 4LCuMODwoPDgsKDw4PCgsOCwoR0Q8ODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LChMODwo
+ PDgsKDw4PCgsOCwoFOdTrDg8KDw4LCg8ODwoLDgsKHw4PCg8OCwoPDg8KCw4LChMODwoPDgsKDw4P
+ CgsOCwoFOw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwrtHw4PCg8OCwoLDg8KCw4LChcOD
+ woPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsK4dMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODw
+ oLDgsKtR8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwo
+ PDgsKDw4PCgsOCwr9SfGrDg8KDw4LCgsODwoLDgsKLQGgxw4PCg8OCwoPDg8KCw4LCoWhQw4PCg8O
+ CwoPDg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKT8ODwoPDgsKCw4PCgsOC
+ wotEJDDDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHTDg8KDw4LCgsODwoLDgsKDw4PCg
+ 8OCwoPDg8KCw4LCuHXDg8KDw4LCgsODwoLDgsKLRCRqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4
+ PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpPDg8K
+ Dw4LCg8ODwoLDgsKQXV9eW8ODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoPD
+ g8KCw4LCgsODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODw
+ oPDgsKDw4PCgsOCwozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgs
+ OCwoxWV8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKxw4PCg8OCwoLDg8KCw4LCi3wkw4P
+ Cg8OCwoLDg8KCw4LCjcODwoPDgsKCw4PCgsOCwofDg8KDw4LCg8ODwoLDgsKof8ODwoPDgsKDw4PC
+ gsOCwr/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCg8ODwoPDgsKDw4PCgsOCwrh5w4PCg
+ 8OCwoLDg8KCw4LChzQzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PCgsOCworDg8KDw4LCgsODwo
+ LDgsKIw4PCg8OCwoLDg8KCw4LCuDFBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNdDF
+ Bw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPD
+ gsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw
+ 4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgs
+ KCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKAdcODwoPDgsKDw4PCgsOCwqhtw4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCsMODwoPDgsKC
+ w4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCt
+ sODwoPDgsKDw4PCgsOCwq7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4
+ PCgsOCwoPDg8KDw4LCg8ODwoLDgsKoZsODwoPDgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4w4P
+ Cg8OCwoLDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwpUzw4PCg8OCwoPDg8KCw4LCicODwoPDgsKCw4PC
+ gsOCworDg8KDw4LCgsODwoLDgsKISDJBw4PCg8OCwoPDg8KCw4LCvyTDg8KDw4LCgsODwoLDgsKNN
+ DJBw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwo
+ PDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8O
+ DwoPDgsKDw4PCgsOCwojDg8KDw4LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCnEzDg8KDw4LCgsOD
+ woLDgsKLSEBmw4PCg8OCwoLDg8KCw4LCg3lwdSTDg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw
+ 4LCv8ODwoPDgsKCw4PCgsOCwobDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwp/Dg8KDw4LCgsODwoLDgsKBw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwoj
+ Dg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCwpPDg8KDw4LCgsOD
+ woLDgsKBw4PCg8OCwoPDg8KCw4LCv1rDg8KDw4LCgsODwoLDgsKAw4PCg8OCwoLDg8KCw4LChMODw
+ oPDgsKCw4PCgsOCwodqw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwoBqaMODwoPDgsKCw4
+ PCgsOCwpBQw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDIMODwoPDgsKCw4PCgsOCwopPw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKOacODwoPDgsKCw4PCgsOCwrhf
+ XsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCw
+ oLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKGw4PCg8OCwoLDg8KCw4LCgM
+ ODwoPDgsKCw4PCgsOCwoRJw4PCg8OCwoLDg8KCw4LCgcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsO
+ DwoLDgsKIw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQ9w4PCg8OCwoLDg8KCw4LCgcOD
+ woPDgsKDw4PCgsOCwr9aw4PCg8OCwoLDg8KCw4LCgMODwoPDgsKCw4PCgsOCwoQxw4PCg8OCwoLDg
+ 8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwoM9w4PCg8OCwoPDg8KCw4LCm0
+ 7Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsK
+ Cw4PCgsOCwrhfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODw
+ oPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgs
+ OCwo7Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoLDg8KCw4LCkMODwoPDgsKDw4PCgsOCwojDg8KDw4L
+ CgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsK+
+ S8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKww4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKDw
+ 4PCgsOCwoTDg8KDw4LCgsODwoLDgsKKT1DDg8KDw4LCg8ODwoLDgsKoRsODwoPDgsKCw4PCgsOCwo
+ vDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwrZ0Y8ODwoPDgsK
+ Cw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK/dF/Dg8KDw4LCgsODwoLDgsKhdHpPw4PCg8OCwoLDg8KC
+ w4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PCg8OCwoPDg8KCw4LCqC1Jw4PCg8OCwoLDg8KCw4LChcODw
+ oPDgsKDw4PCgsOCwoB1RMODwoPDgsKCw4PCgsOCwqFwek/Dg8KDw4LCgsODwoLDgsKLw4PCg8OCwo
+ PDg8KCw4LCj1DDg8KDw4LCg8ODwoLDgsKoScODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsK
+ AdTPDg8KDw4LCgsODwoLDgsKhbHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo5Qw4PC
+ g8OCwoPDg8KCw4LCqEnDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHXDg8KDw4LCgsODw
+ oLDgsKhaHpPw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo9Qw4PCg8OCwoPDg8KCw4LCqM
+ ODwoPDgsKDw4PCgsOCwrpIw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoB1M8ODwoPDgsK
+ Dw4PCgsOCwoBfXsODwoPDgsKDw4PCgsOCwoLDg8KDw4LCgsODwoLDgsK4X17Dg8KDw4LCg8ODwoLD
+ gsKCw4PCg8OCwoLDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgjPDg8KDw4LCg8ODwoLDgsKAX17Dg
+ 8KDw4LCg8ODwoLDgsKCw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo7Dg8KDw4LCg8ODwo
+ LDgsKoJ8ODwoPDgsKDw4PCgsOCwq3Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODwoP
+ DgsKCw4PCgsOCwoPDg8KDw4LCg8ODwoLDgsK4aHU5w4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PC
+ gsOCwovDg8KDw4LCg8ODwoLDgsKOw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpDDg8KDw
+ 4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgs
+ KIw4PCg8OCwoPDg8KCw4LCv8ODwoPDgsKCw4PCgsOCwpLDg8KDw4LCg8ODwoLDgsKEw4PCg8OCwoL
+ Dg8KCw4LChcODwoPDgsKDw4PCgsOCwoB0IcODwoPDgsKCw4PCgsOCwovDg8KDw4LCgsODwoLDgsKA
+ w4PCg8OCwoPDg8KCw4LCtMODwoPDgsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKAdGbDg8KDw4LCg
+ sODwoLDgsKLQGY9dGY9dTPDg8KDw4LCg8ODwoLDgsKAX17Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwo
+ LDg8KCw4LCuF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwrhfXsODwoPDgsKDw4PCgsO
+ CwoIzw4PCg8OCwoPDg8KCw4LCgF9ew4PCg8OCwoPDg8KCw4LCgsODwoPDgsKCw4PCgsOCwovDg8KD
+ w4LCg8ODwoLDgsK/Ri9BUC9BRi9BWi9BZC9BWzBBZC9BZTBBZC9BZC9BbzBBZC9BeTBBw4PCg8OCw
+ oLDg8KCw4LCgzBBMUFhMUFrMUE=
+description:: UF7Dg8KDw4LCg8ODwoLDgsKCw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOC
+ wozDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg
+ 8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCqFDDg8KDw4LCg8ODwoLDgsKpRsODwoPDgsKDw4PCgsOCwo
+ zDg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKDw4PCgsOCwozDg8KDw4LCg8O
+ DwoLDgsKMw4PCg8OCwoPDg8KCw4LCjMODwoPDgsKCw4PCgsOCwotEJCDDg8KDw4LCgsODwoLDgsKD
+ w4PCg8OCwoPDg8KCw4LCrMODwoPDgsKCw4PCgsOCwotUJCRTw4PCg8OCwoLDg8KCw4LCi1wkJFbDg
+ 8KDw4LCgsODwoLDgsKJTCRXVVBSU8ODwoPDgsKDw4PCgsOCwqjDg8KDw4LCg8ODwoLDgsKdT8ODwo
+ PDgsKCw4PCgsOCwoN8JDB1w4PCg8OCwoPDg8KCw4LCh8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8O
+ DwoLDgsKBTsODwoPDgsKDw4PCgsOCwqktw4PCg8OCwoLDg8KCw4LCg3wkMHTDg8KDw4LCgsODwoLD
+ gsKDfCQww4PCg8OCwoLDg8KCw4LChTPDg8KDw4LCg8ODwoLDgsK2OTXDg8KDw4LCg8ODwoLDgsKAw
+ 4PCg8OCwoPDg8KCw4LCgU7Dg8KDw4LCgsODwoLDgsKEIMODwoPDgsKCw4PCgsOCwqFIw4PCg8OCwo
+ PDg8KCw4LChU7Dg8KDw4LCgsODwoLDgsKJNcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCg8ODwoLDgsK
+ BTsODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsKIw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKD
+ w4PCgsOCwr9TXMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw
+ 4LChMODwoPDgsKCw4PCgsOCwpHDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLIEjDg8
+ KDw4LCg8ODwoLDgsKFTlDDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ngw4PCg8OCwoL
+ Dg8KCw4LCi8ODwoPDgsKDw4PCgsOCwpjDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCm3Rx
+ w4PCg8OCwoLDg8KCw4LCizvDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi8ODwoPDgsKDw
+ 4PCgsOCwr9XaMODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGdGLDg8KDw4LCgsODwo
+ LDgsKLf2zDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCi1D
+ Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8OD
+ woLDgsKow4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwq10SmgoT03Dg8KDw4LCgsODwoLDg
+ sKLw4PCg8OCwoPDg8KCw4LCjcODwoPDgsKDw4PCgsOCwqggTMODwoPDgsKCw4PCgsOCwoXDg8KDw4
+ LCg8ODwoLDgsKAdDrDg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLTSBQUcODwoPDgsK
+ Dw4PCgsOCwr/Dg8KDw4LCg8ODwoLDgsKMw4PCg8OCwoLDg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKL
+ RCQoZitEJCDDg8KDw4LCgsODwoLDgsK3w4PCg8OCwoPDg8KCw4LCiMODwoPDgsKDw4PCgsOCwoHDg
+ 8KDw4LCg8ODwoLDgsKhw4PCg8OCwoLDg8KCw4LCi0QkJGYrRCTDg8KDw4LCgsODwoLDgsK3w4PCg8
+ OCwoPDg8KCw4LCkMODwoPDgsKDw4PCgsOCworDg8KDw4LCgsODwoLDgsKLRSBRVmpQw4PCg8OCwoP
+ Dg8KCw4LCv8ODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsODwoLDgsKKTzl0JHXDg8KDw4LCgsODwoLD
+ gsKhOXQkw4PCg8OCwoLDg8KCw4LChW/Dg8KDw4LCg8ODwoLDgsK/w4PCg8OCwoPDg8KCw4LCv8ODw
+ oPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKhRMODwoPDgsKDw4PCgsOCwoVOw4PCg8OCwoLDg8
+ KCw4LCi8ODwoPDgsKDw4PCgsOCwojDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCv1Ncw4P
+ Cg8OCwoLDg8KCw4LCiUQkw4PCg8OCwoLDg8KCw4LChcODwoPDgsKDw4PCgsOCwoDDg8KDw4LCgsOD
+ woLDgsKEw4PCg8OCwoPDg8KCw4LCtjPDg8KDw4LCg8ODwoLDgsK2w4PCg8OCwoLDg8KCw4LCjUQkw
+ 4PCg8OCwoLDg8KCw4LCiyBEw4PCg8OCwoPDg8KCw4LChU5Qw4PCg8OCwoLDg8KCw4LCi8ODwoPDgs
+ KDw4PCgsOCwr9TYMODwoPDgsKCw4PCgsOCwovDg8KDw4LCg8ODwoLDgsK4w4PCg8OCwoLDg8KCw4L
+ ChcODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKEw4PCg8OCwoPDg8KCw4LCkMODwoPDgsKC
+ w4PCgsOCwovDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCj8ODwoPDgsKDw4PCgsOCwr9Ta
+ MODwoPDgsKCw4PCgsOCwolEJDvDg8KDw4LCg8ODwoLDgsKGw4PCg8OCwoLDg8KCw4LChMODwoPDgs
+ KCw4PCgsOCwr3Dg8KDw4LCgsODwoLDgsKNRCTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4L
+ Cj1DDg8KDw4LCg8ODwoLDgsK/U2zDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoPDg8KCw4LCqMODwoPD
+ gsKCw4PCgsOCwoXDg8KDw4LCg8ODwoLDgsKtw4PCg8OCwoLDg8KCw4LChMODwoPDgsKCw4PCgsOCw
+ p9oMMODwoPDgsKDw4PCgsOCwolMw4PCg8OCwoLDg8KCw4LCi8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4
+ LCg8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCq0vDg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4L
+ CgMODwoPDgsKCw4PCgsOCwoTDg8KDw4LCgsODwoLDgsKLw4PCg8OCwoLDg8KCw4LCi0QkOcODwoPD
+ gsKCw4PCgsOCwrDDg8KDw4LCg8ODwoLDgsKEdEU5w4PCg8OCwoLDg8KCw4LCtTR0PcODwoPDgsKCw
+ 4PCgsOCwovDg8KDw4LCg8ODwoLDgsKNw4PCg8OCwoPDg8KCw4LCqMODwoPDgsKDw4PCgsOCwo5Lw4
+ PCg8OCwoLDg8KCw4LCi0AgUMODwoPDgsKDw4PCgsOCwr/Dg8KDw4LCgsODwoLDgsKsw4PCg8OCwoL
+ Dg8KCw4LCik/Dg8KDw4LCgsODwoLDgsKFw4PCg8OCwoPDg8KCw4LCgHUow4PCg8OCwoLDg8KCw4LC
+ i8ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCgsODwoLDgsKJw4PCg8OCwoLDg8KCw4LCtTTDg8KDw4LCg
+ 8ODwoLDgsKow4PCg8OCwoPDg8KCw4LCl8ODwoPDgsKDw4PCgsOCwrtWw4PCg8OCwoLDg8KCw4LCi8
+ ODwoPDgsKDw4PCgsOCwo3Dg8KDw4LCg8ODwoLDgsKow4PCg8OCwoLDg8KCw4LCnw==
+
+dn: cn=ITD Staff,ou=Groups,o=Example,c=US
+owner: cn=Manager,o=Example,c=US
+description: All ITD Staff
+cn: ITD Staff
+objectClass: groupOfUniqueNames
+uniqueMember: cn=Manager,dc=example,dc=com
+uniqueMember: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=
+ example,dc=com
+uniqueMember: cn=James A Jones 2,ou=Information Technology Division,ou=People,
+ dc=example,dc=com
+uniqueMember: cn=John Doe,ou=Information Technology Division,ou=People,dc=exam
+ ple,dc=com
+
+dn: cn=James A Jones 1,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 1
+cn: James Jones
+cn: Jim Jones
+sn: Jones
+uid: jaj
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+userPassword:: amFq
+homePostalAddress: 3882 Beverly Rd. $ Anytown, MI 48105
+homePhone: +1 313 555 4772
+description: Outstanding
+title: Mad Cow Researcher, UM Alumni Association
+pager: +1 313 555 3923
+mail: jaj@mail.alumni.example.com
+facsimileTelephoneNumber: +1 313 555 4332
+telephoneNumber: +1 313 555 0895
+
+dn: cn=James A Jones 2,ou=Information Technology Division,ou=People,o=Example,
+ c=US
+objectClass: OpenLDAPperson
+cn: James A Jones 2
+cn: James Jones
+cn: Jim Jones
+sn: Doe
+uid: jjones
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 933 Brooks $ Anytown, MI 48104
+homePhone: +1 313 555 8838
+title: Senior Manager, Information Technology Division
+description: Not around very much
+mail: jjones@mailgw.example.com
+postalAddress: Info Tech Division $ 535 W William $ Anytown, MI 48103
+pager: +1 313 555 2833
+facsimileTelephoneNumber: +1 313 555 8688
+telephoneNumber: +1 313 555 7334
+
+dn: cn=Jane Doe,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Jane Doe
+cn: Jane Alverson
+sn: Doe
+uid: jdoe
+title: Programmer Analyst, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+drink: diet coke
+description: Enthusiastic
+mail: jdoe@woof.net
+homePhone: +1 313 555 5445
+pager: +1 313 555 1220
+facsimileTelephoneNumber: +1 313 555 2311
+telephoneNumber: +1 313 555 4774
+
+dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Jennifer Smith
+cn: Jen Smith
+sn: Smith
+uid: jen
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+drink: Sam Adams
+homePostalAddress: 1000 Maple #44 $ Anytown, MI 48103
+title: Telemarketer, UM Alumni Association
+mail: jen@mail.alumni.example.com
+homePhone: +1 313 555 2333
+pager: +1 313 555 6442
+facsimileTelephoneNumber: +1 313 555 2756
+telephoneNumber: +1 313 555 8232
+
+dn: cn=John Belushi,ou=Meta,o=Example,c=US
+objectClass: inetOrgPerson
+cn: John Belushi
+sn: Belushi
+userPassword:: amFjaw==
+description: Joliet Jack Blues
+
+dn: cn=John Doe,ou=Information Technology Division,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: John Doe
+cn: Jonathon Doe
+sn: Doe
+uid: johnd
+postalAddress: ITD $ 535 W. William $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 912 East Bllvd $ Anytown, MI 48104
+title: System Administrator, Information Technology Division
+description: overworked!
+mail: johnd@mailgw.example.com
+homePhone: +1 313 555 3774
+pager: +1 313 555 6573
+facsimileTelephoneNumber: +1 313 555 4544
+telephoneNumber: +1 313 555 9394
+
+dn: cn=Manager,o=Example,c=US
+objectClass: person
+cn: Manager
+cn: Directory Manager
+cn: Dir Man
+sn: Manager
+description: Manager of the directory
+userPassword:: c2VjcmV0
+
+dn: cn=Mark Elliot,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Mark Elliot
+cn: Mark A Elliot
+sn: Elliot
+uid: melliot
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 199 Outer Drive $ Ypsilanti, MI 48198
+homePhone: +1 313 555 0388
+drink: Gasoline
+title: Director, UM Alumni Association
+mail: melliot@mail.alumni.example.com
+pager: +1 313 555 7671
+facsimileTelephoneNumber: +1 313 555 7762
+telephoneNumber: +1 313 555 4177
+
+dn: ou=Meta,o=Example,c=US
+objectClass: organizationalUnit
+ou: Meta
+
+dn: ou=People,o=Example,c=US
+objectClass: organizationalUnit
+objectClass: extensibleObject
+ou: People
+uidNumber: 0
+gidNumber: 0
+
+dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,o=Example,c=US
+objectClass: OpenLDAPperson
+cn: Ursula Hampster
+sn: Hampster
+uid: uham
+title: Secretary, UM Alumni Association
+postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109
+seeAlso: cn=All Staff,ou=Groups,o=Example,c=US
+homePostalAddress: 123 Anystreet $ Anytown, MI 48104
+mail: uham@mail.alumni.example.com
+homePhone: +1 313 555 8421
+pager: +1 313 555 2844
+facsimileTelephoneNumber: +1 313 555 9700
+telephoneNumber: +1 313 555 5331
+
+# refldap://:9010/cn=Somewhere,ou=Meta,dc=example,dc=com??sub
+
index c07ac8dc8ed9e141cb63583b7092d5a91329856a..f20ca77ff591b25a49edc1b74203b6d62b1e06b5 100644 (file)
@@ -21,13 +21,13 @@ objectClass: device
 objectClass: pwdPolicy
 cn: Standard Policy
 pwdAttribute: 2.5.4.35
-pwdLockoutDuration: 30
+pwdLockoutDuration: 15
 pwdInHistory: 6
 pwdCheckQuality: 1
-pwdExpireWarning: 300
-pwdMaxAge: 600
+pwdExpireWarning: 10
+pwdMaxAge: 30
 pwdMinLength: 5
-pwdGraceLoginLimit: 3
+pwdGraceAuthnLimit: 3
 pwdAllowUserChange: TRUE
 pwdMustChange: TRUE
 pwdMaxFailure: 3
index f01b747f8f2422609cd2c45e1fea80034f3112bb..c56586bff17df4c9d78b411005f5ab9576e5e723 100644 (file)
@@ -95,6 +95,12 @@ access               to dn.exact="cn=Alumni Assoc Staff,ou=Groups,dc=example,dc=com"
 access         to filter="(name=X*Y*Z)"
                by * continue
 
+access         to dn.subtree="ou=Add/Delete,dc=example,dc=com"
+               by dn.exact="cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com" add
+               by dn.exact="cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com" delete
+               by dn.exact="cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com" write
+               by * read
+
 # fall into global ACLs
 
 #monitor#database monitor
index 3ae2f34df12286185c72db28083a8308c1290ce2..55e5fa17083e4b274f15d0c2dc010005947ff572 100644 (file)
@@ -55,6 +55,10 @@ access               to dn.subtree="dc=example,dc=com"
                by dn.exact="cn=Manager,c=US" write
                by * read
 
+#monitor#database      monitor
+#monitor#access to dn.subtree="cn=Monitor"
+#monitor#      by * read
+
 database       @BACKEND@
 suffix         ""
 directory      ./testrun/db.2.a
@@ -69,5 +73,3 @@ access                to attrs=userPassword
 
 access         to dn.subtree=""
                by * read
-
-#monitor#database monitor
diff --git a/tests/data/slapd-glue-syncrepl1.conf b/tests/data/slapd-glue-syncrepl1.conf
new file mode 100644 (file)
index 0000000..e088dcb
--- /dev/null
@@ -0,0 +1,97 @@
+# stand-alone slapd config -- for backglue testing (with indexing)
+# $OpenLDAP: pkg/ldap/tests/data/slapd-glue.conf,v 1.5.2.4 2003/12/15 22:05:29
+  kurt Exp $
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2005 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+
+include                ./schema/core.schema
+include                ./schema/cosine.schema
+include                ./schema/inetorgperson.schema
+include                ./schema/openldap.schema
+include                ./schema/nis.schema
+pidfile                ./testrun/slapd.1.pid
+argsfile       ./testrun/slapd.1.args
+
+#mod#modulepath        ../servers/slapd/back-@BACKEND@/
+#mod#moduleload        back_@BACKEND@.la
+#monitormod#modulepath ../servers/slapd/back-monitor/
+#monitormod#moduleload back_monitor.la
+#gluemod#moduleload ../servers/slapd/overlays/glue.la
+
+#######################################################################
+# database definitions
+#######################################################################
+
+database       @BACKEND@
+suffix         "ou=Information Technology Division,ou=People,dc=example,dc=com"
+directory      ./testrun/db.1.a
+rootdn         "cn=Manager 1,dc=example,dc=com"
+#ldbm#index            objectclass     eq
+#ldbm#index            uid     pres,eq,sub
+#ldbm#index            cn,sn   pres,eq,sub,subany
+#ldbm#dbnosync
+#ldbm#dbnolocking
+#bdb#index             objectclass     eq
+#bdb#index             uid     pres,eq,sub
+#bdb#index             cn,sn   pres,eq,sub,subany
+#bdb#index             entryUUID,entryCSN      pres
+overlay                syncprov
+
+database       @BACKEND@
+suffix         "ou=Groups,dc=example,dc=com"
+directory      ./testrun/db.1.b
+rootdn         "cn=Manager 1,dc=example,dc=com"
+#ldbm#index            objectclass     eq
+#ldbm#index            uid     pres,eq,sub
+#ldbm#index            cn,sn   pres,eq,sub,subany
+#ldbm#dbnosync
+#ldbm#dbnolocking
+#bdb#index             objectclass     eq
+#bdb#index             uid     pres,eq,sub
+#bdb#index             cn,sn   pres,eq,sub,subany
+#bdb#index             entryUUID,entryCSN      pres
+syncrepl       rid=1
+               provider=@URI2@
+               binddn="cn=Manager 2,dc=example,dc=com"
+               bindmethod=simple
+               credentials=secret
+               searchbase="ou=Groups,dc=example,dc=com"
+               filter="(objectClass=*)"
+               attrs="*,+"
+               schemachecking=off
+               scope=sub
+               type=refreshAndPersist
+               retry="10 3 300 5"
+updateref      @URI2@
+#overlay               syncprov
+
+
+database       @BACKEND@
+suffix         "dc=example,dc=com"
+directory      ./testrun/db.1.c
+rootdn         "cn=Manager 1,dc=example,dc=com"
+rootpw         secret
+#ldbm#index            objectclass     eq
+#ldbm#index            uid     pres,eq,sub
+#ldbm#index            cn,sn   pres,eq,sub,subany
+#ldbm#dbnosync
+#ldbm#dbnolocking
+#bdb#index             objectclass     eq
+#bdb#index             uid     pres,eq,sub
+#bdb#index             cn,sn   pres,eq,sub,subany
+#overlay               syncprov
+overlay                glue
+glue-sub       "ou=Information Technology Division,ou=People,dc=example,dc=com"
+glue-sub       "ou=Groups,dc=example,dc=com"
+
+#monitor#database      monitor
diff --git a/tests/data/slapd-glue-syncrepl2.conf b/tests/data/slapd-glue-syncrepl2.conf
new file mode 100644 (file)
index 0000000..c3d45bd
--- /dev/null
@@ -0,0 +1,97 @@
+# stand-alone slapd config -- for backglue testing (with indexing)
+# $OpenLDAP: pkg/ldap/tests/data/slapd-glue.conf,v 1.5.2.4 2003/12/15 22:05:29
+  kurt Exp $
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2005 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+
+include                ./schema/core.schema
+include                ./schema/cosine.schema
+include                ./schema/inetorgperson.schema
+include                ./schema/openldap.schema
+include                ./schema/nis.schema
+pidfile                ./testrun/slapd.2.pid
+argsfile       ./testrun/slapd.2.args
+
+#mod#modulepath        ../servers/slapd/back-@BACKEND@/
+#mod#moduleload        back_@BACKEND@.la
+#monitormod#modulepath ../servers/slapd/back-monitor/
+#monitormod#moduleload back_monitor.la
+#gluemod#moduleload ../servers/slapd/overlays/glue.la
+
+#######################################################################
+# database definitions
+#######################################################################
+
+database       @BACKEND@
+suffix         "ou=Information Technology Division,ou=People,dc=example,dc=com"
+directory      ./testrun/db.2.a
+rootdn         "cn=Manager 2,dc=example,dc=com"
+#ldbm#index            objectclass     eq
+#ldbm#index            uid     pres,eq,sub
+#ldbm#index            cn,sn   pres,eq,sub,subany
+#ldbm#dbnosync
+#ldbm#dbnolocking
+#bdb#index             objectclass     eq
+#bdb#index             uid     pres,eq,sub
+#bdb#index             cn,sn   pres,eq,sub,subany
+#bdb#index             entryUUID,entryCSN      pres
+syncrepl       rid=2
+               provider=@URI1@
+               binddn="cn=Manager 1,dc=example,dc=com"
+               bindmethod=simple
+               credentials=secret
+               searchbase="ou=Information Technology Division,ou=People,dc=example,dc=com"
+               filter="(objectClass=*)"
+               attrs="*,+"
+               schemachecking=off
+               scope=sub
+               type=refreshAndPersist
+               retry="10 3 300 5"
+updateref      @URI1@
+#overlay               syncprov
+
+database       @BACKEND@
+suffix         "ou=Groups,dc=example,dc=com"
+directory      ./testrun/db.2.b
+rootdn         "cn=Manager 2,dc=example,dc=com"
+#ldbm#index            objectclass     eq
+#ldbm#index            uid     pres,eq,sub
+#ldbm#index            cn,sn   pres,eq,sub,subany
+#ldbm#dbnosync
+#ldbm#dbnolocking
+#bdb#index             objectclass     eq
+#bdb#index             uid     pres,eq,sub
+#bdb#index             cn,sn   pres,eq,sub,subany
+#bdb#index             entryUUID,entryCSN      pres
+overlay                syncprov
+
+
+database       @BACKEND@
+suffix         "dc=example,dc=com"
+directory      ./testrun/db.2.c
+rootdn         "cn=Manager 2,dc=example,dc=com"
+rootpw         secret
+#ldbm#index            objectclass     eq
+#ldbm#index            uid     pres,eq,sub
+#ldbm#index            cn,sn   pres,eq,sub,subany
+#ldbm#dbnosync
+#ldbm#dbnolocking
+#bdb#index             objectclass     eq
+#bdb#index             uid     pres,eq,sub
+#bdb#index             cn,sn   pres,eq,sub,subany
+#overlay               syncprov
+overlay                glue
+glue-sub       "ou=Information Technology Division,ou=People,dc=example,dc=com"
+glue-sub       "ou=Groups,dc=example,dc=com"
+
+#monitor#database      monitor
diff --git a/tests/data/slapd-meta.conf b/tests/data/slapd-meta.conf
new file mode 100644 (file)
index 0000000..2ba1eed
--- /dev/null
@@ -0,0 +1,62 @@
+# master slapd config -- for testing
+# $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2005 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+
+include ./schema/core.schema
+include ./schema/cosine.schema
+include ./schema/inetorgperson.schema
+include ./schema/openldap.schema
+include ./schema/nis.schema
+include ./schema/ppolicy.schema
+pidfile     ./test-db/slapd.m.pid
+argsfile    ./test-db/slapd.m.args
+
+#mod#modulepath        ../servers/slapd/back-@BACKEND@/
+#mod#moduleload        back_@BACKEND@.la
+#relaymod#modulepath ../servers/slapd/back-relay/
+#relaymod#moduleload back_relay.la
+#ldapmod#modulepath ../servers/slapd/back-ldap/
+#ldapmod#moduleload back_ldap.la
+#metamod#modulepath ../servers/slapd/back-meta/
+#metamod#moduleload back_meta.la
+#monitormod#modulepath ../servers/slapd/back-monitor/
+#monitormod#moduleload back_monitor.la
+#rwmmod#modulepath ../servers/slapd/overlays/
+#rwmmod#moduleload rwm.la
+
+#######################################################################
+# database definitions
+#######################################################################
+
+database       meta
+suffix         "o=Example,c=US"
+rootdn         "cn=Manager,o=Example,c=US"
+rootpw         secret
+dont-chase-referrals
+#nretries      forever
+nretries       1000
+
+# local
+uri            "@URI2@ou=Meta,o=Example,c=US"
+suffixmassage  "ou=Meta,o=Example,c=US" "ou=Meta,dc=example,dc=com"
+pseudorootdn   "cn=manager,ou=meta,dc=example,dc=com"
+pseudorootpw   secret
+
+# remote
+uri            "@URI1@o=Example,c=US"
+suffixmassage  "o=Example,c=US" "dc=example,dc=com"
+pseudorootdn   "cn=manager,dc=example,dc=com"
+pseudorootpw   secret
+
+#monitor#database      monitor
diff --git a/tests/data/slapd-meta2.conf b/tests/data/slapd-meta2.conf
new file mode 100644 (file)
index 0000000..bebcea2
--- /dev/null
@@ -0,0 +1,49 @@
+# master slapd config -- for testing
+# $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2005 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+
+include ./schema/core.schema
+include ./schema/cosine.schema
+include ./schema/inetorgperson.schema
+include ./schema/openldap.schema
+include ./schema/nis.schema
+include ./schema/ppolicy.schema
+pidfile     ./test-db/slapd.2.pid
+argsfile    ./test-db/slapd.2.args
+
+#mod#modulepath        ../servers/slapd/back-@BACKEND@/
+#mod#moduleload        back_@BACKEND@.la
+#relaymod#modulepath ../servers/slapd/back-relay/
+#relaymod#moduleload back_relay.la
+#ldapmod#modulepath ../servers/slapd/back-ldap/
+#ldapmod#moduleload back_ldap.la
+#metamod#modulepath ../servers/slapd/back-meta/
+#metamod#moduleload back_meta.la
+#monitormod#modulepath ../servers/slapd/back-monitor/
+#monitormod#moduleload back_monitor.la
+#rwmmod#modulepath ../servers/slapd/overlays/
+#rwmmod#moduleload rwm.la
+
+#######################################################################
+# database definitions
+#######################################################################
+
+database       @BACKEND@
+suffix         "ou=Meta,dc=example,dc=com"
+directory      ./testrun/db.2.a
+rootdn         "cn=Manager,ou=Meta,dc=example,dc=com"
+rootpw         secret
+index          objectClass eq
+
+#monitor#database      monitor
index 8185df803e4451eee29e59dd937e9239f223f51c..3f4ed66066d75156a27cc8c1b6621100f7176e8b 100644 (file)
@@ -35,6 +35,8 @@ argsfile    ./testrun/slapd.2.args
 # database definitions
 #######################################################################
 
+#monitor#database      monitor
+
 database       @BACKEND@
 suffix         "o=translucent"
 directory      ./testrun/db.2.a
index b51b3c5b52500fbe03cd4b330fa7b000c7c6db6c..c3ebd41825526f9ee53e399a9b2da647ff12ae9f 100644 (file)
@@ -31,6 +31,8 @@ argsfile    ./testrun/slapd.1.args
 # database definitions
 #######################################################################
 
+#monitor#database      monitor
+
 database       @BACKEND@
 suffix         "o=translucent"
 directory      ./testrun/db.1.a
diff --git a/tests/data/test-meta.ldif b/tests/data/test-meta.ldif
new file mode 100644 (file)
index 0000000..39456f2
--- /dev/null
@@ -0,0 +1,24 @@
+dn: ou=Meta,dc=example,dc=com
+objectClass: organizationalUnit
+ou: Meta
+
+dn: cn=John Belushi,ou=Meta,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: John Belushi
+sn: Belushi
+userPassword: jack
+description: Joliet Jack Blues
+
+dn: cn=Dan Aykroyd,ou=Meta,dc=example,dc=com
+objectClass: inetOrgPerson
+cn: Dan Aykroyd
+sn: Aykroyd
+userPassword: elwood
+description: Elwood Blues
+
+dn: cn=Somewhere,ou=Meta,dc=example,dc=com
+objectClass: referral
+objectClass: extensibleObject
+cn: Somewhere
+ref: ldap://:9010
+
index 4b2377db56692a39d4b1e75cc81ed014b1cecb15..c96cdccd3528ba2db1f464dff1fba86f36ea58ea 100644 (file)
 #include <ldap.h>
 
 #define LOOPS  100
+#define RETRIES        0
 
 static char *
 get_add_entry( char *filename, LDAPMod ***mods );
 
 static void
 do_addel( char *uri, char *host, int port, char *manager, char *passwd,
-       char *dn, LDAPMod **attrs, int maxloop );
+       char *dn, LDAPMod **attrs, int maxloop, int maxretries );
 
 static void
 usage( char *name )
@@ -54,48 +55,54 @@ int
 main( int argc, char **argv )
 {
        int             i;
-       char        *host = "localhost";
+       char            *host = "localhost";
        char            *uri = NULL;
-       int                     port = -1;
+       int             port = -1;
        char            *manager = NULL;
        char            *passwd = NULL;
        char            *filename = NULL;
        char            *entry = NULL;
-       int                     loops = LOOPS;
-       LDAPMod     **attrs = NULL;
+       int             loops = LOOPS;
+       int             retries = RETRIES;
+       LDAPMod         **attrs = NULL;
 
-       while ( (i = getopt( argc, argv, "H:h:p:D:w:f:l:" )) != EOF ) {
+       while ( (i = getopt( argc, argv, "H:h:p:D:w:f:l:r:" )) != EOF ) {
                switch( i ) {
-                       case 'H':               /* the server's URI */
-                               uri = strdup( optarg );
+               case 'H':               /* the server's URI */
+                       uri = strdup( optarg );
                        break;
-                       case 'h':               /* the servers host */
-                               host = strdup( optarg );
+
+               case 'h':               /* the servers host */
+                       host = strdup( optarg );
                        break;
 
-                       case 'p':               /* the servers port */
-                               port = atoi( optarg );
-                               break;
+               case 'p':               /* the servers port */
+                       port = atoi( optarg );
+                       break;
 
-                       case 'D':               /* the servers manager */
-                               manager = strdup( optarg );
+               case 'D':               /* the servers manager */
+                       manager = strdup( optarg );
                        break;
 
-                       case 'w':               /* the server managers password */
-                               passwd = strdup( optarg );
+               case 'w':               /* the server managers password */
+                       passwd = strdup( optarg );
                        break;
 
-                       case 'f':               /* file with entry search request */
-                               filename = strdup( optarg );
-                               break;
+               case 'f':               /* file with entry search request */
+                       filename = strdup( optarg );
+                       break;
 
-                       case 'l':               /* the number of loops */
-                               loops = atoi( optarg );
-                               break;
+               case 'l':               /* the number of loops */
+                       loops = atoi( optarg );
+                       break;
 
-                       default:
-                               usage( argv[0] );
-                               break;
+               case 'r':
+                       retries = atoi( optarg );
+                       break;
+
+               default:
+                       usage( argv[0] );
+                       break;
                }
        }
 
@@ -120,7 +127,8 @@ main( int argc, char **argv )
 
        }
 
-       do_addel( uri, host, port, manager, passwd, entry, attrs, loops );
+       do_addel( uri, host, port, manager, passwd, entry, attrs,
+                       loops, retries );
 
        exit( EXIT_SUCCESS );
 }
@@ -249,14 +257,16 @@ do_addel(
        char *passwd,
        char *entry,
        LDAPMod **attrs,
-       int maxloop
+       int maxloop,
+       int maxretries
 )
 {
        LDAP    *ld = NULL;
-       int     i;
+       int     i = 0, do_retry = maxretries;
        pid_t   pid = getpid();
        int     rc = LDAP_SUCCESS;
 
+retry:;
        if ( uri ) {
                ldap_initialize( &ld, uri );
        } else {
@@ -273,22 +283,31 @@ do_addel(
                        &version ); 
        }
 
-       if ( ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE )
-                               != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_bind" );
-                exit( EXIT_FAILURE );
+       if ( do_retry == maxretries ) {
+               fprintf( stderr, "PID=%ld - Add/Delete(%d): entry=\"%s\".\n",
+                       (long) pid, maxloop, entry );
        }
 
+       rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
+       if ( rc != LDAP_SUCCESS ) {
+               ldap_perror( ld, "ldap_bind" );
+               if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                       do_retry--;
+                       goto retry;
+               }
+               exit( EXIT_FAILURE );
+       }
 
-       fprintf( stderr, "PID=%ld - Add/Delete(%d): entry=\"%s\".\n",
-                                       (long) pid, maxloop, entry );
-
-       for ( i = 0; i < maxloop; i++ ) {
+       for ( ; i < maxloop; i++ ) {
 
                /* add the entry */
                rc = ldap_add_s( ld, entry, attrs );
                if ( rc != LDAP_SUCCESS ) {
                        ldap_perror( ld, "ldap_add" );
+                       if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                               do_retry--;
+                               goto retry;
+                       }
                        break;
 
                }
@@ -303,10 +322,12 @@ do_addel(
                rc = ldap_delete_s( ld, entry );
                if ( rc != LDAP_SUCCESS ) {
                        ldap_perror( ld, "ldap_delete" );
+                       if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                               do_retry--;
+                               goto retry;
+                       }
                        break;
-
                }
-
        }
 
        fprintf( stderr, " PID=%ld - Add/Delete done (%d).\n", (long) pid, rc );
index 847785947ab07194e16ebe1344a11a9244657b50..301f01f1cc62b94926fea1eb474f8029cbd81d29 100644 (file)
 #include <ldap.h>
 
 #define LOOPS  100
+#define RETRIES 0
 
 static void
-do_modify( char *uri, char *host, int port, char *manager, char *passwd, char *entry, 
-               char *attr, char *value, int maxloop );
+do_modify( char *uri, char *host, int port, char *manager, char *passwd,
+               char *entry, char *attr, char *value, int maxloop,
+               int maxretries );
 
 
 static void
@@ -49,46 +51,56 @@ main( int argc, char **argv )
 {
        int             i;
        char            *uri = NULL;
-       char        *host = "localhost";
-       int                     port = -1;
+       char            *host = "localhost";
+       int             port = -1;
        char            *manager = NULL;
        char            *passwd = NULL;
        char            *entry = NULL;
        char            *ava = NULL;
        char            *value = NULL;
-       int                     loops = LOOPS;
+       int             loops = LOOPS;
+       int             retries = RETRIES;
 
-       while ( (i = getopt( argc, argv, "H:h:p:D:w:e:a:l:" )) != EOF ) {
+       while ( (i = getopt( argc, argv, "H:h:p:D:w:e:a:l:r:" )) != EOF ) {
                switch( i ) {
-                       case 'H':               /* the server uri */
-                               uri = strdup( optarg );
+               case 'H':               /* the server uri */
+                       uri = strdup( optarg );
                        break;
-                       case 'h':               /* the servers host */
-                               host = strdup( optarg );
+
+               case 'h':               /* the servers host */
+                       host = strdup( optarg );
                        break;
 
-                       case 'p':               /* the servers port */
-                               port = atoi( optarg );
+               case 'p':               /* the servers port */
+                       port = atoi( optarg );
                        break;
-                       case 'D':               /* the servers manager */
-                               manager = strdup( optarg );
+
+               case 'D':               /* the servers manager */
+                       manager = strdup( optarg );
                        break;
 
-                       case 'w':               /* the server managers password */
-                               passwd = strdup( optarg );
+               case 'w':               /* the server managers password */
+                       passwd = strdup( optarg );
                        break;
-                       case 'e':               /* entry to modify */
-                               entry = strdup( optarg );
+
+               case 'e':               /* entry to modify */
+                       entry = strdup( optarg );
                        break;
-                       case 'a':
-                               ava = strdup( optarg );
+
+               case 'a':
+                       ava = strdup( optarg );
                        break;
-                       case 'l':               /* the number of loops */
-                               loops = atoi( optarg );
+
+               case 'l':               /* the number of loops */
+                       loops = atoi( optarg );
+                       break;
+
+               case 'r':
+                       retries = atoi( optarg );
                        break;
 
-                       default:
-                               usage( argv[0] );
+               default:
+                       usage( argv[0] );
                        break;
                }
        }
@@ -118,17 +130,19 @@ main( int argc, char **argv )
        while ( *value && isspace( (unsigned char) *value ))
                value++;
 
-       do_modify( uri, host, port, manager, passwd, entry, ava, value, loops );
+       do_modify( uri, host, port, manager, passwd, entry, ava, value,
+                       loops, retries );
        exit( EXIT_SUCCESS );
 }
 
 
 static void
 do_modify( char *uri, char *host, int port, char *manager,
-       char *passwd, char *entry, char* attr, char* value, int maxloop )
+       char *passwd, char *entry, char* attr, char* value,
+       int maxloop, int maxretries )
 {
        LDAP    *ld = NULL;
-       int     i;
+       int     i = 0, do_retry = maxretries;
        pid_t   pid;
        int     rc = LDAP_SUCCESS;
 
@@ -144,7 +158,7 @@ do_modify( char *uri, char *host, int port, char *manager,
        mods[0] = &mod;
        mods[1] = NULL;
 
-       
+retry:;
        if ( uri ) {
                ldap_initialize( &ld, uri );
        } else {
@@ -161,26 +175,42 @@ do_modify( char *uri, char *host, int port, char *manager,
                        &version ); 
        }
 
-       if ( ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_bind" );
-                exit( EXIT_FAILURE );
+       if ( do_retry == maxretries ) {
+               fprintf( stderr, "PID=%ld - Modify(%d): entry=\"%s\".\n",
+                       (long) pid, maxloop, entry );
        }
 
+       rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
+       if ( rc != LDAP_SUCCESS ) {
+               ldap_perror( ld, "ldap_bind" );
+               if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                       do_retry--;
+                       goto retry;
+               }
+               exit( EXIT_FAILURE );
+       }
 
-       fprintf( stderr, "PID=%ld - Modify(%d): entry=\"%s\".\n",
-                (long) pid, maxloop, entry );
-
-       for ( i = 0; i < maxloop; i++ ) {
+       for ( ; i < maxloop; i++ ) {
                mod.mod_op = LDAP_MOD_ADD;
-               if (( rc = ldap_modify_s( ld, entry, mods )) != LDAP_SUCCESS ) {
+               rc = ldap_modify_s( ld, entry, mods );
+               if ( rc != LDAP_SUCCESS ) {
                        ldap_perror( ld, "ldap_modify" );
+                       if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                               do_retry--;
+                               goto retry;
+                       }
                        if ( rc != LDAP_NO_SUCH_OBJECT ) break;
                        continue;
                }
                
                mod.mod_op = LDAP_MOD_DELETE;
-               if (( rc = ldap_modify_s( ld, entry, mods )) != LDAP_SUCCESS ) {
+               rc = ldap_modify_s( ld, entry, mods );
+               if ( rc != LDAP_SUCCESS ) {
                        ldap_perror( ld, "ldap_modify" );
+                       if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                               do_retry--;
+                               goto retry;
+                       }
                        if ( rc != LDAP_NO_SUCH_OBJECT ) break;
                        continue;
                }
index 2ca60b4c0d5d0e9eddec6e52139fa00c1ec47ff8..60e85fa77b839f16df3998f1b75ef35784ee9dd7 100644 (file)
 #include <ldap.h>
 
 #define LOOPS  100
+#define RETRIES        0
 
 static void
-do_modrdn( char *uri, char *host, int port, char *manager, char *passwd, char *entry, int maxloop );
+do_modrdn( char *uri, char *host, int port, char *manager, char *passwd,
+               char *entry, int maxloop, int maxretries );
 
 static void
 usage( char *name )
@@ -51,43 +53,51 @@ main( int argc, char **argv )
 {
        int             i;
        char            *uri = NULL;
-       char        *host = "localhost";
-       int                     port = -1;
+       char            *host = "localhost";
+       int             port = -1;
        char            *manager = NULL;
        char            *passwd = NULL;
        char            *entry = NULL;
-       int                     loops = LOOPS;
+       int             loops = LOOPS;
+       int             retries = RETRIES;
 
-       while ( (i = getopt( argc, argv, "H:h:p:D:w:e:l:" )) != EOF ) {
+       while ( (i = getopt( argc, argv, "H:h:p:D:w:e:l:r:" )) != EOF ) {
                switch( i ) {
-                       case 'H':               /* the server uri */
-                               uri = strdup( optarg );
+               case 'H':               /* the server uri */
+                       uri = strdup( optarg );
                        break;
-                       case 'h':               /* the servers host */
-                               host = strdup( optarg );
+
+               case 'h':               /* the servers host */
+                       host = strdup( optarg );
                        break;
 
-                       case 'p':               /* the servers port */
-                               port = atoi( optarg );
-                               break;
-                       case 'D':               /* the servers manager */
-                               manager = strdup( optarg );
+               case 'p':               /* the servers port */
+                       port = atoi( optarg );
                        break;
 
-                       case 'w':               /* the server managers password */
-                               passwd = strdup( optarg );
+               case 'D':               /* the servers manager */
+                       manager = strdup( optarg );
                        break;
-                       case 'e':               /* entry to rename */
-                               entry = strdup( optarg );
-                               break;
 
-                       case 'l':               /* the number of loops */
-                               loops = atoi( optarg );
-                               break;
+               case 'w':               /* the server managers password */
+                       passwd = strdup( optarg );
+                       break;
 
-                       default:
-                               usage( argv[0] );
-                               break;
+               case 'e':               /* entry to rename */
+                       entry = strdup( optarg );
+                       break;
+
+               case 'l':               /* the number of loops */
+                       loops = atoi( optarg );
+                       break;
+
+               case 'r':               /* the number of retries */
+                       retries = atoi( optarg );
+                       break;
+
+               default:
+                       usage( argv[0] );
+                       break;
                }
        }
 
@@ -102,17 +112,17 @@ main( int argc, char **argv )
 
        }
 
-       do_modrdn( uri, host, port, manager, passwd, entry, loops );
+       do_modrdn( uri, host, port, manager, passwd, entry, loops, retries );
        exit( EXIT_SUCCESS );
 }
 
 
 static void
 do_modrdn( char *uri, char *host, int port, char *manager,
-       char *passwd, char *entry, int maxloop )
+       char *passwd, char *entry, int maxloop, int maxretries )
 {
        LDAP    *ld = NULL;
-       int     i;
+       int     i = 0, do_retry = maxretries;
        pid_t   pid;
        char *DNs[2];
        char *rdns[2];
@@ -141,7 +151,8 @@ do_modrdn( char *uri, char *host, int port, char *manager,
                rdns[0] = strdup( DNs[1] );
                DNs[1][i] = ',';
        }
-               
+
+retry:;
        if ( uri ) {
                ldap_initialize( &ld, uri );
        } else {
@@ -158,25 +169,39 @@ do_modrdn( char *uri, char *host, int port, char *manager,
                        &version ); 
        }
 
-       if ( ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_bind" );
-                exit( EXIT_FAILURE );
+       if ( do_retry == maxretries ) {
+               fprintf( stderr, "PID=%ld - Modrdn(%d): entry=\"%s\".\n",
+                       (long) pid, maxloop, entry );
        }
 
+       rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
+       if ( rc != LDAP_SUCCESS ) {
+               ldap_perror( ld, "ldap_bind" );
+               if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                       do_retry--;
+                       goto retry;
+               }
+               exit( EXIT_FAILURE );
+       }
 
-       fprintf( stderr, "PID=%ld - Modrdn(%d): entry=\"%s\".\n",
-                (long) pid, maxloop, entry );
-
-       for ( i = 0; i < maxloop; i++ ) {
-               if (( rc = ldap_modrdn2_s( ld, DNs[0], rdns[0], 0 ))
-                       != LDAP_SUCCESS ) {
+       for ( ; i < maxloop; i++ ) {
+               rc = ldap_modrdn2_s( ld, DNs[0], rdns[0], 0 );
+               if ( rc != LDAP_SUCCESS ) {
                        ldap_perror( ld, "ldap_modrdn" );
+                       if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                               do_retry--;
+                               goto retry;
+                       }
                        if ( rc != LDAP_NO_SUCH_OBJECT ) break;
                        continue;
                }
-               if (( rc = ldap_modrdn2_s( ld, DNs[1], rdns[1], 1 ))
-                       != LDAP_SUCCESS ) {
+               rc = ldap_modrdn2_s( ld, DNs[1], rdns[1], 1 );
+               if ( rc != LDAP_SUCCESS ) {
                        ldap_perror( ld, "ldap_modrdn" );
+                       if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                               do_retry--;
+                               goto retry;
+                       }
                        if ( rc != LDAP_NO_SUCH_OBJECT ) break;
                        continue;
                }
index bcc24a23810af417f91311f51b2275a97898bba0..c3c09758b5e6057e03adf611fc2d0b002f1f30a1 100644 (file)
 #include <ldap.h>
 
 #define LOOPS  100
+#define RETRIES        0
 
 static void
-do_read( char *uri, char *host, int port, char *entry, int maxloop );
+do_read( char *uri, char *host, int port, char *entry, int maxloop,
+               int maxretries );
 
 static void
 usage( char *name )
@@ -51,35 +53,41 @@ main( int argc, char **argv )
 {
        int             i;
        char            *uri = NULL;
-       char        *host = "localhost";
-       int                     port = -1;
+       char            *host = "localhost";
+       int             port = -1;
        char            *entry = NULL;
-       int                     loops = LOOPS;
+       int             loops = LOOPS;
+       int             retries = RETRIES;
 
-       while ( (i = getopt( argc, argv, "H:h:p:e:l:" )) != EOF ) {
+       while ( (i = getopt( argc, argv, "H:h:p:e:l:r:" )) != EOF ) {
                switch( i ) {
-                       case 'H':               /* the server uri */
-                               uri = strdup( optarg );
+               case 'H':               /* the server uri */
+                       uri = strdup( optarg );
                        break;
-                       case 'h':               /* the servers host */
-                               host = strdup( optarg );
+
+               case 'h':               /* the servers host */
+                       host = strdup( optarg );
                        break;
 
-                       case 'p':               /* the servers port */
-                               port = atoi( optarg );
-                               break;
+               case 'p':               /* the servers port */
+                       port = atoi( optarg );
+                       break;
 
-                       case 'e':               /* file with entry search request */
-                               entry = strdup( optarg );
-                               break;
+               case 'e':               /* DN to search for */
+                       entry = strdup( optarg );
+                       break;
 
-                       case 'l':               /* the number of loops */
-                               loops = atoi( optarg );
-                               break;
+               case 'l':               /* the number of loops */
+                       loops = atoi( optarg );
+                       break;
 
-                       default:
-                               usage( argv[0] );
-                               break;
+               case 'r':               /* the number of retries */
+                       retries = atoi( optarg );
+                       break;
+
+               default:
+                       usage( argv[0] );
+                       break;
                }
        }
 
@@ -87,27 +95,27 @@ main( int argc, char **argv )
                usage( argv[0] );
 
        if ( *entry == '\0' ) {
-
                fprintf( stderr, "%s: invalid EMPTY entry DN.\n",
                                argv[0] );
                exit( EXIT_FAILURE );
-
        }
 
-       do_read( uri, host, port, entry, ( 20 * loops ));
+       do_read( uri, host, port, entry, ( 20 * loops ), retries );
        exit( EXIT_SUCCESS );
 }
 
 
 static void
-do_read( char *uri, char *host, int port, char *entry, int maxloop )
+do_read( char *uri, char *host, int port, char *entry, int maxloop,
+               int maxretries )
 {
        LDAP    *ld = NULL;
-       int     i;
+       int     i = 0, do_retry = maxretries;
        char    *attrs[] = { "1.1", NULL };
        pid_t   pid = getpid();
        int     rc = LDAP_SUCCESS;
-
+       
+retry:;
        if ( uri ) {
                ldap_initialize( &ld, uri );
        } else {
@@ -124,22 +132,32 @@ do_read( char *uri, char *host, int port, char *entry, int maxloop )
                        &version ); 
        }
 
-       if ( ldap_bind_s( ld, NULL, NULL, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_bind" );
-                exit( EXIT_FAILURE );
+       if ( do_retry == maxretries ) {
+               fprintf( stderr, "PID=%ld - Read(%d): entry=\"%s\".\n",
+                       (long) pid, maxloop, entry );
        }
 
+       rc = ldap_bind_s( ld, NULL, NULL, LDAP_AUTH_SIMPLE );
+       if ( rc != LDAP_SUCCESS ) {
+               ldap_perror( ld, "ldap_bind" );
+               if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                       do_retry--;
+                       goto retry;
+               }
+               exit( EXIT_FAILURE );
+       }
 
-       fprintf( stderr, "PID=%ld - Read(%d): entry=\"%s\".\n",
-                (long) pid, maxloop, entry );
-
-       for ( i = 0; i < maxloop; i++ ) {
+       for ( ; i < maxloop; i++ ) {
                LDAPMessage *res;
 
                rc = ldap_search_s( ld, entry, LDAP_SCOPE_BASE,
                                NULL, attrs, 1, &res );
                if ( rc != LDAP_SUCCESS ) {
                        ldap_perror( ld, "ldap_read" );
+                       if ( rc == LDAP_BUSY && do_retry > 0 ) {
+                               do_retry--;
+                               goto retry;
+                       }
                        if ( rc != LDAP_NO_SUCH_OBJECT ) break;
                        continue;
 
@@ -153,4 +171,3 @@ do_read( char *uri, char *host, int port, char *entry, int maxloop )
        ldap_unbind( ld );
 }
 
-
index 790b20dea676bb9e7b9996b2874b1171a07b089c..de42211fca1ef8a8ee28ad3f44f0ff69f166a260 100644 (file)
 #include <ldap.h>
 
 #define LOOPS  100
+#define RETRIES        0
 
 static void
-do_search( char *uri, char *host, int port, char *manager, char *passwd, char *sbase, char *filter, int maxloop );
+do_search( char *uri, char *host, int port, char *manager, char *passwd,
+               char *sbase, char *filter, int maxloop, int maxretries );
 
 static void
 usage( char *name )
@@ -51,50 +53,56 @@ main( int argc, char **argv )
 {
        int             i;
        char            *uri = NULL;
-       char        *host = "localhost";
-       int                     port = -1;
+       char            *host = "localhost";
+       int             port = -1;
        char            *manager = NULL;
        char            *passwd = NULL;
-       char        *sbase = NULL;
+       char            *sbase = NULL;
        char            *filter  = NULL;
-       int                     loops = LOOPS;
+       int             loops = LOOPS;
+       int             retries = RETRIES;
 
-       while ( (i = getopt( argc, argv, "b:D:f:H:h:l:p:w:" )) != EOF ) {
+       while ( (i = getopt( argc, argv, "b:D:f:H:h:l:p:w:r:" )) != EOF ) {
                switch( i ) {
-                       case 'H':               /* the server uri */
-                               uri = strdup( optarg );
+               case 'H':               /* the server uri */
+                       uri = strdup( optarg );
                        break;
-                       case 'h':               /* the servers host */
-                               host = strdup( optarg );
+
+               case 'h':               /* the servers host */
+                       host = strdup( optarg );
+                       break;
+
+               case 'p':               /* the servers port */
+                       port = atoi( optarg );
                        break;
 
-                       case 'p':               /* the servers port */
-                               port = atoi( optarg );
-                               break;
+               case 'D':               /* the servers manager */
+                       manager = strdup( optarg );
+                       break;
 
-                       case 'D':               /* the servers manager */
-                               manager = strdup( optarg );
+               case 'w':               /* the server managers password */
+                       passwd = strdup( optarg );
                        break;
 
-                       case 'w':               /* the server managers password */
-                               passwd = strdup( optarg );
+               case 'b':               /* file with search base */
+                       sbase = strdup( optarg );
                        break;
 
-                       case 'b':               /* file with search base */
-                               sbase = strdup( optarg );
+               case 'f':               /* the search request */
+                       filter = strdup( optarg );
                        break;
 
-                       case 'f':               /* the search request */
-                               filter = strdup( optarg );
-                               break;
+               case 'l':               /* number of loops */
+                       loops = atoi( optarg );
+                       break;
 
-                       case 'l':               /* number of loops */
-                               loops = atoi( optarg );
-                               break;
+               case 'r':               /* number of retries */
+                       retries = atoi( optarg );
+                       break;
 
-                       default:
-                               usage( argv[0] );
-                               break;
+               default:
+                       usage( argv[0] );
+                       break;
                }
        }
 
@@ -109,20 +117,23 @@ main( int argc, char **argv )
 
        }
 
-       do_search( uri, host, port, manager, passwd, sbase, filter, ( 10 * loops ));
+       do_search( uri, host, port, manager, passwd, sbase, filter,
+                       ( 10 * loops ), retries );
        exit( EXIT_SUCCESS );
 }
 
 
 static void
-do_search( char *uri, char *host, int port, char *manager, char *passwd, char *sbase, char *filter, int maxloop )
+do_search( char *uri, char *host, int port, char *manager, char *passwd,
+               char *sbase, char *filter, int maxloop, int maxretries )
 {
        LDAP    *ld = NULL;
-       int     i;
+       int     i = 0, do_retry = maxretries;
        char    *attrs[] = { "cn", "sn", NULL };
        pid_t   pid = getpid();
        int     rc = LDAP_SUCCESS;
 
+retry:;
        if ( uri ) {
                ldap_initialize( &ld, uri );
        } else {
@@ -139,22 +150,32 @@ do_search( char *uri, char *host, int port, char *manager, char *passwd, char *s
                        &version ); 
        }
 
-       if ( ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE ) != LDAP_SUCCESS ) {
-               ldap_perror( ld, "ldap_bind" );
-                exit( EXIT_FAILURE );
+       if ( do_retry == maxretries ) {
+               fprintf( stderr, "PID=%ld - Search(%d): base=\"%s\", filter=\"%s\".\n",
+                               (long) pid, maxloop, sbase, filter );
        }
 
+       rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
+       if ( rc != LDAP_SUCCESS ) {
+               if ( rc == LDAP_BUSY && do_retry == 1 ) {
+                       do_retry = 0;
+                       goto retry;
+               }
+               ldap_perror( ld, "ldap_bind" );
+               exit( EXIT_FAILURE );
+       }
 
-       fprintf( stderr, "PID=%ld - Search(%d): base=\"%s\", filter=\"%s\".\n",
-                               (long) pid, maxloop, sbase, filter );
-
-       for ( i = 0; i < maxloop; i++ ) {
+       for ( ; i < maxloop; i++ ) {
                LDAPMessage *res;
 
                rc = ldap_search_s( ld, sbase, LDAP_SCOPE_SUBTREE,
                                filter, attrs, 0, &res );
                if ( rc != LDAP_SUCCESS ) {
                        ldap_perror( ld, "ldap_search" );
+                       if ( rc == LDAP_BUSY && do_retry == 1 ) {
+                               do_retry = 0;
+                               goto retry;
+                       }
                        if ( rc != LDAP_NO_SUCH_OBJECT ) break;
                        continue;
 
index 2d3819870a63731e4b6d91638dcbb55b42bc9699..7d14de72c6f7eab833bffa36eff9b66e2d569a72 100644 (file)
@@ -43,6 +43,7 @@
 #define MAXARGS                100
 #define MAXREQS                        5000
 #define LOOPS                  "100"
+#define RETRIES                        "0"
 
 #define TSEARCHFILE            "do_search.0"
 #define TREADFILE              "do_read.0"
@@ -86,6 +87,7 @@ main( int argc, char **argv )
        char            *dirname = NULL;
        char            *progdir = NULL;
        char            *loops = LOOPS;
+       char            *retries = RETRIES;
        DIR                     *datadir;
        struct dirent   *file;
        char            *sfile = NULL;
@@ -120,47 +122,51 @@ main( int argc, char **argv )
        char            *moddn[MAXREQS];
        int             modnum = 0;
 
-       while ( (i = getopt( argc, argv, "H:h:p:D:w:b:d:j:l:P:" )) != EOF ) {
+       while ( (i = getopt( argc, argv, "D:d:H:h:j:l:P:p:r:w:" )) != EOF ) {
                switch( i ) {
-                       case 'H':               /* slapd uri */
-                               uri = strdup( optarg );
+               case 'D':               /* slapd manager */
+                       manager = ArgDup( optarg );
                        break;
-                               
-                       case 'h':               /* slapd host */
-                               host = strdup( optarg );
+
+               case 'd':               /* data directory */
+                       dirname = strdup( optarg );
+                       break;
+
+               case 'H':               /* slapd uri */
+                       uri = strdup( optarg );
                        break;
 
-                       case 'p':               /* the servers port number */
-                               port = strdup( optarg );
-                               break;
+               case 'h':               /* slapd host */
+                       host = strdup( optarg );
+                       break;
 
-                       case 'D':               /* slapd manager */
-                               manager = ArgDup( optarg );
+               case 'j':               /* the number of parallel clients */
+                       maxkids = atoi( optarg );
                        break;
 
-                       case 'w':               /* the managers passwd */
-                               passwd = ArgDup( optarg );
-                               break;
+               case 'l':               /* the number of loops per client */
+                       loops = strdup( optarg );
+                       break;
 
-                       case 'd':               /* data directory */
-                               dirname = strdup( optarg );
+               case 'P':               /* prog directory */
+                       progdir = strdup( optarg );
                        break;
 
-                       case 'P':               /* prog directory */
-                               progdir = strdup( optarg );
+               case 'p':               /* the servers port number */
+                       port = strdup( optarg );
                        break;
 
-                       case 'j':               /* the number of parallel clients */
-                               maxkids = atoi( optarg );
-                               break;
+               case 'r':
+                       retries = strdup( optarg );
+                       break;
 
-                       case 'l':               /* the number of loops per client */
-                               loops = strdup( optarg );
-                               break;
+               case 'w':               /* the managers passwd */
+                       passwd = ArgDup( optarg );
+                       break;
 
-                       default:
-                               usage( argv[0] );
-                               break;
+               default:
+                       usage( argv[0] );
+                       break;
                }
        }
 
@@ -246,6 +252,8 @@ main( int argc, char **argv )
        sargs[sanum++] = passwd;
        sargs[sanum++] = "-l";
        sargs[sanum++] = loops;
+       sargs[sanum++] = "-r";
+       sargs[sanum++] = retries;
        sargs[sanum++] = "-b";
        sargs[sanum++] = NULL;          /* will hold the search base */
        sargs[sanum++] = "-f";
@@ -271,6 +279,8 @@ main( int argc, char **argv )
        }
        rargs[ranum++] = "-l";
        rargs[ranum++] = loops;
+       rargs[ranum++] = "-r";
+       rargs[ranum++] = retries;
        rargs[ranum++] = "-e";
        rargs[ranum++] = NULL;          /* will hold the read entry */
        rargs[ranum++] = NULL;
@@ -298,6 +308,8 @@ main( int argc, char **argv )
        margs[manum++] = passwd;
        margs[manum++] = "-l";
        margs[manum++] = loops;
+       margs[manum++] = "-r";
+       margs[manum++] = retries;
        margs[manum++] = "-e";
        margs[manum++] = NULL;          /* will hold the modrdn entry */
        margs[manum++] = NULL;
@@ -325,6 +337,8 @@ main( int argc, char **argv )
        modargs[modanum++] = passwd;
        modargs[modanum++] = "-l";
        modargs[modanum++] = loops;
+       modargs[modanum++] = "-r";
+       modargs[modanum++] = retries;
        modargs[modanum++] = "-e";
        modargs[modanum++] = NULL;              /* will hold the modify entry */
        modargs[modanum++] = "-a";;
@@ -354,6 +368,8 @@ main( int argc, char **argv )
        aargs[aanum++] = passwd;
        aargs[aanum++] = "-l";
        aargs[aanum++] = loops;
+       aargs[aanum++] = "-r";
+       aargs[aanum++] = retries;
        aargs[aanum++] = "-f";
        aargs[aanum++] = NULL;          /* will hold the add data file */
        aargs[aanum++] = NULL;
index e2a44ba9f1cd0bd98a25f8e619e8eeeb9e2ffbc8..5e631b8ae4409a0e35b18e82e8c4fac46428752a 100755 (executable)
@@ -80,7 +80,7 @@ IDASSERTCONF=$DATADIR/slapd-idassert.conf
 LDAPGLUECONF1=$DATADIR/slapd-ldapglue.conf
 LDAPGLUECONF2=$DATADIR/slapd-ldapgluepeople.conf
 LDAPGLUECONF3=$DATADIR/slapd-ldapgluegroups.conf
-RWMCONF=$DATADIR/slapd-relay.conf
+RELAYCONF=$DATADIR/slapd-relay.conf
 CHAINCONF1=$DATADIR/slapd-chain1.conf
 CHAINCONF2=$DATADIR/slapd-chain2.conf
 GLUESYNCCONF1=$DATADIR/slapd-glue-syncrepl1.conf
@@ -88,6 +88,8 @@ GLUESYNCCONF2=$DATADIR/slapd-glue-syncrepl2.conf
 SQLCONF=$DATADIR/slapd-sql.conf
 TRANSLUCENTLOCALCONF=$DATADIR/slapd-translucent-local.conf
 TRANSLUCENTREMOTECONF=$DATADIR/slapd-translucent-remote.conf
+METACONF=$DATADIR/slapd-meta.conf
+METACONF2=$DATADIR/slapd-meta2.conf
 
 CONF1=$TESTDIR/slapd.1.conf
 CONF2=$TESTDIR/slapd.2.conf
@@ -176,6 +178,7 @@ LDIFTRANSLUCENTDATA=$DATADIR/test-translucent-data.ldif
 LDIFTRANSLUCENTCONFIG=$DATADIR/test-translucent-config.ldif
 LDIFTRANSLUCENTADD=$DATADIR/test-translucent-add.ldif
 LDIFTRANSLUCENTMERGED=$DATADIR/test-translucent-merged.ldif
+LDIFMETA=$DATADIR/test-meta.ldif
 SQLADD=$DATADIR/sql-add.ldif
 MONITOR=""
 REFDN="c=US"
@@ -193,6 +196,8 @@ TRANSLUCENTROOT="o=translucent"
 TRANSLUCENTUSER="ou=users,o=translucent"
 TRANSLUCENTDN="uid=binder,o=translucent"
 TRANSLUCENTPASSWD="bindtest"
+METABASEDN="ou=Meta,dc=example,dc=com"
+METAMANAGERDN="cn=Manager,$METABASEDN"
 
 LOG1=$TESTDIR/slapd.1.log
 LOG2=$TESTDIR/slapd.2.log
@@ -257,6 +262,8 @@ GLUESYNCOUT=$DATADIR/gluesync.out
 SQLREAD=$DATADIR/sql-read.out
 SQLWRITE=$DATADIR/sql-write.out
 TRANSLUCENTOUT=$DATADIR/translucent.search.out
+METAOUT=$DATADIR/meta.out
+METACONCURRENCYOUT=$DATADIR/metaconcurrency.out
 
 # Just in case we linked the binaries dynamically
 LD_LIBRARY_PATH=`pwd`/../libraries:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH
index f6cfcef7c122e937fa7ff0806a542d4969e2281a..638d330b77d78c71b3a21bad0da632e2303e1407 100755 (executable)
@@ -17,7 +17,7 @@ echo "Using $RELAY backend..."
 echo ""
 
 echo "Starting slapd on TCP/IP port $PORT1..."
-. $CONFFILTER $BACKEND $MONITORDB < $RWMCONF > $CONF1
+. $CONFFILTER $BACKEND $MONITORDB < $RELAYCONF > $CONF1
 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
 PID=$!
 if test $WAIT != 0 ; then
@@ -38,7 +38,7 @@ for i in 0 1 2 3 4 5; do
        sleep 5
 done
 if test $RC != 0 ; then
-       echo "ldapsearch failed $(RC)!"
+       echo "ldapsearch failed ($RC)!"
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
        exit $RC
 fi
index fa495f21085e2e91d649df62439d8fb71072f074..955391aefa06b860e26a435a9ea7b1520775e601 100755 (executable)
@@ -179,6 +179,8 @@ if test $? != 0 ; then
        exit 1
 fi
 
+# Test that you can use modrdn with an attribute value which was previously
+# present
 
 echo "Testing modrdn(deleteoldrdn=1), modrdn with new rdn already an att val..."
 $LDAPMODRDN -D "$MANAGERDN" -r -h $LOCALHOST -p $PORT1 -w $PASSWD > \
@@ -191,16 +193,11 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-# Test that you can use modrdn with an attribute value which was previously
-# present
-
 echo "Using ldapsearch to retrieve entries using new rdn (cn=James A Jones 1)..."
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
            'cn=James A Jones 1' > $SEARCHOUT 2>&1
 RC=$?
 
-test $KILLSERVERS != no && kill -HUP $KILLPIDS
-
 if test $RC != 0 ; then
        echo "ldapsearch failed ($RC)!"
        exit $RC
@@ -220,5 +217,19 @@ if test $? != 0 ; then
        exit 1
 fi
 
+echo "Testing modrdn with newSuperior as child of target "
+$LDAPMODRDN -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
+       /dev/null 2>&1  -s 'cn=Sub1, ou=FooBar, cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example, dc=com' 'cn=James A Jones 1' \
+       'cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example, dc=com' 'cn=James A Jones 1'
+
+RC=$?
+if test $RC -eq 0 ; then
+       echo "ldapmodrdn succeeded, should have failed!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit 1
+fi
+
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
+
 echo ">>>>> Test succeeded"
 exit 0
index 338b145fc9e5465c92cfe1890556bac7ca260839..20a367f6ac82f3e8fc52529dfd7def7990992794 100755 (executable)
@@ -172,6 +172,103 @@ description: added by bjensen (should fail)
 -
 EOMODS6
 
+$LDAPMODIFY -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD >> \
+       $TESTOUT 2>&1 << EOMODS7
+dn: ou=Add/Delete,dc=example,dc=com
+changetype: add
+objectClass: organizationalUnit
+ou: Add/Delete
+EOMODS7
+
+$LDAPMODIFY -D "$BABSDN" -h $LOCALHOST -p $PORT1 -w bjensen >> \
+       $TESTOUT 2>&1 << EOMODS8
+dn: cn=Added by Babs (must fail),ou=Add/Delete,dc=example,dc=com
+changetype: add
+objectClass: inetOrgPerson
+cn: Added by Babs (must fail)
+sn: None
+EOMODS8
+
+$LDAPMODIFY -D "$BJORNSDN" -h $LOCALHOST -p $PORT1 -w bjorn >> \
+       $TESTOUT 2>&1 << EOMODS9
+dn: cn=Added by Bjorn (must succeed),ou=Add/Delete,dc=example,dc=com
+changetype: add
+objectClass: inetOrgPerson
+cn: Added by Bjorn (must succeed)
+sn: None
+
+dn: cn=Added by Bjorn (will be deleted),ou=Add/Delete,dc=example,dc=com
+changetype: add
+objectClass: inetOrgPerson
+cn: Added by Bjorn (will be deleted)
+sn: None
+
+dn: cn=Added by Bjorn (will be renamed),ou=Add/Delete,dc=example,dc=com
+changetype: add
+objectClass: inetOrgPerson
+cn: Added by Bjorn (will be renamed)
+sn: None
+
+dn: cn=Added by Bjorn (must succeed),ou=Add/Delete,dc=example,dc=com
+changetype: modify
+add: description
+description: this attribute value has been added __after__entry creation
+description: this attribute value will be deleted by Babs (must succeed)
+description: Bjorn will try to delete this attribute value (should fail)
+-
+EOMODS9
+
+$LDAPMODIFY -D "$BJORNSDN" -h $LOCALHOST -p $PORT1 -w bjorn >> \
+       $TESTOUT 2>&1 << EOMODS10
+dn: cn=Added by Bjorn (will be deleted),ou=Add/Delete,dc=example,dc=com
+changetype: delete
+EOMODS10
+
+$LDAPMODIFY -D "$BJORNSDN" -h $LOCALHOST -p $PORT1 -w bjorn >> \
+       $TESTOUT 2>&1 << EOMODS11
+dn: cn=Added by Bjorn (will be renamed),ou=Add/Delete,dc=example,dc=com
+changetype: modrdn
+newrdn: cn=Added by Bjorn (renamed by Bjorn)
+deleteoldrdn: 1
+EOMODS11
+
+$LDAPMODIFY -D "$BABSDN" -h $LOCALHOST -p $PORT1 -w bjensen >> \
+       $TESTOUT 2>&1 << EOMODS12
+dn: cn=Added by Bjorn (will be renamed),ou=Add/Delete,dc=example,dc=com
+changetype: modrdn
+newrdn: cn=Added by Bjorn (renamed by Babs)
+deleteoldrdn: 1
+EOMODS12
+
+$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT1 -w jaj >> \
+       $TESTOUT 2>&1 << EOMODS13
+dn: cn=Added by Bjorn (will be renamed),ou=Add/Delete,dc=example,dc=com
+changetype: modrdn
+newrdn: cn=Added by Bjorn (renamed by Jaj)
+deleteoldrdn: 1
+EOMODS13
+
+$LDAPMODIFY -D "$BJORNSDN" -h $LOCALHOST -p $PORT1 -w bjorn >> \
+       $TESTOUT 2>&1 << EOMODS14
+dn: cn=Added by Bjorn (must succeed),ou=Add/Delete,dc=example,dc=com
+changetype: modify
+delete: description
+description: Bjorn will try to delete this attribute value (should fail)
+-
+EOMODS14
+
+$LDAPMODIFY -D "$BABSDN" -h $LOCALHOST -p $PORT1 -w bjensen >> \
+       $TESTOUT 2>&1 << EOMODS15
+dn: cn=Added by Bjorn (will be deleted),ou=Add/Delete,dc=example,dc=com
+changetype: delete
+
+dn: cn=Added by Bjorn (must succeed),ou=Add/Delete,dc=example,dc=com
+changetype: modify
+delete: description
+description: this attribute value will be deleted by Babs (must succeed)
+-
+EOMODS15
+
 echo "Using ldapsearch to retrieve all the entries..."
 echo "# Using ldapsearch to retrieve all the entries..." >> $SEARCHOUT
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
index 158dd6a8e310b75374020ead3ee715c92c48d9d7..21cfed803f546ee9ece74f092b82667f0d920dc1 100755 (executable)
@@ -79,8 +79,8 @@ if test $COUNT != 2 ; then
        exit 1
 fi
 
-echo "Waiting 30 seconds for lockout to reset..."
-sleep 30
+echo "Waiting 20 seconds for lockout to reset..."
+sleep 20
 
 $LDAPSEARCH -e ppolicy -h $LOCALHOST -p $PORT1 -D "$USER" -w $PASS \
        -b "$BASEDN" -s base >> $SEARCHOUT 2>&1
@@ -91,15 +91,9 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-echo "Testing password expiration..."
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
-       $TESTOUT 2>&1 << EOMODS
-dn: uid=nd, ou=People, dc=example, dc=com
-changetype: modify
-replace: pwdChangedTime
-pwdChangedTime: 20031231000001Z
-
-EOMODS
+echo "Testing password expiration"
+echo "Waiting 20 seconds for password to expire..."
+sleep 20
 
 $LDAPSEARCH -e ppolicy -h $LOCALHOST -p $PORT1 -D "$USER" -w $PASS \
        -b "$BASEDN" -s base > $SEARCHOUT 2>&1
index 5d7f618b05e5f57df2717e0252d284683ac996b0..6d1223bf610b7af62157f37abba6b96e64276afd 100755 (executable)
@@ -92,6 +92,28 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
+echo "Searching database for uniqueMember (approx) ..."
+$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
+       "(uniqueMember~=dc=example,dc=com)" >> $SEARCHOUT 2>&1
+
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Searching database for uniqueMember (approx) ..."
+$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
+       "(uniqueMember~=dc=example,dc=com#'001000'B)" >> $SEARCHOUT 2>&1
+
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
 test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
 LDIFOUT=$DNOUT
index e4e2eb2cff0fd781d773cefef8af17ee9337ef66..32900758369844ec4d40ac7787a88ed7d6fa8a53 100755 (executable)
@@ -28,7 +28,7 @@ if test $RC != 0 ; then
 fi
 
 echo "Running slapadd to build empty DN slapd database..."
-$SLAPADD -f $CONF1 -n 2 -l $LDIFEMPTYDN2
+$SLAPADD -f $CONF1 -n 3 -l $LDIFEMPTYDN2
 RC=$?
 if test $RC != 0 ; then
        echo "slapadd failed ($RC)!"
diff --git a/tests/scripts/test035-meta b/tests/scripts/test035-meta
new file mode 100755 (executable)
index 0000000..450e256
--- /dev/null
@@ -0,0 +1,569 @@
+#! /bin/sh
+# $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2005 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+
+echo "running defines.sh"
+. $SRCDIR/scripts/defines.sh
+
+echo ""
+
+if test $BACKMETA = metano ; then 
+       echo "meta backend not available, test skipped"
+       exit 0
+fi
+
+rm -rf $TESTDIR
+
+mkdir -p $TESTDIR $DBDIR1 $DBDIR2
+
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
+PID=$!
+if test $WAIT != 0 ; then
+    echo PID $PID
+    read foo
+fi
+KILLPIDS="$PID"
+
+echo "Using ldapsearch to check that slapd is running..."
+for i in 0 1 2 3 4 5; do
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
+               'objectclass=*' > /dev/null 2>&1
+       RC=$?
+       if test $RC = 0 ; then
+               break
+       fi
+       echo "Waiting 5 seconds for slapd to start..."
+       sleep 5
+done
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Using ldapadd to populate the database..."
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
+       $LDIFORDERED > $TESTOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapadd failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Starting slapd on TCP/IP port $PORT2..."
+. $CONFFILTER $BACKEND $MONITORDB < $METACONF2 > $CONF2
+$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
+PID=$!
+if test $WAIT != 0 ; then
+    echo PID $PID
+    read foo
+fi
+KILLPIDS="$KILLPIDS $PID"
+
+echo "Using ldapsearch to check that slapd is running..."
+for i in 0 1 2 3 4 5; do
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
+               'objectclass=*' > /dev/null 2>&1
+       RC=$?
+       if test $RC = 0 ; then
+               break
+       fi
+       echo "Waiting 5 seconds for slapd to start..."
+       sleep 5
+done
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Using ldapadd to populate the database..."
+$LDAPADD -D "$METAMANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD < \
+       $LDIFMETA >> $TESTOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapadd failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Starting slapd on TCP/IP port $PORT3..."
+. $CONFFILTER $BACKEND $MONITORDB < $METACONF > $CONF3
+$SLAPD -f $CONF3 -h $URI3 -d $LVL $TIMING > $LOG3 2>&1 &
+PID=$!
+if test $WAIT != 0 ; then
+    echo PID $PID
+    read foo
+fi
+KILLPIDS="$KILLPIDS $PID"
+
+echo "Using ldapsearch to check that slapd is running..."
+for i in 0 1 2 3 4 5; do
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT3 \
+               'objectclass=*' > /dev/null 2>&1
+       RC=$?
+       if test $RC = 0 ; then
+               break
+       fi
+       echo "Waiting 5 seconds for slapd to start..."
+       sleep 5
+done
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+cat /dev/null > $SEARCHOUT
+
+BASEDN="o=Example,c=US"
+echo "Searching base=\"$BASEDN\"..."
+echo "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" >> $SEARCHOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Search failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Search failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+#
+# Do some modifications
+#
+
+BASEDN="o=Example,c=US"
+echo "Modifying database \"$BASEDN\"..."
+$LDAPMODIFY -v -D "cn=Manager,$BASEDN" -h $LOCALHOST -p $PORT3 -w $PASSWD \
+       -M >> $TESTOUT 2>&1 << EOMODS
+# These operations (updates with objectClass mapping) triggered ITS#3499
+dn: cn=Added Group,ou=Groups,$BASEDN
+changetype: add
+objectClass: groupOfNames
+objectClass: uidObject
+cn: Added Group
+member: cn=Added Group,ou=Groups,$BASEDN
+uid: added
+
+dn: cn=Another Added Group,ou=Groups,$BASEDN
+changetype: add
+objectClass: groupOfNames
+cn: Another Added Group
+member: cn=Added Group,ou=Groups,$BASEDN
+member: cn=Another Added Group,ou=Groups,$BASEDN
+
+dn: cn=Another Added Group,ou=Groups,$BASEDN
+changetype: modify
+add: objectClass
+objectClass: uidObject
+-
+add: uid
+uid: added
+-
+
+dn: cn=Added Group,ou=Groups,$BASEDN
+changetype: modify
+delete: objectClass
+objectClass: uidObject
+-
+delete: uid
+-
+
+dn: ou=Meta,$BASEDN
+changetype: modify
+add: description
+description: added to "ou=Meta,$BASEDN"
+-
+
+dn: ou=Who's going to handle this?,$BASEDN
+changetype: add
+objectClass: organizationalUnit
+ou: Who's going to handle this?
+description: added
+description: will be deleted
+
+dn: ou=Same as above,$BASEDN
+changetype: add
+objectClass: organizationalUnit
+ou: Same as above
+description: added right after "Who's going to handle this?"
+description: will be preserved
+
+dn: ou=Who's going to handle this?,$BASEDN
+changetype: delete
+
+dn: ou=Who's going to handle this?,ou=Meta,$BASEDN
+changetype: add
+objectClass: organizationalUnit
+ou: Who's going to handle this?
+description: added
+description: will be deleted
+
+dn: ou=Same as above,ou=Meta,$BASEDN
+changetype: add
+objectClass: organizationalUnit
+ou: Same as above
+description: added right after "Who's going to handle this?"
+description: will be preserved
+
+dn: cn=Added User,ou=Same as above,ou=Meta,$BASEDN
+changetype: add
+objectClass: inetOrgPerson
+cn: Added User
+sn: User
+userPassword: secret
+
+dn: ou=Who's going to handle this?,ou=Meta,$BASEDN
+changetype: delete
+EOMODS
+
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Modify failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Compare failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+echo "Searching base=\"$BASEDN\"..."
+echo "# searching base=\"$BASEDN\"..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" >> $SEARCHOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Search failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Search failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+BASEDN="o=Example,c=US"
+echo " base=\"$BASEDN\"..."
+echo "#        base=\"$BASEDN\"..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" -M "$FILTER" '*' ref \
+       >> $SEARCHOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Search failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Search failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+BASEDN="o=Example,c=US"
+FILTER="(seeAlso=cn=all staff,ou=Groups,$BASEDN)"
+echo "Searching filter=\"$FILTER\""
+echo " attrs=\"seeAlso\""
+echo " base=\"$BASEDN\"..."
+echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
+echo "#        attrs=\"seeAlso\"" >> $SEARCHOUT
+echo "#        base=\"$BASEDN\"..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" seeAlso \
+       >> $SEARCHOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Search failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Search failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+FILTER="(uid=example)"
+echo "Searching filter=\"$FILTER\""
+echo " attrs=\"uid\""
+echo " base=\"$BASEDN\"..."
+echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
+echo "#        attrs=\"uid\"" >> $SEARCHOUT
+echo "#        base=\"$BASEDN\"..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" uid \
+       >> $SEARCHOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Search failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Search failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+FILTER="(member=cn=Another Added Group,ou=Groups,$BASEDN)"
+echo "Searching filter=\"$FILTER\""
+echo " attrs=\"member\""
+echo " base=\"$BASEDN\"..."
+echo "# searching filter=\"$FILTER\"" >> $SEARCHOUT
+echo "#        attrs=\"member\"" >> $SEARCHOUT
+echo "#        base=\"$BASEDN\"..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -h $LOCALHOST -p $PORT3 -b "$BASEDN" "$FILTER" member \
+       >> $SEARCHOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Search failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Search failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+echo "Filtering ldapsearch results..."
+. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $LDIFFILTER < $METAOUT > $LDIFFLT
+echo "Comparing filter output..."
+$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
+       
+if test $? != 0 ; then
+       echo "comparison failed - meta search/modification didn't succeed"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit 1
+fi
+
+BASEDN="o=Example,c=US"
+echo "Changing password to database \"$BASEDN\"..."
+$LDAPPASSWD -h $LOCALHOST -p $PORT3 -D "cn=Manager,$BASEDN" -w $PASSWD \
+       -s $PASSWD "cn=Ursula Hampster,ou=Alumni Association,ou=People,$BASEDN" \
+       >> $TESTOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Passwd ExOp failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Passwd ExOp failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+echo "Binding with newly changed password to database \"$BASEDN\"..."
+$LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
+       -D "cn=Ursula Hampster,ou=Alumni Association,ou=People,$BASEDN" \
+       -w $PASSWD >> $TESTOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "WhoAmI failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+       ;;
+       *)
+               echo "WhoAmI failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+echo "Binding as newly added user to database \"$BASEDN\"..."
+$LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
+       -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
+       -w $PASSWD >> $TESTOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "WhoAmI failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+       ;;
+       *)
+               echo "Compare failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+echo "Changing password to database \"$BASEDN\"..."
+$LDAPPASSWD -h $LOCALHOST -p $PORT3 -D "cn=Manager,$BASEDN" -w $PASSWD \
+       -s meta "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
+       >> $TESTOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "Passwd ExOp failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit 0
+       ;;
+       *)
+               echo "Passwd ExOp failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+echo "Binding with newly changed password to database \"$BASEDN\"..."
+$LDAPWHOAMI -h $LOCALHOST -p $PORT3 \
+       -D "cn=Added User,ou=Same as above,ou=Meta,$BASEDN" \
+       -w meta >> $TESTOUT 2>&1
+RC=$?
+#if test $RC != 0 ; then
+#      echo "WhoAmI failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       0)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+       ;;
+       *)
+               echo "WhoAmI failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+echo "Comparing to database \"$BASEDN\"..."
+$LDAPCOMPARE -h $LOCALHOST -p $PORT3 \
+       "cn=Another Added Group,ou=Groups,$BASEDN" \
+       "member:cn=Added Group,ou=Groups,$BASEDN" >> $TESTOUT 2>&1
+RC=$?
+#if test $RC != 6 ; then
+#      echo "Compare failed ($RC)!"
+#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
+#      exit $RC
+#fi
+case $RC in 
+       6)
+       ;;
+       51)
+               echo "### Hit LDAP_BUSY problem; you may want to re-run the test"
+       ;;
+       *)
+               echo "Compare failed ($RC)!"
+               test $KILLSERVERS != no && kill -HUP $KILLPIDS
+               exit $RC
+       ;;
+esac
+
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
+
+echo ">>>>> Test succeeded"
+exit 0
+
diff --git a/tests/scripts/test036-meta-concurrency b/tests/scripts/test036-meta-concurrency
new file mode 100755 (executable)
index 0000000..68741cd
--- /dev/null
@@ -0,0 +1,216 @@
+#! /bin/sh
+# $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2005 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+
+echo "running defines.sh"
+. $SRCDIR/scripts/defines.sh
+
+echo ""
+
+if test $BACKMETA = metano ; then 
+       echo "meta backend not available, test skipped"
+       exit 0
+fi
+
+# to be removed some time...
+if test "x$TEST_META" != "xyes" ; then
+       echo "### this test is currently disabled;"
+       echo "### set \"TEST_META=yes\" to enable (at own risk)."
+       echo ""
+       exit 0
+else
+       echo "### this test is __very__ experimental; enable at own risk"
+       echo ""
+fi
+
+rm -rf $TESTDIR
+
+mkdir -p $TESTDIR $DBDIR1 $DBDIR2
+
+# NOTE: this could be added to all tests...
+if test "$BACKEND" = "bdb" -o "$BACKEND" = "hdb" ; then
+       if test "x$DB_CONFIG" != "x" ; then \
+               if test -f $DB_CONFIG ; then
+                       echo "==> using DB_CONFIG \"$DB_CONFIG\""
+                       cp $DB_CONFIG $DBDIR1
+                       cp $DB_CONFIG $DBDIR2
+               else
+                       echo "==> DB_CONFIG must point to a valid file (ignored)"
+               fi
+       else
+               echo "==> set \"DB_CONFIG\" to the DB_CONFIG file you want to use for the test."
+       fi
+       echo ""
+fi
+
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
+PID=$!
+if test $WAIT != 0 ; then
+    echo PID $PID
+    read foo
+fi
+KILLPIDS="$PID"
+
+echo "Using ldapsearch to check that slapd is running..."
+for i in 0 1 2 3 4 5; do
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
+               'objectclass=*' > /dev/null 2>&1
+       RC=$?
+       if test $RC = 0 ; then
+               break
+       fi
+       echo "Waiting 5 seconds for slapd to start..."
+       sleep 5
+done
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Using ldapadd to populate the database..."
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
+       $LDIFORDERED > $TESTOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapadd failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Starting slapd on TCP/IP port $PORT2..."
+. $CONFFILTER $BACKEND $MONITORDB < $METACONF2 > $CONF2
+$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
+PID=$!
+if test $WAIT != 0 ; then
+    echo PID $PID
+    read foo
+fi
+KILLPIDS="$KILLPIDS $PID"
+
+echo "Using ldapsearch to check that slapd is running..."
+for i in 0 1 2 3 4 5; do
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
+               'objectclass=*' > /dev/null 2>&1
+       RC=$?
+       if test $RC = 0 ; then
+               break
+       fi
+       echo "Waiting 5 seconds for slapd to start..."
+       sleep 5
+done
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Using ldapadd to populate the database..."
+$LDAPADD -D "$METAMANAGERDN" -h $LOCALHOST -p $PORT2 -w $PASSWD < \
+       $LDIFMETA >> $TESTOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapadd failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+echo "Starting slapd on TCP/IP port $PORT3..."
+. $CONFFILTER $BACKEND $MONITORDB < $METACONF > $CONF3
+$SLAPD -f $CONF3 -h $URI3 -d $LVL $TIMING > $LOG3 2>&1 &
+PID=$!
+if test $WAIT != 0 ; then
+    echo PID $PID
+    read foo
+fi
+KILLPIDS="$KILLPIDS $PID"
+
+echo "Using ldapsearch to check that slapd is running..."
+for i in 0 1 2 3 4 5; do
+       $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT3 \
+               'objectclass=*' > /dev/null 2>&1
+       RC=$?
+       if test $RC = 0 ; then
+               break
+       fi
+       echo "Waiting 5 seconds for slapd to start..."
+       sleep 5
+done
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+cat /dev/null > $SEARCHOUT
+
+mkdir -p $TESTDIR/$DATADIR
+METABASEDN="o=Example,c=US"
+for f in $DATADIR/do_* ; do
+       sed -e "s;$BASEDN;$METABASEDN;" $f > $TESTDIR/$f
+done
+
+# add a read that matches only the local database, but selects 
+# also the remote as candidate; this should be removed to compare
+# execution times with test008...
+for f in $TESTDIR/$DATADIR/do_read.* ; do
+       echo "ou=Meta,$METABASEDN" >> $f
+done
+
+# add a read that matches a referral in the local database only, 
+# but selects also the remote as candidate; this should be removed 
+# to compare execution times with test008...
+for f in $TESTDIR/$DATADIR/do_read.* ; do
+       echo "cn=Somewhere,ou=Meta,$METABASEDN" >> $f
+done
+
+echo "Using tester for concurrent server access..."
+$SLAPDTESTER -P "$PROGDIR" -d "$TESTDIR/$DATADIR" -h $LOCALHOST -p $PORT3 -D "cn=Manager,$METABASEDN" -w $PASSWD -l 50 # -r 20
+RC=$?
+
+if test $RC != 0 ; then
+       echo "slapd-tester failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi 
+
+echo "Using ldapsearch to retrieve all the entries..."
+$LDAPSEARCH -S "" -b "$METABASEDN" -h $LOCALHOST -p $PORT3 \
+                       'objectClass=*' > $SEARCHOUT 2>&1
+RC=$?
+
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
+
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       exit $RC
+fi
+
+echo "Filtering ldapsearch results..."
+. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $LDIFFILTER < $METACONCURRENCYOUT > $LDIFFLT
+echo "Comparing filter output..."
+$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
+
+if test $? != 0 ; then
+       echo "comparison failed - meta search/modification didn't succeed"
+       exit 1
+fi
+
+echo ">>>>> Test succeeded"
+exit 0
+