baresip: add symbol to prevent FFmpeg dependency by default
[feed/telephony.git] / net / baresip / Makefile
1 #
2 # Copyright (C) 2010-2017 OpenWrt.org
3 # Copyright (C) 2010 Alfred E. Heggestad
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=baresip
12 PKG_VERSION:=0.5.6
13 PKG_RELEASE:=4
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.creytiv.com/pub
17 PKG_HASH:=148defef160842e0247af92c84bb0c8de4b36ffa68cf3a87c4cd7e510cddd00c
18
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=docs/COPYING
21 PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
22
23 PKG_INSTALL:=1
24
25 baresip-mods:= \
26 alsa \
27 avcodec \
28 avformat \
29 cons \
30 evdev \
31 g711 \
32 g722 \
33 g726 \
34 opus \
35 oss \
36 plc \
37 portaudio \
38 pulse \
39 sndfile \
40 speex \
41 speex_aec \
42 speex_pp \
43 srtp \
44 stdio \
45 v4l \
46 v4l2
47
48 PKG_CONFIG_DEPENDS:= \
49 $(patsubst %,CONFIG_PACKAGE_baresip-mod-%,$(baresip-mods)) \
50
51 include $(INCLUDE_DIR)/package.mk
52
53 define Package/$(PKG_NAME)/config
54 source "$(SOURCE)/Config.in"
55 endef
56
57 define Package/baresip/Default
58 SECTION:=net
59 CATEGORY:=Network
60 SUBMENU:=Telephony
61 URL:=http://www.creytiv.com
62 endef
63
64 define Package/baresip
65 $(call Package/baresip/Default)
66 TITLE:=Portable and modular SIP User-Agent with A/V support
67 DEPENDS:=+libre +librem
68 MENU:=1
69 endef
70
71 baresip-mod-alsa := USE_ALSA
72 baresip-mod-avcodec := USE_AVCODEC
73 baresip-mod-avformat := USE_AVFORMAT
74 baresip-mod-cons := USE_CONS
75 baresip-mod-evdev := USE_EVDEV
76 baresip-mod-g711 := USE_G711
77 baresip-mod-g722 := USE_G722
78 baresip-mod-g726 := USE_G726
79 baresip-mod-opus := USE_OPUS
80 baresip-mod-oss := USE_OSS
81 baresip-mod-plc := USE_PLC
82 baresip-mod-portaudio := USE_PORTAUDIO
83 baresip-mod-pulse := USE_PULSE
84 baresip-mod-sndfile := USE_SNDFILE
85 baresip-mod-speex := USE_SPEEX
86 baresip-mod-speex_aec := USE_SPEEX_AEC
87 baresip-mod-speex_pp := USE_SPEEX_PP
88 baresip-mod-srtp := USE_SRTP
89 baresip-mod-stdio := USE_STDIO
90 baresip-mod-v4l := USE_V4L
91 baresip-mod-v4l2 := USE_V4L2
92
93 BARESIP_MOD_OPTIONS:= \
94 MOD_AUTODETECT= \
95 EXTRA_MODULES="dtmfio" \
96 $(foreach m,$(baresip-mods),$(baresip-mod-$(m))=$(if $(CONFIG_PACKAGE_baresip-mod-$(m)),1))
97
98 MAKE_FLAGS+= \
99 EXTRA_LFLAGS="$(TARGET_LDFLAGS)" \
100 LD="$(TARGET_CC)" \
101 LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \
102 LIBRE_INC="$(STAGING_DIR)/usr/include/re" \
103 LIBRE_SO="$(STAGING_DIR)/usr/lib" \
104 LIBREM_PATH="$(STAGING_DIR)/usr" \
105 SYSROOT="$(shell $(FIND) $(TOOLCHAIN_DIR) -path '*/include/pthread.h' | sed -ne '1s|/include/pthread.h||p')" \
106 SYSROOT_ALT="$(STAGING_DIR)/usr" \
107 RELEASE=1 \
108 $(BARESIP_MOD_OPTIONS)
109
110 TARGET_CFLAGS+=-D_GNU_SOURCE
111
112 define Package/baresip/install
113 $(INSTALL_DIR) $(1)/usr/bin
114 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/baresip $(1)/usr/bin
115 $(INSTALL_DIR) $(1)/usr/lib/baresip/modules
116 $(INSTALL_BIN) \
117 $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/{account,auloop,contact,ice,menu,stun,turn}.so \
118 $(1)/usr/lib/baresip/modules
119 $(INSTALL_DIR) $(1)/usr/share/baresip
120 $(CP) $(PKG_INSTALL_DIR)/usr/share/baresip/* $(1)/usr/share/baresip
121 $(INSTALL_DIR) $(1)/etc/init.d
122 $(INSTALL_BIN) ./files/baresip.init $(1)/etc/init.d/baresip
123 endef
124
125 ##################
126 # bareSIP modules
127 # 1. Name
128 # 2. Title
129 # 3. Files
130 # 4. Dependencies
131 ##################
132
133 define BuildPlugin
134
135 define Package/baresip-mod-$(1)
136 $$(call Package/baresip/Default)
137 TITLE:=$(2)
138 DEPENDS:=baresip $(patsubst +%,+PACKAGE_$(PKG_NAME)-mod-$(1):%,$(4))
139 endef
140
141 define Package/baresip-mod-$(1)/install
142 [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/usr/lib/baresip/modules
143 for f in $(3); do \
144 $(INSTALL_DATA) \
145 $(PKG_INSTALL_DIR)/usr/lib/baresip/modules/$$$$$$$${f}.so \
146 $$(1)/usr/lib/baresip/modules; \
147 done
148 endef
149
150 $$(eval $$(call BuildPackage,baresip-mod-$(1)))
151 endef
152
153 $(eval $(call BuildPackage,baresip))
154
155 $(eval $(call BuildPlugin,alsa,ALSA audio driver,alsa,+alsa-lib))
156 $(eval $(call BuildPlugin,aubridge,Audio bridge module,aubridge,))
157 $(eval $(call BuildPlugin,aufile,Audio module for using a WAV-file as audio input,aufile,))
158 $(eval $(call BuildPlugin,avcodec,Video codec using FFmpeg,avcodec,@BARESIP_WITH_FFMPEG +libffmpeg-full +libx264))
159 $(eval $(call BuildPlugin,avformat,Video source using FFmpeg,avformat,@BARESIP_WITH_FFMPEG +libffmpeg-full))
160 $(eval $(call BuildPlugin,cons,UDP/TCP console UI driver,cons,))
161 $(eval $(call BuildPlugin,debug_cmd,Debug commands,debug_cmd,))
162 $(eval $(call BuildPlugin,dtls_srtp,DTLS-SRTP end-to-end encryption,dtls_srtp,))
163 $(eval $(call BuildPlugin,dtmfio,DTMF input/output,dtmfio,))
164 $(eval $(call BuildPlugin,evdev,Linux input driver,evdev,))
165 $(eval $(call BuildPlugin,fakevideo,Fake video input/output driver,fakevideo,))
166 $(eval $(call BuildPlugin,g711,G.711 audio codec,g711,))
167 $(eval $(call BuildPlugin,g722,G.722 audio codec,g722,+libspandsp))
168 $(eval $(call BuildPlugin,g726,G.726 audio codec,g726,+libspandsp))
169 $(eval $(call BuildPlugin,httpd,HTTP webserver UI-module,httpd,))
170 $(eval $(call BuildPlugin,mwi,Message Waiting Indication,mwi,))
171 $(eval $(call BuildPlugin,natbd,NAT Behavior Discovery Module,natbd,))
172 $(eval $(call BuildPlugin,natpmp,NAT Port Mapping Protocol module,natpmp,))
173 $(eval $(call BuildPlugin,opus,OPUS Interactive audio codec,opus,+libopus))
174 $(eval $(call BuildPlugin,oss,OSS audio driver,oss,))
175 $(eval $(call BuildPlugin,plc,Packet Loss Concealment,plc,+libspandsp))
176 $(eval $(call BuildPlugin,portaudio,Portaudio audio driver,portaudio,+portaudio))
177 $(eval $(call BuildPlugin,presence,Presence module,presence,))
178 $(eval $(call BuildPlugin,pulse,Pulseaudio audio driver,pulse,+pulseaudio-daemon))
179 $(eval $(call BuildPlugin,selfview,Video selfview module,selfview,))
180 $(eval $(call BuildPlugin,sndfile,Audio dumper using libsndfile,sndfile,+libsndfile))
181 $(eval $(call BuildPlugin,speex,Speex audio codec,speex,+libspeex))
182 $(eval $(call BuildPlugin,speex_aec,Speex Acoustic Echo Canceller,speex_aec,+libspeex +libspeexdsp))
183 $(eval $(call BuildPlugin,speex_pp,Speex preprocessor,speex_pp,+libspeex +libspeexdsp))
184 $(eval $(call BuildPlugin,srtp,Secure RTP module using libre,srtp,))
185 $(eval $(call BuildPlugin,stdio,Standard input/output UI driver,stdio,))
186 $(eval $(call BuildPlugin,uuid,UUID generator and loader,uuid,))
187 $(eval $(call BuildPlugin,v4l,Video4Linux video source,v4l,+libv4l))
188 $(eval $(call BuildPlugin,v4l2,Video4Linux2 video source,v4l2,+libv4l))
189 $(eval $(call BuildPlugin,v4l2_codec,Video4Linux2 video codec module,v4l2_codec,))
190 $(eval $(call BuildPlugin,vidbridge,Video bridge module,vidbridge,))
191 $(eval $(call BuildPlugin,vidloop,Video-loop test module,vidloop,))
192 $(eval $(call BuildPlugin,vumeter,Display audio levels in console,vumeter,))