package/asterisk: update to 20.10.0
[buildroot-mgba.git] / package / asterisk / asterisk.mk
CommitLineData
05e306d8
YM
1################################################################################
2#
3# asterisk
4#
5################################################################################
6
5ed6aa0f 7ASTERISK_VERSION = 20.10.0
05e306d8
YM
8# Use the github mirror: it's an official mirror maintained by Digium, and
9# provides tarballs, which the main Asterisk git tree (behind Gerrit) does not.
10ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION))
11
12ASTERISK_SOUNDS_BASE_URL = http://downloads.asterisk.org/pub/telephony/sounds/releases
13ASTERISK_EXTRA_DOWNLOADS = \
78790d3e 14 $(ASTERISK_SOUNDS_BASE_URL)/asterisk-core-sounds-en-gsm-1.6.1.tar.gz \
05e306d8
YM
15 $(ASTERISK_SOUNDS_BASE_URL)/asterisk-moh-opsound-wav-2.03.tar.gz
16
e22572d1 17ASTERISK_LICENSE = GPL-2.0, BSD-3-Clause (SHA1, resample), BSD-4-Clause (db1-ast)
05e306d8
YM
18ASTERISK_LICENSE_FILES = \
19 COPYING \
20 main/sha1.c \
21 codecs/speex/speex_resampler.h \
22 utils/db1-ast/include/db.h
23
b2ef0347
FF
24ASTERISK_CPE_ID_VENDOR = asterisk
25ASTERISK_CPE_ID_PRODUCT = open_source
8d3b6b38 26ASTERISK_SELINUX_MODULES = asterisk
b2ef0347 27
300717f0 28# For patches 0002 and 0003
05e306d8 29ASTERISK_AUTORECONF = YES
0e6d4d21 30ASTERISK_AUTORECONF_OPTS = -Iautoconf -Ithird-party -Ithird-party/pjproject -Ithird-party/jansson -Ithird-party/libjwt
05e306d8
YM
31
32ASTERISK_DEPENDENCIES = \
33 host-asterisk \
bd42aa1d 34 host-pkgconf \
05e306d8
YM
35 jansson \
36 libcurl \
78790d3e 37 libedit \
0e6d4d21
WB
38 libjwt \
39 libpjsip \
05e306d8 40 libxml2 \
05e306d8
YM
41 sqlite \
42 util-linux
43
44# Asterisk wants to run its menuselect tool (a highly tweaked derivative of
45# kconfig), but builds it using the target tools. So we build it in the host
46# variant (see below), and copy the full build tree of menuselect.
47define ASTERISK_COPY_MENUSELECT
48 rm -rf $(@D)/menuselect
49 cp -a $(HOST_ASTERISK_DIR)/menuselect $(@D)/menuselect
50endef
51ASTERISK_PRE_CONFIGURE_HOOKS += ASTERISK_COPY_MENUSELECT
52
53ASTERISK_CONF_OPTS = \
54 --disable-xmldoc \
55 --disable-internal-poll \
56 --disable-asteriskssl \
57 --disable-rpath \
05e306d8 58 --without-bfd \
05e306d8
YM
59 --without-cap \
60 --without-cpg \
05e306d8
YM
61 --without-gtk2 \
62 --without-gmime \
05e306d8 63 --without-hoard \
05e306d8
YM
64 --without-iconv \
65 --without-iksemel \
66 --without-imap \
67 --without-inotify \
68 --without-iodbc \
05e306d8
YM
69 --without-jack \
70 --without-uriparser \
71 --without-kqueue \
05e306d8
YM
72 --without-libedit \
73 --without-libxslt \
05e306d8 74 --without-lua \
05e306d8 75 --without-mysqlclient \
05e306d8 76 --without-neon29 \
05e306d8 77 --without-newt \
05e306d8 78 --without-openr2 \
05e306d8 79 --without-osptk \
05e306d8 80 --without-postgres \
05e306d8 81 --without-popt \
05e306d8
YM
82 --without-resample \
83 --without-sdl \
84 --without-SDL_image \
05e306d8 85 --without-tds \
05e306d8 86 --without-timerfd \
05e306d8
YM
87 --without-unbound \
88 --without-unixodbc \
05e306d8 89 --without-x11 \
05e306d8
YM
90 --with-crypt \
91 --with-jansson \
92 --with-libcurl \
93 --with-ilbc \
0e6d4d21 94 --with-libjwt="$(STAGING_DIR)/usr" \
05e306d8 95 --with-libxml2 \
78790d3e 96 --with-libedit="$(STAGING_DIR)/usr" \
0e6d4d21
WB
97 --without-pjproject-bundled \
98 --with-pjproject="$(STAGING_DIR)/usr" \
05e306d8 99 --with-sqlite3="$(STAGING_DIR)/usr" \
9c5f17a9 100 --with-sounds-cache=$(ASTERISK_DL_DIR)
05e306d8
YM
101
102# avcodec are from ffmpeg. There is virtually zero chance this could
103# even work; asterisk is looking for ffmpeg/avcodec.h which has not
104# been installed in this location since early 2007 (~10 years ago at
105# the time of this writing).
106ASTERISK_CONF_OPTS += --without-avcodec
107
22ed1ddc
FF
108# asterisk is not compatible with freeswitch spandsp
109ASTERISK_CONF_OPTS += --without-spandsp
110
05e306d8 111ASTERISK_CONF_ENV = \
bd42aa1d 112 ac_cv_file_bridges_bridge_softmix_include_hrirs_h=true
05e306d8 113
78790d3e
BK
114# Uses __atomic_fetch_add_4
115ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
07b7d870 116ASTERISK_LIBS += -latomic
78790d3e
BK
117endif
118
07b7d870
WB
119ifeq ($(BR2_PACKAGE_LIBYUV)$(BR2_PACKAGE_JPEG),yy)
120ASTERISK_LIBS += -ljpeg
121endif
122
123ASTERISK_CONF_ENV += LIBS="$(ASTERISK_LIBS)"
124
19b1c16e
YM
125ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
126ASTERISK_CONF_OPTS += --with-execinfo
127else
128ASTERISK_CONF_OPTS += --without-execinfo
129endif
130
d068ccfd
YM
131ifeq ($(BR2_PACKAGE_LIBGSM),y)
132ASTERISK_DEPENDENCIES += libgsm
133ASTERISK_CONF_OPTS += --with-gsm
134else
135ASTERISK_CONF_OPTS += --without-gsm
136endif
137
bb50a1ff
YM
138ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
139ASTERISK_DEPENDENCIES += alsa-lib
140ASTERISK_CONF_OPTS += --with-asound
141else
142ASTERISK_CONF_OPTS += --without-asound
143endif
144
61a81333 145ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
dd3d7d18
FF
146ASTERISK_DEPENDENCIES += bluez5_utils
147ASTERISK_CONF_OPTS += --with-bluetooth
94ae9f15
YM
148else
149ASTERISK_CONF_OPTS += --without-bluetooth
150endif
151
a1e2cd63
YM
152ifeq ($(BR2_PACKAGE_LIBICAL),y)
153ASTERISK_DEPENDENCIES += libical
154ASTERISK_CONF_OPTS += --with-ical
155else
156ASTERISK_CONF_OPTS += --without-ical
157endif
158
04d86a59
YM
159ifeq ($(BR2_PACKAGE_OPENLDAP),y)
160ASTERISK_DEPENDENCIES += openldap
161ASTERISK_CONF_OPTS += --with-ldap
162else
163ASTERISK_CONF_OPTS += --without-ldap
164endif
165
1cf7b3c7
YM
166ifeq ($(BR2_PACKAGE_NEON),y)
167ASTERISK_DEPENDENCIES += neon
168ASTERISK_CONF_OPTS += --with-neon
169ASTERISK_CONF_ENV += \
170 ac_cv_path_CONFIG_NEON=$(STAGING_DIR)/usr/bin/neon-config
171else
172ASTERISK_CONF_OPTS += --without-neon
173endif
174
4d597d70
YM
175ifeq ($(BR2_PACKAGE_NETSNMP),y)
176ASTERISK_DEPENDENCIES += netsnmp
177ASTERISK_CONF_OPTS += --with-netsnmp=$(STAGING_DIR)/usr
178else
179ASTERISK_CONF_OPTS += --without-netsnmp
180endif
181
637800de
YM
182ifeq ($(BR2_PACKAGE_LIBOGG),y)
183ASTERISK_DEPENDENCIES += libogg
184ASTERISK_CONF_OPTS += --with-ogg
185else
186ASTERISK_CONF_OPTS += --without-ogg
187endif
188
da2539d5
YM
189ifeq ($(BR2_PACKAGE_OPUS),y)
190ASTERISK_DEPENDENCIES += opus
191ASTERISK_CONF_OPTS += --with-opus
192else
193ASTERISK_CONF_OPTS += --without-opus
194endif
195
9b12a77f
YM
196ifeq ($(BR2_PACKAGE_PORTAUDIO),y)
197ASTERISK_DEPENDENCIES += portaudio
198ASTERISK_CONF_OPTS += --with-portaudio
199else
200ASTERISK_CONF_OPTS += --without-portaudio
201endif
202
5a532b02
YM
203ifeq ($(BR2_PACKAGE_FREERADIUS_CLIENT),y)
204ASTERISK_DEPENDENCIES += freeradius-client
205ASTERISK_CONF_OPTS += --with-radius
206else
207ASTERISK_CONF_OPTS += --without-radius
208endif
209
e1fba2c4
YM
210ifeq ($(BR2_PACKAGE_DAHDI_LINUX)$(BR2_PACKAGE_DAHDI_TOOLS),yy)
211ASTERISK_DEPENDENCIES += dahdi-linux dahdi-tools
212ASTERISK_CONF_OPTS += --with-dahdi --with-tonezone
66e632f7 213
bef84afa
YM
214ifeq ($(BR2_PACKAGE_LIBPRI),y)
215ASTERISK_DEPENDENCIES += libpri
216ASTERISK_CONF_OPTS += --with-pri
217else
218ASTERISK_CONF_OPTS += --without-pri
219endif # PRI
220
66e632f7
YM
221ifeq ($(BR2_PACKAGE_LIBSS7),y)
222ASTERISK_DEPENDENCIES += libss7
223ASTERISK_CONF_OPTS += --with-ss7
224else
225ASTERISK_CONF_OPTS += --without-ss7
226endif # SS7
227
e1fba2c4 228else
bef84afa
YM
229ASTERISK_CONF_OPTS += \
230 --without-dahdi --without-tonezone \
231 --without-pri --without-ss7
e1fba2c4
YM
232endif # DAHDI
233
5bc671c3
YM
234ifeq ($(BR2_PACKAGE_OPENSSL),y)
235ASTERISK_DEPENDENCIES += openssl
236ASTERISK_CONF_OPTS += --with-ssl
237else
238ASTERISK_CONF_OPTS += --without-ssl
239endif
240
8996fede
YM
241ifeq ($(BR2_PACKAGE_LIBXCRYPT),y)
242# --with-crypt is unconditional, relies on the C library if present
243ASTERISK_DEPENDENCIES += libxcrypt
244endif
245
bb9a2c17 246ifeq ($(BR2_PACKAGE_SPEEX)$(BR2_PACKAGE_SPEEXDSP),yy)
4f1c3403
YM
247ASTERISK_DEPENDENCIES += speex
248ASTERISK_CONF_OPTS += --with-speex --with-speexdsp
249else
fd3f8ae5 250ASTERISK_CONF_OPTS += --without-speex --without-speexdsp
4f1c3403
YM
251endif
252
c48bff9d 253# asterisk needs an openssl-enabled libsrtp
19294eb3 254ifeq ($(BR2_PACKAGE_LIBSRTP)$(BR2_PACKAGE_OPENSSL),yy)
7ebab72b
YM
255ASTERISK_DEPENDENCIES += libsrtp
256ASTERISK_CONF_OPTS += --with-srtp
257else
258ASTERISK_CONF_OPTS += --without-srtp
259endif
260
c5a4355c
YM
261ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
262ASTERISK_DEPENDENCIES += libvorbis
263ASTERISK_CONF_OPTS += --with-vorbis
264else
265ASTERISK_CONF_OPTS += --without-vorbis
266endif
267
13fcc16d
YM
268ifeq ($(BR2_PACKAGE_ZLIB),y)
269ASTERISK_DEPENDENCIES += zlib
270ASTERISK_CONF_OPTS += --with-z
271else
272ASTERISK_CONF_OPTS += --without-z
273endif
274
05e306d8
YM
275ASTERISK_DIRS = \
276 ASTVARLIBDIR="/usr/lib/asterisk" \
277 ASTDATADIR="/usr/lib/asterisk" \
278 ASTKEYDIR="/usr/lib/asterisk" \
279 ASTDBDIR="/usr/lib/asterisk"
280
281ASTERISK_MAKE_OPTS = $(ASTERISK_DIRS)
282
78790d3e
BK
283# Uses __atomic_fetch_add_4
284ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
285ASTERISK_MAKE_OPTS += ASTLDFLAGS="-latomic"
286endif
287
eaba3c8e
GB
288# Remove default -O3 optimization flag
289ASTERISK_MAKE_OPTS += OPTIMIZE=""
290
830fb828
GB
291ASTERISK_CFLAGS = $(TARGET_CFLAGS)
292
293ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)
294ASTERISK_CFLAGS += -O0
295endif
296
297ASTERISK_CONF_OPTS += CFLAGS="$(ASTERISK_CFLAGS)"
298
05e306d8
YM
299# We want to install sample configuration files, too.
300ASTERISK_INSTALL_TARGET_OPTS = \
301 $(ASTERISK_DIRS) \
302 DESTDIR=$(TARGET_DIR) \
303 LDCONFIG=true \
304 install samples
305
306$(eval $(autotools-package))
307
308#-------------------------------------------------------------------------------
309# This part deals with building the menuselect tool as a host package
310
311HOST_ASTERISK_DEPENDENCIES = host-pkgconf host-libxml2 host-ncurses
312HOST_ASTERISK_SUBDIR = menuselect
313
314HOST_ASTERISK_LICENSE = GPL-2.0
315HOST_ASTERISK_LICENSE_FILES = COPYING
316
317# No need to autoreconf for the host variant,
318# so do not inherit the target setup.
319HOST_ASTERISK_AUTORECONF = NO
320
05e306d8
YM
321HOST_ASTERISK_CONF_OPTS = \
322 --without-newt \
323 --without-curses \
af0cd44a 324 --with-ncurses=$(HOST_DIR)
05e306d8 325
52dfe8bf
YM
326# Not an automake package, so does not inherit LDFLAGS et al. from
327# the configure run.
328HOST_ASTERISK_MAKE_ENV = $(HOST_CONFIGURE_OPTS)
329
330# Even though menuselect is an autotools package, it is not an automake
331# package and does not have an 'install' rule, as asterisk does expect
332# it to be in a sub-directory of its source tree. We do so by copying
333# the full menuselect build tree as a pre-configure hook in the target
334# variant.
335# However, the sanity checks on host packages are not run on menuselect.
336# But we still want to catch that menuselect has the proper rpath set,
337# for example, as it uses host libraries that we do build, like
338# host-libxml2.
339# So we do manually install the menuselect tool.
05e306d8 340define HOST_ASTERISK_INSTALL_CMDS
52dfe8bf
YM
341 $(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \
342 $(HOST_DIR)/bin/asterisk-menuselect
05e306d8
YM
343endef
344
345$(eval $(host-autotools-package))
This page took 2.259429 seconds and 4 git commands to generate.