]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
major Makefile and build process improvements, including removal of all hardcoded...
authorKevin P. Fleming <kpfleming@digium.com>
Mon, 6 Jun 2005 03:04:58 +0000 (03:04 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Mon, 6 Jun 2005 03:04:58 +0000 (03:04 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5855 65c4cc65-6c06-0410-ace0-fbb531ad65f3

36 files changed:
.cleancount
.cvsignore
Makefile
app.c
apps/app_adsiprog.c
apps/app_chanspy.c
apps/app_directory.c
apps/app_hasnewvoicemail.c
apps/app_ices.c
apps/app_math.c
apps/app_meetme.c
apps/app_queue.c
apps/app_sms.c
apps/app_test.c
apps/app_voicemail.c
asterisk.c
cdr/cdr_csv.c
cdr/cdr_custom.c
cdr/cdr_manager.c
channels/chan_iax2.c
cli.c
config.c
db.c
file.c
image.c
include/astconf.h [deleted file]
include/asterisk.h
loader.c
logger.c
make_build_h
pbx/pbx_config.c
pbx/pbx_spool.c
res/res_agi.c
res/res_crypto.c
res/res_monitor.c
res/res_musiconhold.c

index 7ed6ff82de6bcc2a78243fc9c54d3ef5ac14da69..1e8b314962144c26d5e0e50fd29d2ca327864913 100755 (executable)
@@ -1 +1 @@
-5
+6
index 26fff12281101fe1c42928bde11fb129a1e5ccaf..3fe629253a4b2c6592bae6280adbc5a6180991f7 100755 (executable)
@@ -20,3 +20,5 @@ update.out
 tags
 TAGS
 vercomp
+version.h
+defaults.h
index 0a9baab8ac01c2aceab3faee6d7c3782a90e4183..f15e5ebb5b2494a84b2c7347bbc85dd93c7d7613 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -211,22 +211,10 @@ CFLAGS+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h ]; th
 
 LIBEDIT=editline/libedit.a
 
-ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then if [ -f CVS/Tag ] ; then echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`"; else echo "CVS-HEAD-`date +"%D-%T"`"; fi; fi; fi)
+ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then if [ -f CVS/Tag ] ; then echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`"; else echo "CVS-HEAD"; fi; fi; fi)
 ASTERISKVERSIONNUM=$(shell if [ -d CVS ]; then echo 999999 ; else if [ -f .version ] ; then awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version ; else echo 000000 ; fi ; fi)
 HTTPDIR=$(shell if [ -d $(CROSS_COMPILE_TARGET)/var/www ]; then echo "/var/www"; else echo "/home/httpd"; fi)
 RPMVERSION=$(shell if [ -f .version ]; then sed 's/[-\/:]/_/g' .version; else echo "unknown" ; fi)
-CFLAGS+=-DASTERISK_VERSION=\"$(ASTERISKVERSION)\"
-CFLAGS+=-DASTERISK_VERSION_NUM=$(ASTERISKVERSIONNUM)
-CFLAGS+=-DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
-CFLAGS+=-DASTETCDIR=\"$(ASTETCDIR)\"
-CFLAGS+=-DASTLIBDIR=\"$(ASTLIBDIR)\"
-CFLAGS+=-DASTVARLIBDIR=\"$(ASTVARLIBDIR)\"
-CFLAGS+=-DASTVARRUNDIR=\"$(ASTVARRUNDIR)\"
-CFLAGS+=-DASTSPOOLDIR=\"$(ASTSPOOLDIR)\"
-CFLAGS+=-DASTLOGDIR=\"$(ASTLOGDIR)\"
-CFLAGS+=-DASTCONFPATH=\"$(ASTCONFPATH)\"
-CFLAGS+=-DASTMODDIR=\"$(MODULES_DIR)\"
-CFLAGS+=-DASTAGIDIR=\"$(AGI_DIR)\"
 
 CFLAGS+= $(DEBUG_THREADS)
 CFLAGS+= $(TRACE_FRAMES)
@@ -327,12 +315,7 @@ ifneq ($(wildcard .tags-depend),)
 include .tags-depend
 endif
 
-.PHONY: _version ast_expr
-
-_version: 
-       if [ -d CVS ] && [ ! -f .version ]; then echo $(ASTERISKVERSION) > .version; fi 
-
-.version: _version
+.PHONY: ast_expr
 
 vercomp: vercomp.c
        $(HOST_CC) -o $@ $<
@@ -382,10 +365,6 @@ ast_expr.a: $(FLEXOBJS)
        ar r $@ $(FLEXOBJS)
        ranlib $@
 
-cli.o: cli.c build.h
-
-asterisk.o: asterisk.c build.h
-
 testexpr2 :
        flex ast_expr2.fl
        bison -v -d --name-prefix=ast_yy -o ast_expr2.c ast_expr2.y
@@ -415,13 +394,26 @@ asterisk.html: asterisk.sgml
 asterisk.txt: asterisk.sgml
        docbook2txt asterisk.sgml
 
-ifneq ($(strip $(ASTERISKVERSION)),)
-build.h: .version
-       ./make_build_h
-else
-build.h:
-       ./make_build_h
-endif
+defaults.h: FORCE
+       ./make_defaults_h > $@.tmp
+       if ! cmp -s $@.tmp $@ ; then \
+               mv $@.tmp $@ ; \
+       fi
+       rm -f $@.tmp
+
+include/asterisk/build.h: FORCE
+       ./make_build_h > $@.tmp
+       if ! cmp -s $@.tmp $@ ; then \
+               mv $@.tmp $@ ; \
+       fi
+       rm -f $@.tmp
+
+include/asterisk/version.h: FORCE
+       ./make_version_h > $@.tmp
+       if ! cmp -s $@.tmp $@ ; then \
+               mv $@.tmp $@ ; \
+       fi
+       rm -f $@.tmp
 
 stdtime/libtime.a: FORCE
        @if [ -d stdtime ]; then \
@@ -443,7 +435,9 @@ subdirs:
 clean:
        for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done
        rm -f *.o *.so asterisk .depend
-       rm -f build.h 
+       rm -f defaults.h
+       rm -f include/asterisk/build.h
+       rm -f include/asterisk/version.h
        rm -f ast_expr.c ast_expr.h ast_expr.output
        rm -f ast_expr2.c ast_expr2f.c ast_expr2.h ast_expr2.output
        rm -f ast_expr.a vercomp
@@ -758,7 +752,7 @@ dont-optimize:
 
 valgrind: dont-optimize
 
-depend: .depend
+depend: .depend defaults.h include/asterisk/build.h include/asterisk/version.h
        for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
 
 .depend:
diff --git a/app.c b/app.c
index 9f4267f3440691dea4f044f683f870576ddffcbf..a21e3b2b1552fdf627960f7cbf7cb83b143acfe4 100755 (executable)
--- a/app.c
+++ b/app.c
@@ -34,7 +34,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/indications.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 #define MAX_OTHER_FORMATS 10
 
index c6b451a30db2def9a7c1889ef27a647ccf49615d..fbd6c927ee4414bc540ef31eeb582a73e587565b 100755 (executable)
@@ -31,7 +31,6 @@
 #include <errno.h>
 
 #include "asterisk.h"
-#include "astconf.h"
 
 static char *tdesc = "Asterisk ADSI Programming Application";
 
index 292a1518a685d08522628f8f5b02da010a641328..656b76947aacd79ac543e185c87d3c28bd0cc249 100755 (executable)
@@ -30,8 +30,6 @@
 #include "asterisk/module.h"
 #include "asterisk/lock.h"
 
-#define AST_MONITOR_DIR AST_SPOOL_DIR "/monitor"
-
 AST_MUTEX_DEFINE_STATIC(modlock);
 
 #define ast_fit_in_short(in) (in < -32768 ? -32768 : in > 32767 ? 32767 : in)
@@ -704,7 +702,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
 
        if (recbase) {
                char filename[512];
-               snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",AST_MONITOR_DIR, recbase, time(NULL));
+               snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",ast_config_AST_MONITOR_DIR, recbase, time(NULL));
                if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC)) <= 0) {
                        ast_log(LOG_WARNING, "Cannot open %s for recording\n", filename);
                        fd = 0;
index b73e539797dfb256a2f3f2ef2ac46c5884a36c6f..870fd5a690deb4f8fe22e1e8ae18db2dde09816e 100755 (executable)
@@ -25,7 +25,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include "asterisk.h"
-#include "astconf.h"
 
 static char *tdesc = "Extension Directory";
 static char *app = "Directory";
index 63102de0847e5cd6f6e5e8fcdd235ac672ac5e58..7dc3980a49fa47d56d6506ca1d92a4494459ff70 100755 (executable)
@@ -45,7 +45,7 @@
 #include <stdlib.h>
 #include <dirent.h>
 
-#include "astconf.h"
+#include "asterisk.h"
 
 static char *tdesc = "Indicator for whether a voice mailbox has messages in a given folder.";
 static char *app_hasvoicemail = "HasVoicemail";
index c5ffa45fd0f5e83518d409dcc2e4218b327981c8..6e1629d4102cc56cf8c2346fa3f4e23dd518f38a 100755 (executable)
@@ -27,7 +27,7 @@
 #include <fcntl.h>
 #include <sys/time.h>
 #include <errno.h>
-#include "astconf.h"
+#include "asterisk.h"
 
 #define ICES "/usr/bin/ices"
 #define LOCAL_ICES "/usr/local/bin/ices"
index 0e0b6304d20bdfc7cd7f85e7ab3c0526e9bf2f52..9d040ff5e70647f7dbbc39ca0c5fbcf16d0421f0 100755 (executable)
@@ -38,7 +38,7 @@
 #include "asterisk/translate.h"
 #include <ctype.h>
 #include <sys/file.h>
-#include "astconf.h"
+#include "asterisk.h"
 
 static char *tdesc = "Basic Math Functions";
 
index afd39f2799670c5e6d537b92d54e993bef73ce6f..c7b1c920d9b5dd9b57f22c29ffae8ace6b49c10a 100755 (executable)
@@ -33,7 +33,6 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include "asterisk.h"
-#include "astconf.h"
 
 #ifdef __linux__
 #include <linux/zaptel.h>
index 9add78a4dda4605d2a7b7995dd47768e6180b4f0..0e759aa24a004988cd41064a3b02a544cf7f8ab1 100755 (executable)
@@ -67,7 +67,7 @@
 #include <sys/signal.h>
 #include <netinet/in.h>
 
-#include "astconf.h"
+#include "asterisk.h"
 
 #define QUEUE_STRATEGY_RINGALL         0
 #define QUEUE_STRATEGY_ROUNDROBIN      1
index f2a6c7569aec64cbd0003818c5002c6dee10ebd1..93b7d15c2e10ed2b580d855dbbd906836e97cfd7 100755 (executable)
@@ -27,7 +27,7 @@
 #include <sys/stat.h>
 #include <dirent.h>
 #include <ctype.h>
-#include "astconf.h"
+#include "asterisk.h"
 
 /* output using Alaw rather than linear */
 /* #define OUTALAW */
index 370c547fdf78a79dbd32ccbb9812cb6addd0a381..2d9a075a2415172ba5e8b191a8f198f04f6c6038 100755 (executable)
@@ -26,7 +26,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include "astconf.h"
+#include "asterisk.h"
 
 
 static char *tdesc = "Interface Test Application";
index 39ab1cc8bdfcca627529609e7085e0aaf7057c35..57f06e1dfe9ccf196f813b1ec7ec471c16bb9fba 100755 (executable)
@@ -48,7 +48,6 @@
 #include <dirent.h>
 
 #include "asterisk.h"
-#include "astconf.h"
 
 #define COMMAND_TIMEOUT 5000
 
index 94f1f341c6829a4d1ef1637ebf9c5bbe8e8251b0..1c0ba53d032fb5b47ca173e82fd4d5f874f4494a 100755 (executable)
@@ -33,6 +33,7 @@
 #include <netdb.h>
 #endif
 
+#include "asterisk.h"
 #include "asterisk/logger.h"
 #include "asterisk/options.h"
 #include "asterisk/cli.h"
 #include "asterisk/io.h"
 #include "asterisk/lock.h"
 #include "editline/histedit.h"
-#include "asterisk.h"
 #include "asterisk/config.h"
+#include "asterisk/version.h"
+#include "asterisk/build.h"
+
+#include "defaults.h"
 
 #ifndef AF_LOCAL
 #define AF_LOCAL AF_UNIX
@@ -128,6 +132,7 @@ char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
 char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
+char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
 char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
@@ -395,7 +400,7 @@ static int ast_makesocket(void)
        int x;
 
        struct ast_config *cfg;
-       char *config = ASTCONFPATH;
+       char *config = AST_CONFIG_FILE;
        char *owner;
        char *group;
        char *perms;
@@ -1547,7 +1552,7 @@ static void ast_readconfig(void) {
        struct ast_config *cfg;
        struct ast_variable *v;
        struct ast_variable *v_ctlfile;
-       char *config = ASTCONFPATH;
+       char *config = AST_CONFIG_FILE;
 
        if (option_overrideconfig == 1) {
                cfg = ast_config_load((char *)ast_config_AST_CONFIG_FILE);
@@ -1561,6 +1566,7 @@ static void ast_readconfig(void) {
        ast_copy_string((char *)ast_config_AST_CONFIG_DIR,AST_CONFIG_DIR,sizeof(ast_config_AST_CONFIG_DIR));
        ast_copy_string((char *)ast_config_AST_SPOOL_DIR,AST_SPOOL_DIR,sizeof(ast_config_AST_SPOOL_DIR));
        ast_copy_string((char *)ast_config_AST_MODULE_DIR,AST_MODULE_DIR,sizeof(ast_config_AST_VAR_DIR));
+       snprintf((char *)ast_config_AST_MONITOR_DIR,sizeof(ast_config_AST_MONITOR_DIR)-1,"%s/monitor",ast_config_AST_SPOOL_DIR);
        ast_copy_string((char *)ast_config_AST_VAR_DIR,AST_VAR_DIR,sizeof(ast_config_AST_VAR_DIR));
        ast_copy_string((char *)ast_config_AST_LOG_DIR,AST_LOG_DIR,sizeof(ast_config_AST_LOG_DIR));
        ast_copy_string((char *)ast_config_AST_AGI_DIR,AST_AGI_DIR,sizeof(ast_config_AST_AGI_DIR));
@@ -1588,6 +1594,7 @@ static void ast_readconfig(void) {
                        ast_copy_string((char *)ast_config_AST_CONFIG_DIR,v->value,sizeof(ast_config_AST_CONFIG_DIR));
                } else if (!strcasecmp(v->name, "astspooldir")) {
                        ast_copy_string((char *)ast_config_AST_SPOOL_DIR,v->value,sizeof(ast_config_AST_SPOOL_DIR));
+                       snprintf((char *)ast_config_AST_MONITOR_DIR,sizeof(ast_config_AST_MONITOR_DIR)-1,"%s/monitor",v->value);
                } else if (!strcasecmp(v->name, "astvarlibdir")) {
                        ast_copy_string((char *)ast_config_AST_VAR_DIR,v->value,sizeof(ast_config_AST_VAR_DIR));
                        snprintf((char *)ast_config_AST_DB,sizeof(ast_config_AST_DB),"%s/%s",v->value,"astdb");    
index ca5b96370b16771a699db3611a5adea805f7e6bb..aa95fa1a0fef0e4c8896ee2244c7474725f10002 100755 (executable)
@@ -21,7 +21,6 @@
 #include "asterisk/logger.h"
 #include "asterisk/utils.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 #define CSV_LOG_DIR "/cdr-csv"
 #define CSV_MASTER  "/Master.csv"
index 69b6f2c51b3f7ead891f62075eb56dd6cf44876f..cbb6d970b317446531aa4c72b1b7b04f462c3a6f 100755 (executable)
@@ -23,7 +23,6 @@
 #include "asterisk/logger.h"
 #include "asterisk/utils.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 #define CUSTOM_LOG_DIR "/cdr_custom"
 
index d8421783cf88dd16aed295bbf7a52479098fec94..556358287197c5bf4e8ff36d8d12d93a57c474de 100755 (executable)
@@ -17,7 +17,6 @@
 #include "asterisk/manager.h"
 #include "asterisk/config.h"
 #include "asterisk.h"
-#include "astconf.h"
 #include <strings.h>
 #include <unistd.h>
 #include <time.h>
index 232f6f2fb6bcfd40fbd05a05af41d99fdcc9fb40..bd64da658a00c39a368b7042743408d8370f16b5 100755 (executable)
@@ -69,7 +69,7 @@
 #include "iax2.h"
 #include "iax2-parser.h"
 #include "iax2-provision.h"
-#include "astconf.h"
+#include "asterisk.h"
 
 /* Define NEWJB to use the new channel independent jitterbuffer,
  * otherwise, use the old jitterbuffer */
diff --git a/cli.c b/cli.c
index 8e13573657531c9bdc189695251dede008389485..18aadd871c4a7514d7b5eac76a84b02b42adc037 100755 (executable)
--- a/cli.c
+++ b/cli.c
 #include "editline/readline/readline.h"
 /* For module directory */
 #include "asterisk.h"
-#include "build.h"
-#include "astconf.h"
+#include "asterisk/version.h"
+#include "asterisk/build.h"
 
 #define VERSION_INFO "Asterisk " ASTERISK_VERSION " built by " BUILD_USER "@" BUILD_HOSTNAME \
-       " on a " BUILD_MACHINE " running " BUILD_OS
+       " on a " BUILD_MACHINE " running " BUILD_OS " on " BUILD_DATE
        
 extern unsigned long global_fin, global_fout;
        
index d8675e27cb203cca192d672fca61f47f6ed3a62e..916dc0c8351bb394bc06f5433586e6f15333d717 100755 (executable)
--- a/config.c
+++ b/config.c
@@ -34,7 +34,6 @@
 #include "asterisk/channel.h"
 #include "asterisk/app.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 #define MAX_NESTED_COMMENTS 128
 #define COMMENT_START ";--"
@@ -687,7 +686,7 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
        int blanklines = 0;
 
        if (configfile[0] == '/') {
-               strncpy(fn, configfile, sizeof(fn)-1);
+               ast_copy_string(fn, configfile, sizeof(fn));
        } else {
                snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, configfile);
        }
diff --git a/db.c b/db.c
index 063d298ee51358ee4823386f9f3d18d2c46f50d0..29603d1db95984209a34d3263ee73e312c58af0c 100755 (executable)
--- a/db.c
+++ b/db.c
@@ -37,7 +37,6 @@
 #include "asterisk/manager.h"
 #include "db1-ast/include/db.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 static DB *astdb;
 AST_MUTEX_DEFINE_STATIC(dblock);
diff --git a/file.c b/file.c
index cbe72801e6bad35c1a86b0cf3b50ef87dbf55723..52e81716d2d63f1bd49f01b5374595134d627c31 100755 (executable)
--- a/file.c
+++ b/file.c
@@ -34,7 +34,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 struct ast_format {
        /* Name of format */
diff --git a/image.c b/image.c
index 7fa2141f1c1d2eb90c3ebcfbca0d7ff07b35b3be..804c2d87c2ac699a0dcc874a7239347975307ea7 100755 (executable)
--- a/image.c
+++ b/image.c
@@ -30,7 +30,6 @@
 #include "asterisk/cli.h"
 #include "asterisk/lock.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 static struct ast_imager *list;
 AST_MUTEX_DEFINE_STATIC(listlock);
diff --git a/include/astconf.h b/include/astconf.h
deleted file mode 100755 (executable)
index da3301f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * General Definitions for Asterisk top level program
- * 
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- */
-
-#ifndef _ASTCONF_H
-#define _ASTCONF_H
-
-#define AST_CONFIG_MAX_PATH 255
-
-extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
-
-#endif
index 09410fdb6aba0c82df8aaba9fe4877c9915fedbb..b4b26a7757b673d1cb5b76d3129432d4fb8ddc91 100755 (executable)
 #define DEFAULT_LANGUAGE "en"
 
 #define AST_CONFIG_MAX_PATH 255
-#define AST_CONFIG_DIR         ASTETCDIR
-#define AST_RUN_DIR    ASTVARRUNDIR
-#define AST_SOCKET     ASTVARRUNDIR "/asterisk.ctl"
-#define AST_PID                ASTVARRUNDIR "/asterisk.pid"
-#define AST_MODULE_DIR         ASTMODDIR
-#define AST_SPOOL_DIR          ASTSPOOLDIR
-#define AST_VAR_DIR            ASTVARLIBDIR
-#define AST_LOG_DIR    ASTLOGDIR
-#define AST_AGI_DIR    ASTAGIDIR
-#define AST_KEY_DIR    ASTVARLIBDIR "/keys"
-#define AST_DB         ASTVARLIBDIR "/astdb"
-#define AST_TMP_DIR    ASTSPOOLDIR "/tmp"
 
-#define AST_CONFIG_FILE ASTCONFPATH
-
-#define AST_SOUNDS AST_VAR_DIR "/sounds"
-#define AST_IMAGES AST_VAR_DIR "/images"
+/* provided in asterisk.c */
+extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
+extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
 
 /* Provided by module.c */
 extern int load_modules(void);
index 71626c0650a2949b5354ea2f741a2e03ac9f67fe..4403652e4d6bc8cc47b6bb655f65e097235b3ea7 100755 (executable)
--- a/loader.c
+++ b/loader.c
@@ -35,7 +35,6 @@
 #endif
 #include "asterisk/md5.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 #ifndef RTLD_NOW
 #define RTLD_NOW 0
index bd7c258c41a7ba9d6ce9fa3ed2e209e1c85b4075..9e31cd5856c7bfdd67030fa992cac753ec3bf8ec 100755 (executable)
--- a/logger.c
+++ b/logger.c
@@ -34,7 +34,6 @@
 #include "asterisk/utils.h"
 #include "asterisk/manager.h"
 #include "asterisk.h"
-#include "astconf.h"
 
 static int syslog_level_map[] = {
        LOG_DEBUG,
index f98f54991b7ad4f32ebaebcf5fba015a17a7007a..fda1cea38015ab1f0226f56d28f37aeab55df94c 100755 (executable)
@@ -4,9 +4,8 @@ KERNEL=`uname -r`
 MACHINE=`uname -m`
 OS=`uname -s`
 USER=`whoami`
-VERSION=`cat .version`
-rm -f build.h
-cat > build.h << END
+DATE=`date --utc "+%Y-%m-%d %H:%M:%S"`
+cat << END
 /*
  * build.h 
  * Automatically generated
@@ -15,6 +14,7 @@ cat > build.h << END
 #define BUILD_KERNEL "${KERNEL}"
 #define BUILD_MACHINE "${MACHINE}"
 #define BUILD_OS "${OS}"
-#define BUILD_VERSION "${VERSION}"
+#define BUILD_DATE "${DATE}"
 #define BUILD_USER "${USER}"
+
 END
index 4b53dfa39f4c0ea6e86d71c51b1a572c8dc9a955..1e5bd49bd62828f721206b906fc2e0c5aa9d64bf 100755 (executable)
@@ -26,7 +26,6 @@
 #include <errno.h>
 /* For where to put dynamic tables */
 #include "asterisk.h"
-#include "astconf.h"
 
 #ifdef __AST_DEBUG_MALLOC
 static void FREE(void *ptr)
index 4551c0cf83e49d62e50560ce52d28f7850fa2cfe..c30888dc472a2c35dc37ead69f7ed07dfc5998a0 100755 (executable)
@@ -31,7 +31,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <unistd.h>
-#include "astconf.h"
+#include "asterisk.h"
 
 /*
  * pbx_spool is similar in spirit to qcall, but with substantially enhanced functionality...
index f1837b5f01fe8f7b0a153d3adce728334a4db68c..726c549515c7b30572dda4327423202b80b0f214 100755 (executable)
@@ -47,7 +47,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/agi.h"
 #include "asterisk.h"
-#include "astconf.h"
 #ifdef SOLARIS
 #include "asterisk/astmm.h"
 #endif
index 13e4c2dbc88cb7881f6558a05f0d7ea1abc6ef0b..0ca1b9e11060504b121805f6a74216a758f2ed58 100755 (executable)
@@ -33,7 +33,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include "asterisk.h"
-#include "astconf.h"
 
 /*
  * Asterisk uses RSA keys with SHA-1 message digests for its
index 62d35dd1deb98507562cc5290940c9c2a9517466..1053e9aea550c165e955fcd5e9861ac20a792a0c 100755 (executable)
@@ -19,9 +19,6 @@
 #include "asterisk/utils.h"
 #include "asterisk/config.h"
 #include "asterisk.h"
-#include "astconf.h"
-
-#define AST_MONITOR_DIR        AST_SPOOL_DIR "/monitor"
 
 AST_MUTEX_DEFINE_STATIC(monitorlock);
 
@@ -83,7 +80,7 @@ int ast_monitor_start(        struct ast_channel *chan, const char *format_spec,
                char *channel_name, *p;
 
                /* Create monitoring directory if needed */
-               if (mkdir(AST_MONITOR_DIR, 0770) < 0) {
+               if (mkdir(ast_config_AST_MONITOR_DIR, 0770) < 0) {
                        if (errno != EEXIST) {
                                ast_log(LOG_WARNING, "Unable to create audio monitor directory: %s\n",
                                        strerror(errno));
@@ -109,16 +106,16 @@ int ast_monitor_start(    struct ast_channel *chan, const char *format_spec,
                                ast_safe_system(tmp);
                        }
                        snprintf(monitor->read_filename, FILENAME_MAX, "%s/%s-in",
-                                               directory ? "" : AST_MONITOR_DIR, fname_base);
+                                               directory ? "" : ast_config_AST_MONITOR_DIR, fname_base);
                        snprintf(monitor->write_filename, FILENAME_MAX, "%s/%s-out",
-                                               directory ? "" : AST_MONITOR_DIR, fname_base);
+                                               directory ? "" : ast_config_AST_MONITOR_DIR, fname_base);
                        strncpy(monitor->filename_base, fname_base, sizeof(monitor->filename_base) - 1);
                } else {
                        ast_mutex_lock(&monitorlock);
                        snprintf(monitor->read_filename, FILENAME_MAX, "%s/audio-in-%ld",
-                                               AST_MONITOR_DIR, seq);
+                                               ast_config_AST_MONITOR_DIR, seq);
                        snprintf(monitor->write_filename, FILENAME_MAX, "%s/audio-out-%ld",
-                                               AST_MONITOR_DIR, seq);
+                                               ast_config_AST_MONITOR_DIR, seq);
                        seq++;
                        ast_mutex_unlock(&monitorlock);
 
@@ -127,7 +124,7 @@ int ast_monitor_start(      struct ast_channel *chan, const char *format_spec,
                                        *p = '-';
                                }
                                snprintf(monitor->filename_base, FILENAME_MAX, "%s/%ld-%s",
-                                                AST_MONITOR_DIR, time(NULL),channel_name);
+                                                ast_config_AST_MONITOR_DIR, time(NULL),channel_name);
                                monitor->filename_changed = 1;
                        } else {
                                ast_log(LOG_ERROR,"Failed to allocate Memory\n");
@@ -236,7 +233,7 @@ int ast_monitor_stop(struct ast_channel *chan, int need_lock)
                        char *format = !strcasecmp(chan->monitor->format,"wav49") ? "WAV" : chan->monitor->format;
                        char *name = chan->monitor->filename_base;
                        int directory = strchr(name, '/') ? 1 : 0;
-                       char *dir = directory ? "" : AST_MONITOR_DIR;
+                       char *dir = directory ? "" : ast_config_AST_MONITOR_DIR;
 
                        /* Set the execute application */
                        execute = pbx_builtin_getvar_helper(chan, "MONITOR_EXEC");
@@ -295,7 +292,7 @@ int ast_monitor_change_fname(struct ast_channel *chan, const char *fname_base, i
                        ast_safe_system(tmp);
                }
 
-               snprintf(chan->monitor->filename_base, FILENAME_MAX, "%s/%s", directory ? "" : AST_MONITOR_DIR, fname_base);
+               snprintf(chan->monitor->filename_base, FILENAME_MAX, "%s/%s", directory ? "" : ast_config_AST_MONITOR_DIR, fname_base);
        } else {
                ast_log(LOG_WARNING, "Cannot change monitor filename of channel %s to %s, monitoring not started\n", chan->name, fname_base);
        }
index 3b8c5b0988cfa0ee8e2d80e0470852897700789e..33609c442321e83d9d5441210d0c55ec2aea900b 100755 (executable)
@@ -16,7 +16,6 @@
 #include "asterisk/logger.h"
 #include "asterisk/channel.h"
 #include "asterisk/pbx.h"
-#include "astconf.h"
 #include "asterisk/options.h"
 #include "asterisk/module.h"
 #include "asterisk/translate.h"