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