#! /bin/sh
# $OpenLDAP$
-# from OpenLDAP: pkg/ldap/configure.in,v 1.560 2004/12/04 18:48:48 hyc Exp
+# from OpenLDAP: pkg/ldap/configure.in,v 1.561 2005/01/01 19:49:37 kurt Exp
# This work is part of OpenLDAP Software <http://www.openldap.org/>.
#
PLAT=UNIX
fi
-if test -z "$SLAPD_STATIC_BACKENDS"; then
- SLAPD_NO_STATIC='#'
-else
- SLAPD_NO_STATIC=
-fi
-
-BACKEND_HEADER=servers/slapd/backend.h
-cat > $BACKEND_HEADER << EOF
-/* 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>.
- */
-/* This file is automatically generated by configure; please do not edit.
- */
-
-EOF
-
-for b in $SLAPD_STATIC_BACKENDS; do
- bb=`echo "$b" | sed -e 's;back-;;'`
-
- cat >> $BACKEND_HEADER << EOF
-extern BI_init ${bb}_back_initialize;
-EOF
-done
-
-cat >> $BACKEND_HEADER << EOF
-
-static BackendInfo binfo[] = {
-EOF
-
-for b in $SLAPD_STATIC_BACKENDS; do
- bb=`echo "$b" | sed -e 's;back-;;'`
-
- cat >> $BACKEND_HEADER << EOF
- { "$bb", ${bb}_back_initialize },
-EOF
-done
-
-cat >> $BACKEND_HEADER << EOF
- { NULL, NULL }
-};
-
-/* end of generated file */
-EOF
-
EOF
cat >> $CONFIG_STATUS <<EOF
-
+STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"
EOF
cat >> $CONFIG_STATUS <<\EOF
chmod +x tests/run
date > stamp-h
+BACKENDSC="servers/slapd/backends.c"
+echo "Making $BACKENDSC"
+rm -f $BACKENDSC
+cat > $BACKENDSC << ENDX
+/* 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>.
+ */
+/* This file is automatically generated by configure; please do not edit. */
+
+#include "portable.h"
+#include "slap.h"
+
+ENDX
+if test "${STATIC_BACKENDS}"; then
+ for b in ${STATIC_BACKENDS}; do
+ bb=`echo "${b}" | sed -e 's/back-//'`
+ cat >> $BACKENDSC << ENDX
+extern BI_init ${bb}_back_initialize;
+ENDX
+ done
+
+ cat >> $BACKENDSC << ENDX
+
+BackendInfo slap_binfo[] = {
+ENDX
+
+ for b in ${STATIC_BACKENDS}; do
+ bb=`echo "${b}" | sed -e 's/back-//'`
+ echo " Add ${bb} ..."
+ cat >> $BACKENDSC << ENDX
+ { "${bb}", ${bb}_back_initialize },
+ENDX
+ done
+
+ cat >> $BACKENDSC << ENDX
+ { NULL, NULL },
+};
+
+/* end of generated file */
+ENDX
+fi
+
echo Please run \"make depend\" to build dependencies
exit 0
PLAT=UNIX
fi
-if test -z "$SLAPD_STATIC_BACKENDS"; then
- SLAPD_NO_STATIC='#'
-else
- SLAPD_NO_STATIC=
-fi
-
-dnl Generate static backend header file
-BACKEND_HEADER=servers/slapd/backend.h
-cat > $BACKEND_HEADER << EOF
-/* 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>.
- */
-/* This file is automatically generated by configure; please do not edit.
- */
-
-EOF
-
-for b in $SLAPD_STATIC_BACKENDS; do
- bb=`echo "$b" | sed -e 's;back-;;'`
-
- cat >> $BACKEND_HEADER << EOF
-extern BI_init ${bb}_back_initialize;
-EOF
-done
-
-cat >> $BACKEND_HEADER << EOF
-
-static BackendInfo binfo[[]] = {
-EOF
-
-for b in $SLAPD_STATIC_BACKENDS; do
- bb=`echo "$b" | sed -e 's;back-;;'`
-
- cat >> $BACKEND_HEADER << EOF
- { "$bb", ${bb}_back_initialize },
-EOF
-done
-
-cat >> $BACKEND_HEADER << EOF
- { NULL, NULL }
-};
-
-/* end of generated file */
-EOF
-dnl done generating static backend header file
-
AC_SUBST(LIBSRCS)
AC_SUBST(PLAT)
AC_SUBST(WITH_SASL)
,[
chmod +x tests/run
date > stamp-h
+BACKENDSC="servers/slapd/backends.c"
+echo "Making $BACKENDSC"
+rm -f $BACKENDSC
+cat > $BACKENDSC << ENDX
+/* 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>.
+ */
+/* This file is automatically generated by configure; please do not edit. */
+
+#include "portable.h"
+#include "slap.h"
+
+ENDX
+if test "${STATIC_BACKENDS}"; then
+ for b in ${STATIC_BACKENDS}; do
+ bb=`echo "${b}" | sed -e 's/back-//'`
+ cat >> $BACKENDSC << ENDX
+extern BI_init ${bb}_back_initialize;
+ENDX
+ done
+
+ cat >> $BACKENDSC << ENDX
+
+BackendInfo slap_binfo[[]] = {
+ENDX
+
+ for b in ${STATIC_BACKENDS}; do
+ bb=`echo "${b}" | sed -e 's/back-//'`
+ echo " Add ${bb} ..."
+ cat >> $BACKENDSC << ENDX
+ { "${bb}", ${bb}_back_initialize },
+ENDX
+ done
+
+ cat >> $BACKENDSC << ENDX
+ { NULL, NULL },
+};
+
+/* end of generated file */
+ENDX
+fi
+
echo Please run \"make depend\" to build dependencies
-])
+],[STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"])
SLAPTOOLS=slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl
PROGRAMS=slapd $(SLAPTOOLS)
XPROGRAMS=sslapd libbackends.a .backend liboverlays.a
-XSRCS=version.c
+XSRCS=version.c backends.c
SUBDIRS=back-* shell-backends slapi overlays
all-local-srv: all-cffiles
NT_SLAPD_DEPENDS = slapd.exp
-NT_SLAPD_OBJECTS = slapd.exp symdummy.o $(OBJS) version.o
+NT_SLAPD_OBJECTS = slapd.exp symdummy.o $(OBJS) backends.o version.o
-UNIX_SLAPD_DEPENDS = $(SLAPD_STATIC_DEPENDS) version.o $(SLAPD_L)
-UNIX_SLAPD_OBJECTS = $(OBJS) version.o
+UNIX_SLAPD_DEPENDS = $(SLAPD_STATIC_DEPENDS) backends.o version.o $(SLAPD_L)
+UNIX_SLAPD_OBJECTS = $(OBJS) backends.o version.o
SLAPD_DEPENDS = liboverlays.a $(@PLAT@_SLAPD_DEPENDS)
SLAPD_OBJECTS = $(@PLAT@_SLAPD_OBJECTS)
liboverlays.a: FORCE
@cd overlays; $(MAKE) $(MFLAGS) all
-backend.c: backend.h
-
version.c: Makefile
@-$(RM) $@
$(MKVERSION) -s -n Versionstr slapd > $@
* imported into slapd without appropriate __declspec(dllimport) directives.
*/
-/*
- * This file is automatically generated by configure; it defines
- * the BackendInfo binfo[] structure with the configured static
- * backend info. It assumes that every backend of type <name>
- * provides an initialization function
- *
- * int name_back_initialize( BackendInfo *bi )
- *
- * that populates the rest of the structure.
- */
-
-#include "backend.h"
-
int nBackendInfo = 0;
BackendInfo *backendInfo = NULL;
}
for( ;
- binfo[nBackendInfo].bi_type != NULL;
+ slap_binfo[nBackendInfo].bi_type != NULL;
nBackendInfo++ )
{
- assert( binfo[nBackendInfo].bi_init );
+ assert( slap_binfo[nBackendInfo].bi_init );
- rc = binfo[nBackendInfo].bi_init( &binfo[nBackendInfo] );
+ rc = slap_binfo[nBackendInfo].bi_init( &slap_binfo[nBackendInfo] );
if(rc != 0) {
Debug( LDAP_DEBUG_ANY,
"backend_init: initialized for type \"%s\"\n",
- binfo[nBackendInfo].bi_type, 0, 0 );
+ slap_binfo[nBackendInfo].bi_type, 0, 0 );
/* destroy those we've already inited */
for( nBackendInfo--;
nBackendInfo >= 0 ;
nBackendInfo-- )
{
- if ( binfo[nBackendInfo].bi_destroy ) {
- binfo[nBackendInfo].bi_destroy(
- &binfo[nBackendInfo] );
+ if ( slap_binfo[nBackendInfo].bi_destroy ) {
+ slap_binfo[nBackendInfo].bi_destroy(
+ &slap_binfo[nBackendInfo] );
}
}
return rc;
}
if ( nBackendInfo > 0) {
- backendInfo = binfo;
+ backendInfo = slap_binfo;
return 0;
}
{
BackendInfo *newBackendInfo = 0;
- /* if backendInfo == binfo no deallocation of old backendInfo */
- if (backendInfo == binfo) {
+ /* 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);
}
#ifdef SLAPD_MODULES
- if (backendInfo != binfo) {
+ if (backendInfo != slap_binfo) {
free(backendInfo);
}
#endif /* SLAPD_MODULES */
SlapReply *rs
));
+LDAP_SLAPD_V(BackendInfo) slap_binfo[];
+
/*
* backglue.c
*/