[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
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
ol_with_dyngroup=no
ol_with_proxycache=no
+ ol_with_rwm=no
elif test $ol_enable_ldbm = no ; then
dnl SLAPD without LDBM
BUILD_DYNGROUP=no
BUILD_PROXYCACHE=no
+BUILD_RWM=no
SLAPD_DYNAMIC_OVERLAYS=
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 ----------------------------------------------------------------
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
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)
## 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
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 \
#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;
#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 }
};
#include "portable.h"
+#ifdef SLAPD_OVER_RWM
+
#include <stdio.h>
#include "slap.h"
}
static int
-rwm_init(
+rwm_over_init(
BackendDB *be
)
{
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;
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 */
#include "portable.h"
+#ifdef SLAPD_OVER_RWM
+
#include <stdio.h>
#include <ac/string.h>
return 0;
}
#endif /* ENABLE_REWRITE */
+
+#endif /* SLAPD_OVER_RWM */
#include "portable.h"
+#ifdef SLAPD_OVER_RWM
+
#include <stdio.h>
#include <ac/string.h>
return 0;
}
#endif /* !ENABLE_REWRITE */
+
+#endif /* SLAPD_OVER_RWM */
#include "portable.h"
+#ifdef SLAPD_OVER_RWM
+
#include <stdio.h>
#include <ac/string.h>
ch_free( mapping );
}
+#endif /* SLAPD_OVER_RWM */