[svn-commits] kpfleming: branch group/new_loader_completion r40553 - in /team/group/new_loa...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Aug 19 15:51:47 MST 2006


Author: kpfleming
Date: Sat Aug 19 17:51:46 2006
New Revision: 40553

URL: http://svn.digium.com/view/asterisk?rev=40553&view=rev
Log:
begin providing support for platforms that cannot load dynamic modules

Modified:
    team/group/new_loader_completion/build_tools/cflags.xml
    team/group/new_loader_completion/main/Makefile
    team/group/new_loader_completion/main/loader.c

Modified: team/group/new_loader_completion/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/build_tools/cflags.xml?rev=40553&r1=40552&r2=40553&view=diff
==============================================================================
--- team/group/new_loader_completion/build_tools/cflags.xml (original)
+++ team/group/new_loader_completion/build_tools/cflags.xml Sat Aug 19 17:51:46 2006
@@ -23,4 +23,7 @@
 		</member>
 		<member name="STATIC_BUILD" displayname="Build static binaries">
 		</member>
+		<member name="LOADABLE_MODULES" displayname="Runtime module loading">
+			<defaultenabled>yes</defaultenabled>
+		</member>
 	</category>

Modified: team/group/new_loader_completion/main/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/main/Makefile?rev=40553&r1=40552&r2=40553&view=diff
==============================================================================
--- team/group/new_loader_completion/main/Makefile (original)
+++ team/group/new_loader_completion/main/Makefile Sat Aug 19 17:51:46 2006
@@ -13,7 +13,9 @@
 
 include $(ASTTOPDIR)/menuselect.makeopts
 include $(ASTTOPDIR)/menuselect.makedeps
+ifneq ($(wildcard $(ASTTOPDIR)/makeopts.embed_rules),)
 include $(ASTTOPDIR)/makeopts.embed_rules
+endif
 
 all: asterisk
 
@@ -47,7 +49,10 @@
 endif
 
 ifeq ($(OSARCH),Linux)
-  AST_LIBS+=-ldl -lpthread $(EDITLINE_LIB) -lm -lresolv  #-lnjamd
+  ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
+  AST_LIBS+=-ldl
+  endif
+  AST_LIBS+=-lpthread $(EDITLINE_LIB) -lm -lresolv  #-lnjamd
 else
   AST_LIBS+=$(EDITLINE_LIB) -lm
 endif

Modified: team/group/new_loader_completion/main/loader.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/main/loader.c?rev=40553&r1=40552&r2=40553&view=diff
==============================================================================
--- team/group/new_loader_completion/main/loader.c (original)
+++ team/group/new_loader_completion/main/loader.c Sat Aug 19 17:51:46 2006
@@ -323,7 +323,10 @@
 
 		AST_LIST_REMOVE_CURRENT(&module_list, entry);
 
+#if LOADABLE_MODULES
 		dlclose(cur->lib);
+#endif
+
 		free_module(cur);
 
 		break;
@@ -463,7 +466,11 @@
 	else
 		snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_MODULE_DIR, resource_name);
 
-	if (!(cur->lib = dlopen(fn, RTLD_NOW | RTLD_LOCAL))) {
+#if LOADABLE_MODULES
+	cur->lib = dlopen(fn, RTLD_NOW | RTLD_LOCAL);
+#endif
+	
+	if (!cur->lib) {
 		ast_log(LOG_WARNING, "%s\n", dlerror());
 		free(cur);
 		return NULL;



More information about the svn-commits mailing list