Hello,
I want to make s/k modules with -j 3 . Thus specifying 3 parallel jobs
(Hehe I have one of those fancy SMP machines). The problem is this:
>make -j 3
....
make[1]: Entering directory `/home/marius/dev/sip-router/modules/avpops'
make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent
make rule.
....
Problem description is here
http://lists.samba.org/archive/distcc/2004q1/002160.html(I also checked
the gnu make manual and this mail is a rather complete copy-paste of the
section in question)
A description of the jobserver implementation in here
http://make.paulandlesley.org/jobserver.html.
The code in the Makefile which causes this is :
.PHONY: $(1)
$(1): modules.lst
@for r in $($(1)) "" ; do \
if [ -n "$$$$r" -a -r "$$$$r/Makefile" ]; then \
$(call oecho, "" ;) \
$(call oecho, "" ;) \
if $(MAKE) -C $$$$r $$(mk_params) || [ ${err_fail} != 1 ] ;
then \
:; \
else \
exit 1; \
fi ; \
fi ; \
done; true
Because I thought the problem might be with the for construct(make
launches a new shell) I have replaced this with
.PHONY: $(1)
$(1): modules.lst
@$(foreach r,$($(1)),$(call module_make,$(r),$(mk_params)))
And in Makefile.rules I've added
module_make= if [ -n "$(1)" -a -r "$(1)/Makefile" ]; then \
$(call oecho, "" ;) \
$(call oecho, "" ;) \
( $$(MAKE) -C $(1) $(2) || [ ${err_fail} != 1 ] ) || exit 1; \
fi ; \
This fixed the warning and multiple make jobs work fine now with make
modules.
So. Do I push?!
Marius
Module: sip-router
Branch: master
Commit: db73ecee1755342b2511153c3936a16edcca8161
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=db73ece…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Date: Thu Feb 4 11:24:36 2010 +0200
modules_k/siputils : Forgot to commit config.* files
I broke the build...
---
modules_k/siputils/config.c | 51 +++++++++++++++++++++++++++++++++++++++++++
modules_k/siputils/config.h | 38 ++++++++++++++++++++++++++++++++
2 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/modules_k/siputils/config.c b/modules_k/siputils/config.c
new file mode 100644
index 0000000..4294f27
--- /dev/null
+++ b/modules_k/siputils/config.c
@@ -0,0 +1,51 @@
+/*
+ * $Id$
+ * This file is part of SIP-router, a free SIP server.
+ *
+ * SIP-router is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version
+ *
+ * SIP-router is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * History
+ * -------
+ * 2008-02-05 adapting tm module for the configuration framework (Miklos)
+ */
+
+/*!
+ * \file
+ * \brief Siputils :: Configuration
+ * \ingroup Siputils
+ */
+
+
+#include "../../cfg/cfg.h"
+#include "../../parser/msg_parser.h" /* method types */
+
+#include "config.h"
+
+struct cfg_group_siputils default_siputils_cfg = {
+ 0
+ };
+
+void *siputils_cfg = &default_siputils_cfg;
+
+cfg_def_t siputils_cfg_def[] = {
+ {"ring_timeout", CFG_VAR_INT | CFG_ATOMIC, 0, 0, ring_timeout_fixup, 0,
+ "define how long the Call-id is kept in the internal list" },
+ {0, 0, 0, 0, 0, 0}
+};
+
+int ring_timeout_fixup(void *handle, str* gname, str* name, void **val){
+ if((int)*val > 0) return 0;
+ return -1;
+}
diff --git a/modules_k/siputils/config.h b/modules_k/siputils/config.h
new file mode 100644
index 0000000..e81eb66
--- /dev/null
+++ b/modules_k/siputils/config.h
@@ -0,0 +1,38 @@
+/*
+ * $Id$
+ *
+ * SIP-router is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*!
+ * \file
+ * \brief Siputils :: Configuration
+ * \ingroup siputils
+ */
+
+
+#ifndef _SIPUTILS_CONFIG_H
+#define _SIPUTILS_CONFIG_H
+
+
+#include "../../cfg/cfg.h"
+#include "../../str.h"
+
+struct cfg_group_siputils {
+ unsigned int ring_timeout;
+};
+
+extern struct cfg_group_siputils default_siputils_cfg;
+extern void *siputils_cfg;
+extern cfg_def_t siputils_cfg_def[];
+
+int ring_timeout_fixup(void*, str*, str*, void**);
+
+#endif
Module: sip-router
Branch: master
Commit: 4607f39ad00c0d1133618ad54a1c9c788f3ac01c
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4607f39…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Date: Mon Feb 1 12:26:21 2010 +0200
Modules_k/siputils : config framework implementation start
Started for ring_timeout
---
modules_k/siputils/README | 2 +-
modules_k/siputils/doc/siputils_admin.xml | 2 +-
modules_k/siputils/ring.c | 5 +++++
modules_k/siputils/siputils.c | 12 +++++++++---
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/modules_k/siputils/README b/modules_k/siputils/README
index 9078784..fab43aa 100644
--- a/modules_k/siputils/README
+++ b/modules_k/siputils/README
@@ -293,7 +293,7 @@ modparam("siputils", "options_support", "100rel")
Inserting the call-id in the internal list, which is checked when
further replies arrive. Any 183 reply that is received during the
- timeout value will be converted to a 180 message. Please not that you
+ timeout value will be converted to a 180 message. Please note that you
need to set a positive timeout value in order to use this function.
The function returns TRUE on success, and FALSE during processing
diff --git a/modules_k/siputils/doc/siputils_admin.xml b/modules_k/siputils/doc/siputils_admin.xml
index 84f546e..c9e169d 100644
--- a/modules_k/siputils/doc/siputils_admin.xml
+++ b/modules_k/siputils/doc/siputils_admin.xml
@@ -225,7 +225,7 @@ modparam("siputils", "options_support", "100rel")
<para>
Inserting the call-id in the internal list, which is checked when
further replies arrive. Any 183 reply that is received during the
- timeout value will be converted to a 180 message. Please not that you
+ timeout value will be converted to a 180 message. Please note that you
need to set a positive timeout value in order to use this function.
</para>
<para>
diff --git a/modules_k/siputils/ring.c b/modules_k/siputils/ring.c
index f895572..ed0d478 100644
--- a/modules_k/siputils/ring.c
+++ b/modules_k/siputils/ring.c
@@ -50,6 +50,7 @@
#include "../../locking.h"
#include "../../md5.h"
+#include "config.h"
#include "ring.h"
@@ -174,6 +175,10 @@ static unsigned int hash(char *buf, int len)
*/
static void remove_timeout(unsigned int index)
{
+ int ring_timeout = cfg_get(siputils, siputils_cfg, ring_timeout);
+ if(ring_timeout == 0){
+ LM_ERR("Could not get timeout from cfg. This will expire all entries");
+ }
while ((*hashtable)[index].head && ((*hashtable)[index].head)->time + ring_timeout < get_ticks()) {
struct ring_record_t* rr = (*hashtable)[index].head;
(*hashtable)[index].head = rr->next;
diff --git a/modules_k/siputils/siputils.c b/modules_k/siputils/siputils.c
index 461dd30..2b3aec8 100644
--- a/modules_k/siputils/siputils.c
+++ b/modules_k/siputils/siputils.c
@@ -74,6 +74,7 @@
#include "utils.h"
#include "contact_ops.h"
#include "sipops.h"
+#include "config.h"
MODULE_VERSION
@@ -115,7 +116,7 @@ static cmd_export_t cmds[]={
};
static param_export_t params[] = {
- {"ring_timeout", INT_PARAM, &ring_timeout},
+ {"ring_timeout", INT_PARAM, &default_siputils_cfg.ring_timeout},
{"options_accept", STR_PARAM, &opt_accept.s},
{"options_accept_encoding", STR_PARAM, &opt_accept_enc.s},
{"options_accept_language", STR_PARAM, &opt_accept_lang.s},
@@ -143,7 +144,7 @@ struct module_exports exports= {
static int mod_init(void)
{
- if(ring_timeout > 0) {
+ if(default_siputils_cfg.ring_timeout > 0) {
ring_init_hashtable();
ring_lock = lock_alloc();
@@ -163,7 +164,12 @@ static int mod_init(void)
LM_ERR("can't load SL API\n");
return -1;
}
-
+
+ if(cfg_declare("siptutils", siputils_cfg_def, &default_siputils_cfg, cfg_sizeof(siputils), &siputils_cfg)){
+ LM_ERR("Fail to declare the configuration\n");
+ return -1;
+ }
+
opt_accept.len = strlen(opt_accept.s);
opt_accept_enc.len = strlen(opt_accept_enc.s);
opt_accept_lang.len = strlen(opt_accept_lang.s);
Module: sip-router
Branch: master
Commit: 90a2f89574483cf750c9234bc870d9c6ebbb25fc
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=90a2f89…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Feb 3 23:32:55 2010 +0100
Merge remote branch 'origin/sr_3.0'
* origin/sr_3.0:
core: new param to give outbut buffer size
core: use one buffer for int2str
core: use dlflags to load modules
uac(k): use header types for detection
uac(k): proper test for send failure
uac(k): set type for tm callback
modules/mediaproxy: take boundary string from Content-Type header.
core: stats events cbs are called only if USE_CORE_STATS is defined
update drp_reqs statistics
update drp_rpls statistics
update fwd_rpls statistics
update err_reqs statistics
update err_rpls statistics
update bad_URIs statistics
update bad_msg_hdr statistics
core: update fwd_reqs stat
kex: support to update core stats via core events
core: added new event SREV_CORE_STATS
---
Module: sip-router
Branch: sr_3.0
Commit: cdfedc3c3f15ff714c8fce1f1e820457f17b0924
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cdfedc3…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Feb 3 23:09:26 2010 +0100
Merge remote branch 'origin/tmp/k3.0_sr_backports' into sr_3.0
statistics callback support (enabled only if compiled with
-DUSE_CORE_STATS) and latest kamailio 3.0 fixes
* origin/tmp/k3.0_sr_backports:
core: new param to give outbut buffer size
core: use one buffer for int2str
core: use dlflags to load modules
uac(k): use header types for detection
uac(k): proper test for send failure
uac(k): set type for tm callback
core: stats events cbs are called only if USE_CORE_STATS is defined
update drp_reqs statistics
update drp_rpls statistics
update fwd_rpls statistics
update err_reqs statistics
update err_rpls statistics
update bad_URIs statistics
update bad_msg_hdr statistics
core: update fwd_reqs stat
kex: support to update core stats via core events
core: added new event SREV_CORE_STATS
---
Module: sip-router
Branch: tmp/k3.0_sr_backports
Commit: 5a45124b8bc8f7bc316ae8a9e2ef6a434f55dadf
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5a45124…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Feb 2 13:23:03 2010 +0100
core: use one buffer for int2str
- static declaration inside ut.h function results in hard copy to many
places, affecting acc detection of int to str conversions in buffer
- reported by Alex Balashov
(cherry picked from commit 229496c7170bcc85f517a4985f7ab4bad553c8d3)
---
ut.c | 3 +++
ut.h | 13 ++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ut.c b/ut.c
index 7c63941..11d4fe7 100644
--- a/ut.c
+++ b/ut.c
@@ -42,6 +42,9 @@
#include "mem/mem.h"
#include "globals.h"
+/* global buffer for ut.h int2str() */
+char ut_buf_int2str[INT2STR_MAX_LEN];
+
/* converts a username into uid:gid,
* returns -1 on error & 0 on success */
diff --git a/ut.h b/ut.h
index 6861af7..3e4d7a6 100644
--- a/ut.h
+++ b/ut.h
@@ -292,10 +292,10 @@ static inline char* int2str_base(unsigned int l, int* len, int base)
-/* returns a pointer to a static buffer containing l in asciiz & sets len */
-static inline char* int2str(unsigned int l, int* len)
+/* print int to asciiz in a string buffer
+ * - be sure result buffer is at least INT2STR_MAX_LEN in size */
+static inline char* int2strbuf(unsigned int l, char *r, int* len)
{
- static char r[INT2STR_MAX_LEN];
int i;
i=INT2STR_MAX_LEN-2;
@@ -312,6 +312,13 @@ static inline char* int2str(unsigned int l, int* len)
return &r[i+1];
}
+extern char ut_buf_int2str[INT2STR_MAX_LEN];
+/* returns a pointer to a static buffer containing l in asciiz & sets len */
+static inline char* int2str(unsigned long l, int* len)
+{
+ return int2strbuf(l, ut_buf_int2str, len);
+}
+
/* Signed INTeger-TO-STRing: convers a long to a string
* returns a pointer to a static buffer containing l in asciiz & sets len */
static inline char* sint2str(long l, int* len)