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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
#
# Patch managed by http://www.holgerschurig.de/patcher.html
#
--- asterisk-1.0.7/Makefile~makefile.patch
+++ asterisk-1.0.7/Makefile
@@ -127,64 +127,67 @@
AGI_DIR=$(ASTVARLIBDIR)/agi-bin
INCLUDE=-Iinclude -I../include
-CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-CFLAGS+=$(OPTIMIZE)
+my_CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+my_CFLAGS+=$(OPTIMIZE)
ifneq ($(PROC),ultrasparc)
-CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
+my_CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
endif
-CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
-CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
+my_CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
+my_CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
ifeq (${OSARCH},FreeBSD)
OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
-CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+my_CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
INCLUDE+=-I/usr/local/include
-CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
+my_CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
MPG123TARG=freebsd
endif # FreeBSD
ifeq (${OSARCH},NetBSD)
-CFLAGS+=-pthread
+my_CFLAGS+=-pthread
INCLUDE+=-I/usr/local/include -I/usr/pkg/include
MPG123TARG=netbsd
endif
ifeq (${OSARCH},OpenBSD)
-CFLAGS+=-pthread
+my_CFLAGS+=-pthread
endif
#Uncomment this to use the older DSP routines
#CFLAGS+=-DOLD_DSP_ROUTINES
-CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
+my_CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
+my_CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
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)
HTTPDIR=$(shell if [ -d /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+=-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)\"
+my_CFLAGS+=-DASTERISK_VERSION=\"$(ASTERISKVERSION)\"
+my_CFLAGS+=-DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
+my_CFLAGS+=-DASTETCDIR=\"$(ASTETCDIR)\"
+my_CFLAGS+=-DASTLIBDIR=\"$(ASTLIBDIR)\"
+my_CFLAGS+=-DASTVARLIBDIR=\"$(ASTVARLIBDIR)\"
+my_CFLAGS+=-DASTVARRUNDIR=\"$(ASTVARRUNDIR)\"
+my_CFLAGS+=-DASTSPOOLDIR=\"$(ASTSPOOLDIR)\"
+my_CFLAGS+=-DASTLOGDIR=\"$(ASTLOGDIR)\"
+my_CFLAGS+=-DASTCONFPATH=\"$(ASTCONFPATH)\"
+my_CFLAGS+=-DASTMODDIR=\"$(MODULES_DIR)\"
+my_CFLAGS+=-DASTAGIDIR=\"$(AGI_DIR)\"
+
+my_CFLAGS+= $(DEBUG_THREADS)
+my_CFLAGS+= $(TRACE_FRAMES)
+my_CFLAGS+= $(MALLOC_DEBUG)
+my_CFLAGS+= $(BUSYDETECT)
+my_CFLAGS+= $(OPTIONS)
+my_CFLAGS+=# -fomit-frame-pointer
+
+override CFLAGS += $(my_CFLAGS)
-CFLAGS+= $(DEBUG_THREADS)
-CFLAGS+= $(TRACE_FRAMES)
-CFLAGS+= $(MALLOC_DEBUG)
-CFLAGS+= $(BUSYDETECT)
-CFLAGS+= $(OPTIONS)
-CFLAGS+=# -fomit-frame-pointer
SUBDIRS=res channels pbx apps codecs formats agi cdr astman stdtime
ifeq (${OSARCH},Linux)
LIBS=-ldl -lpthread
@@ -296,7 +299,7 @@
fi
asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LDFLAGS) $(LIBS)
muted: muted.o
$(CC) -o muted muted.o
--- asterisk-1.0.7/res/Makefile~makefile.patch
+++ asterisk-1.0.7/res/Makefile
@@ -13,15 +13,13 @@
MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
res_agi.so
-MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
+MODS+=$(shell if [ -f "${STAGING_INCDIR}/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
+MODS+=$(shell if [ -f "${STAGING_INCDIR}/osp/osp.h" ]; then echo "res_osp.so"; fi)
CRYPTO_LIBS=-lssl -lcrypto
CFLAGS+=
-CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
-CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
+CFLAGS+=$(shell [ -f ${STAGING_INCDIR}/linux/zaptel.h ] && echo " -DZAPATA_MOH")
#
# Work around buggy RedHat 9.0
#
@@ -37,7 +35,7 @@
for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)
+ $(CC) $(SOLINK) -o $@ $< $(LDFLAGS) $(CRYPTO_LIBS)
clean:
rm -f *.so *.o .depend
--- asterisk-1.0.7/channels/Makefile~makefile.patch
+++ asterisk-1.0.7/channels/Makefile
@@ -71,22 +71,20 @@
CHANNEL_LIBS+=chan_oss.so
endif
-CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
-CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
+CHANNEL_LIBS+=$(shell [ -f ${STAGING_INCDIR}/linux/ixjuser.h ] && echo chan_phone.so)
CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
-CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
-CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
-CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
+CFLAGS+=$(shell [ ! -f ${STAGING_INCDIR}/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
+CHANNEL_LIBS+=$(shell [ -f ${STAGING_INCDIR}/alsa/asoundlib.h ] && echo "chan_alsa.so")
+CFLAGS+=$(shell [ -f ${STAGING_LIBDIR}/libpri.so.1 ] && echo " -DZAPATA_PRI")
+CFLAGS+=$(shell [ -f ${STAGING_LIBDIR}/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
-ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
-CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
-CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
+ZAPPRI=$(shell [ -f ${STAGING_LIBDIR}/libpri.so.1 ] && echo "-lpri")
+ZAPR2=$(shell [ -f ${STAGING_LIBDIR}/libmfcr2.so.1 ] && echo "-lmfcr2")
+CFLAGS+=$(shell [ -f ${STAGING_INCDIR}/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
+CHANNEL_LIBS+=$(shell [ -f ${STAGING_INCDIR}/vpbapi.h ] && echo "chan_vpb.so" )
+CFLAGS+=$(shell [ -f ${STAGING_INCDIR}/vpbapi.h ] && echo " -DLINUX")
ALSA_SRC=chan_alsa.c
ALSA_SRC+=$(shell [ -f alsa-monitor.h ] && echo "alsa-monitor.h")
@@ -106,10 +104,9 @@
ZAPDIR=/usr/lib
-CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
-CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
+CHANNEL_LIBS+=$(shell [ -f ${STAGING_INCDIR}/linux/zaptel.h ] && echo "chan_zap.so")
-CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+CHANNEL_LIBS+=$(shell [ -f ${STAGING_INCDIR}/nbs.h ] && echo "chan_nbs.so" )
ifndef OPENH323DIR
OPENH323DIR=$(HOME)/openh323
@@ -135,10 +132,10 @@
endif
gentone: gentone.c
- $(CC) -o gentone gentone.c -lm
+ $(BUILD_CC) -o gentone gentone.c -lm
gentone-ulaw: gentone-ulaw.c
- $(CC) -o gentone-ulaw gentone-ulaw.c -lm
+ $(BUILD_CC) -o gentone-ulaw gentone-ulaw.c -lm
busy.h: gentone
./gentone busy 480 620
--- asterisk-1.0.7/pbx/Makefile~makefile.patch
+++ asterisk-1.0.7/pbx/Makefile
@@ -16,7 +16,7 @@
PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
# Add GTK console if appropriate
-PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+PBX_LIBS+=$(shell ${STAGING_BINDIR_CROSS}/gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
--- asterisk-1.0.7/codecs/lpc10/Makefile~makefile.patch
+++ asterisk-1.0.7/codecs/lpc10/Makefile
@@ -25,28 +25,6 @@
CFLAGS += $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS) -fPIC
#CFLAGS+= $(shell if uname -m | grep -q 86; then echo "-mpentium" ; fi)
-#fix for PPC processors and ALPHA, And UltraSparc too
-ifneq ($(OSARCH),Darwin)
-ifneq ($(findstring BSD,${OSARCH}),BSD)
-ifneq ($(PROC),ppc)
-ifneq ($(PROC),x86_64)
-ifneq ($(PROC),alpha)
-#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-#This works for even old (2.96) versions of gcc and provides a small boost either way.
-#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn.t support it.
-#So we go lowest common available by gcc and go a step down, still a step up from
-#the default as we now have a better instruction set to work with. - Belgarath
-ifeq ($(PROC),ultrasparc)
- CFLAGS+= -mtune=$(PROC) -mcpu=v8 -O3 -fomit-frame-pointer
-else
- CFLAGS+= -march=$(PROC)
-endif
-endif
-endif
-endif
-endif
-endif
-
LIB = $(LIB_TARGET_DIR)/liblpc10.a
.PHONY: all clean
--- asterisk-1.0.7/cdr/Makefile~makefile.patch
+++ asterisk-1.0.7/cdr/Makefile
@@ -37,36 +37,25 @@
#
# unixODBC stuff...
#
-MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
-MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
+MODS+=$(shell if [ -f "${STAGING_INCDIR}/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
#
# FreeTDS stuff...
#
-MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi)
-MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi)
+MODS+=$(shell if [ -f "${STAGING_INCDIR}/tds.h" ]; then echo "cdr_tds.so"; fi)
#
# PGSQL stuff... Autoconf anyone??
#
-MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi)
-CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi)
-CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi)
-CFLAGS+=$(shell if [ -d /usr/include/postgresql ]; then echo "-I/usr/include/postgresql"; fi)
-CFLAGS+=$(shell if [ -d /usr/local/include/pgsql ]; then echo "-I/usr/local/include/pgsql"; fi)
-CFLAGS+=$(shell if [ -d /opt/pgsql/include ]; then echo "-I/opt/pgsql/include"; fi)
-#CFLAGS+=$(shell if [ -f /usr/include/libpq-fe.h ]; then echo "-I/usr/include"; fi)
+CFLAGS+=$(shell if [ -d ${STAGING_INCDIR}/pgsql ]; then echo "-I${STAGING_INCDIR}/pgsql"; fi)
+CFLAGS+=$(shell if [ -d ${STAGING_INCDIR}/postgresql ]; then echo "-I${STAGING_INCDIR}/postgresql"; fi)
MLFLAGS=
-MLFLAGS+=$(shell if [ -d /usr/lib/pgsql ]; then echo "-L/usr/lib/pgsql"; fi)
-MLFLAGS+=$(shell if [ -d /usr/local/pgsql/lib ]; then echo "-L/usr/local/pgsql/lib"; fi)
-MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi)
-MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi)
-MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi)
+MLFLAGS+=$(shell if [ -d ${STAGING_LIBDIR}/pgsql ]; then echo "-L${STAGING_LIBDIR}/pgsql"; fi)
#
# SQLIte stuff...
#
-MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
+MODS+=$(shell if [ -f "${STAGING_INCDIR}/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
all: depend $(MODS)
@@ -84,16 +73,16 @@
endif
cdr_odbc.so: cdr_odbc.o
- $(CC) $(SOLINK) -o $@ $< -lodbc $(MLFLAGS)
+ $(CC) $(SOLINK) -o $@ $< -lodbc $(LDFLAGS) $$(MLFLAGS)
cdr_tds.so: cdr_tds.o
- $(CC) $(SOLINK) -o $@ $< -ltds $(MLFLAGS)
+ $(CC) $(SOLINK) -o $@ $< -ltds $(LDFLAGS) $$(MLFLAGS)
cdr_pgsql.so: cdr_pgsql.o
- $(CC) $(SOLINK) -o $@ $< -lpq -lz $(MLFLAGS)
+ $(CC) $(SOLINK) -o $@ $< -lpq -lz $(LDFLAGS) $$(MLFLAGS)
cdr_sqlite.so: cdr_sqlite.o
- $(CC) $(SOLINK) -o $@ $< -lsqlite $(MLFLAGS)
+ $(CC) $(SOLINK) -o $@ $< -lsqlite $(LDFLAGS) $(MLFLAGS)
depend: .depend
|