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