Skip to content
Snippets Groups Projects
Commit 08d50c85 authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

Implement the outcome of a discussion on the -dev list re. the use

of DESTDIR and INSTALL_PATH - many thanks to Tzafrir Cohen and
Simon Perreault for extremely useful feedback:
 
1. comment out the [directories] section the created asterisk.conf ;
   you can set the correct defaults at build time using INSTALL_PATH,
   so the repetition here is redundant and often wrong.
   (The next step now is move asterisk.conf outside the Makefile to
   asterisk.conf.sample, because there is little if anything here
   that needs to be constructed at build/install time).
 
2. use DESTDIR?=$(INSTALL_PATH) so you only need to specify a path
   once if the two coincide. This should have no ill side effects, 
   because if you don't specify DESTDIR, you really need
   INSTALL_PATH="" to set the correct defaults, and if you specify
   DESTDIR the value is not overridden.

The second part required moving the 'export DESTDIR' right after
the assignment to prevent DESTDIR getting set by the export 
(this is documented in the Makefile).o hopefully avoid the mistake)$

With this change you can now do something like this from your source tree:

	make INSTALL_PATH=/some/place install samples

and then

	main/asterisk -vdc

which will pick up the correct config files and libraries from
/some/place - i.e. great for developers!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 10b3c519
Branches
Tags
No related merge requests found
......@@ -53,7 +53,6 @@ export RANLIB
export HOST_CC
export STATIC_BUILD
export INSTALL
export DESTDIR
export PROC
export SOLINK
export STRIP
......@@ -88,12 +87,13 @@ OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
DEBUG=-g3
# Staging directory
# DESTDIR is the staging directory.
# Files are copied here temporarily during the install process
# For example, make DESTDIR=/tmp/asterisk woud put things in
# /tmp/asterisk/etc/asterisk
# !!! Watch out, put no spaces or comments after the value !!!
#DESTDIR?=/tmp/asterisk
# WARNING: do not put spaces or comments after the value.
# Also, do not export it before this point or the 'export' will
# assign it to the empty string so ?= fails.
DESTDIR?=$(INSTALL_PATH)
export DESTDIR
# Define standard directories for various platforms
# These apply if they are not redefined in asterisk.conf
......@@ -578,7 +578,7 @@ samples: adsi
@if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
echo "Creating asterisk.conf"; \
( \
echo "[directories]" ; \
echo "[directories](!) ; remove the (!) to enable this" ; \
echo "astetcdir => $(ASTETCDIR)" ; \
echo "astmoddir => $(MODULES_DIR)" ; \
echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment