add rwm overlay configure and make stuff (need autoconf/autoheader ...)

This commit is contained in:
Pierangelo Masarati 2003-12-09 23:50:10 +00:00
parent 0176e02398
commit b5bba83a31
7 changed files with 60 additions and 5 deletions

View file

@ -247,6 +247,8 @@ OL_ARG_WITH(dyngroup,[ --with-dyngroup Dynamic Group overlay no|yes|mod], n
[no yes mod])
OL_ARG_WITH(proxycache,[ --with-proxycache Proxy Cache overlay no|yes|mod], no,
[no yes mod])
OL_ARG_WITH(rwm,[ --with-rwm Rewrite/Remap overlay no|yes|mod], no,
[no yes mod])
dnl ----------------------------------------------------------------
dnl SLURPD OPTIONS
@ -374,6 +376,9 @@ if test $ol_enable_slapd = no ; then
if test $ol_with_proxycache != no ; then
AC_MSG_WARN([slapd disabled, ignoring --with-proxycache argument])
fi
if test $ol_with_rwm != no ; then
AC_MSG_WARN([slapd disabled, ignoring --with-rwm argument])
fi
# force settings to no
ol_enable_slapi=no
@ -418,6 +423,7 @@ if test $ol_enable_slapd = no ; then
ol_with_dyngroup=no
ol_with_proxycache=no
ol_with_rwm=no
elif test $ol_enable_ldbm = no ; then
dnl SLAPD without LDBM
@ -578,6 +584,7 @@ BUILD_SQL_DYNAMIC=static
BUILD_DYNGROUP=no
BUILD_PROXYCACHE=no
BUILD_RWM=no
SLAPD_DYNAMIC_OVERLAYS=
@ -814,6 +821,10 @@ else
AC_MSG_WARN([building static proxycache overlay])
ol_with_proxycache = yes
fi
if test $ol_with_rwm = mod ; then
AC_MSG_WARN([building static rwm overlay])
ol_with_rwm = yes
fi
fi
dnl ----------------------------------------------------------------
@ -2766,6 +2777,18 @@ if test "$ol_with_proxycache" != no ; then
AC_DEFINE_UNQUOTED(SLAPD_OVER_PROXYCACHE,$MFLAG,[define for Proxy Cache overlay])
fi
if test "$ol_with_rwm " != no ; then
BUILD_REWRITE=yes
BUILD_RWM=$ol_with_rwm
if test "$ol_with_rwm" = mod ; then
MFLAG=SLAPD_MOD_DYNAMIC
SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS rwm.la"
else
MFLAG=SLAPD_MOD_STATIC
fi
AC_DEFINE_UNQUOTED(SLAPD_OVER_RWM,$MFLAG,[define for Rewrite/Remap overlay])
fi
if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
$BUILD_SLAPD = yes ; then
BUILD_SLURPD=yes
@ -2836,6 +2859,7 @@ AC_SUBST(BUILD_SLAPD)
AC_SUBST(BUILD_SQL_DYNAMIC)
AC_SUBST(BUILD_DYNGROUP)
AC_SUBST(BUILD_PROXYCACHE)
AC_SUBST(BUILD_RWM)
AC_SUBST(BUILD_SLURPD)
AC_SUBST(LDAP_LIBS)

View file

@ -13,8 +13,10 @@
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
SRCS = overlays.c dyngroup.c pcache.c
OBJS = overlays.lo dyngroup.lo pcache.lo
SRCS = overlays.c dyngroup.c pcache.c \
rwm.c rwmconf.c rwmdn.c rwmmap.c
OBJS = overlays.lo dyngroup.lo pcache.lo \
rwm.lo rwmconf.lo rwmdn.lo rwmmap.lo
LDAP_INCDIR= ../../../include
LDAP_LIBDIR= ../../../libraries
@ -37,6 +39,9 @@ dyngroup.la : dyngroup.lo $(@PLAT@_LINK_LIBS)
pcache.la : pcache.lo $(@PLAT@_LINK_LIBS)
$(LTLINK_MOD) -module -o $@ pcache.lo version.lo $(LINK_LIBS)
rwm.la : rwm.lo $(@PLAT@_LINK_LIBS)
$(LTLINK_MOD) -module -o $@ rwm.lo rwmconf.lo rwmdn.lo rwmmap.lo version.lo $(LINK_LIBS)
install-local: $(PROGRAMS)
@-$(MKDIR) $(DESTDIR)$(moduledir)
@for i in $? ; do \

View file

@ -30,6 +30,9 @@ extern int dyngroup_init();
#if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_STATIC
extern int pcache_init();
#endif
#if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
extern int rwm_init();
#endif
static struct {
char *name;
@ -40,6 +43,9 @@ static struct {
#endif
#if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_STATIC
{ "Proxy Cache", pcache_init },
#endif
#if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
{ "Rewrite/Remap", rwm_init },
#endif
{ NULL, NULL }
};

View file

@ -17,6 +17,8 @@
#include "portable.h"
#ifdef SLAPD_OVER_RWM
#include <stdio.h>
#include "slap.h"
@ -521,7 +523,7 @@ rwm_config(
}
static int
rwm_init(
rwm_over_init(
BackendDB *be
)
{
@ -582,12 +584,12 @@ rwm_destroy(
static slap_overinst rwm = { { NULL } };
int
init_module(void)
rwm_init(void)
{
memset( &rwm, 0, sizeof(slap_overinst) );
rwm.on_bi.bi_type = "rewrite-remap";
rwm.on_bi.bi_db_init = rwm_init;
rwm.on_bi.bi_db_init = rwm_over_init;
rwm.on_bi.bi_db_config = rwm_config;
rwm.on_bi.bi_db_destroy = rwm_destroy;
@ -605,3 +607,10 @@ init_module(void)
return overlay_register( &rwm );
}
#if SLAPD_OVER_RWM == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[]) {
return rwm_init();
}
#endif
#endif /* SLAPD_OVER_RWM */

View file

@ -23,6 +23,8 @@
#include "portable.h"
#ifdef SLAPD_OVER_RWM
#include <stdio.h>
#include <ac/string.h>
@ -300,3 +302,5 @@ suffix_massage_config(
return 0;
}
#endif /* ENABLE_REWRITE */
#endif /* SLAPD_OVER_RWM */

View file

@ -24,6 +24,8 @@
#include "portable.h"
#ifdef SLAPD_OVER_RWM
#include <stdio.h>
#include <ac/string.h>
@ -169,3 +171,5 @@ rwm_dn_massage(
return 0;
}
#endif /* !ENABLE_REWRITE */
#endif /* SLAPD_OVER_RWM */

View file

@ -23,6 +23,8 @@
#include "portable.h"
#ifdef SLAPD_OVER_RWM
#include <stdio.h>
#include <ac/string.h>
@ -560,3 +562,4 @@ mapping_free( void *v_mapping )
ch_free( mapping );
}
#endif /* SLAPD_OVER_RWM */