Commit | Line | Data |
---|---|---|
05e306d8 YM |
1 | ################################################################################ |
2 | # | |
3 | # asterisk | |
4 | # | |
5 | ################################################################################ | |
6 | ||
5ed6aa0f | 7 | ASTERISK_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. | |
10 | ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION)) | |
11 | ||
12 | ASTERISK_SOUNDS_BASE_URL = http://downloads.asterisk.org/pub/telephony/sounds/releases | |
13 | ASTERISK_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 | 17 | ASTERISK_LICENSE = GPL-2.0, BSD-3-Clause (SHA1, resample), BSD-4-Clause (db1-ast) |
05e306d8 YM |
18 | ASTERISK_LICENSE_FILES = \ |
19 | COPYING \ | |
20 | main/sha1.c \ | |
21 | codecs/speex/speex_resampler.h \ | |
22 | utils/db1-ast/include/db.h | |
23 | ||
b2ef0347 FF |
24 | ASTERISK_CPE_ID_VENDOR = asterisk |
25 | ASTERISK_CPE_ID_PRODUCT = open_source | |
8d3b6b38 | 26 | ASTERISK_SELINUX_MODULES = asterisk |
b2ef0347 | 27 | |
300717f0 | 28 | # For patches 0002 and 0003 |
05e306d8 | 29 | ASTERISK_AUTORECONF = YES |
0e6d4d21 | 30 | ASTERISK_AUTORECONF_OPTS = -Iautoconf -Ithird-party -Ithird-party/pjproject -Ithird-party/jansson -Ithird-party/libjwt |
05e306d8 YM |
31 | |
32 | ASTERISK_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. | |
47 | define ASTERISK_COPY_MENUSELECT | |
48 | rm -rf $(@D)/menuselect | |
49 | cp -a $(HOST_ASTERISK_DIR)/menuselect $(@D)/menuselect | |
50 | endef | |
51 | ASTERISK_PRE_CONFIGURE_HOOKS += ASTERISK_COPY_MENUSELECT | |
52 | ||
53 | ASTERISK_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). | |
106 | ASTERISK_CONF_OPTS += --without-avcodec | |
107 | ||
22ed1ddc FF |
108 | # asterisk is not compatible with freeswitch spandsp |
109 | ASTERISK_CONF_OPTS += --without-spandsp | |
110 | ||
05e306d8 | 111 | ASTERISK_CONF_ENV = \ |
bd42aa1d | 112 | ac_cv_file_bridges_bridge_softmix_include_hrirs_h=true |
05e306d8 | 113 | |
78790d3e BK |
114 | # Uses __atomic_fetch_add_4 |
115 | ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) | |
07b7d870 | 116 | ASTERISK_LIBS += -latomic |
78790d3e BK |
117 | endif |
118 | ||
07b7d870 WB |
119 | ifeq ($(BR2_PACKAGE_LIBYUV)$(BR2_PACKAGE_JPEG),yy) |
120 | ASTERISK_LIBS += -ljpeg | |
121 | endif | |
122 | ||
123 | ASTERISK_CONF_ENV += LIBS="$(ASTERISK_LIBS)" | |
124 | ||
19b1c16e YM |
125 | ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) |
126 | ASTERISK_CONF_OPTS += --with-execinfo | |
127 | else | |
128 | ASTERISK_CONF_OPTS += --without-execinfo | |
129 | endif | |
130 | ||
d068ccfd YM |
131 | ifeq ($(BR2_PACKAGE_LIBGSM),y) |
132 | ASTERISK_DEPENDENCIES += libgsm | |
133 | ASTERISK_CONF_OPTS += --with-gsm | |
134 | else | |
135 | ASTERISK_CONF_OPTS += --without-gsm | |
136 | endif | |
137 | ||
bb50a1ff YM |
138 | ifeq ($(BR2_PACKAGE_ALSA_LIB),y) |
139 | ASTERISK_DEPENDENCIES += alsa-lib | |
140 | ASTERISK_CONF_OPTS += --with-asound | |
141 | else | |
142 | ASTERISK_CONF_OPTS += --without-asound | |
143 | endif | |
144 | ||
61a81333 | 145 | ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y) |
dd3d7d18 FF |
146 | ASTERISK_DEPENDENCIES += bluez5_utils |
147 | ASTERISK_CONF_OPTS += --with-bluetooth | |
94ae9f15 YM |
148 | else |
149 | ASTERISK_CONF_OPTS += --without-bluetooth | |
150 | endif | |
151 | ||
a1e2cd63 YM |
152 | ifeq ($(BR2_PACKAGE_LIBICAL),y) |
153 | ASTERISK_DEPENDENCIES += libical | |
154 | ASTERISK_CONF_OPTS += --with-ical | |
155 | else | |
156 | ASTERISK_CONF_OPTS += --without-ical | |
157 | endif | |
158 | ||
04d86a59 YM |
159 | ifeq ($(BR2_PACKAGE_OPENLDAP),y) |
160 | ASTERISK_DEPENDENCIES += openldap | |
161 | ASTERISK_CONF_OPTS += --with-ldap | |
162 | else | |
163 | ASTERISK_CONF_OPTS += --without-ldap | |
164 | endif | |
165 | ||
1cf7b3c7 YM |
166 | ifeq ($(BR2_PACKAGE_NEON),y) |
167 | ASTERISK_DEPENDENCIES += neon | |
168 | ASTERISK_CONF_OPTS += --with-neon | |
169 | ASTERISK_CONF_ENV += \ | |
170 | ac_cv_path_CONFIG_NEON=$(STAGING_DIR)/usr/bin/neon-config | |
171 | else | |
172 | ASTERISK_CONF_OPTS += --without-neon | |
173 | endif | |
174 | ||
4d597d70 YM |
175 | ifeq ($(BR2_PACKAGE_NETSNMP),y) |
176 | ASTERISK_DEPENDENCIES += netsnmp | |
177 | ASTERISK_CONF_OPTS += --with-netsnmp=$(STAGING_DIR)/usr | |
178 | else | |
179 | ASTERISK_CONF_OPTS += --without-netsnmp | |
180 | endif | |
181 | ||
637800de YM |
182 | ifeq ($(BR2_PACKAGE_LIBOGG),y) |
183 | ASTERISK_DEPENDENCIES += libogg | |
184 | ASTERISK_CONF_OPTS += --with-ogg | |
185 | else | |
186 | ASTERISK_CONF_OPTS += --without-ogg | |
187 | endif | |
188 | ||
da2539d5 YM |
189 | ifeq ($(BR2_PACKAGE_OPUS),y) |
190 | ASTERISK_DEPENDENCIES += opus | |
191 | ASTERISK_CONF_OPTS += --with-opus | |
192 | else | |
193 | ASTERISK_CONF_OPTS += --without-opus | |
194 | endif | |
195 | ||
9b12a77f YM |
196 | ifeq ($(BR2_PACKAGE_PORTAUDIO),y) |
197 | ASTERISK_DEPENDENCIES += portaudio | |
198 | ASTERISK_CONF_OPTS += --with-portaudio | |
199 | else | |
200 | ASTERISK_CONF_OPTS += --without-portaudio | |
201 | endif | |
202 | ||
5a532b02 YM |
203 | ifeq ($(BR2_PACKAGE_FREERADIUS_CLIENT),y) |
204 | ASTERISK_DEPENDENCIES += freeradius-client | |
205 | ASTERISK_CONF_OPTS += --with-radius | |
206 | else | |
207 | ASTERISK_CONF_OPTS += --without-radius | |
208 | endif | |
209 | ||
e1fba2c4 YM |
210 | ifeq ($(BR2_PACKAGE_DAHDI_LINUX)$(BR2_PACKAGE_DAHDI_TOOLS),yy) |
211 | ASTERISK_DEPENDENCIES += dahdi-linux dahdi-tools | |
212 | ASTERISK_CONF_OPTS += --with-dahdi --with-tonezone | |
66e632f7 | 213 | |
bef84afa YM |
214 | ifeq ($(BR2_PACKAGE_LIBPRI),y) |
215 | ASTERISK_DEPENDENCIES += libpri | |
216 | ASTERISK_CONF_OPTS += --with-pri | |
217 | else | |
218 | ASTERISK_CONF_OPTS += --without-pri | |
219 | endif # PRI | |
220 | ||
66e632f7 YM |
221 | ifeq ($(BR2_PACKAGE_LIBSS7),y) |
222 | ASTERISK_DEPENDENCIES += libss7 | |
223 | ASTERISK_CONF_OPTS += --with-ss7 | |
224 | else | |
225 | ASTERISK_CONF_OPTS += --without-ss7 | |
226 | endif # SS7 | |
227 | ||
e1fba2c4 | 228 | else |
bef84afa YM |
229 | ASTERISK_CONF_OPTS += \ |
230 | --without-dahdi --without-tonezone \ | |
231 | --without-pri --without-ss7 | |
e1fba2c4 YM |
232 | endif # DAHDI |
233 | ||
5bc671c3 YM |
234 | ifeq ($(BR2_PACKAGE_OPENSSL),y) |
235 | ASTERISK_DEPENDENCIES += openssl | |
236 | ASTERISK_CONF_OPTS += --with-ssl | |
237 | else | |
238 | ASTERISK_CONF_OPTS += --without-ssl | |
239 | endif | |
240 | ||
8996fede YM |
241 | ifeq ($(BR2_PACKAGE_LIBXCRYPT),y) |
242 | # --with-crypt is unconditional, relies on the C library if present | |
243 | ASTERISK_DEPENDENCIES += libxcrypt | |
244 | endif | |
245 | ||
bb9a2c17 | 246 | ifeq ($(BR2_PACKAGE_SPEEX)$(BR2_PACKAGE_SPEEXDSP),yy) |
4f1c3403 YM |
247 | ASTERISK_DEPENDENCIES += speex |
248 | ASTERISK_CONF_OPTS += --with-speex --with-speexdsp | |
249 | else | |
fd3f8ae5 | 250 | ASTERISK_CONF_OPTS += --without-speex --without-speexdsp |
4f1c3403 YM |
251 | endif |
252 | ||
c48bff9d | 253 | # asterisk needs an openssl-enabled libsrtp |
19294eb3 | 254 | ifeq ($(BR2_PACKAGE_LIBSRTP)$(BR2_PACKAGE_OPENSSL),yy) |
7ebab72b YM |
255 | ASTERISK_DEPENDENCIES += libsrtp |
256 | ASTERISK_CONF_OPTS += --with-srtp | |
257 | else | |
258 | ASTERISK_CONF_OPTS += --without-srtp | |
259 | endif | |
260 | ||
c5a4355c YM |
261 | ifeq ($(BR2_PACKAGE_LIBVORBIS),y) |
262 | ASTERISK_DEPENDENCIES += libvorbis | |
263 | ASTERISK_CONF_OPTS += --with-vorbis | |
264 | else | |
265 | ASTERISK_CONF_OPTS += --without-vorbis | |
266 | endif | |
267 | ||
13fcc16d YM |
268 | ifeq ($(BR2_PACKAGE_ZLIB),y) |
269 | ASTERISK_DEPENDENCIES += zlib | |
270 | ASTERISK_CONF_OPTS += --with-z | |
271 | else | |
272 | ASTERISK_CONF_OPTS += --without-z | |
273 | endif | |
274 | ||
05e306d8 YM |
275 | ASTERISK_DIRS = \ |
276 | ASTVARLIBDIR="/usr/lib/asterisk" \ | |
277 | ASTDATADIR="/usr/lib/asterisk" \ | |
278 | ASTKEYDIR="/usr/lib/asterisk" \ | |
279 | ASTDBDIR="/usr/lib/asterisk" | |
280 | ||
281 | ASTERISK_MAKE_OPTS = $(ASTERISK_DIRS) | |
282 | ||
78790d3e BK |
283 | # Uses __atomic_fetch_add_4 |
284 | ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) | |
285 | ASTERISK_MAKE_OPTS += ASTLDFLAGS="-latomic" | |
286 | endif | |
287 | ||
eaba3c8e GB |
288 | # Remove default -O3 optimization flag |
289 | ASTERISK_MAKE_OPTS += OPTIMIZE="" | |
290 | ||
830fb828 GB |
291 | ASTERISK_CFLAGS = $(TARGET_CFLAGS) |
292 | ||
293 | ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y) | |
294 | ASTERISK_CFLAGS += -O0 | |
295 | endif | |
296 | ||
297 | ASTERISK_CONF_OPTS += CFLAGS="$(ASTERISK_CFLAGS)" | |
298 | ||
05e306d8 YM |
299 | # We want to install sample configuration files, too. |
300 | ASTERISK_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 | ||
311 | HOST_ASTERISK_DEPENDENCIES = host-pkgconf host-libxml2 host-ncurses | |
312 | HOST_ASTERISK_SUBDIR = menuselect | |
313 | ||
314 | HOST_ASTERISK_LICENSE = GPL-2.0 | |
315 | HOST_ASTERISK_LICENSE_FILES = COPYING | |
316 | ||
317 | # No need to autoreconf for the host variant, | |
318 | # so do not inherit the target setup. | |
319 | HOST_ASTERISK_AUTORECONF = NO | |
320 | ||
05e306d8 YM |
321 | HOST_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. | |
328 | HOST_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 | 340 | define HOST_ASTERISK_INSTALL_CMDS |
52dfe8bf YM |
341 | $(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \ |
342 | $(HOST_DIR)/bin/asterisk-menuselect | |
05e306d8 YM |
343 | endef |
344 | ||
345 | $(eval $(host-autotools-package)) |