asterisk.mk 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. ################################################################################
  2. #
  3. # asterisk
  4. #
  5. ################################################################################
  6. ASTERISK_VERSION = 16.14.1
  7. # Use the github mirror: it's an official mirror maintained by Digium, and
  8. # provides tarballs, which the main Asterisk git tree (behind Gerrit) does not.
  9. ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION))
  10. ASTERISK_SOUNDS_BASE_URL = http://downloads.asterisk.org/pub/telephony/sounds/releases
  11. ASTERISK_EXTRA_DOWNLOADS = \
  12. $(ASTERISK_SOUNDS_BASE_URL)/asterisk-core-sounds-en-gsm-1.6.1.tar.gz \
  13. $(ASTERISK_SOUNDS_BASE_URL)/asterisk-moh-opsound-wav-2.03.tar.gz
  14. ASTERISK_LICENSE = GPL-2.0, BSD-3c (SHA1, resample), BSD-4c (db1-ast)
  15. ASTERISK_LICENSE_FILES = \
  16. COPYING \
  17. main/sha1.c \
  18. codecs/speex/speex_resampler.h \
  19. utils/db1-ast/include/db.h
  20. # For patches 0002, 0003 and 0005
  21. ASTERISK_AUTORECONF = YES
  22. ASTERISK_AUTORECONF_OPTS = -Iautoconf -Ithird-party -Ithird-party/pjproject -Ithird-party/jansson
  23. ASTERISK_DEPENDENCIES = \
  24. host-asterisk \
  25. jansson \
  26. libcurl \
  27. libedit \
  28. libxml2 \
  29. sqlite \
  30. util-linux
  31. # Asterisk wants to run its menuselect tool (a highly tweaked derivative of
  32. # kconfig), but builds it using the target tools. So we build it in the host
  33. # variant (see below), and copy the full build tree of menuselect.
  34. define ASTERISK_COPY_MENUSELECT
  35. rm -rf $(@D)/menuselect
  36. cp -a $(HOST_ASTERISK_DIR)/menuselect $(@D)/menuselect
  37. endef
  38. ASTERISK_PRE_CONFIGURE_HOOKS += ASTERISK_COPY_MENUSELECT
  39. ASTERISK_CONF_OPTS = \
  40. --disable-xmldoc \
  41. --disable-internal-poll \
  42. --disable-asteriskssl \
  43. --disable-rpath \
  44. --without-bfd \
  45. --without-cap \
  46. --without-cpg \
  47. --without-curses \
  48. --without-gtk2 \
  49. --without-gmime \
  50. --without-hoard \
  51. --without-iconv \
  52. --without-iksemel \
  53. --without-imap \
  54. --without-inotify \
  55. --without-iodbc \
  56. --without-isdnnet \
  57. --without-jack \
  58. --without-uriparser \
  59. --without-kqueue \
  60. --without-libedit \
  61. --without-libxslt \
  62. --without-lua \
  63. --without-misdn \
  64. --without-mysqlclient \
  65. --without-nbs \
  66. --without-neon29 \
  67. --without-newt \
  68. --without-openr2 \
  69. --without-osptk \
  70. --without-oss \
  71. --without-postgres \
  72. --without-pjproject \
  73. --without-pjproject-bundled \
  74. --without-popt \
  75. --without-resample \
  76. --without-sdl \
  77. --without-SDL_image \
  78. --without-sqlite \
  79. --without-suppserv \
  80. --without-tds \
  81. --without-termcap \
  82. --without-timerfd \
  83. --without-tinfo \
  84. --without-unbound \
  85. --without-unixodbc \
  86. --without-vpb \
  87. --without-x11 \
  88. --with-crypt \
  89. --with-jansson \
  90. --with-libcurl \
  91. --with-ilbc \
  92. --with-libxml2 \
  93. --with-libedit="$(STAGING_DIR)/usr" \
  94. --with-sqlite3="$(STAGING_DIR)/usr" \
  95. --with-sounds-cache=$(ASTERISK_DL_DIR)
  96. # avcodec are from ffmpeg. There is virtually zero chance this could
  97. # even work; asterisk is looking for ffmpeg/avcodec.h which has not
  98. # been installed in this location since early 2007 (~10 years ago at
  99. # the time of this writing).
  100. ASTERISK_CONF_OPTS += --without-avcodec
  101. # asterisk is not compatible with freeswitch spandsp
  102. ASTERISK_CONF_OPTS += --without-spandsp
  103. ASTERISK_CONF_ENV = \
  104. ac_cv_file_bridges_bridge_softmix_include_hrirs_h=true \
  105. ac_cv_path_CONFIG_LIBXML2=$(STAGING_DIR)/usr/bin/xml2-config
  106. # Uses __atomic_fetch_add_4
  107. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  108. ASTERISK_CONF_ENV += LIBS="-latomic"
  109. endif
  110. ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
  111. ASTERISK_CONF_OPTS += --with-execinfo
  112. else
  113. ASTERISK_CONF_OPTS += --without-execinfo
  114. endif
  115. ifeq ($(BR2_PACKAGE_LIBGSM),y)
  116. ASTERISK_DEPENDENCIES += libgsm
  117. ASTERISK_CONF_OPTS += --with-gsm
  118. else
  119. ASTERISK_CONF_OPTS += --without-gsm
  120. endif
  121. ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
  122. ASTERISK_DEPENDENCIES += alsa-lib
  123. ASTERISK_CONF_OPTS += --with-asound
  124. else
  125. ASTERISK_CONF_OPTS += --without-asound
  126. endif
  127. ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
  128. ASTERISK_DEPENDENCIES += bluez5_utils
  129. ASTERISK_CONF_OPTS += --with-bluetooth
  130. else
  131. ASTERISK_CONF_OPTS += --without-bluetooth
  132. endif
  133. ifeq ($(BR2_PACKAGE_LIBICAL),y)
  134. ASTERISK_DEPENDENCIES += libical
  135. ASTERISK_CONF_OPTS += --with-ical
  136. else
  137. ASTERISK_CONF_OPTS += --without-ical
  138. endif
  139. ifeq ($(BR2_PACKAGE_OPENLDAP),y)
  140. ASTERISK_DEPENDENCIES += openldap
  141. ASTERISK_CONF_OPTS += --with-ldap
  142. else
  143. ASTERISK_CONF_OPTS += --without-ldap
  144. endif
  145. ifeq ($(BR2_PACKAGE_NEON),y)
  146. ASTERISK_DEPENDENCIES += neon
  147. ASTERISK_CONF_OPTS += --with-neon
  148. ASTERISK_CONF_ENV += \
  149. ac_cv_path_CONFIG_NEON=$(STAGING_DIR)/usr/bin/neon-config
  150. else
  151. ASTERISK_CONF_OPTS += --without-neon
  152. endif
  153. ifeq ($(BR2_PACKAGE_NETSNMP),y)
  154. ASTERISK_DEPENDENCIES += netsnmp
  155. ASTERISK_CONF_OPTS += --with-netsnmp=$(STAGING_DIR)/usr
  156. else
  157. ASTERISK_CONF_OPTS += --without-netsnmp
  158. endif
  159. ifeq ($(BR2_PACKAGE_LIBOGG),y)
  160. ASTERISK_DEPENDENCIES += libogg
  161. ASTERISK_CONF_OPTS += --with-ogg
  162. else
  163. ASTERISK_CONF_OPTS += --without-ogg
  164. endif
  165. ifeq ($(BR2_PACKAGE_OPUS),y)
  166. ASTERISK_DEPENDENCIES += opus
  167. ASTERISK_CONF_OPTS += --with-opus
  168. else
  169. ASTERISK_CONF_OPTS += --without-opus
  170. endif
  171. ifeq ($(BR2_PACKAGE_PORTAUDIO),y)
  172. ASTERISK_DEPENDENCIES += portaudio
  173. ASTERISK_CONF_OPTS += --with-portaudio
  174. else
  175. ASTERISK_CONF_OPTS += --without-portaudio
  176. endif
  177. ifeq ($(BR2_PACKAGE_FREERADIUS_CLIENT),y)
  178. ASTERISK_DEPENDENCIES += freeradius-client
  179. ASTERISK_CONF_OPTS += --with-radius
  180. else
  181. ASTERISK_CONF_OPTS += --without-radius
  182. endif
  183. ifeq ($(BR2_PACKAGE_DAHDI_LINUX)$(BR2_PACKAGE_DAHDI_TOOLS),yy)
  184. ASTERISK_DEPENDENCIES += dahdi-linux dahdi-tools
  185. ASTERISK_CONF_OPTS += --with-dahdi --with-tonezone
  186. ifeq ($(BR2_PACKAGE_LIBPRI),y)
  187. ASTERISK_DEPENDENCIES += libpri
  188. ASTERISK_CONF_OPTS += --with-pri
  189. else
  190. ASTERISK_CONF_OPTS += --without-pri
  191. endif # PRI
  192. ifeq ($(BR2_PACKAGE_LIBSS7),y)
  193. ASTERISK_DEPENDENCIES += libss7
  194. ASTERISK_CONF_OPTS += --with-ss7
  195. else
  196. ASTERISK_CONF_OPTS += --without-ss7
  197. endif # SS7
  198. else
  199. ASTERISK_CONF_OPTS += \
  200. --without-dahdi --without-tonezone \
  201. --without-pri --without-ss7
  202. endif # DAHDI
  203. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  204. ASTERISK_DEPENDENCIES += openssl
  205. ASTERISK_CONF_OPTS += --with-ssl
  206. else
  207. ASTERISK_CONF_OPTS += --without-ssl
  208. endif
  209. ifeq ($(BR2_PACKAGE_SPEEX)$(BR2_PACKAGE_SPEEXDSP),yy)
  210. ASTERISK_DEPENDENCIES += speex
  211. ASTERISK_CONF_OPTS += --with-speex --with-speexdsp
  212. else
  213. ASTERISK_CONF_OPTS += --without-speex --without-speexdsp
  214. endif
  215. # asterisk needs an openssl-enabled libsrtp
  216. ifeq ($(BR2_PACKAGE_LIBSRTP)$(BR2_PACKAGE_OPENSSL)x$(BR2_STATIC_LIBS),yyx)
  217. ASTERISK_DEPENDENCIES += libsrtp
  218. ASTERISK_CONF_OPTS += --with-srtp
  219. else
  220. ASTERISK_CONF_OPTS += --without-srtp
  221. endif
  222. ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
  223. ASTERISK_DEPENDENCIES += libvorbis
  224. ASTERISK_CONF_OPTS += --with-vorbis
  225. else
  226. ASTERISK_CONF_OPTS += --without-vorbis
  227. endif
  228. ifeq ($(BR2_PACKAGE_ZLIB),y)
  229. ASTERISK_DEPENDENCIES += zlib
  230. ASTERISK_CONF_OPTS += --with-z
  231. else
  232. ASTERISK_CONF_OPTS += --without-z
  233. endif
  234. ASTERISK_DIRS = \
  235. ASTVARLIBDIR="/usr/lib/asterisk" \
  236. ASTDATADIR="/usr/lib/asterisk" \
  237. ASTKEYDIR="/usr/lib/asterisk" \
  238. ASTDBDIR="/usr/lib/asterisk"
  239. ASTERISK_MAKE_OPTS = $(ASTERISK_DIRS)
  240. # Uses __atomic_fetch_add_4
  241. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  242. ASTERISK_MAKE_OPTS += ASTLDFLAGS="-latomic"
  243. endif
  244. # We want to install sample configuration files, too.
  245. ASTERISK_INSTALL_TARGET_OPTS = \
  246. $(ASTERISK_DIRS) \
  247. DESTDIR=$(TARGET_DIR) \
  248. LDCONFIG=true \
  249. install samples
  250. $(eval $(autotools-package))
  251. #-------------------------------------------------------------------------------
  252. # This part deals with building the menuselect tool as a host package
  253. HOST_ASTERISK_DEPENDENCIES = host-pkgconf host-libxml2 host-ncurses
  254. HOST_ASTERISK_SUBDIR = menuselect
  255. HOST_ASTERISK_LICENSE = GPL-2.0
  256. HOST_ASTERISK_LICENSE_FILES = COPYING
  257. # No need to autoreconf for the host variant,
  258. # so do not inherit the target setup.
  259. HOST_ASTERISK_AUTORECONF = NO
  260. HOST_ASTERISK_CONF_ENV = CONFIG_LIBXML2=$(HOST_DIR)/bin/xml2-config
  261. HOST_ASTERISK_CONF_OPTS = \
  262. --without-newt \
  263. --without-curses \
  264. --with-ncurses=$(HOST_DIR)
  265. # Not an automake package, so does not inherit LDFLAGS et al. from
  266. # the configure run.
  267. HOST_ASTERISK_MAKE_ENV = $(HOST_CONFIGURE_OPTS)
  268. # Even though menuselect is an autotools package, it is not an automake
  269. # package and does not have an 'install' rule, as asterisk does expect
  270. # it to be in a sub-directory of its source tree. We do so by copying
  271. # the full menuselect build tree as a pre-configure hook in the target
  272. # variant.
  273. # However, the sanity checks on host packages are not run on menuselect.
  274. # But we still want to catch that menuselect has the proper rpath set,
  275. # for example, as it uses host libraries that we do build, like
  276. # host-libxml2.
  277. # So we do manually install the menuselect tool.
  278. define HOST_ASTERISK_INSTALL_CMDS
  279. $(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \
  280. $(HOST_DIR)/bin/asterisk-menuselect
  281. endef
  282. $(eval $(host-autotools-package))