Module: sip-router
Branch: master
Commit: a88b7d6f18d98ed877b6295dbc9526155dbd688e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a88b7d6…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed May 6 17:48:05 2009 +0200
make: fix the module path in installed cfg
- fix: the module path is updated in the installed cfg and man
pages (broken when the multiple modules were added).
---
Makefile | 16 +++++++++++-----
Makefile.defs | 4 ++--
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 4079bb7..160f1c4 100644
--- a/Makefile
+++ b/Makefile
@@ -382,7 +382,8 @@ nullstring=
space=$(nullstring) $(nullstring)
modules_search_path=$(subst $(space),:,$(strip\
- $(addprefix $(modules_target),$(modules_dirs))))
+ $(foreach m,$(modules_dirs),$($(m)_target))))
+ # $(addprefix $(modules_target),$(modules_dirs))))
main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
@@ -455,6 +456,7 @@ print-modules:
define MODULES_RULES_template
$(1)_dst=$(modules_prefix)/$(modules_dir)$(1)
+$(1)_target=$(prefix)/$(modules_dir)$(1)
.PHONY: $(1)
$(1): modules.lst
@@ -738,7 +740,8 @@ $(man_prefix)/$(man_dir)/man5:
# note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...)
install-cfg: $(cfg_prefix)/$(cfg_dir)
- sed -e "s#/usr/.*lib/ser/modules/#$(modules-target)#g" \
+ sed $(foreach m,$(modules_dirs),\
+ -e "s#/usr/[^:]*lib/ser/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
< etc/ser-basic.cfg > $(cfg_prefix)/$(cfg_dir)ser.cfg.sample
chmod 644 $(cfg_prefix)/$(cfg_dir)ser.cfg.sample
if [ -z "${skip_cfg_install}" -a \
@@ -746,7 +749,8 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
mv -f $(cfg_prefix)/$(cfg_dir)ser.cfg.sample \
$(cfg_prefix)/$(cfg_dir)ser.cfg; \
fi
- sed -e "s#/usr/.*lib/ser/modules/#$(modules-target)#g" \
+ sed $(foreach m,$(modules_dirs),\
+ -e "s#/usr/[^:]*lib/ser/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
< etc/ser-oob.cfg \
$(cfg_prefix)/$(cfg_dir)ser-advanced.cfg.sample
chmod 644 $(cfg_prefix)/$(cfg_dir)ser-advanced.cfg.sample
@@ -850,13 +854,15 @@ install-doc: $(doc_prefix)/$(doc_dir) install-every-module-doc
install-ser-man: $(man_prefix)/$(man_dir)/man8 $(man_prefix)/$(man_dir)/man5
sed -e "s#/etc/ser/ser\.cfg#$(cfg_target)ser.cfg#g" \
-e "s#/usr/sbin/#$(bin_target)#g" \
- -e "s#/usr/lib/ser/modules/#$(modules_target)#g" \
+ $(foreach m,$(modules_dirs),\
+ -e "s#/usr/lib/ser/$(m)\([^_]\)#$($(m)_target)\1#g") \
-e "s#/usr/share/doc/ser/#$(doc_target)#g" \
< ser.8 > $(man_prefix)/$(man_dir)/man8/ser.8
chmod 644 $(man_prefix)/$(man_dir)/man8/ser.8
sed -e "s#/etc/ser/ser\.cfg#$(cfg_target)ser.cfg#g" \
-e "s#/usr/sbin/#$(bin_target)#g" \
- -e "s#/usr/lib/ser/modules/#$(modules_target)#g" \
+ $(foreach m,$(modules_dirs),\
+ -e "s#/usr/lib/ser/$(m)\([^_]\)#$($(m)_target)\1#g") \
-e "s#/usr/share/doc/ser/#$(doc_target)#g" \
< ser.cfg.5 > $(man_prefix)/$(man_dir)/man5/ser.cfg.5
chmod 644 $(man_prefix)/$(man_dir)/man5/ser.cfg.5
diff --git a/Makefile.defs b/Makefile.defs
index c2b23a8..1bead07 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -234,7 +234,7 @@ share_prefix = $(basedir)$(prefix)
# target dirs for various stuff
cfg_target = $(prefix)/$(cfg_dir)
bin_target = $(prefix)/$(bin_dir)
-modules_target = $(prefix)/$(modules_dir)
+#modules_target = $(prefix)/$(modules_dir)
lib_target = $(prefix)/$(lib_dir)
doc_target = $(prefix)/$(doc_dir)
@@ -1709,7 +1709,7 @@ saved_chg_vars:=\
cfg_prefix cfg_dir bin_prefix bin_dir modules_prefix modules_dir \
doc_prefix doc_dir man_prefix man_dir ut_prefix ut_dir \
share_prefix share_dir lib_prefix lib_dir \
- cfg_target lib_target modules_target
+ cfg_target lib_target
#export relevant variables to the sub-makes