Makefile.defs has
MAIN_NAME=ser
how can i change MAIN_NAME to sip-router? could the above be changed to
MAIN_NAME=sip-router
or
MAIN_NAME ?= ser
-- juha
Juha Heinanen writes:
how can i change MAIN_NAME to sip-router?
i made progress on this one.
if i do
make cfg CFLAGS="-Wall -g" SCTP=1 MAIN_NAME=sip-router CFG_DIR=/etc/sip-router
i get in config.mak:
# this file is autogenerated by make cfg MAIN_NAME= sip-router RELEASE= 2.1.0-dev23-make OS= linux ARCH= i386 C_DEFS= -DNAME='"sip-router"' -DVERSION='"2.1.0-dev23-make"' -DARCH='"i386"' - DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 4.3.2"' -D__CPU_i386 -D__OS_ linux -DSER_VER=2001000 -DCFG_DIR='"/usr/local/etc/ser/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_R ES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DF_MALLOC -DUSE_TLS -DTLS_HOOKS -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -D HAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE _SCHED_SETSCHEDULER -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_F UTEX -DHAVE_SELECT -DUSE_SCTP ... CFLAGS= -Wall -g
looks ok, except for
-DCFG_DIR='"/usr/local/etc/ser/"'
why is that not changed?
my suggestion still is that in core, all references to ser are changed to sip-router.
if ok, i can change those that i find.
-- juha
after the ser => $(MAIN_NAME) commit to Makefile.defs, i got my debian package build like i want it to be. i used the following definitions:
MAIN_NAME=sip-router SCTP=1
and then made config like this:
$(MAKE) cfg CFLAGS="$(CFLAGS)" SCTP=$(SCTP) MAIN_NAME=$(MAIN_NAME) LOCALBASE=/usr modules="$(MODULES)" modules_s="" modules_k="$(MODULES_K)"
the above puts config files in /usr/etc/sip-router dir. i haven't yet figured out, how to get them to /etc/sip-router instead, but it doesn't matter, because i don't use them anyhow.
-- juha
On May 28, 2009 at 17:17, Juha Heinanen jh@tutpro.com wrote:
after the ser => $(MAIN_NAME) commit to Makefile.defs, i got my debian package build like i want it to be. i used the following definitions:
MAIN_NAME=sip-router SCTP=1
and then made config like this:
$(MAKE) cfg CFLAGS="$(CFLAGS)" SCTP=$(SCTP) MAIN_NAME=$(MAIN_NAME) LOCALBASE=/usr modules="$(MODULES)" modules_s="" modules_k="$(MODULES_K)"
the above puts config files in /usr/etc/sip-router dir. i haven't yet figured out, how to get them to /etc/sip-router instead, but it doesn't matter, because i don't use them anyhow.
cfg_prefix=/ and optionally cfg_target=/etc/sip-router (for the default config path) should do it. You should also use prefix=/usr instead of LOCALBASE=/usr (since LOCALBASE is expected to point to /usr/local or /usr/pkg and it's used for the include search path).
You could also install everything in a temp directory (e.g. for testing) and then tar/copy it to /: make BASEDIR=/tmp/sr ... # same options as above This is very useful for generating packages or testing that all the files are installed.
Andrei
Andrei Pelinescu-Onciul writes:
cfg_prefix=/ and optionally cfg_target=/etc/sip-router (for the default config path) should do it.
cfg_prefix cannot be set to / because then this in Makefile will fail:
mv -f $(cfg_prefix)/$(cfg_dir)ser.cfg.sample \ $(cfg_prefix)/$(cfg_dir)ser.cfg; \
when debian package is build. everything needs to be installed relative to debian source dir (i guess LOCALDIR or BASEDIR).
-- juha
this is (in debian/rules) how i got my debian package built properly:
variables:
MAIN_NAME=sip-router LOCALBASE=$(CURDIR)/debian/$(MAIN_NAME) SCTP=1 MODULES= ... MODULES_S= ... MODULES_K= ...
configuration:
$(MAKE) cfg CFLAGS="$(CFLAGS)" SCTP=$(SCTP) MAIN_NAME=$(MAIN_NAME) LOCALBASE=$(LOCALBASE) prefix=/usr cfg_prefix=$(LOCALBASE) cfg_target=/etc/sip-router modules="$(MODULES)" modules_s="$(MODULES_S)" modules_k="$(MODULES_K)"
compilation:
CC="$(CC)" $(MAKE) all
installation:
CC="$(CC)" $(MAKE) install basedir=$(LOCALBASE)
improvements are welcome.
-- juha
On May 28, 2009 at 20:13, Juha Heinanen jh@tutpro.com wrote:
this is (in debian/rules) how i got my debian package built properly:
variables:
MAIN_NAME=sip-router LOCALBASE=$(CURDIR)/debian/$(MAIN_NAME) SCTP=1 MODULES= ... MODULES_S= ... MODULES_K= ...
configuration:
$(MAKE) cfg CFLAGS="$(CFLAGS)" SCTP=$(SCTP) MAIN_NAME=$(MAIN_NAME)
LOCALBASE=$(LOCALBASE) prefix=/usr cfg_prefix=$(LOCALBASE) [...]
You should not use LOCALBASE= and use instead BASEDIR=$(CURDIR)/debian/$(MAIN_NAME) and cfg_prefix=$(CURDIR)/debian/$(MAIN_NAME). prefix and cfg_target are ok.
compilation:
CC="$(CC)" $(MAKE) all
installation:
CC="$(CC)" $(MAKE) install basedir=$(LOCALBASE)
If you use BASEDIR or basedir in make cfg, you don't need to override it on make install. ( $(MAKE) install is enough).
Same for CC (if you add CC=$(CC) to make cfg you don't need to add it to $(MAKE) all or $(MAKE) install).
improvements are welcome.
Andrei
andrei,
thanks for your tips. they worked and simplified rules statements.
kamailio Makefile.defs has: n # nicer compilation? Q= NICER ?= ifneq ($(NICER),) export Q=@ endif
which makes compilation less verbose if NICER is defined.
it would be nice to have the same feature in sr compilation process.
-- juha
On May 28, 2009 at 21:33, Juha Heinanen jh@tutpro.com wrote:
andrei,
thanks for your tips. they worked and simplified rules statements.
kamailio Makefile.defs has: n # nicer compilation? Q= NICER ?= ifneq ($(NICER),) export Q=@ endif
which makes compilation less verbose if NICER is defined.
it would be nice to have the same feature in sr compilation process.
While I find it useless, I did talk with Daniel about it. The kamailio version is "too slow", It introduces extra slow shell commands for each file compiled (both if you use NICE or not), which slow compilation unnecessarily.
Daniel said he'll come up with something better.
Andrei