On Jun 10, 2009 at 16:43, Edson - Lists 4lists@gmail.com wrote:
I compile and install with: # make prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router install
then I run: # ser
and got: ERROR: loading config file(/usr/local/etc/ser/ser.cfg): No such file or directory
The ERROR message is expected (there is no /usr/local/etc/ser directory at all), but why is sip-router (ser) trying to find configuration file on the default directory if I explicitly compile it pointing to another one? From what I looked on Makefile.defs the config directory is gived by the "cfg_dir" variable... "prefix" is honor, since "ser" binary is installed correctly:
# which ser /sbin/ser
You have to run make cfg prefix=/ mandir=/usr/local/man cfg_dir=/etc/sip-router and then make install.
You could override most saved config vars on the command line, but the problem with the built-in config dir is that is part of C_DEFS (-DCFG_DIR=....) and C_DEFS is evaluated before is saved in config.mak => even if you later override cfg_target, prefix or cfg_dir, C_DEFS won't change.
I could make this override work (either by moving -DCFG_DIR out of C_DEFS or by saving C_DEFS without evaluating it first), but on any change to prefix, cfg_dir or cfg_target you'll get a full recompilation any way, since -DCFG_DIR will change (so the only gain would be not having to run make cfg).
Andrei