blob: 8bc49a7a5b5e3c194622b69e3457c2f16bf2adf3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
--- icd-1.0.0/Makefile.orig 2005-06-15 20:48:38.000000000 +0200
+++ icd-1.0.0/Makefile 2005-06-15 21:09:04.000000000 +0200
@@ -3,56 +3,37 @@
all: .sqlite app_icd.so
-
.sqlite:
cd sqlite && test -f ./config.status || ./configure --enable-threadsafe
cd sqlite && make
touch .sqlite
-
-
%.o: %.c
@echo -n " ===> Compile:" `pwd` ; echo "/$< ($@)"
@$(CC) -fPIC $(CFLAGS) -c -o $@ $<
-
app_icd.so: $(OBJS)
@echo " ===> Linking: >> $(OBJS) << ($@)"
@$(CC) -fPIC -shared -Xlinker -x -o $@ $(OBJS) $(LDFLAGS) ./sqlite/.libs/libsqlite3.a
-
-config_if_none:
+config:
@if [ ! -d $(ASTETCDIR)/icd_config ] ; then echo INSTALLING NEW CONFIGS ;\
- mkdir $(ASTETCDIR)/icd_config ;\
+ mkdir -p $(ASTETCDIR)/icd_config ;\
/bin/cp -dp icd_config/*.conf $(ASTETCDIR)/icd_config ;\
echo CONFIGS INSTALLED ;\
fi
-
-config_overwrite:
- @echo 'INSTALLING CONFIGS (OVERWRITE)'
- @if [ ! -d $(ASTETCDIR)/icd_config ] ; then mkdir $(ASTETCDIR)/icd_config ; fi
- @/bin/cp -dp icd_config/*.conf $(ASTETCDIR)/icd_config ;\
- echo CONFIGS OVERWRITTEN
-
-overwrite: clean all install config_overwrite
-
-fresh: clean all install
-
-$(MODULES_DIR)/app_icd.so: app_icd.so
- @/bin/cp -pf app_icd.so $(MODULES_DIR)
-
-modules: $(MODULES_DIR)/app_icd.so $(DYNA)
- @/bin/mkdir -p /usr/lib/icd
- @/bin/cp icd_mod_*.so /usr/lib/icd
+modules: app_icd.so $(DYNA)
+ @/bin/mkdir -p $(INSTALL_PREFIX)/usr/lib/icd
+ @/bin/cp icd_mod_*.so $(INSTALL_PREFIX)/usr/lib/icd
@echo OK MODULE INSTALL COMPLETE
-install: all modules config_if_none
- @echo INSTALLING
- @/bin/rm -f $(MODULES_DIR)/app_icd.so
+install: modules config
+ @echo INSTALLING
+ @/bin/mkdir -p $(MODULES_DIR)
@/bin/cp -p app_icd.so $(MODULES_DIR)
- @/bin/mkdir -p /usr/lib/icd
- @/bin/cp icd_mod_*.so /usr/lib/icd
+ @/bin/mkdir -p $(INSTALL_PREFIX)/usr/lib/icd
+ @/bin/cp icd_mod_*.so $(INSTALL_PREFIX)/usr/lib/icd
@echo OK INSTALL COMPLETE
clean:
@@ -65,5 +46,4 @@
%.so: %.c
@echo -n " ===> Compile External Module:" `pwd` ; echo "/$< ($@)"
@$(CC) -fPIC $(CFLAGS) -c $<
- @$(CC) -fPIC -shared -Xlinker -x -o $@ $(shell echo $@ | sed "s/\.so/\.o/g" ) /usr/lib/asterisk/modules/app_icd.so $(LDFLAGS)
-
+ @$(CC) -fPIC -shared -Xlinker -x -o $@ $(shell echo $@ | sed "s/\.so/\.o/g" ) $(LDFLAGS)
--- icd-1.0.0/make.conf.orig 2005-06-15 20:52:32.000000000 +0200
+++ icd-1.0.0/make.conf 2005-06-15 21:02:26.000000000 +0200
@@ -1,31 +1,25 @@
# what compiler
-CC=gcc
+CC:=gcc
OBJS = app_icd.o icd_agent.o icd_bridge.o icd_caller.o icd_caller_list.o icd_command.o \
icd_conference.o icd_config.o icd_customer.o icd_distributor.o icd_distributor_list.o \
icd_event.o icd_fieldset.o icd_list.o icd_listeners.o icd_member.o icd_member_list.o \
icd_metalist.o icd_queue.o voidhash.o \
- icd_module_api.o icd_plugable_fn.o icd_plugable_fn_list.o
+ icd_module_api.o icd_plugable_fn.o icd_plugable_fn_list.o
FORDIST = icd_caller.o icd_distributor.o
# this is the path to apr-config a MUST HAVE for APR
-APR_CONFIG=/usr/local/apr/bin/apr-config
+APR_CONFIG:=/usr/bin/apr-config
# Uncomment YES or NO for apr support or just touch .apr file in the icd src dir.
-#USE_APR=YES
-#USE_APR=NO
-USE_APR=$(shell if [ -f .apr ] ; then echo YES ; else echo NO ; fi )
+USE_APR:=NO
# Uncomment to print every malloc/dealloc when apr mode is active
#CFLAGS += -DICD_APR_DEBUG
-
-
CFLAGS += $(shell if [ -f $(APR_CONFIG) ] && [ $(USE_APR) = "YES" ] ; then $(APR_CONFIG) --cflags --includes ; fi )
CFLAGS += $(shell if [ -f $(APR_CONFIG) ] && [ $(USE_APR) = "YES" ] ; then echo -DUSE_APR ; fi )
LDFLAGS += $(shell if [ -f $(APR_CONFIG) ] && [ $(USE_APR) = "YES" ] ; then $(APR_CONFIG) --link-ld --libs ; fi )
OBJS += $(shell if [ -f $(APR_CONFIG) ] && [ $(USE_APR) = "YES" ] ; then echo icd_apr.o ; fi )
-# where is the asterisk source tree
-ASTSRC = /usr/src/asterisk
#####################################################################################
# copy these from the asterisk top level Makefile
@@ -39,19 +33,20 @@
ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
-ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run/asterisk
MODULES_DIR=$(ASTLIBDIR)/modules
AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-INCLUDES = -I$(ASTSRC) -I$(ASTSRC)/include -I.
+INCLUDES = -I.
CFLAGS += $(INCLUDES)
CFLAGS += -DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\" -DASTETCDIR=\"$(ASTETCDIR)\" -DASTLIBDIR=\"$(ASTLIBDIR)\"
CFLAGS += -DASTVARLIBDIR=\"$(ASTVARLIBDIR)\" -DASTVARRUNDIR=\"$(ASTVARRUNDIR)\" -DASTSPOOLDIR=\"$(ASTSPOOLDIR)\" -DASTLOGDIR=\"$(ASTLOGDIR)\"
CFLAGS += -DASTCONFPATH=\"$(ASTCONFPATH)\" -DASTMODDIR=\"$(MODULES_DIR)\" -DASTAGIDIR=\"$(AGI_DIR)\" -D_GNU_SOURCE
-CFLAGS += -O0 -g
CFLAGS += -Wall
-#CFLAGS += -DNDEBUG
+ifeq ($(DEBUG),1)
+CFLAGS += -g -DNDEBUG
+endif
|