]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/asterisk/asterisk.mk
50512c0b3a6b1d9c3ee01579cef85f665da7dbda
[coffee/buildroot.git] / package / asterisk / asterisk.mk
1 ################################################################################
2 #
3 # asterisk
4 #
5 ################################################################################
6
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))
11
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
16
17 ASTERISK_LICENSE = GPL-2.0, BSD-3c (SHA1, resample), BSD-4c (db1-ast)
18 ASTERISK_LICENSE_FILES = \
19         COPYING \
20         main/sha1.c \
21         codecs/speex/speex_resampler.h \
22         utils/db1-ast/include/db.h
23
24 # For patches 0001, 0003 and 0004
25 ASTERISK_AUTORECONF = YES
26 ASTERISK_AUTORECONF_OPTS = -Iautoconf -Ithird-party -Ithird-party/pjproject
27
28 ASTERISK_DEPENDENCIES = \
29         host-asterisk \
30         jansson \
31         libcurl \
32         libxml2 \
33         ncurses \
34         sqlite \
35         util-linux
36
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
43 endef
44 ASTERISK_PRE_CONFIGURE_HOOKS += ASTERISK_COPY_MENUSELECT
45
46 ASTERISK_CONF_OPTS = \
47         --disable-xmldoc \
48         --disable-internal-poll \
49         --disable-asteriskssl \
50         --disable-rpath \
51         --without-bfd \
52         --without-cap \
53         --without-cpg \
54         --without-curses \
55         --without-gtk2 \
56         --without-gmime \
57         --without-h323 \
58         --without-hoard \
59         --without-iconv \
60         --without-iksemel \
61         --without-imap \
62         --without-inotify \
63         --without-iodbc \
64         --without-isdnnet \
65         --without-jack \
66         --without-uriparser \
67         --without-kqueue \
68         --without-libedit \
69         --without-libxslt \
70         --without-ltdl \
71         --without-lua \
72         --without-misdn \
73         --without-mysqlclient \
74         --without-nbs \
75         --without-neon29 \
76         --without-newt \
77         --without-openr2 \
78         --without-osptk \
79         --without-oss \
80         --without-postgres \
81         --without-pjproject \
82         --without-popt \
83         --without-pwlib \
84         --without-resample \
85         --without-sdl \
86         --without-SDL_image \
87         --without-spandsp \
88         --without-sqlite \
89         --without-suppserv \
90         --without-tds \
91         --without-termcap \
92         --without-timerfd \
93         --without-tinfo \
94         --without-unbound \
95         --without-unixodbc \
96         --without-vpb \
97         --without-x11 \
98         --with-crypt \
99         --with-jansson \
100         --with-libcurl \
101         --with-ilbc \
102         --with-libxml2 \
103         --with-ncurses="$(STAGING_DIR)/usr" \
104         --with-sqlite3="$(STAGING_DIR)/usr" \
105         --with-sounds-cache=$(BR2_DL_DIR)
106
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
112
113 ASTERISK_CONF_ENV = \
114         ac_cv_path_CONFIG_LIBXML2=$(STAGING_DIR)/usr/bin/xml2-config
115
116 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
117 ASTERISK_CONF_OPTS += --with-execinfo
118 else
119 ASTERISK_CONF_OPTS += --without-execinfo
120 endif
121
122 ifeq ($(BR2_PACKAGE_LIBGSM),y)
123 ASTERISK_DEPENDENCIES += libgsm
124 ASTERISK_CONF_OPTS += --with-gsm
125 else
126 ASTERISK_CONF_OPTS += --without-gsm
127 endif
128
129 ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
130 ASTERISK_DEPENDENCIES += alsa-lib
131 ASTERISK_CONF_OPTS += --with-asound
132 else
133 ASTERISK_CONF_OPTS += --without-asound
134 endif
135
136 ifeq ($(BR2_PACKAGE_BLUEZ_UTILS),y)
137 ASTERISK_DEPENDENCIES += bluez_utils
138 ASTERISK_CONF_OPTS += --with-bluetooth
139 else
140 ASTERISK_CONF_OPTS += --without-bluetooth
141 endif
142
143 ifeq ($(BR2_PACKAGE_LIBICAL),y)
144 ASTERISK_DEPENDENCIES += libical
145 ASTERISK_CONF_OPTS += --with-ical
146 else
147 ASTERISK_CONF_OPTS += --without-ical
148 endif
149
150 ifeq ($(BR2_PACKAGE_OPENLDAP),y)
151 ASTERISK_DEPENDENCIES += openldap
152 ASTERISK_CONF_OPTS += --with-ldap
153 else
154 ASTERISK_CONF_OPTS += --without-ldap
155 endif
156
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
162 else
163 ASTERISK_CONF_OPTS += --without-neon
164 endif
165
166 ifeq ($(BR2_PACKAGE_NETSNMP),y)
167 ASTERISK_DEPENDENCIES += netsnmp
168 ASTERISK_CONF_OPTS += --with-netsnmp=$(STAGING_DIR)/usr
169 else
170 ASTERISK_CONF_OPTS += --without-netsnmp
171 endif
172
173 ifeq ($(BR2_PACKAGE_LIBOGG),y)
174 ASTERISK_DEPENDENCIES += libogg
175 ASTERISK_CONF_OPTS += --with-ogg
176 else
177 ASTERISK_CONF_OPTS += --without-ogg
178 endif
179
180 ifeq ($(BR2_PACKAGE_OPUS),y)
181 ASTERISK_DEPENDENCIES += opus
182 ASTERISK_CONF_OPTS += --with-opus
183 else
184 ASTERISK_CONF_OPTS += --without-opus
185 endif
186
187 ifeq ($(BR2_PACKAGE_PORTAUDIO),y)
188 ASTERISK_DEPENDENCIES += portaudio
189 ASTERISK_CONF_OPTS += --with-portaudio
190 else
191 ASTERISK_CONF_OPTS += --without-portaudio
192 endif
193
194 ifeq ($(BR2_PACKAGE_FREERADIUS_CLIENT),y)
195 ASTERISK_DEPENDENCIES += freeradius-client
196 ASTERISK_CONF_OPTS += --with-radius
197 else
198 ASTERISK_CONF_OPTS += --without-radius
199 endif
200
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
204
205 ifeq ($(BR2_PACKAGE_LIBPRI),y)
206 ASTERISK_DEPENDENCIES += libpri
207 ASTERISK_CONF_OPTS += --with-pri
208 else
209 ASTERISK_CONF_OPTS += --without-pri
210 endif # PRI
211
212 ifeq ($(BR2_PACKAGE_LIBSS7),y)
213 ASTERISK_DEPENDENCIES += libss7
214 ASTERISK_CONF_OPTS += --with-ss7
215 else
216 ASTERISK_CONF_OPTS += --without-ss7
217 endif # SS7
218
219 else
220 ASTERISK_CONF_OPTS += \
221         --without-dahdi --without-tonezone \
222         --without-pri --without-ss7
223 endif # DAHDI
224
225 ifeq ($(BR2_PACKAGE_OPENSSL),y)
226 ASTERISK_DEPENDENCIES += openssl
227 ASTERISK_CONF_OPTS += --with-ssl
228 else
229 ASTERISK_CONF_OPTS += --without-ssl
230 endif
231
232 ifeq ($(BR2_PACKAGE_SPEEX),y)
233 ASTERISK_DEPENDENCIES += speex
234 ASTERISK_CONF_OPTS += --with-speex --with-speexdsp
235 else
236 ASTERISK_CONF_OPTS += --without-speex  --without-speexdsp
237 endif
238
239 ifeq ($(BR2_PACKAGE_LIBSRTP),y)
240 ASTERISK_DEPENDENCIES += libsrtp
241 ASTERISK_CONF_OPTS += --with-srtp
242 else
243 ASTERISK_CONF_OPTS += --without-srtp
244 endif
245
246 ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
247 ASTERISK_DEPENDENCIES += libvorbis
248 ASTERISK_CONF_OPTS += --with-vorbis
249 else
250 ASTERISK_CONF_OPTS += --without-vorbis
251 endif
252
253 ifeq ($(BR2_PACKAGE_ZLIB),y)
254 ASTERISK_DEPENDENCIES += zlib
255 ASTERISK_CONF_OPTS += --with-z
256 else
257 ASTERISK_CONF_OPTS += --without-z
258 endif
259
260 ASTERISK_DIRS = \
261         ASTVARLIBDIR="/usr/lib/asterisk" \
262         ASTDATADIR="/usr/lib/asterisk" \
263         ASTKEYDIR="/usr/lib/asterisk" \
264         ASTDBDIR="/usr/lib/asterisk"
265
266 ASTERISK_MAKE_OPTS = $(ASTERISK_DIRS)
267
268 # We want to install sample configuration files, too.
269 ASTERISK_INSTALL_TARGET_OPTS = \
270         $(ASTERISK_DIRS) \
271         DESTDIR=$(TARGET_DIR) \
272         LDCONFIG=true \
273         install samples
274
275 $(eval $(autotools-package))
276
277 #-------------------------------------------------------------------------------
278 # This part deals with building the menuselect tool as a host package
279
280 HOST_ASTERISK_DEPENDENCIES = host-pkgconf host-libxml2 host-ncurses
281 HOST_ASTERISK_SUBDIR = menuselect
282
283 HOST_ASTERISK_LICENSE = GPL-2.0
284 HOST_ASTERISK_LICENSE_FILES = COPYING
285
286 # No need to autoreconf for the host variant,
287 # so do not inherit the target setup.
288 HOST_ASTERISK_AUTORECONF = NO
289
290 HOST_ASTERISK_CONF_ENV = CONFIG_LIBXML2=$(HOST_DIR)/usr/bin/xml2-config
291
292 HOST_ASTERISK_CONF_OPTS = \
293         --without-newt \
294         --without-curses \
295         --with-ncurses=$(HOST_DIR)/usr
296
297 # Not an automake package, so does not inherit LDFLAGS et al. from
298 # the configure run.
299 HOST_ASTERISK_MAKE_ENV = $(HOST_CONFIGURE_OPTS)
300
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
305 # variant.
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
309 # host-libxml2.
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
314 endef
315
316 $(eval $(host-autotools-package))