summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrussell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-09-26 03:34:29 +0000
committerrussell <russell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-09-26 03:34:29 +0000
commit1d7d247ab9d612f392b8f812e2afe33c1204a43d (patch)
treee59fecc9bb591c39cf0f796305b71bfdc6905995
parenta5e23e7e1ac45b4dfaa741afdf1a4faacf072a25 (diff)
make ztcfg respect INSTALL_PREFIX
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@460 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xMakefile5
-rwxr-xr-xztcfg.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f105780..a9c88cb 100755
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,9 @@ CFLAGS+=-DSTANDALONE_ZAPATA
INSTALL_PREFIX=
+CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf
+CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
+
BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
MODCONF=$(shell if [ -d $(INSTALL_PREFIX)/etc/modprobe.d ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(INSTALL_PREFIX)/etc/modutils ]; then echo "$(INSTALL_PREFIX)/etc/modutils/zaptel"; elif [ -f $(INSTALL_PREFIX)/etc/modprobe.conf ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.conf"; elif [ -f $(INSTALL_PREFIX)/etc/modules.conf ]; then echo "$(INSTALL_PREFIX)/etc/modules.conf"; else echo $(INSTALL_PREFIX)/etc/conf.modules ; fi)
@@ -310,7 +313,7 @@ install: all devices $(LIBTONEZONE)
/sbin/update-modules ; \
fi
-/sbin/depmod -a
- [ -f $(INSTALL_PREFIX)/etc/zaptel.conf ] || install -m 644 zaptel.conf.sample $(INSTALL_PREFIX)/etc/zaptel.conf
+ [ -f $(CONFIG_FILE) ] || install -m 644 zaptel.conf.sample $(CONFIG_FILE)
config:
if [ -d $(INSTALL_PREFIX)/etc/rc.d/init.d ]; then \
diff --git a/ztcfg.h b/ztcfg.h
index bc68118..8ad5d81 100755
--- a/ztcfg.h
+++ b/ztcfg.h
@@ -22,6 +22,6 @@
#ifndef _ZTCFG_H
#define _ZTCFG_H
-#define CONFIG_FILENAME "/etc/zaptel.conf"
+#define CONFIG_FILENAME ZAPTEL_CONFIG
#define MASTER_DEVICE "/dev/zap/ctl"
#endif