1 ################################################################################
5 ################################################################################
7 ASTERISK_VERSION = 14.5.0
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))
12 ASTERISK_SOUNDS_BASE_URL = http://downloads.asterisk.org/pub/telephony/sounds/releases
13 ASTERISK_EXTRA_DOWNLOADS = \
14 $(ASTERISK_SOUNDS_BASE_URL)/asterisk-core-sounds-en-gsm-1.5.tar.gz \
15 $(ASTERISK_SOUNDS_BASE_URL)/asterisk-moh-opsound-wav-2.03.tar.gz
17 ASTERISK_LICENSE = GPL-2.0, BSD-3c (SHA1, resample), BSD-4c (db1-ast)
18 ASTERISK_LICENSE_FILES = \
21 codecs/speex/speex_resampler.h \
22 utils/db1-ast/include/db.h
24 # For patches 0001, 0003 and 0004
25 ASTERISK_AUTORECONF = YES
26 ASTERISK_AUTORECONF_OPTS = -Iautoconf -Ithird-party -Ithird-party/pjproject
28 ASTERISK_DEPENDENCIES = \
37 # Asterisk wants to run its menuselect tool (a highly tweaked derivative of
38 # kconfig), but builds it using the target tools. So we build it in the host
39 # variant (see below), and copy the full build tree of menuselect.
40 define ASTERISK_COPY_MENUSELECT
41 rm -rf $(@D)/menuselect
42 cp -a $(HOST_ASTERISK_DIR)/menuselect $(@D)/menuselect
44 ASTERISK_PRE_CONFIGURE_HOOKS += ASTERISK_COPY_MENUSELECT
46 ASTERISK_CONF_OPTS = \
48 --disable-internal-poll \
49 --disable-asteriskssl \
73 --without-mysqlclient \
103 --with-ncurses="$(STAGING_DIR)/usr" \
104 --with-sqlite3="$(STAGING_DIR)/usr" \
105 --with-sounds-cache=$(BR2_DL_DIR)
107 # avcodec are from ffmpeg. There is virtually zero chance this could
108 # even work; asterisk is looking for ffmpeg/avcodec.h which has not
109 # been installed in this location since early 2007 (~10 years ago at
110 # the time of this writing).
111 ASTERISK_CONF_OPTS += --without-avcodec
113 ASTERISK_CONF_ENV = \
114 ac_cv_path_CONFIG_LIBXML2=$(STAGING_DIR)/usr/bin/xml2-config
116 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
117 ASTERISK_CONF_OPTS += --with-execinfo
119 ASTERISK_CONF_OPTS += --without-execinfo
122 ifeq ($(BR2_PACKAGE_LIBGSM),y)
123 ASTERISK_DEPENDENCIES += libgsm
124 ASTERISK_CONF_OPTS += --with-gsm
126 ASTERISK_CONF_OPTS += --without-gsm
129 ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
130 ASTERISK_DEPENDENCIES += alsa-lib
131 ASTERISK_CONF_OPTS += --with-asound
133 ASTERISK_CONF_OPTS += --without-asound
136 ifeq ($(BR2_PACKAGE_BLUEZ_UTILS),y)
137 ASTERISK_DEPENDENCIES += bluez_utils
138 ASTERISK_CONF_OPTS += --with-bluetooth
140 ASTERISK_CONF_OPTS += --without-bluetooth
143 ifeq ($(BR2_PACKAGE_LIBICAL),y)
144 ASTERISK_DEPENDENCIES += libical
145 ASTERISK_CONF_OPTS += --with-ical
147 ASTERISK_CONF_OPTS += --without-ical
150 ifeq ($(BR2_PACKAGE_OPENLDAP),y)
151 ASTERISK_DEPENDENCIES += openldap
152 ASTERISK_CONF_OPTS += --with-ldap
154 ASTERISK_CONF_OPTS += --without-ldap
157 ifeq ($(BR2_PACKAGE_NEON),y)
158 ASTERISK_DEPENDENCIES += neon
159 ASTERISK_CONF_OPTS += --with-neon
160 ASTERISK_CONF_ENV += \
161 ac_cv_path_CONFIG_NEON=$(STAGING_DIR)/usr/bin/neon-config
163 ASTERISK_CONF_OPTS += --without-neon
166 ifeq ($(BR2_PACKAGE_NETSNMP),y)
167 ASTERISK_DEPENDENCIES += netsnmp
168 ASTERISK_CONF_OPTS += --with-netsnmp=$(STAGING_DIR)/usr
170 ASTERISK_CONF_OPTS += --without-netsnmp
173 ifeq ($(BR2_PACKAGE_LIBOGG),y)
174 ASTERISK_DEPENDENCIES += libogg
175 ASTERISK_CONF_OPTS += --with-ogg
177 ASTERISK_CONF_OPTS += --without-ogg
180 ifeq ($(BR2_PACKAGE_OPUS),y)
181 ASTERISK_DEPENDENCIES += opus
182 ASTERISK_CONF_OPTS += --with-opus
184 ASTERISK_CONF_OPTS += --without-opus
187 ifeq ($(BR2_PACKAGE_PORTAUDIO),y)
188 ASTERISK_DEPENDENCIES += portaudio
189 ASTERISK_CONF_OPTS += --with-portaudio
191 ASTERISK_CONF_OPTS += --without-portaudio
194 ifeq ($(BR2_PACKAGE_FREERADIUS_CLIENT),y)
195 ASTERISK_DEPENDENCIES += freeradius-client
196 ASTERISK_CONF_OPTS += --with-radius
198 ASTERISK_CONF_OPTS += --without-radius
201 ifeq ($(BR2_PACKAGE_DAHDI_LINUX)$(BR2_PACKAGE_DAHDI_TOOLS),yy)
202 ASTERISK_DEPENDENCIES += dahdi-linux dahdi-tools
203 ASTERISK_CONF_OPTS += --with-dahdi --with-tonezone
205 ifeq ($(BR2_PACKAGE_LIBPRI),y)
206 ASTERISK_DEPENDENCIES += libpri
207 ASTERISK_CONF_OPTS += --with-pri
209 ASTERISK_CONF_OPTS += --without-pri
212 ifeq ($(BR2_PACKAGE_LIBSS7),y)
213 ASTERISK_DEPENDENCIES += libss7
214 ASTERISK_CONF_OPTS += --with-ss7
216 ASTERISK_CONF_OPTS += --without-ss7
220 ASTERISK_CONF_OPTS += \
221 --without-dahdi --without-tonezone \
222 --without-pri --without-ss7
225 ifeq ($(BR2_PACKAGE_OPENSSL),y)
226 ASTERISK_DEPENDENCIES += openssl
227 ASTERISK_CONF_OPTS += --with-ssl
229 ASTERISK_CONF_OPTS += --without-ssl
232 ifeq ($(BR2_PACKAGE_SPEEX),y)
233 ASTERISK_DEPENDENCIES += speex
234 ASTERISK_CONF_OPTS += --with-speex --with-speexdsp
236 ASTERISK_CONF_OPTS += --without-speex --without-speexdsp
239 ifeq ($(BR2_PACKAGE_LIBSRTP),y)
240 ASTERISK_DEPENDENCIES += libsrtp
241 ASTERISK_CONF_OPTS += --with-srtp
243 ASTERISK_CONF_OPTS += --without-srtp
246 ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
247 ASTERISK_DEPENDENCIES += libvorbis
248 ASTERISK_CONF_OPTS += --with-vorbis
250 ASTERISK_CONF_OPTS += --without-vorbis
253 ifeq ($(BR2_PACKAGE_ZLIB),y)
254 ASTERISK_DEPENDENCIES += zlib
255 ASTERISK_CONF_OPTS += --with-z
257 ASTERISK_CONF_OPTS += --without-z
261 ASTVARLIBDIR="/usr/lib/asterisk" \
262 ASTDATADIR="/usr/lib/asterisk" \
263 ASTKEYDIR="/usr/lib/asterisk" \
264 ASTDBDIR="/usr/lib/asterisk"
266 ASTERISK_MAKE_OPTS = $(ASTERISK_DIRS)
268 # We want to install sample configuration files, too.
269 ASTERISK_INSTALL_TARGET_OPTS = \
271 DESTDIR=$(TARGET_DIR) \
275 $(eval $(autotools-package))
277 #-------------------------------------------------------------------------------
278 # This part deals with building the menuselect tool as a host package
280 HOST_ASTERISK_DEPENDENCIES = host-pkgconf host-libxml2 host-ncurses
281 HOST_ASTERISK_SUBDIR = menuselect
283 HOST_ASTERISK_LICENSE = GPL-2.0
284 HOST_ASTERISK_LICENSE_FILES = COPYING
286 # No need to autoreconf for the host variant,
287 # so do not inherit the target setup.
288 HOST_ASTERISK_AUTORECONF = NO
290 HOST_ASTERISK_CONF_ENV = CONFIG_LIBXML2=$(HOST_DIR)/usr/bin/xml2-config
292 HOST_ASTERISK_CONF_OPTS = \
295 --with-ncurses=$(HOST_DIR)/usr
297 # Not an automake package, so does not inherit LDFLAGS et al. from
299 HOST_ASTERISK_MAKE_ENV = $(HOST_CONFIGURE_OPTS)
301 # Even though menuselect is an autotools package, it is not an automake
302 # package and does not have an 'install' rule, as asterisk does expect
303 # it to be in a sub-directory of its source tree. We do so by copying
304 # the full menuselect build tree as a pre-configure hook in the target
306 # However, the sanity checks on host packages are not run on menuselect.
307 # But we still want to catch that menuselect has the proper rpath set,
308 # for example, as it uses host libraries that we do build, like
310 # So we do manually install the menuselect tool.
311 define HOST_ASTERISK_INSTALL_CMDS
312 $(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \
313 $(HOST_DIR)/bin/asterisk-menuselect
316 $(eval $(host-autotools-package))