Browse code

core: start with a complete module search path

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

Andrei Pelinescu-Onciul authored on 03/04/2009 16:30:30
Showing 3 changed files
... ...
@@ -359,6 +359,14 @@ lex.yy.c: cfg.lex cfg.tab.h $(ALLDEP)
359 359
 cfg.tab.c cfg.tab.h: cfg.y  $(ALLDEP)
360 360
 	$(YACC) $(YACC_FLAGS) $<
361 361
 
362
+nullstring=
363
+space=$(nullstring) $(nullstring)
364
+
365
+modules_search_path=$(subst $(space),:,$(strip\
366
+						$(addprefix $(modules_target),$(modules_dirs))))
367
+
368
+main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
369
+
362 370
 include Makefile.shared
363 371
 
364 372
 ifeq ($(config_mak),1)
... ...
@@ -239,6 +239,7 @@ lib_target = $(prefix)/$(lib_dir)
239 239
 doc_target = $(prefix)/$(doc_dir)
240 240
 
241 241
 
242
+
242 243
 ifeq ($(OS), solaris)
243 244
 #use GNU versions
244 245
 INSTALL ?= ginstall
... ...
@@ -466,10 +467,10 @@ endif
466 466
 
467 467
 C_DEFS= $(extra_defs) \
468 468
 	 -DNAME='"$(MAIN_NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
469
-	 -DOS='$(OS)_' -DOS_QUOTED='"$(OS)"' -DCOMPILER='"$(CC_VER)"' -D__CPU_$(ARCH) -D__OS_$(OS) \
469
+	 -DOS='$(OS)_' -DOS_QUOTED='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
470
+	 -D__CPU_$(ARCH) -D__OS_$(OS) \
470 471
 	 -DSER_VER=$(SER_VER) \
471 472
 	 -DCFG_DIR='"$(cfg_target)"'\
472
-	 -DMODS_DIR='"$(modules_target)"'\
473 473
 	 -DPKG_MALLOC \
474 474
 	 -DSHM_MEM  -DSHM_MMAP \
475 475
 	 -DDNS_IP_HACK \
... ...
@@ -194,7 +194,7 @@ static char help_msg[]= "\
194 194
 Usage: " NAME " [options]\n\
195 195
 Options:\n\
196 196
     -f file      Configuration file (default: " CFG_FILE ")\n\
197
-    -L dir       Modules directory (default: " MODS_DIR ")\n\
197
+    -L path      Modules search path (default: " MODS_DIR ")\n\
198 198
     -c           Check configuration file for errors\n\
199 199
     -l address   Listen on the specified address/interface (multiple -l\n\
200 200
                   mean listening on more addresses).  The address format is\n\
... ...
@@ -283,7 +283,7 @@ void receive_stdin_loop()
283 283
 int own_pgid = 0; /* whether or not we have our own pgid (and it's ok
284 284
 					 to use kill(0, sig) */
285 285
 
286
-char* mods_dir = MODS_DIR;  /* directory with dyn. loadable modules */
286
+char* mods_dir = MODS_DIR;  /* search path for dyn. loadable modules */
287 287
 
288 288
 char* cfg_file = 0;
289 289
 unsigned int maxbuffer = MAX_RECV_BUFFER_SIZE; /* maximum buffer size we do