From b5bba83a31e8f5c1cf82214ab88c294fe8cf3fd9 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 9 Dec 2003 23:50:10 +0000 Subject: [PATCH] add rwm overlay configure and make stuff (need autoconf/autoheader ...) --- configure.in | 24 ++++++++++++++++++++++++ servers/slapd/overlays/Makefile.in | 9 +++++++-- servers/slapd/overlays/overlays.c | 6 ++++++ servers/slapd/overlays/rwm.c | 15 ++++++++++++--- servers/slapd/overlays/rwmconf.c | 4 ++++ servers/slapd/overlays/rwmdn.c | 4 ++++ servers/slapd/overlays/rwmmap.c | 3 +++ 7 files changed, 60 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 2aeec53862..5d5684f0f4 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/servers/slapd/overlays/Makefile.in b/servers/slapd/overlays/Makefile.in index c2060025d1..0895bd0cc7 100644 --- a/servers/slapd/overlays/Makefile.in +++ b/servers/slapd/overlays/Makefile.in @@ -13,8 +13,10 @@ ## top-level directory of the distribution or, alternatively, at ## . -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 \ diff --git a/servers/slapd/overlays/overlays.c b/servers/slapd/overlays/overlays.c index 1e6762cfc6..aca15a350d 100644 --- a/servers/slapd/overlays/overlays.c +++ b/servers/slapd/overlays/overlays.c @@ -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 } }; diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index 9c8e814ae6..6a52a4df81 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -17,6 +17,8 @@ #include "portable.h" +#ifdef SLAPD_OVER_RWM + #include #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 */ diff --git a/servers/slapd/overlays/rwmconf.c b/servers/slapd/overlays/rwmconf.c index 6f5812e69a..c0a498f2b6 100644 --- a/servers/slapd/overlays/rwmconf.c +++ b/servers/slapd/overlays/rwmconf.c @@ -23,6 +23,8 @@ #include "portable.h" +#ifdef SLAPD_OVER_RWM + #include #include @@ -300,3 +302,5 @@ suffix_massage_config( return 0; } #endif /* ENABLE_REWRITE */ + +#endif /* SLAPD_OVER_RWM */ diff --git a/servers/slapd/overlays/rwmdn.c b/servers/slapd/overlays/rwmdn.c index d05dbd5634..b5da3fdc80 100644 --- a/servers/slapd/overlays/rwmdn.c +++ b/servers/slapd/overlays/rwmdn.c @@ -24,6 +24,8 @@ #include "portable.h" +#ifdef SLAPD_OVER_RWM + #include #include @@ -169,3 +171,5 @@ rwm_dn_massage( return 0; } #endif /* !ENABLE_REWRITE */ + +#endif /* SLAPD_OVER_RWM */ diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index 3bbad55526..f80f2774ec 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -23,6 +23,8 @@ #include "portable.h" +#ifdef SLAPD_OVER_RWM + #include #include @@ -560,3 +562,4 @@ mapping_free( void *v_mapping ) ch_free( mapping ); } +#endif /* SLAPD_OVER_RWM */ -- 2.39.5