]> git.sur5r.net Git - openldap/commitdiff
add rwm overlay configure and make stuff (need autoconf/autoheader ...)
authorPierangelo Masarati <ando@openldap.org>
Tue, 9 Dec 2003 23:50:10 +0000 (23:50 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 9 Dec 2003 23:50:10 +0000 (23:50 +0000)
configure.in
servers/slapd/overlays/Makefile.in
servers/slapd/overlays/overlays.c
servers/slapd/overlays/rwm.c
servers/slapd/overlays/rwmconf.c
servers/slapd/overlays/rwmdn.c
servers/slapd/overlays/rwmmap.c

index 2aeec53862304969f1c09f8e550afc8fb3651821..5d5684f0f48122b8af9c6851264e12408f893dd0 100644 (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)
index c2060025d13c11106bf6f0e3d507cc6daecc9475..0895bd0cc77a40957dd6355a6e872784f8a9755a 100644 (file)
 ## 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 \
index 1e6762cfc685612d6ce077300d684307dcf29e7f..aca15a350d44195b95c6dcb3ed886938b2962c61 100644 (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 }
 };
index 9c8e814ae66a2b44b47d2a0728a9fb94c28259d1..6a52a4df81f3d35e0fb5efadec05c90454711cd4 100644 (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 */
index 6f5812e69ac019179d3890f11032b9cc81c1b169..c0a498f2b6152429b7f37eefdf6c61163b1af96a 100644 (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 */
index d05dbd563478adb5c58560ac83283ae51f1d1f9b..b5da3fdc80bd762d5802e155c75f04439dc23723 100644 (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 */
index 3bbad55526171a327b55726e81248029e767effc..f80f2774ec8527e166ce878a60f039fc0d6ae669 100644 (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 */