[asterisk-dev] DESTDIR vs INSTALL_PATH ?

Luigi Rizzo rizzo at icir.org
Sun Dec 9 09:10:18 CST 2007


On Sun, Dec 09, 2007 at 04:43:57PM +0200, Tzafrir Cohen wrote:
> On Sun, Dec 09, 2007 at 06:16:18AM -0800, Luigi Rizzo wrote:
> > hi,
> > there is some confusion (in trunk at least) on the role of DESTDIR
> > and INSTALL_PATH.
> > 
> > DESTDIR is widely used in the top level Makefile (and below) to determine
> > where things get installed. There are two noticeable exceptions:
> > 
> > 1. in creating asterisk.conf (which is part of the 'samples' target),
> >    DESTDIR is ignored, so the entries in [directories] are wrong if you
> >    install to a non-standard place.
> > 
> >    PROPOSED FIX: prepend ${DESTDIR} to all the entries in [directories]
> >    in the code that creates asterisk.conf . This should not break anything.
> 
> Why would you need that? DESTDIR is normally not a path that is used in
> real life. Consider installing to a subtree for the purpose of
> packaging. 

"normally" varies a lot from person to person. I normally use DESTDIR to install
a newly built tree in some place (e.g. for testing), and hate it when asterisk.conf
has completely bogus paths.

> Currently the following has funny results:
> 
>   make install DESTDIR=relative/path
> 
> As it is interepted differently by subdirectories.

That's an orthogonal issue - making sure that DESTDIR is an absolute path.

> Hence I use:
> 
>   make install $PWD/subdir
> 
> And this works well.
> 
> 
> As for asterisk.conf: this is pure duplication. The compiled defualts
> are already there. 

And those are likely to be wrong too, as i mentioned re. the INSTALL_PATH

The real problem I have (as a developer, who I believe should be one of the well
supported target for trunk) is that the asterisk binary is unable to run from the
source tree, or to locate modules and config files relatively to its own location.

Changing asterisk.conf to point in the right location during a 'make
samples' is only a first step in this direction, without
backward-incompatible side effects. If there is a better solution
e.g. put some intelligence in the source to look for modules and
config files in multiple places based on asterisk's own location,
I am all for that.

	cheers
	luigi



More information about the asterisk-dev mailing list