FreeSWITCH: Revert previous fix on Big Endian compilation issue and sync to FS latest...
[feed/telephony.git] / net / freeswitch / Makefile
1 #
2 # Copyright (C) 2009-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 #
8 include $(TOPDIR)/rules.mk
9
10
11 PKG_NAME:=freeswitch
12 PKG_SOURCE_PROTO:=git
13 PKG_DISTNAME:=$(PKG_NAME)_$(PKG_SOURCE_PROTO)
14 PKG_VERSION:=1.5.5b
15
16
17 #
18 # The latest FS git hash in PKG_SOURCE_VERSION can be obtained from
19 # http://fisheye.freeswitch.org
20 #
21 PKG_SOURCE_URL:=git://git.$(PKG_NAME).org/$(PKG_NAME).git
22 FS_DEFAULT_HEAD:=451aece80391bf08bc0e8b25fce2e2cb4f88bc41
23 FS_LATEST_HEAD:=$(if $(DUMP),$(FS_DEFAULT_HEAD),$(shell git ls-remote $(PKG_SOURCE_URL) HEAD | cut -f1))
24 PKG_SOURCE_VERSION:=$(if $(CONFIG_FS_WITH_PULL_CURRENT),$(FS_LATEST_HEAD),$(FS_DEFAULT_HEAD))
25 PKG_SOURCE_VERSION_SHORT:=$(shell echo $(PKG_SOURCE_VERSION)|cut -b -7)
26 PKG_RELEASE:=$(PKG_SOURCE_VERSION_SHORT)
27 PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)
28 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_SOURCE_VERSION_SHORT).tar.bz2
29 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
30
31
32 PKG_FIXUP:=libtool autoreconf
33 PKG_BUILD_PARALLEL:=1
34
35
36 FS_MOD_AVAILABLE:= \
37         abstraction \
38         alsa \
39         amr \
40         amrwb \
41         avmd \
42         blacklist \
43         bv \
44         callcenter \
45         cdr-csv \
46         cdr-pg-csv \
47         cdr-sqlite \
48         celt \
49         cepstral \
50         cidlookup \
51         cluechoo \
52         codec2 \
53         commands \
54         conference \
55         console \
56         curl \
57         dahdi-codec \
58         db \
59         dialplan-asterisk \
60         dialplan-directory \
61         dialplan-xml \
62         dingaling \
63         directory \
64         distributor \
65         dptools \
66         easyroute \
67         enum \
68         erlang-event \
69         esf \
70         event-multicast \
71         event-socket \
72         event-zmq \
73         expr \
74         fifo \
75         file-string \
76         flite \
77         fsk \
78         fsv \
79         g723-1 \
80         g729 \
81         gsmopen \
82         h26x \
83         h323 \
84         hash \
85         html5 \
86         httapi \
87         http-cache \
88         ilbc \
89         isac \
90         java \
91         json-cdr \
92         lcr \
93         local-stream \
94         logfile \
95         loopback \
96         lua \
97         managed \
98         mp4 \
99         mp4v \
100         native-file \
101         nibblebill \
102         openzap \
103         opus \
104         oreka \
105         portaudio \
106         portaudio-stream \
107         posix-timer \
108         radius-cdr \
109         rayo \
110         redis \
111         rss \
112         rtmp \
113         sangoma-codec \
114         say-de \
115         say-en \
116         say-es \
117         say-fa \
118         say-fr \
119         say-hu \
120         say-it \
121         say-nl \
122         say-pt \
123         say-ru \
124         say-th \
125         say-zh \
126         shell-stream \
127         silk \
128         siren \
129         skel \
130         skinny \
131         skypopen \
132         sms \
133         snapshot \
134         snipe-hunt \
135         sndfile \
136         snmp \
137         snom \
138         sofia \
139         sonar \
140         spandsp \
141         speex \
142         spidermonkey \
143         spidermonkey-core-db \
144         spidermonkey-curl \
145         spidermonkey-odbc \
146         spidermonkey-socket \
147         spidermonkey-teletone \
148         spy \
149         stress \
150         syslog \
151         timerfd \
152         tone-stream \
153         tts-commandline \
154         unimrcp \
155         valet-parking \
156         vmd \
157         voicemail \
158         voicemail-ivr \
159         vp8 \
160         xml-cdr \
161         xml-curl \
162         xml-rpc \
163         xml-scgi \
164         yaml \
165
166
167 PKG_CONFIG_DEPENDS:= \
168         CONFIG_FS_WITH_ALSA \
169         CONFIG_FS_WITH_BUILTIN_ZRTP \
170         CONFIG_FS_WITH_FIXED_POINT \
171         CONFIG_FS_WITH_IPV6 \
172         CONFIG_FS_WITH_LZMA \
173         CONFIG_FS_WITH_MYSQL \
174         CONFIG_FS_WITH_ODBC \
175         CONFIG_FS_WITH_OPT \
176         CONFIG_FS_WITH_POSTGRESQL \
177         CONFIG_FS_WITH_PULL_CURRENT \
178         CONFIG_FS_WITH_SQLITE3 \
179         CONFIG_FS_WITH_SCTP \
180         $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_MOD_AVAILABLE)) \
181
182
183 include $(INCLUDE_DIR)/package.mk
184 include $(INCLUDE_DIR)/nls.mk
185
186
187 TAR_OPTIONS+= --strip-components=1 -C $(PKG_BUILD_DIR)
188
189
190 define Package/$(PKG_NAME)/Default
191   SECTION:=net
192   CATEGORY:=Network
193   SUBMENU:=Telephony
194   URL:=http://www.$(PKG_NAME).org/
195   MAINTAINER:=Mazilo <openwrt.mazilo@recursor.net>
196 endef
197
198
199 define Package/$(PKG_NAME)
200 $(call Package/$(PKG_NAME)/Default)
201   TITLE:=FreeSWITCH open source telephony platform ($(PKG_SOURCE_VERSION_SHORT))
202   DEPENDS:=+libcurl +libiconv-full +libjpeg +libncurses +libpthread +librt +libstdcpp +FS_WITH_POSTGRESQL:libpq +libuuid
203   MENU:=1
204 endef
205
206
207 define Package/$(PKG_NAME)/description
208   FreeSWITCH is an open source telephony platform designed to
209   facilitate the creation of voice and chat driven products scaling
210   from a soft-phone up to a soft-switch.  See http://wiki.$(PKG_NAME).org
211 endef
212
213
214 define Package/$(PKG_NAME)/config
215     config FS_WITH_PULL_CURRENT
216     depends on DEVEL
217     depends on PACKAGE_$(PKG_NAME)
218     bool "Pull the latest git HEAD - $(PKG_SOURCE_VERSION_SHORT) (Press < Help > for more information)"
219     default n
220     help
221         This existing git HEAD ($(FS_DEFAULT_HEAD))
222         is probably outdated. Enable this option for the latest git HEAD
223         ($(FS_LATEST_HEAD)) ONLY if you know what
224         you are doing. It may and/or may not be cleanly compiled and may
225         require some intervension to create new patches. If you take this
226         route and come up with some patches, please contemplate to contribute
227         or send in your patches.
228
229     config FS_WITH_ALSA
230     depends on PACKAGE_$(PKG_NAME)
231     bool "Enable ALSA for sound support"
232     default n
233     help
234         Compile $(PKG_NAME) with ALSA support.
235
236     config FS_WITH_BUILTIN_ZRTP
237     depends on PACKAGE_$(PKG_NAME)
238     bool "Enable built-in ZRTP"
239     default y
240     help
241         Compile $(PKG_NAME) with ZRTP support.
242
243     config FS_WITH_IPV6
244     depends on PACKAGE_$(PKG_NAME)
245     bool "Enable IPV6 support in APR"
246     default y
247     help
248         Compile libs/apr package with IPV6 support.
249
250     config FS_WITH_LZMA
251     depends on PACKAGE_$(PKG_NAME) && PACKAGE_liblzma
252     bool "Enable liblzma usage in libtiff"
253     default y
254     help
255         Compile libs/tiff package with liblzma support. This option requires
256         LZMA2 compression package called liblzma.
257
258     config FS_WITH_OPT
259     depends on PACKAGE_$(PKG_NAME)
260     bool "Enable optimization"
261     default y
262     help
263         Compile $(PKG_NAME) with optimization flag enabled. This will add
264         max optimising compiler flags
265
266     config FS_WITH_SCTP
267     depends on PACKAGE_$(PKG_NAME)
268     bool "Enable SCTP (Stream Control Transfer Protocol) support in APR"
269     default y
270     select PACKAGE_sctp
271     help
272         Compile $(PKG_NAME) with SCTP support in lib APR.
273
274     config FS_WITH_MYSQL
275     depends on PACKAGE_$(PKG_NAME)
276     bool "Compile apr-util with MySQL"
277     default n
278     select PACKAGE_libmysqlclient
279     help
280         Compile libs/apr-util with MySQL.
281
282     config FS_WITH_POSTGRESQL
283     depends on PACKAGE_$(PKG_NAME)
284     bool "Compile apr-util (also enable $(PKG_NAME) core) with PostgreSQL support"
285     default n
286     help
287         Compile both libs/apr-util and $(PKG_NAME) with PostgreSQL support.
288
289     config FS_WITH_SQLITE3
290     depends on PACKAGE_$(PKG_NAME)
291     bool "Compile apr-util with SQLITE3"
292     default y
293     select PACKAGE_libsqlite3
294     help
295         Compile libs/apr-util with SQLITE3.
296
297     config FS_WITH_ODBC
298     depends on PACKAGE_$(PKG_NAME)
299     depends on PACKAGE_sqliteodbc
300     depends on PACKAGE_unixodbc_svn
301     bool "Compile with ODBC support (Requires unixodbc_svn NOT YET AVAILABLE)"
302     default n
303     help
304         Compile $(PKG_NAME) with ODBC support. Since both sqliteodbc and unixodbc_svn packages
305         are not yet available on OpenWRT, $(PKG_NAME) CAN NOT be compiled with ODBC support.
306 endef
307
308
309 define Package/$(PKG_NAME)-mod-spandsp/config
310     config FS_WITH_FIXED_POINT
311     depends on PACKAGE_$(PKG_NAME)-mod-spandsp
312     bool "Enable fixed point support for spandsp (may degrade performance)"
313     default n
314     help
315         Compile spandsp package with a fixed point support. ONLY enabled this option when
316         necessary, i.e. CPU doesn't support floating computation.
317 endef
318
319
320 define Package/$(PKG_NAME)-example-config
321 $(call Package/$(PKG_NAME)/Default)
322   TITLE:=FreeSWITCH example config (commented)
323   DEPENDS:= $(PKG_NAME)
324 endef
325
326
327 define Package/$(PKG_NAME)-example-config/description
328   The default configuration included with FreeSWITCH. It is not intended to be
329   a final product, and is thus moved to /usr/share/$(PKG_NAME)/examples/conf to
330   be an example of how FreeSWITCH can be configured.
331 endef
332
333
334 define Package/$(PKG_NAME)-config-upstream-defaults
335 $(call Package/$(PKG_NAME)/Default)
336   TITLE:=FreeSWITCH upstream config
337   DEPENDS:= $(PKG_NAME)
338 endef
339
340
341 define Package/$(PKG_NAME)-config-upstream-defaults/description
342   The default configuration included with FreeSWITCH. It is not intended to be
343   a final product, and but is included for those who don't want to use the
344   OpenWRT configuration and/or want to try things as prepared by upstream.
345 endef
346
347
348 define Package/$(PKG_NAME)-config-minimal
349 $(call Package/$(PKG_NAME)/Default)
350   TITLE:=FreeSWITCH minimal config
351   DEPENDS:= $(PKG_NAME)
352 endef
353
354
355 define Package/$(PKG_NAME)-config-minimal/description
356   A minimal configuration of FreeSWITCH for OpenWRT devices.  Is what the UCI
357   configuration began with.
358 endef
359
360
361 define Package/$(PKG_NAME)-collection-upstream-defaults
362 $(call Package/$(PKG_NAME)/Default)
363   TITLE:=FS upstream def sample conf
364   DEPENDS:= $(PKG_NAME) \
365                 +$(PKG_NAME)-config-upstream-defaults \
366                 +$(PKG_NAME)-mod-callcenter \
367                 +$(PKG_NAME)-mod-codec2 \
368                 +$(PKG_NAME)-mod-commands \
369                 +$(PKG_NAME)-mod-conference \
370                 +$(PKG_NAME)-mod-curl \
371                 +$(PKG_NAME)-mod-dialplan-xml \
372                 +$(PKG_NAME)-mod-dingaling \
373                 +$(PKG_NAME)-mod-dptools \
374                 +$(PKG_NAME)-mod-event-socket \
375                 +$(PKG_NAME)-mod-g723-1 \
376                 +$(PKG_NAME)-mod-g729 \
377                 +$(PKG_NAME)-mod-hash \
378                 +$(PKG_NAME)-mod-http-cache \
379                 +$(PKG_NAME)-mod-ilbc \
380                 +$(PKG_NAME)-mod-local-stream \
381                 +$(PKG_NAME)-mod-lua \
382                 +$(PKG_NAME)-mod-native-file \
383                 +$(PKG_NAME)-mod-sndfile \
384                 +$(PKG_NAME)-mod-sofia \
385                 +$(PKG_NAME)-mod-spandsp \
386                 +$(PKG_NAME)-mod-speex \
387                 +$(PKG_NAME)-mod-syslog \
388                 +$(PKG_NAME)-mod-tone-stream \
389                 +$(PKG_NAME)-mod-xml-curl \
390                 +$(PKG_NAME)-mod-xml-rpc \
391                 +$(PKG_NAME)-tools
392 endef
393
394
395 define Package/$(PKG_NAME)-collection-minimal
396 $(call Package/$(PKG_NAME)/Default)
397   TITLE:=FreeSWITCH minimal package collection
398   DEFAULT:=y
399   DEPENDS:= $(PKG_NAME) \
400                 +$(PKG_NAME)-config-minimal \
401                 +$(PKG_NAME)-mod-codec2 \
402                 +$(PKG_NAME)-mod-commands \
403                 +$(PKG_NAME)-mod-dialplan-xml \
404                 +$(PKG_NAME)-mod-dptools \
405                 +$(PKG_NAME)-mod-event-socket \
406                 +$(PKG_NAME)-mod-hash \
407                 +$(PKG_NAME)-mod-local-stream \
408                 +$(PKG_NAME)-mod-sndfile \
409                 +$(PKG_NAME)-mod-sofia \
410                 +$(PKG_NAME)-mod-syslog \
411                 +$(PKG_NAME)-mod-tone-stream \
412                 +$(PKG_NAME)-tools
413 endef
414
415
416 define Package/$(PKG_NAME)-sounds-en-08KHz
417 $(call Package/$(PKG_NAME)/Default)
418   TITLE:=FreeSWITCH 8KHz english sounds
419   DEPENDS:= $(PKG_NAME)
420 endef
421
422
423 define Package/$(PKG_NAME)-sounds-en-16KHz
424 $(call Package/$(PKG_NAME)/Default)
425   TITLE:=FreeSWITCH 16KHz english sounds
426   DEPENDS:= +$(PKG_NAME)-sounds-en-08KHz
427 endef
428
429
430 define Package/$(PKG_NAME)-sounds-en-32KHz
431 $(call Package/$(PKG_NAME)/Default)
432   TITLE:=FreeSWITCH 32KHz english sounds
433   DEPENDS:= +$(PKG_NAME)-sounds-en-16KHz
434 endef
435
436
437 define Package/$(PKG_NAME)-sounds-en-48KHz
438 $(call Package/$(PKG_NAME)/Default)
439   TITLE:=FreeSWITCH 48KHz english sounds
440   DEPENDS:= +$(PKG_NAME)-sounds-en-32KHz
441 endef
442
443
444 define Package/$(PKG_NAME)-sounds-moh-08KHz
445 $(call Package/$(PKG_NAME)/Default)
446   TITLE:=FreeSWITCH 8KHz music-on-hold sounds
447   DEPENDS:= $(PKG_NAME)
448 endef
449
450
451 define Package/$(PKG_NAME)-sounds-moh-16KHz
452 $(call Package/$(PKG_NAME)/Default)
453   TITLE:=FreeSWITCH 16KHz music-on-hold sounds
454   DEPENDS:= +$(PKG_NAME)-sounds-moh-08KHz
455 endef
456
457
458 define Package/$(PKG_NAME)-sounds-moh-32KHz
459 $(call Package/$(PKG_NAME)/Default)
460   TITLE:=FreeSWITCH 32KHz music-on-hold sounds
461   DEPENDS:= +$(PKG_NAME)-sounds-moh-16KHz
462 endef
463
464
465 define Package/$(PKG_NAME)-sounds-moh-48KHz
466 $(call Package/$(PKG_NAME)/Default)
467   TITLE:=FreeSWITCH 48KHz music-on-hold sounds
468   DEPENDS:= +$(PKG_NAME)-sounds-moh-32KHz
469 endef
470
471
472 define Package/$(PKG_NAME)-tools
473 $(call Package/$(PKG_NAME)/Default)
474   TITLE:=FreeSWITCH control tools
475   DEPENDS:= $(PKG_NAME)
476 endef
477
478
479 define Download/files
480  define Download/$(1)
481   FILE:=$(2)
482   URL:=$(if $(4),$(4),http://files.$(PKG_NAME).org)/$(5)
483   MD5SUM:=$(3)
484  endef
485  define Prepare/$(1)
486   $(LN) $(DL_DIR)/$(2) $(PKG_BUILD_DIR)/$(6)
487  endef
488  $$(eval $$(call Download,$(1)))
489 endef
490
491
492 MAKE_INSTALL_TARGETS:=install
493
494
495 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),)
496  $(eval $(call Download/files,celt,celt-0.10.0.tar.gz,a656f6176e9be84027c0e51ceedd710f,,downloads/libs/,libs/))
497 endif
498
499
500 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl),)
501  $(eval $(call Download/files,json-cdr,json-c-0.9.tar.gz,4653b3b9c568bb9c782178abfaac128d,,downloads/libs/,libs/))
502 endif
503
504
505 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event-zmq),)
506  $(eval $(call Download/files,event-zmq,zeromq-2.1.9.tar.gz,94c5e0262a79c5f82bc0b178c1f8a33d,http://download.zeromq.org http://download.zeromq.org/historic,,libs/))
507 endif
508
509
510 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-flite),)
511  $(eval $(call Download/files,flite,flite-1.5.4-current.tar.bz2,f3a2d88b1059f6f4ff3c20a8169bc0f4,,downloads/libs/,libs/))
512 endif
513
514
515 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-opus),)
516  $(eval $(call Download/files,opus,opus-1.0.2.tar.gz,c503ad05a59ddb44deab96204401be03,,downloads/libs/,libs/))
517 endif
518
519
520 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-08KHz),)
521  $(eval $(call Download/files,sounds-en-08KHz,$(PKG_NAME)-sounds-en-us-callie-8000-1.0.25.tar.gz,1140efad453ed1a72259d799f7fef0fc,,,))
522         MAKE_INSTALL_TARGETS+= sounds-install
523 endif
524
525
526 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-16KHz),)
527  $(eval $(call Download/files,sounds-en-16KHz,$(PKG_NAME)-sounds-en-us-callie-16000-1.0.25.tar.gz,20b9bf1b1637be2abe838113fb675c41,,,))
528         MAKE_INSTALL_TARGETS+= hd-sounds-install
529 endif
530
531
532 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-32KHz),)
533  $(eval $(call Download/files,sounds-en-32KHz,$(PKG_NAME)-sounds-en-us-callie-32000-1.0.25.tar.gz,977d453d8ffa9a5b0fadee8408e84f60,,,))
534         MAKE_INSTALL_TARGETS+= uhd-sounds-install
535 endif
536
537
538 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-48KHz),)
539  $(eval $(call Download/files,sounds-en-48KHz,$(PKG_NAME)-sounds-en-us-callie-48000-1.0.25.tar.gz,96ec0df908eb1c535063fdc8580626d2,,,))
540         MAKE_INSTALL_TARGETS+= cd-sounds-install
541 endif
542
543
544 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-08KHz),)
545  $(eval $(call Download/files,sounds-moh-08KHz,$(PKG_NAME)-sounds-music-8000-1.0.8.tar.gz,f63ef3cc3507af079ae5c7b8b8a01e42,,,))
546         MAKE_INSTALL_TARGETS+= moh-install
547 endif
548
549
550 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-16KHz),)
551  $(eval $(call Download/files,sounds-moh-16KHz,$(PKG_NAME)-sounds-music-16000-1.0.8.tar.gz,7fd0ca9a9e3878783baa39b8187743bf,,,))
552         MAKE_INSTALL_TARGETS+= hd-moh-install
553 endif
554
555
556 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-32KHz),)
557  $(eval $(call Download/files,sounds-moh-32KHz,$(PKG_NAME)-sounds-music-32000-1.0.8.tar.gz,7e03932ea81b8d0bf6d686f838b060b4,,,))
558         MAKE_INSTALL_TARGETS+= uhd-moh-install
559 endif
560
561
562 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-48KHz),)
563  $(eval $(call Download/files,sounds-moh-48KHz,$(PKG_NAME)-sounds-music-48000-1.0.8.tar.gz,d06cd2a80379f224affab21f5180e4c6,,,))
564         MAKE_INSTALL_TARGETS+= cd-moh-install
565 endif
566
567
568 #
569 # XXX: -fgnu89-inline is not supported on all compiler versions, so only enable it on avr32 where it solves build issues
570 #
571 ifneq ($(CONFIG_avr32),)
572   TARGET_CFLAGS += -fgnu89-inline
573   TARGET_CXXFLAGS += -fgnu89-inline
574 endif
575
576
577 ifneq ($(CONFIG_USE_EGLIBC),)
578   ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
579     TARGET_CFLAGS += -DNO_GETLOGIN
580   endif
581 endif
582
583
584 FS_TARGET_CFLAGS:= $(TARGET_CFLAGS) -DLUA_USE_LINUX $(FPIC) -std=gnu99 -Wno-format
585 FS_TARGET_CXXFLAGS:= $(TARGET_CXXFLAGS) -DLUA_USE_LINUX $(FPIC) -Wno-format
586 FS_TARGET_CPPFLAGS:= -I. -I./lua $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),-I$(STAGING_DIR_HOST)/lib/erlang/lib/erl_interface-3.7.7/include) $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-json-cdr),-Wno-error) $(TARGET_CPPFLAGS)
587
588
589 CONFIGURE_ARGS+= \
590         --host=$(GNU_TARGET_NAME) \
591         --build=$(GNU_HOST_NAME) \
592         --prefix="/usr/share/$(PKG_NAME)" \
593         --bindir="/usr/bin" \
594         --libdir="/usr/lib" \
595         --srcdir="$(PKG_BUILD_DIR)" \
596         --sysconfdir="/etc/$(PKG_NAME)" \
597         --with-modinstdir="/usr/lib/$(PKG_NAME)" \
598         --with-random="/dev/urandom" \
599         $(if $(CONFIG_FS_WITH_MYSQL),--with,--without)-mysql \
600         $(if $(CONFIG_FS_WITH_POSTGRESQL),--with,--without)-pgsql \
601         $(if $(CONFIG_FS_WITH_SQLITE3),--with,--without)-sqlite3 \
602         $(call autoconf_bool,CONFIG_FS_WITH_IPV6,ipv6) \
603         $(call autoconf_bool,CONFIG_FS_WITH_OPT,optimization) \
604         $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),--with-ogg="$(STAGING_DIR)/usr",--without-ogg) \
605         $(if ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-cdr)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-curl)),--with-libcurl="$(STAGING_DIR)/usr",--without-libcurl) \
606         $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),--with,--without)-erlang \
607         $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-java),--with-java="$(STAGING_DIR)/usr",--without-java) \
608         $(call autoconf_bool,CONFIG_FS_WITH_LZMA,lzma) \
609         $(call autoconf_bool,CONFIG_FS_WITH_POSTGRESQL,core-pgsql-support) \
610         $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp && CONFIG_FS_WITH_FIXED_POINT,fixed-point) \
611         $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp,builtin-tiff) \
612         $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-timerfd,timerfd-wrapper) \
613         $(call autoconf_bool,CONFIG_FS_WITH_BUILTIN_ZRTP,zrtp) \
614         $(call autoconf_bool,CONFIG_FS_WITH_ODBC,core-odbc-support) \
615         $(if $(CONFIG_FS_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \
616         $(if $(CONFIG_FS_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)/usr/lib") \
617
618
619 CONFIGURE_VARS+= \
620         config_TARGET_CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
621         config_TARGET_CFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CFLAGS)" \
622         config_TARGET_CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
623         config_TARGET_CXXFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CXXFLAGS)" \
624         config_TARGET_CPPFLAGS="$(FS_TARGET_CPPFLAGS)" \
625         config_TARGET_READLINE_INC="$(FS_TARGET_CPPFLAGS)" \
626         config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
627         config_TARGET_LIBS="$(TARGET_LDFLAGS) -lpthread -ldl" \
628         config_BUILD_CC="$(HOSTCC)" \
629         config_BUILD_CFLAGS="$(HOST_CFLAGS)" \
630         CC_FOR_BUILD="$(HOSTCC)" \
631         BUILDTOOL_CC="$(HOSTCC)" \
632         BUILDTOOL_CCLD="$(HOSTCC)" \
633         LDFLAGS="$$$$LDFLAGS" \
634         LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
635         CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
636         CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
637         AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
638         RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
639         CFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CFLAGS)" \
640         CXXFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CXXFLAGS)" \
641         CPPFLAGS="$(FS_TARGET_CPPFLAGS)" \
642         LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=\"$(STAGING_DIR)/usr/lib\"" \
643         HOST_CC="/usr/bin/cc" \
644         HOST_CXX="/usr/bin/g++" \
645         CROSS_COMPILE="1" \
646         ax_cv_c_compiler_vendor="gnu" \
647         ac_cv_dev_urandom="yes" \
648         ac_cv_file_dbd_apr_dbd_mysql_c="no" \
649         ac_cv_file__dev_random="no" \
650         ac_cv_file__dev_urandom="yes" \
651         ac_cv_file___dev_urandom_="yes" \
652         ac_cv_func_mmap_fixed_mapped="yes" \
653         ac_cv_func_pthread_rwlock_init="yes" \
654         ac_cv_struct_rlimit="yes" \
655         apr_cv_mutex_recursive="yes" \
656         apr_cv_process_shared_works="no" \
657         apr_cv_tcp_nodelay_with_cork="yes" \
658         apr_cv_type_rwlock_t="yes" \
659         $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-perl),ac_cv_path_PERL="yes",) \
660         libzmq_cv_cxx_werror_flag="" \
661
662
663 define Build/Prepare
664         $(call Build/Prepare/Default)
665         $(call Prepare/celt)
666         $(call Prepare/event-zmq)
667         $(call Prepare/flite)
668         $(call Prepare/json-cdr)
669         $(call Prepare/opus)
670         $(call Prepare/sounds-en-08KHz)
671         $(call Prepare/sounds-en-16KHz)
672         $(call Prepare/sounds-en-32KHz)
673         $(call Prepare/sounds-en-48KHz)
674         $(call Prepare/sounds-moh-08KHz)
675         $(call Prepare/sounds-moh-16KHz)
676         $(call Prepare/sounds-moh-32KHz)
677         $(call Prepare/sounds-moh-48KHz)
678 endef
679
680
681 define Build/Configure
682         if [ -d $(PKG_BUILD_DIR)/libs/libcodec2/src ]; then \
683                 (cd $(PKG_BUILD_DIR)/libs/libcodec2/src; $(HOSTCC) -c generate_codebook.c; $(HOSTCC) -o generate_codebook generate_codebook.o -lm) \
684         fi
685         (cd $(PKG_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap.sh)
686         $(call Build/Configure/Default,)
687         $(foreach m,$(FS_MOD_AVAILABLE),
688                 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)),
689                         $(SED) 's|^[ #]*\([^#]*/mod_$(subst -,_,$(m))\)$$$$|\1|g' $(PKG_BUILD_DIR)/modules.conf
690                 ,
691                         $(SED) 's|^\([^#]*/mod_$(subst -,_,$(m))\)$$$$|#\1|g' $(PKG_BUILD_DIR)/modules.conf
692                 )
693         )
694 endef
695
696
697 define Build/Compile
698         $(MAKE) -C $(PKG_BUILD_DIR) \
699                 AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
700                 RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
701                 CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
702                 CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
703                 DESTDIR="$(PKG_INSTALL_DIR)" \
704                 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
705                 all $(MAKE_INSTALL_TARGETS)
706         $(SED) 's|^\([ \t]*\)\(.*\)"mod_console"\(.*\)$$$$|\1<!-- \2"mod_console"\3 -->|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
707         $(SED) 's|^\([ \t]*\)<!-- *\(.*\)"mod_syslog"\(.*\) *-->\(.*\)$$$$|\1\2"mod_syslog"\3\4|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
708 endef
709
710
711 define Build/InstallDev
712         $(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)
713         $(INSTALL_DIR) $(1)/usr/lib
714         $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/include/* $(1)/usr/include/$(PKG_NAME)/
715         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).{a,so*} $(1)/usr/lib/
716 endef
717
718
719 define Package/$(PKG_NAME)/install
720         $(INSTALL_DIR) $(1)/etc/config
721         $(INSTALL_DIR) $(1)/etc/default
722         $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
723         $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)/scripts
724         $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
725         $(INSTALL_DIR) $(1)/etc/init.d
726         $(INSTALL_DIR) $(1)/usr/bin
727         $(INSTALL_DIR) $(1)/usr/lib
728         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
729         $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
730         $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
731         $(INSTALL_DATA) ./files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME)
732         $(INSTALL_DATA) ./files/$(PKG_NAME).hotplug $(1)/etc/hotplug.d/iface/90-$(PKG_NAME)
733         $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
734         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME)* $(1)/usr/lib/
735         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/$(PKG_NAME).pc $(1)/usr/lib/pkgconfig/
736         $(if $(1)/usr/lib/lib$(PKG_NAME).la,sed -i -e "s#-lcurl -lz\(.*\)/usr/lib/libexpat.la\(.*\)$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)\(.*\)#-L/usr/lib -lcurl -lz /usr/lib/libexpat.la\2/usr\3#g" $(1)/usr/lib/lib$(PKG_NAME).la)
737 endef
738
739
740 define Package/$(PKG_NAME)-collection-upstream-defaults/install
741         $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
742 endef
743
744
745 define Package/$(PKG_NAME)-example-config/install
746         $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/examples/conf
747         $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/* $(1)/usr/share/$(PKG_NAME)/examples/conf/
748 endef
749
750
751 define Package/$(PKG_NAME)-config-upstream-defaults/install
752         $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
753         $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME) $(1)/etc
754 endef
755
756
757 define Package/$(PKG_NAME)-collection-minimal/install
758         $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
759 endef
760
761
762 define Package/$(PKG_NAME)-collection-uci-minimal/install
763         $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
764 endef
765
766
767 define Package/$(PKG_NAME)-config-minimal/install
768         $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)/autoload_configs
769
770         #
771         # Copying dialplan directory jingle_profiles sip_profiles $(PKG_NAME).xml
772         # fur_elise.ttml mime.types tetris.ttml tones.conf vars.xml
773         #
774         $(foreach f,dialplan directory jingle_profiles sip_profiles $(PKG_NAME).xml fur_elise.ttml mime.types tetris.ttml vars.xml,$(if $(PKG_BUILD_DIR)/conf/vanilla/$(f),$(CP) $(PKG_BUILD_DIR)/conf/vanilla/$(f) $(1)/etc/$(PKG_NAME);))
775
776         #
777         # Copying acl ivr modules post_load_modules switch timezones
778         #
779         $(foreach f,acl ivr modules post_load_modules switch timezones,$(if $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/$(f).conf.xml,$(CP) $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/$(f).conf.xml $(1)/etc/$(PKG_NAME)/autoload_configs;))
780 endef
781
782
783 define Package/$(PKG_NAME)-sounds-en-08KHz/install
784         #
785         # sounds-en-8KHz
786         #
787         for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
788         do \
789                 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000; \
790                 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000; \
791         done
792 endef
793
794
795 define Package/$(PKG_NAME)-sounds-en-16KHz/install
796         #
797         # sounds-en-16KHz
798         #
799         for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
800         do \
801                 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000; \
802                 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000; \
803         done
804 endef
805
806
807 define Package/$(PKG_NAME)-sounds-en-32KHz/install
808         #
809         # sounds-en-32KHz
810         #
811         for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
812         do \
813                 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000; \
814                 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000; \
815         done
816 endef
817
818
819 define Package/$(PKG_NAME)-sounds-en-48KHz/install
820         #
821         # sounds-en-48KHz
822         #
823         for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
824         do \
825                 [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000; \
826                 $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000; \
827         done
828 endef
829
830
831 define Package/$(PKG_NAME)-sounds-moh-08KHz/install
832         #
833         # sounds-moh-8KHz
834         #
835         [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/8000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/8000;
836         $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/8000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
837 endef
838
839
840 define Package/$(PKG_NAME)-sounds-moh-16KHz/install
841         #
842         # sounds-moh-16KHz
843         #
844         [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/16000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/16000;
845         $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/16000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
846 endef
847
848
849 define Package/$(PKG_NAME)-sounds-moh-32KHz/install
850         #
851         # sounds-moh-32KHz
852         #
853         [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/32000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/32000;
854         $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/32000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
855 endef
856
857
858 define Package/$(PKG_NAME)-sounds-moh-48KHz/install
859         #
860         # sounds-moh-48KHz
861         #
862         [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/48000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/48000;
863         $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/48000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
864 endef
865
866
867 define Package/$(PKG_NAME)-tools/install
868         $(INSTALL_DIR) $(1)/usr/bin
869         $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_cli $(1)/usr/bin/
870         $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_encode $(1)/usr/bin/
871         $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_ivrd $(1)/usr/bin/
872         $(CP) $(PKG_INSTALL_DIR)/usr/bin/fsxs $(1)/usr/bin/
873         $(CP) $(PKG_INSTALL_DIR)/usr/bin/gentls_cert $(1)/usr/bin/
874         $(CP) $(PKG_INSTALL_DIR)/usr/bin/tone2wav $(1)/usr/bin/
875 endef
876
877
878 # 1. Name
879 # 2. Title
880 # 3. Selection on module configuration file
881 # 4. Files (module files include different names)
882 # 5. Files (supporting files include different names)
883 # 6. Inter module depends
884 # 7. Extra depends
885 #
886 define BuildPlugin
887   define Package/$(PKG_NAME)-mod-$(1)
888     $$(call Package/$(PKG_NAME)/Default)
889     TITLE:= FS $(2) module
890     DEPENDS:= $(PKG_NAME) $(foreach m,$(6),+$(PKG_NAME)-mod-$(m)) $(7)
891   endef
892
893   define Package/$(PKG_NAME)-mod-$(1)/install
894         [ -z "mod_$(subst -,_,$(1))" ] || $(INSTALL_DIR) $$(1)/usr/lib/$(PKG_NAME)
895
896         for f in $$$$(realpath $$$$(wildcard $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/mod_$(subst -,_,$(1)).*)) $$$$(wildcard $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/$(4)_*); \
897         do \
898                 $(CP) $$$$$$$${f} $$(1)/usr/lib/$(PKG_NAME)/; \
899         done
900
901         #
902         # mod_$(subst -,_,$(1)): $(5)
903         #
904         $(foreach f,$(5),[ -d $(dir $$(1)/usr/${f}) ] || $(INSTALL_DIR) $(dir $$(1)/usr/${f});$(CP) $$$$(wildcard $(PKG_INSTALL_DIR)/usr/${f}*) $(dir $$(1)/usr/${f});)
905
906         #
907         # mod_$(subst -,_,$(1)): Clean installed library control files from referencig to OpenWRT PATH.
908         #
909         for f in `ls $$(1)/usr/lib/$(PKG_NAME)/*.la`; \
910         do \
911                 sed -i -e "s#' \(.*\)/usr/lib/libexpat.la\(.*\)$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)\(.*\)#' -L/usr/lib -L/usr/lib/libiconv-full/lib -L/usr/lib/libintl-full/lib /usr/lib/lib$(PKG_NAME).la /usr/lib/libexpat.la\2/usr\3#g;s#' \(.*\)/usr/lib/libintl-full/lib#' -L/usr/lib -L/usr/lib/libiconv-full/lib -L/usr/lib/libintl-full/lib#g;s#-L\.\.##g;s#$(PKG_BUILD_DIR)\(.*\)/usr/lib/libtiff.la\(.*\)#/usr/lib/libtiff.la\2#g" $$$$$$$${f}; \
912         done
913
914         #
915         # 1. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)))
916         #
917         $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
918
919         #
920         # 2. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)))
921         #
922         $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
923
924         #
925         # 3. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)))
926         #
927         $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
928
929         #
930         # 4. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)))
931         #
932         $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
933
934         #
935         # 5. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)))
936         #
937         $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs)
938
939         #
940         # 6. Additional configuration files for mod_$(subst -,_,$(1)) from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/$(1)/*.$(1))))
941         #
942         $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/$(1)/*.$(1))),[ -d $$(1)/etc/$(PKG_NAME)/$(1) ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/$(1);$(CP) $(PKG_BUILD_DIR)/conf/$(3)/$(1) $$(1)/etc/$(PKG_NAME))
943   endef
944
945   define Package/$(PKG_NAME)-mod-$(1)/postinst
946 #!/bin/sh
947 sed -i -e 's|^\([ \t]*\)<!-- *\(.*\)"mod_$(subst -,_,$(1))"\(.*\) *-->\(.*\)$$$$|\1\2"mod_$(subst -,_,$(1))"\3\4|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
948   endef
949
950   define Package/$(PKG_NAME)-mod-$(1)/prerm
951 #!/bin/sh
952 sed -i -e 's|^\([ \t]*\)\(.*\)"mod_$(subst -,_,$(1))"\(.*\)$$$$|\1<!-- \2"mod_$(subst -,_,$(1))"\3 -->|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
953   endef
954
955   $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1)))
956 endef
957
958
959 $(eval $(call BuildPackage,$(PKG_NAME)))
960 $(eval $(call BuildPackage,$(PKG_NAME)-collection-upstream-defaults))
961 $(eval $(call BuildPackage,$(PKG_NAME)-collection-minimal))
962 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-08KHz))
963 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-16KHz))
964 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-32KHz))
965 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-48KHz))
966 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-08KHz))
967 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-16KHz))
968 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-32KHz))
969 $(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-48KHz))
970 $(eval $(call BuildPackage,$(PKG_NAME)-tools))
971 $(eval $(call BuildPackage,$(PKG_NAME)-example-config))
972 $(eval $(call BuildPackage,$(PKG_NAME)-config-upstream-defaults))
973 $(eval $(call BuildPackage,$(PKG_NAME)-config-minimal))
974
975
976 #
977 # $(eval $(call BuildPlugin,Name,Title,Selection on module Conf File,Files,Inter Depends,Extra Depends))
978 #
979 $(eval $(call BuildPlugin,abstraction,An Abstraction To API Call,vanilla,,,,))
980 $(eval $(call BuildPlugin,alsa,Alsa Endpoint,vanilla,,,,+alsa-lib @FS_WITH_ALSA))
981 $(eval $(call BuildPlugin,amr,Adaptive Multi-Rate On Bandwidth Codec,vanilla,,,,))
982 $(eval $(call BuildPlugin,amrwb,Wide Band AMR,vanilla,,,,))
983 $(eval $(call BuildPlugin,avmd,Advanced Voice Mail Detection,vanilla,,,,))
984 $(eval $(call BuildPlugin,blacklist,Blacklist,vanilla,,,,))
985 $(eval $(call BuildPlugin,bv,BroadVoice 16/32-bit Audio Codec,vanilla,,,,))
986 $(eval $(call BuildPlugin,callcenter,Call Center,vanilla,,,,))
987 $(eval $(call BuildPlugin,cdr-csv,CSV-CDR Handler,mod,,,,)) # ~/conf
988 $(eval $(call BuildPlugin,cdr-pg-csv,PostgreSQL CDR Handler,vanilla,,,,+coreutils +FS_WITH_POSTGRESQL:libpq @FS_WITH_POSTGRESQL))
989 $(eval $(call BuildPlugin,cdr-sqlite,SQLite3 CDR Handler,vanilla,,,,@FS_WITH_SQLITE3))
990 $(eval $(call BuildPlugin,celt,CELT Ultra-Low Delay Codec,vanilla,,,,+libogg))
991 $(eval $(call BuildPlugin,cepstral,Cepstral Interface,vanilla,,,,@BROKEN)) # needs <swift.h>
992 $(eval $(call BuildPlugin,cidlookup,Data Query For CID->NAME Services,mod,,,,+libcurl)) # ~/conf
993 $(eval $(call BuildPlugin,cluechoo,Framework Demo,vanilla,,,,))
994 $(eval $(call BuildPlugin,codec2,CoDec 2,,,,,))
995 $(eval $(call BuildPlugin,commands,API Commands,vanilla,,,,))
996 $(eval $(call BuildPlugin,conference,Conference Room,vanilla,,,,))
997 $(eval $(call BuildPlugin,console,Console Logger,vanilla,,,,))
998 $(eval $(call BuildPlugin,curl,HTTP Request,vanilla,,,,+libcurl))
999 $(eval $(call BuildPlugin,dahdi-codec,DAHDI Codecs,vanilla,,,,))
1000 $(eval $(call BuildPlugin,db,Database Backend,vanilla,,,,))
1001 $(eval $(call BuildPlugin,dialplan-asterisk,Asterisk Dialplan Parser,vanilla,,,,))
1002 $(eval $(call BuildPlugin,dialplan-directory,Dialplan Directory,vanilla,,,,))
1003 $(eval $(call BuildPlugin,dialplan-xml,Dialplan-XML Interface,vanilla,,,,))
1004 $(eval $(call BuildPlugin,dingaling,Jabber Interface,vanilla,,,,+libopenssl))
1005 $(eval $(call BuildPlugin,directory,Search By Name Directory IVR,vanilla,,,,))
1006 $(eval $(call BuildPlugin,distributor,Simple Robin-Round Load,vanilla,,,,))
1007 $(eval $(call BuildPlugin,dptools,Dialplan Tools,vanilla,,,,))
1008 $(eval $(call BuildPlugin,easyroute,Simple DID Routing,vanilla,,,,))
1009 $(eval $(call BuildPlugin,enum,ENUM Routing,,,,,))
1010 $(eval $(call BuildPlugin,erlang-event,Erlang Event Handler,vanilla,,,,+erlang @BROKEN))
1011 $(eval $(call BuildPlugin,esf,Extra SIP Functionality,vanilla,,,,))
1012 $(eval $(call BuildPlugin,event-multicast,Multicast Event Handler,vanilla,,,,))
1013 $(eval $(call BuildPlugin,event-socket,Socket Event Handler,vanilla,,,,))
1014 $(eval $(call BuildPlugin,event-zmq,Socket Event Handler By Zero MQ,vanilla,,,,+libuuid))
1015 $(eval $(call BuildPlugin,expr,Expression Evaluation,vanilla,,,,))
1016 $(eval $(call BuildPlugin,fifo,FIFO,vanilla,,,,))
1017 $(eval $(call BuildPlugin,file-string,Streaming Multiple Sound Files Sequentially,vanilla,,,,@OBSOLETE)) # merged into dptools
1018 $(eval $(call BuildPlugin,flite,Festival TTS,vanilla,,,,@(!(armeb||avr32)||BROKEN)))
1019 $(eval $(call BuildPlugin,fsk,Bell-202 1200-Baud FSK Decoder,vanilla,,,,))
1020 $(eval $(call BuildPlugin,fsv,Video Player / Recorder,vanilla,,,,))
1021 $(eval $(call BuildPlugin,g723-1,G.723.1 Codec,vanilla,,,,))
1022 $(eval $(call BuildPlugin,g729,G.729 Codec,vanilla,,,,))
1023 $(eval $(call BuildPlugin,gsmopen,GSM Modem compatible Endpoint,mod,,,alsa,+alsa-lib @FS_WITH_ALSA @BROKEN)) # needs gsmlib
1024 $(eval $(call BuildPlugin,h26x,H26X Linear Codec,vanilla,,,,))
1025 $(eval $(call BuildPlugin,h323,H323 Endpoint,mod,,,,@BROKEN)) # Req. H323Plus v1.24.x or newer
1026 $(eval $(call BuildPlugin,hash,API For Manipulating A Hash Table,vanilla,,,,))
1027 $(eval $(call BuildPlugin,html5,HTML5 Endpoint Module,vanilla,,,,))
1028 $(eval $(call BuildPlugin,httapi,HT Telephony API and HTTP Caching,mod,,,,)) # ~/conf
1029 $(eval $(call BuildPlugin,http-cache,HTTP GET With Caching,mod,,,,+libcurl)) # ~/conf
1030 $(eval $(call BuildPlugin,ilbc,ILBC Codec,vanilla,,,,))
1031 $(eval $(call BuildPlugin,isac,iSAC Codec,vanilla,,,,))
1032 $(eval $(call BuildPlugin,java,Java Language Interface,vanilla,,,,@BROKEN)) # needs java
1033 $(eval $(call BuildPlugin,json-cdr,JSon-CDR Interface,mod,,,,+libcurl))
1034 $(eval $(call BuildPlugin,lcr,Least Cost Routing,vanilla,,,,))
1035 $(eval $(call BuildPlugin,local-stream,Multi-Channel On Same Stream,vanilla,,,,))
1036 $(eval $(call BuildPlugin,logfile,File Logger,vanilla,,,,))
1037 $(eval $(call BuildPlugin,loopback,Loopback to Dialplan Endpoint,vanilla,,,,))
1038 $(eval $(call BuildPlugin,lua,LUA Language Interface,vanilla,,,,))
1039 $(eval $(call BuildPlugin,managed,Media Switching Software Library,vanilla,,,,+glib2 @BROKEN)) # needs Mono
1040 $(eval $(call BuildPlugin,mp4,MP4 File Format Support For Video,vanilla,,,,@BROKEN)) # needs libmp4v2
1041 $(eval $(call BuildPlugin,mp4v,MP4 CoDec Support For Video,vanilla,,,,))
1042 $(eval $(call BuildPlugin,native-file,WAV Format Sound Player,vanilla,,,,))
1043 $(eval $(call BuildPlugin,nibblebill,Credit / Debit Billing,vanilla,,,,))
1044 $(eval $(call BuildPlugin,openzap,Zaptel (Superseded by FreeTDM),libs,ozmod,lib/libopenzap lib/pkgconfig/openzap,,+libpcap))
1045 $(eval $(call BuildPlugin,opus,Opus CoDec,vanilla,,,,))
1046 $(eval $(call BuildPlugin,oreka,Media Recording with Oreka,vanilla,,,,))
1047 $(eval $(call BuildPlugin,portaudio,Portaudio To Sound Card Interface,vanilla,,,alsa,+alsa-lib @FS_WITH_ALSA))
1048 $(eval $(call BuildPlugin,portaudio-stream,Portaudio Streaming Interface,vanilla,,,alsa,+alsa-lib @FS_WITH_ALSA))
1049 $(eval $(call BuildPlugin,posix-timer,POSIX Compliant Soft Timer,vanilla,,,,))
1050 $(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,vanilla,,,,@BROKEN)) # fails in freeradius-client
1051 $(eval $(call BuildPlugin,rayo,Rayo server & node implementation,vanilla,,,,))
1052 $(eval $(call BuildPlugin,redis,Redis Limited Backend,vanilla,,,,))
1053 $(eval $(call BuildPlugin,rss,RRS Feeds via TTS,vanilla,,,,))
1054 $(eval $(call BuildPlugin,rtmp,RTMP Protocol Handler,vanilla,,,,))
1055 $(eval $(call BuildPlugin,sangoma-codec,Sangoma Codec,vanilla,,,,@BROKEN)) # Req. Sangoma CoDec source
1056 $(eval $(call BuildPlugin,say-de,German Say,vanilla,,,,))
1057 $(eval $(call BuildPlugin,say-en,English Say,vanilla,,,,))
1058 $(eval $(call BuildPlugin,say-es,Spanish Say,vanilla,,,,))
1059 $(eval $(call BuildPlugin,say-fa,Persian Say,vanilla,,,,))
1060 $(eval $(call BuildPlugin,say-fr,French Say,vanilla,,,,))
1061 $(eval $(call BuildPlugin,say-hu,Hungarian Say,vanilla,,,,))
1062 $(eval $(call BuildPlugin,say-it,Italian Say,vanilla,,,,))
1063 $(eval $(call BuildPlugin,say-nl,Dutch Say,vanilla,,,,))
1064 $(eval $(call BuildPlugin,say-pt,Portugeese Say,vanilla,,,,))
1065 $(eval $(call BuildPlugin,say-ru,Russian Say,vanilla,,,,))
1066 $(eval $(call BuildPlugin,say-th,Thai Say,vanilla,,,,))
1067 $(eval $(call BuildPlugin,say-zh,Chineese Say,vanilla,,,,))
1068 $(eval $(call BuildPlugin,shell-stream,Streaming Audio Through CLI,vanilla,,,,))
1069 $(eval $(call BuildPlugin,silk,Skype(TM) SILK Codec Module,vanilla,,,,))
1070 $(eval $(call BuildPlugin,siren,G.722.1 Codec,vanilla,,,,))
1071 $(eval $(call BuildPlugin,skel,Template For New Module,vanilla,,,,))
1072 $(eval $(call BuildPlugin,skinny,Skinny Call Control Protocol (SCCP),vanilla,,,,))
1073 $(eval $(call BuildPlugin,skypopen,Skype Compatible Endpoint,mod,,,,@FEATURE_drawing-backend_libX11))
1074 $(eval $(call BuildPlugin,sms,SMS,vanilla,,,,))
1075 $(eval $(call BuildPlugin,snapshot,Record Audio Snapshot to File,vanilla,,,,))
1076 $(eval $(call BuildPlugin,sndfile,Multi-Format Sound File,vanilla,,,,))
1077 $(eval $(call BuildPlugin,snipe-hunt,Snipe Hunt (Simple Example Module),vanilla,,,,))
1078 $(eval $(call BuildPlugin,snmp,SNMP AgentX Subagent,vanilla,,,,+libnetsnmp))
1079 $(eval $(call BuildPlugin,snom,SNOM specific features,vanilla,,,,))
1080 $(eval $(call BuildPlugin,sofia,SOFIA SIP,mod,,,,)) # ~/conf
1081 $(eval $(call BuildPlugin,sonar,Sonar Ping Timer,vanilla,,,,))
1082 $(eval $(call BuildPlugin,spandsp,Span DSP,mod,,,,+libjpeg)) # ~/conf
1083 $(eval $(call BuildPlugin,speex,Speex codec,mod,,,,))
1084 $(eval $(call BuildPlugin,spidermonkey,JavaScript,vanilla,,,,@BROKEN)) # fails in js
1085 $(eval $(call BuildPlugin,spidermonkey-core_db,JavaScript DB,vanilla,,,,@BROKEN))
1086 $(eval $(call BuildPlugin,spidermonkey-curl,JavaScript Curl,vanilla,,,,@BROKEN))
1087 $(eval $(call BuildPlugin,spidermonkey-odbc,JavaScript ODBC,vanilla,,,,@BROKEN))
1088 $(eval $(call BuildPlugin,spidermonkey-socket,JavaScript Socket,vanilla,,,,@BROKEN))
1089 $(eval $(call BuildPlugin,spidermonkey-teletone,JavaScript Teletone,vanilla,,,,@BROKEN))
1090 $(eval $(call BuildPlugin,spy,User Spy,vanilla,,,,))
1091 $(eval $(call BuildPlugin,stress,Voice Stress Detection,vanilla,,,,))
1092 $(eval $(call BuildPlugin,syslog,SysLog logger,vanilla,,,,))
1093 $(eval $(call BuildPlugin,timerfd,Linux Kernel timerfd API,vanilla,,,,))
1094 $(eval $(call BuildPlugin,tone-stream,Tone Generation Stream,vanilla,,,,))
1095 $(eval $(call BuildPlugin,tts-commandline,ASR TTS Command Interface,vanilla,,,,))
1096 $(eval $(call BuildPlugin,unimrcp,UniMRCP (MRCP Client),vanilla,,,,@BROKEN))
1097 $(eval $(call BuildPlugin,valet-parking,Valet Parking Application,vanilla,,,,))
1098 $(eval $(call BuildPlugin,vmd,VoiceMail Beep Detection,vanilla,,,,))
1099 $(eval $(call BuildPlugin,voicemail,VoiceMail,vanilla,,,,))
1100 $(eval $(call BuildPlugin,voicemail-ivr,VoiceMail IVR,vanilla,,,,))
1101 $(eval $(call BuildPlugin,vp8,VP8 Video Codec,vanilla,,,,))
1102 $(eval $(call BuildPlugin,xml-cdr,XML-CDR Handler,vanilla,,,,+libcurl))
1103 $(eval $(call BuildPlugin,xml-curl,XML-Curl Gateway,vanilla,,,,+libcurl))
1104 $(eval $(call BuildPlugin,xml-rpc,XML-RPC Interface,vanilla,,,,))
1105 $(eval $(call BuildPlugin,xml-scgi,SCGI XML Gateway,vanilla,,,,))
1106 $(eval $(call BuildPlugin,yaml,YAML langunage,vanilla,,,,))