LDFLAGS += -L../lib
LIBS += -lradius $(SNMP_LIBS)
MODULE_LIBS = $(STATIC_MODULES)
+VFLAGS = -DRADIUSD_MAJOR_VERSION=$(RADIUSD_MAJOR_VERSION)
+VFLAGS += -DRADIUSD_MINOR_VERSION=$(RADIUSD_MINOR_VERSION)
#
# Not using shared libraries, add in ALL known static modules
$(CC) $(CFLAGS) -c timestr.c
modules.o: modules.c $(INCLUDES)
- $(CC) $(CFLAGS) $(INCLTDL) -c modules.c
+ $(CC) $(CFLAGS) $(VFLAGS) $(INCLTDL) -c modules.c
modcall.o: modcall.c $(INCLUDES)
$(CC) $(CFLAGS) $(INCLTDL) -c modcall.c
{
module_list_t **last, *node;
lt_dlhandle *handle;
+ char module_struct[256];
+ char *p;
/*
* Look through the global module library list for the
/*
* Link to the module's rlm_FOO{} module structure.
*/
- node->module = (module_t *) lt_dlsym(node->handle, module_name);
+ /* module_name has the version embedded; strip it. */
+ strcpy(module_struct, module_name);
+ p = strrchr(module_struct, '-');
+ if (p)
+ *p = '\0';
+ node->module = (module_t *) lt_dlsym(node->handle, module_struct);
if (!node->module) {
radlog(L_ERR|L_CONS, "%s[%d] Failed linking to "
"%s structure in %s: %s\n",
node->insthandle = NULL;
/*
- * Link to the module by name: rlm_FOO
+ * Link to the module by name: rlm_FOO-major.minor
*/
- snprintf(module_name, sizeof(module_name), "rlm_%s", name1);
+ if (strncmp(name1, "rlm_", 4))
+ snprintf(module_name, sizeof(module_name), "rlm_%s-%d.%d",
+ name1, RADIUSD_MAJOR_VERSION, RADIUSD_MINOR_VERSION);
+ else
+ strNcpy(module_name, name1, sizeof(module_name));
+ /* XXX "radiusd.conf" is wrong here; must find cf filename */
node->entry = linkto_module(module_name,
"radiusd.conf", cf_section_lineno(inst_cs));
if (!node->entry) {
#
#######################################################################
$(TARGET).a: $(STATIC_OBJS)
- $(LIBTOOL) --mode=link $(LD) -module -static $(CFLAGS) $(RLM_CFLAGS) $^ -o $@
+ $(LIBTOOL) --mode=link $(LD) -release $(RADIUSD_VERSION) \
+ -module -static $(CFLAGS) $(RLM_CFLAGS) $^ -o $@
#
# If the module is in the list of static modules, then the "dynamic"
endif
$(TARGET).la: $(DYNAMIC_OBJS)
- $(LIBTOOL) --mode=link $(CC) -module $(LINK_MODE) $(CFLAGS) \
- $(RLM_CFLAGS) $(RLM_LDFLAGS) -o $@ -rpath $(libdir) $^ $(RLM_LIBS) $(LIBS)
+ $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \
+ -module $(LINK_MODE) $(CFLAGS) $(RLM_CFLAGS) $(RLM_LDFLAGS) \
+ -o $@ -rpath $(libdir) $^ $(RLM_LIBS) $(LIBS)
#######################################################################
#