Replace backend.h with backends.c, generated by config.status.

This commit is contained in:
Kurt Zeilenga 2005-01-09 08:42:44 +00:00
parent 0ea4070eb1
commit 7dc0b02fc9
5 changed files with 124 additions and 143 deletions

110
configure vendored
View File

@ -1,6 +1,6 @@
#! /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/>.
#
@ -25282,60 +25282,6 @@ else
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
@ -25910,12 +25856,64 @@ fi; done
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

View File

@ -2924,62 +2924,6 @@ else
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)
@ -3108,5 +3052,57 @@ tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
,[
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"])

View File

@ -16,7 +16,7 @@
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
@ -80,10 +80,10 @@ BUILD_SRV = @BUILD_SLAPD@
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)
@ -313,8 +313,6 @@ libbackends.a: .backend
liboverlays.a: FORCE
@cd overlays; $(MAKE) $(MFLAGS) all
backend.c: backend.h
version.c: Makefile
@-$(RM) $@
$(MKVERSION) -s -n Versionstr slapd > $@

View File

@ -56,19 +56,6 @@ static void call_group_postop_plugins( Operation *op );
* 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;
@ -92,25 +79,25 @@ int backend_init(void)
}
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;
@ -118,7 +105,7 @@ int backend_init(void)
}
if ( nBackendInfo > 0) {
backendInfo = binfo;
backendInfo = slap_binfo;
return 0;
}
@ -156,8 +143,8 @@ int backend_add(BackendInfo *aBackendInfo)
{
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);
@ -431,7 +418,7 @@ int backend_destroy(void)
}
#ifdef SLAPD_MODULES
if (backendInfo != binfo) {
if (backendInfo != slap_binfo) {
free(backendInfo);
}
#endif /* SLAPD_MODULES */

View File

@ -296,6 +296,8 @@ LDAP_SLAPD_F (int) backend_operational LDAP_P((
SlapReply *rs
));
LDAP_SLAPD_V(BackendInfo) slap_binfo[];
/*
* backglue.c
*/