Module: sip-router
Branch: master
Commit: 68ed88ef4ef01789159a4e77302a9ddd8dca442d
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=68ed88e…
Author: Carsten Bock <lists(a)bock.info>
Committer: Carsten Bock <lists(a)bock.info>
Date: Tue Aug 31 16:42:05 2010 +0200
Merge remote branch 'origin/carstenbock/rtpproxy2'
* origin/carstenbock/rtpproxy2:
- Updated the patch to the latest changes (see previous commit)
Add a parameter for the type of the RTP-Timeout-Socket (defaults to 1 for Kamailio-XMLRPC)
Added the changes to the RTP-Proxy as a patch, for easier review.
- fixed identation
The Timeout socket must be sent with Update after session confirmation.
Tiny typo.
- added support for the retrieval of RTP-Statistics through $rtpstat
---
Module: sip-router
Branch: master
Commit: e8b64a9db7487233e6ddea10ea7b504e0a4484f6
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e8b64a9…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Mon Aug 30 13:28:17 2010 +0200
doc: dump_*.pl: support for gcc 4.5
- support for gcc 4.5 (gcc 4.5 will produce the translation unit
dump file in the same directory as the output file, while older
versions will always write it in the current directory).
- be more verbose on gcc error (display the complete gcc command line)
- cleanup temporary files even in the error case
---
doc/scripts/cdefs2doc/dump_cfg_defs.pl | 17 ++++++++++++++---
doc/scripts/cdefs2doc/dump_rpcs.pl | 17 ++++++++++++++---
doc/scripts/cdefs2doc/dump_selects.pl | 17 ++++++++++++++---
3 files changed, 42 insertions(+), 9 deletions(-)
diff --git a/doc/scripts/cdefs2doc/dump_cfg_defs.pl b/doc/scripts/cdefs2doc/dump_cfg_defs.pl
index 48e199b..ebf14af 100755
--- a/doc/scripts/cdefs2doc/dump_cfg_defs.pl
+++ b/doc/scripts/cdefs2doc/dump_cfg_defs.pl
@@ -228,9 +228,20 @@ if (! defined $opt_is_tu){
# => we have to create one
$src_fname=basename($file);
$tmp_file = "/tmp/" . mktemp ("dump_translation_unit_XXXXXX");
- system("$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file.o && \
- mv \"$src_fname\".001t.tu $tmp_file") == 0 or
- die "$gcc failed to generate a translation unit dump from $file";
+ # Note: gcc < 4.5 will produce the translation unit dump in a file in
+ # the current directory. gcc 4.5 will write it in the same directory as
+ # the output file.
+ system("$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file") == 0
+ or die "$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file" .
+ " failed to generate a translation unit dump from $file";
+ if (system("if [ -f \"$src_fname\".001t.tu ]; then \
+ mv \"$src_fname\".001t.tu $tmp_file; \
+ else mv /tmp/\"$src_fname\".001t.tu $tmp_file; fi ") != 0) {
+ unlink($tmp_file, "$tmp_file.o");
+ die "could not find the gcc translation unit dump file" .
+ " ($src_fname.001t.tu) neither in the current directory" .
+ " or /tmp";
+ };
$tu=GCC::TranslationUnit::Parser->parsefile($tmp_file);
print(STDERR "src name $src_fname\n") if $dbg;
unlink($tmp_file, "$tmp_file.o");
diff --git a/doc/scripts/cdefs2doc/dump_rpcs.pl b/doc/scripts/cdefs2doc/dump_rpcs.pl
index 706ec80..63c222e 100755
--- a/doc/scripts/cdefs2doc/dump_rpcs.pl
+++ b/doc/scripts/cdefs2doc/dump_rpcs.pl
@@ -221,9 +221,20 @@ if (! defined $opt_is_tu){
# => we have to create one
$src_fname=basename($file);
$tmp_file = "/tmp/" . mktemp ("dump_translation_unit_XXXXXX");
- system("$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file && \
- mv \"$src_fname\".001t.tu $tmp_file") == 0 or
- die "$gcc failed to generate a translation unit dump from $file";
+ # Note: gcc < 4.5 will produce the translation unit dump in a file in
+ # the current directory. gcc 4.5 will write it in the same directory as
+ # the output file.
+ system("$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file") == 0
+ or die "$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file" .
+ " failed to generate a translation unit dump from $file";
+ if (system("if [ -f \"$src_fname\".001t.tu ]; then \
+ mv \"$src_fname\".001t.tu $tmp_file; \
+ else mv /tmp/\"$src_fname\".001t.tu $tmp_file; fi ") != 0) {
+ unlink($tmp_file, "$tmp_file.o");
+ die "could not find the gcc translation unit dump file" .
+ " ($src_fname.001t.tu) neither in the current directory" .
+ " or /tmp";
+ };
$tu=GCC::TranslationUnit::Parser->parsefile($tmp_file);
print(STDERR "src name $src_fname\n") if $dbg;
unlink($tmp_file, "$tmp_file.o");
diff --git a/doc/scripts/cdefs2doc/dump_selects.pl b/doc/scripts/cdefs2doc/dump_selects.pl
index aea0018..76aa5d9 100755
--- a/doc/scripts/cdefs2doc/dump_selects.pl
+++ b/doc/scripts/cdefs2doc/dump_selects.pl
@@ -391,9 +391,20 @@ sub process_file
# => we have to create one
$src_fname=basename($file);
$tmp_file = "/tmp/" . mktemp ("dump_translation_unit_XXXXXX");
- system("$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file && \
- mv \"$src_fname\".001t.tu $tmp_file") == 0 or
- die "$gcc failed to generate a translation unit dump from $file";
+ # Note: gcc < 4.5 will produce the translation unit dump in a file in
+ # the current directory. gcc 4.5 will write it in the same directory as
+ # the output file.
+ system("$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file") == 0
+ or die "$gcc -fdump-translation-unit $c_defs -c $file -o $tmp_file" .
+ " failed to generate a translation unit dump from $file";
+ if (system("if [ -f \"$src_fname\".001t.tu ]; then \
+ mv \"$src_fname\".001t.tu $tmp_file; \
+ else mv /tmp/\"$src_fname\".001t.tu $tmp_file; fi ") != 0) {
+ unlink($tmp_file, "$tmp_file.o");
+ die "could not find the gcc translation unit dump file" .
+ " ($src_fname.001t.tu) neither in the current directory" .
+ " or /tmp";
+ };
$tu=GCC::TranslationUnit::Parser->parsefile($tmp_file);
print(STDERR "src name $src_fname\n") if $dbg;
unlink($tmp_file, "$tmp_file.o");
Module: sip-router
Branch: master
Commit: ab5e3984b5afe1d31ed67bbb4842184821215228
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ab5e398…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Mon Aug 30 13:32:18 2010 +0200
doc: cfg_list: parse DEFS from the modules Makefiles
Get all the variable definitions from each module Makefile and
evaluate them to get proper DEFS and INCLUDES (using sed to
extract the variable definitions, conditionals and filter-out
rules from the Makefiles, some hack to preserve the LFs and
$(eval) to evaluate the extracted stuff in the current context).
The DEFS and INCLUDES will be passed to the documentation
generating script (dump_cfg_defs.pl) as extra arguments for gcc. This
way the proper defines and includes will be used for each module.
Fixes cfg var. list generation failure for modules with kamailio module
interface or with non-standard include dirs.
---
doc/cfg_list/Makefile | 81 +++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 78 insertions(+), 3 deletions(-)
diff --git a/doc/cfg_list/Makefile b/doc/cfg_list/Makefile
index 16d645a..a10aaef 100644
--- a/doc/cfg_list/Makefile
+++ b/doc/cfg_list/Makefile
@@ -53,7 +53,23 @@ override force_grp=
endif
# command used for gcc (contains extra includes)
-gcc=gcc -I$(COREPATH)/lib -I/usr/include/libxml2
+gcc=gcc
+#-I$(COREPATH)/lib -I$(COREPATH) -I/usr/include/libxml2
+
+# defines used by gcc
+c_defs=-D__CPU_i386 -D__OS_linux -DSER_VER=2099099 -DPKG_MALLOC -DSHM_MEM \
+ -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP \
+ -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR \
+ -DUSE_TLS -DTLS_HOOKS -DFAST_LOCK -DCC_GCC_LIKE_ASM \
+ -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
+ -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
+ -DHAVE_SCHED_SETSCHEDULER -DHAVE_EPOLL -DUSE_SCTP -DNAME='\"ser\"' \
+ -DVERSION='\"2.99.99-pre3\"' -DARCH='\"i386\"' -DOS_QUOTED='\"linux\"'
+
+
+# common makefile vars used in defs
+LOCALBASE=/usr/local
+SYSBASE=/usr
filter_files=$(filter-out $(addsuffix %,$(file_exclude)),\
$(filter-out $(addprefix %:,$(grp_exclude)),$(1)))
@@ -86,21 +102,80 @@ get_grp=$(strip $(if $(grp_f_$(call get_bname,$(1))), \
# get target from file:grp (get_target(file:grp) => cfg_grp.txt)
get_target=cfg_$(call get_grp,$(1))
+
+# $(LF) definition (do not remove)
+define LF
+
+
+endef
+
+# get all the lines containing DEFS or INCLUDES definitions from the Makefile.
+# WARNING: does not work with all sed implementation (tested with GNU sed).
+# It uses a hack to restore the LFs (LFs are removed by $(shell)): LFs are
+# replaced with '^LF^' and then ^LF^ is subst'ed back to a real LF.
+get_make_idefs=$(subst ^LF^,$(LF),$(shell sed \
+ -ne '/^[\t ]*\(DEFS\|INCLUDES\)[\t ]*[+:]\?=.*[^\]$$/H'\
+ -ne '/^[\t ]*\(DEFS\|INCLUDES\)[\t ]*[+:]\?=.*\\$$/,/\(^$$\)\|\([^\]$$\)/H'\
+ -ne '$${g;s/\n/^LF^/g;p}'\
+< $(1)/Makefile ))
+
+
+# get all the lines from the makefile containing variable definitions.
+# It will also return conditionals and try to filter out possible rules.
+# WARNING: does not work with all sed implementation (tested with GNU sed).
+# It uses a hack to restore the LFs (LFs are removed by $(shell)): LFs are
+# replaced with '^LF^' and then ^LF^ is subst'ed back to a real LF.
+get_make_vars=$(subst ^LF^,$(LF),$(shell sed -n \
+ -e ': start' \
+ -e '/^\(ifeq\|ifneq\|else\|endif\)[\t ]*\($$\|.*[^\]$$\)/{H;d}' \
+ -e '/^\(ifeq\|ifneq\|else\|endif\)[\t ]\+.*[\]$$/,/[^\]$$/{H;d}' \
+ -e '/^[a-zA-Z._/$$][a-zA-Z0-9._()/$$ \t-]*:\([^=]\|$$\)/b eat_rule' \
+ -e '/^[\t ]*[A-Za-z._][A-Za-z0-9._-]*[\t ]*[+:]\?=.*[^\]$$/{H;d}' \
+ -e '/^[\t ]*[A-Za-z._][A-Za-z0-9._-]*[\t ]*[+:]\?=.*\\$$/,/\(^$$\)\|\([^\]$$\)/{H;d}' \
+ -e ': end' \
+ -e '$${g;s/\n/^LF^/g;p}'\
+ -e 'b' \
+ -e ': eat_rule' \
+ -e '$$b end' \
+ -e 'n' \
+ -e '/^[a-zA-Z._/$$][a-zA-Z0-9._()/$$ \t-]*:\([^=]\|$$\)/b eat_rule' \
+ -e '/^[\t]/b eat_rule' \
+ -e 'b start' \
+< $(1)/Makefile ))
+
+
define mk_rules
$(call check_fname_grp, $(1))
#$$(info generating cfg_$$(call get_grp,$(1)).txt: $$(call get_prereq,$(1)))
+
+DEFS:=
+INCLUDES:=
+# extract all the includes and defs from the module makefile and
+# evaluate them
+$$(eval $$(call get_make_vars,$$(dir $$(call get_prereq,$(1)))))
+# save the result in a per group e_idefs_<grp_name> var
+$$(eval e_idefs_$$(call get_grp,$(1)):=$$(DEFS) $$(INCLUDES))
+
+# debugging:
+#$$(info eval: $$(call get_make_vars,$$(dir $$(call get_prereq,$(1)))))
+#$$(info e_idefs_$$(call get_grp,$(1))=$$(e_idefs_$$(call get_grp,$(1))))
+
$(txt_output_dir)/$$(call get_target,$(1)).txt: \
$$(call get_prereq,$(1)) Makefile $(CFG2TXT)
$(CFG2TXT) --file $$< --$(force_grp)grp=$$(call get_grp,$(1)) \
- --gcc="$(gcc)" --txt > "$$@" || (rm -f "$$@"; exit 1)
+ --gcc="$(gcc)" --txt \
+ --defs="$(c_defs) $$(e_idefs_$$(call get_grp,$(1)))" \
+ > "$$@" || (rm -f "$$@"; exit 1)
$(docbook_output_dir)/$$(call get_target,$(1)).xml: \
$$(call get_prereq,$(1)) Makefile $(CFG2TXT)
$(CFG2DOCBOOK) --file $$< --$(force_grp)grp=$$(call get_grp,$(1)) \
- --gcc="$(gcc)" --docbook > "$$@" || (rm -f "$$@"; exit 1)
+ --gcc="$(gcc)" --docbook \
+ --defs="$(c_defs) $$(e_idefs_$$(call get_grp,$(1)))" \
+ > "$$@" || (rm -f "$$@"; exit 1)
clean_$$(call get_target,$(1)).txt: