[SR-Dev] git:master: core: start with a complete module search path

Andrei Pelinescu-Onciul andrei at iptel.org
Fri Apr 3 18:31:57 CEST 2009


Module: sip-router
Branch: master
Commit: c82fe029711cf9eda4f49522d446285e97bc5ce2
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c82fe029711cf9eda4f49522d446285e97bc5ce2

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Fri Apr  3 18:30:30 2009 +0200

core: start with a complete module search path

- set the default module search path in function of the selected
  modules_dirs.

---

 Makefile      |    8 ++++++++
 Makefile.defs |    5 +++--
 main.c        |    4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index fe0c6b3..5ed6935 100644
--- a/Makefile
+++ b/Makefile
@@ -359,6 +359,14 @@ lex.yy.c: cfg.lex cfg.tab.h $(ALLDEP)
 cfg.tab.c cfg.tab.h: cfg.y  $(ALLDEP)
 	$(YACC) $(YACC_FLAGS) $<
 
+nullstring=
+space=$(nullstring) $(nullstring)
+
+modules_search_path=$(subst $(space),:,$(strip\
+						$(addprefix $(modules_target),$(modules_dirs))))
+
+main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
+
 include Makefile.shared
 
 ifeq ($(config_mak),1)
diff --git a/Makefile.defs b/Makefile.defs
index e7794ad..2687d0a 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -239,6 +239,7 @@ lib_target = $(prefix)/$(lib_dir)
 doc_target = $(prefix)/$(doc_dir)
 
 
+
 ifeq ($(OS), solaris)
 #use GNU versions
 INSTALL ?= ginstall
@@ -466,10 +467,10 @@ endif
 
 C_DEFS= $(extra_defs) \
 	 -DNAME='"$(MAIN_NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
-	 -DOS='$(OS)_' -DOS_QUOTED='"$(OS)"' -DCOMPILER='"$(CC_VER)"' -D__CPU_$(ARCH) -D__OS_$(OS) \
+	 -DOS='$(OS)_' -DOS_QUOTED='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
+	 -D__CPU_$(ARCH) -D__OS_$(OS) \
 	 -DSER_VER=$(SER_VER) \
 	 -DCFG_DIR='"$(cfg_target)"'\
-	 -DMODS_DIR='"$(modules_target)"'\
 	 -DPKG_MALLOC \
 	 -DSHM_MEM  -DSHM_MMAP \
 	 -DDNS_IP_HACK \
diff --git a/main.c b/main.c
index 868572f..228e6f3 100644
--- a/main.c
+++ b/main.c
@@ -194,7 +194,7 @@ static char help_msg[]= "\
 Usage: " NAME " [options]\n\
 Options:\n\
     -f file      Configuration file (default: " CFG_FILE ")\n\
-    -L dir       Modules directory (default: " MODS_DIR ")\n\
+    -L path      Modules search path (default: " MODS_DIR ")\n\
     -c           Check configuration file for errors\n\
     -l address   Listen on the specified address/interface (multiple -l\n\
                   mean listening on more addresses).  The address format is\n\
@@ -283,7 +283,7 @@ void receive_stdin_loop()
 int own_pgid = 0; /* whether or not we have our own pgid (and it's ok
 					 to use kill(0, sig) */
 
-char* mods_dir = MODS_DIR;  /* directory with dyn. loadable modules */
+char* mods_dir = MODS_DIR;  /* search path for dyn. loadable modules */
 
 char* cfg_file = 0;
 unsigned int maxbuffer = MAX_RECV_BUFFER_SIZE; /* maximum buffer size we do




More information about the sr-dev mailing list