Android.mk 5.97 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
##
## Android.mk -Android build script-
##
##
## Copyright (C) 2010  Belledonne Communications, Grenoble, France
##
##  This program is free software; you can redistribute it and/or modify
##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation; either version 2 of the License, or
##  (at your option) any later version.
##
##  This program is distributed in the hope that it will be useful,
##  but WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Simon Morlat's avatar
Simon Morlat committed
15
##  GNU General Public License for more details.
16 17 18 19 20 21 22 23
##
##  You should have received a copy of the GNU General Public License
##  along with this program; if not, write to the Free Software
##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##

LOCAL_PATH:= $(call my-dir)/../../coreapi

24
include $(CLEAR_VARS)
25

Ghislain MARY's avatar
Ghislain MARY committed
26 27 28 29
LOCAL_CPP_EXTENSION := .cc

LOCAL_SRC_FILES := \
	address.c \
30
	authentication.c \
Ghislain MARY's avatar
Ghislain MARY committed
31 32 33 34
	bellesip_sal/sal_address_impl.c \
	bellesip_sal/sal_impl.c \
	bellesip_sal/sal_op_call.c \
	bellesip_sal/sal_op_call_transfer.c \
35
	bellesip_sal/sal_op_events.c \
Ghislain MARY's avatar
Ghislain MARY committed
36
	bellesip_sal/sal_op_impl.c \
37
	bellesip_sal/sal_op_info.c \
Ghislain MARY's avatar
Ghislain MARY committed
38 39 40
	bellesip_sal/sal_op_message.c \
	bellesip_sal/sal_op_presence.c \
	bellesip_sal/sal_op_publish.c \
41
	bellesip_sal/sal_op_registration.c \
Ghislain MARY's avatar
Ghislain MARY committed
42
	bellesip_sal/sal_sdp.c \
43
	buffer.c \
Ghislain MARY's avatar
Ghislain MARY committed
44
	callbacks.c \
45 46 47
	call_log.c \
	call_params.c \
	chat.c \
Ghislain MARY's avatar
Ghislain MARY committed
48
	conference.c \
49
	content.c \
Ghislain MARY's avatar
Ghislain MARY committed
50
	ec-calibrator.c \
51
	enum.c \
52
	event.c \
53 54 55 56 57 58 59
	friend.c \
	info.c \
	linphonecall.c \
	linphonecore.c \
	linphonecore_jni.cc \
	linphone_tunnel_config.c \
	localplayer.c \
60
	lpc2xml.c \
61
	lime.c \
62 63 64 65
	lpconfig.c \
	message_storage.c \
	misc.c  \
	offeranswer.c \
66
	player.c \
67 68 69 70 71 72 73 74
	presence.c \
	proxy.c \
	quality_reporting.c \
	remote_provisioning.c \
	sal.c \
	siplogin.c \
	sipsetup.c \
	xml2lpc.c \
Simon Morlat's avatar
Simon Morlat committed
75 76
	xml.c \
	vtables.c
Ghislain MARY's avatar
Ghislain MARY committed
77

jehan's avatar
jehan committed
78 79
ifndef LIBLINPHONE_VERSION
LIBLINPHONE_VERSION = "Devel"
Ghislain MARY's avatar
Ghislain MARY committed
80 81 82 83 84 85 86 87
endif

LOCAL_CFLAGS += \
	-D_BYTE_ORDER=_LITTLE_ENDIAN \
	-DORTP_INET6 \
	-DINET6 \
	-DENABLE_TRACE \
	-DHAVE_CONFIG_H \
jehan's avatar
jehan committed
88
	-DLIBLINPHONE_VERSION=\"$(LIBLINPHONE_VERSION)\" \
Ghislain MARY's avatar
Ghislain MARY committed
89
	-DLINPHONE_PLUGINS_DIR=\"\\tmp\" \
Margaux Clerc's avatar
Margaux Clerc committed
90 91
	-DUSE_BELLESIP \
	-DHAVE_ZLIB
Ghislain MARY's avatar
Ghislain MARY committed
92 93 94 95 96 97 98 99

LOCAL_CFLAGS += -DIN_LINPHONE

ifeq ($(_BUILD_VIDEO),1)
LOCAL_CFLAGS += -DVIDEO_ENABLED
ifeq ($(BUILD_X264),1)
LOCAL_CFLAGS += -DHAVE_X264
endif
100 101 102
ifeq ($(BUILD_OPENH264),1)
LOCAL_CFLAGS += -DHAVE_OPENH264
endif
Ghislain MARY's avatar
Ghislain MARY committed
103 104
endif

Margaux Clerc's avatar
Margaux Clerc committed
105 106 107 108
ifeq ($(BUILD_CONTACT_HEADER),1)
LOCAL_CFLAGS += -DSAL_OP_CALL_FORCE_CONTACT_IN_RINGING
endif

Ghislain MARY's avatar
Ghislain MARY committed
109 110 111 112 113 114 115 116 117 118 119 120 121
ifeq ($(USE_JAVAH),1)
LOCAL_CFLAGS += -DUSE_JAVAH
endif

LOCAL_C_INCLUDES += \
	$(LOCAL_PATH) \
	$(LOCAL_PATH)/../include \
	$(LOCAL_PATH)/../build/android \
	$(LOCAL_PATH)/../oRTP/include \
	$(LOCAL_PATH)/../mediastreamer2/include \
	$(LOCAL_PATH)/../../belle-sip/include \
	$(LOCAL_PATH)/../../../gen \
	$(LOCAL_PATH)/../../externals/libxml2/include \
johan's avatar
johan committed
122 123
	$(LOCAL_PATH)/../../externals/build/libxml2 \
	$(LOCAL_PATH)/../../externals/polarssl/include
Ghislain MARY's avatar
Ghislain MARY committed
124

Margaux Clerc's avatar
Margaux Clerc committed
125
LOCAL_LDLIBS += -llog -ldl -lz
Ghislain MARY's avatar
Ghislain MARY committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172

LOCAL_STATIC_LIBRARIES := \
	cpufeatures \
	libmediastreamer2 \
	libortp \
	libbellesip \
	libgsm \
	liblpxml2


ifeq ($(BUILD_TUNNEL),1)
LOCAL_CFLAGS +=-DTUNNEL_ENABLED
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../tunnel/include $(LOCAL_PATH)/../../tunnel/src
LOCAL_SRC_FILES +=  linphone_tunnel.cc TunnelManager.cc
LOCAL_STATIC_LIBRARIES += libtunnelclient
else
LOCAL_SRC_FILES += linphone_tunnel_stubs.c
endif


_BUILD_AMR=0
ifneq ($(BUILD_AMRNB), 0)
_BUILD_AMR=1
endif

ifneq ($(BUILD_AMRWB), 0)
_BUILD_AMR=1
endif

ifneq ($(_BUILD_AMR), 0)
LOCAL_CFLAGS += -DHAVE_AMR
LOCAL_STATIC_LIBRARIES += \
        libmsamr \
        libopencoreamr
endif

ifneq ($(BUILD_AMRWB), 0)
LOCAL_STATIC_LIBRARIES += \
	libvoamrwbenc
endif


ifeq ($(BUILD_SILK),1)
LOCAL_CFLAGS += -DHAVE_SILK
LOCAL_STATIC_LIBRARIES += libmssilk
endif

173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC),00)
LOCAL_CFLAGS += -DHAVE_WEBRTC
LOCAL_STATIC_LIBRARIES += libmswebrtc
endif
ifneq ($(BUILD_WEBRTC_AECM),0)
LOCAL_STATIC_LIBRARIES += \
	libwebrtc_aecm \
	libwebrtc_apm_utility \
	libwebrtc_spl \
	libwebrtc_system_wrappers
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
LOCAL_STATIC_LIBRARIES += \
	libwebrtc_aecm_neon \
	libwebrtc_spl_neon
endif
endif
ifneq ($(BUILD_WEBRTC_ISAC),0)
LOCAL_STATIC_LIBRARIES += \
	libwebrtc_isacfix \
	libwebrtc_spl
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
LOCAL_STATIC_LIBRARIES += \
	libwebrtc_isacfix_neon \
	libwebrtc_spl_neon
endif
198 199
endif

Ghislain MARY's avatar
Ghislain MARY committed
200 201 202 203 204 205 206 207 208 209 210 211 212
ifeq ($(BUILD_G729),1)
LOCAL_CFLAGS += -DHAVE_G729
LOCAL_STATIC_LIBRARIES += libbcg729 libmsbcg729
endif

ifeq ($(_BUILD_VIDEO),1)
LOCAL_LDLIBS    += -lGLESv2
LOCAL_STATIC_LIBRARIES += libvpx
ifeq ($(BUILD_X264),1)
LOCAL_STATIC_LIBRARIES += \
	libmsx264 \
	libx264
endif
213 214 215
ifeq ($(BUILD_OPENH264),1)
LOCAL_STATIC_LIBRARIES += \
	libmsopenh264 \
216
	libopenh264
217
endif
Ghislain MARY's avatar
Ghislain MARY committed
218 219 220 221 222 223 224
endif

ifeq ($(BUILD_UPNP),1)
LOCAL_CFLAGS += -DBUILD_UPNP
LOCAL_SRC_FILES += upnp.c
endif

225
LOCAL_STATIC_LIBRARIES += libspeex
Ghislain MARY's avatar
Ghislain MARY committed
226 227 228 229 230

ifeq ($(BUILD_SRTP), 1)
	LOCAL_C_INCLUDES += $(SRTP_C_INCLUDE)
endif

231
ifeq ($(BUILD_ILBC), 1)
232
ifneq ($(TARGET_ARCH_ABI),armeabi)
Ghislain MARY's avatar
Ghislain MARY committed
233 234 235
LOCAL_CFLAGS += -DHAVE_ILBC=1
LOCAL_STATIC_LIBRARIES += libmsilbc
endif
236
endif
Ghislain MARY's avatar
Ghislain MARY committed
237

238
LOCAL_C_INCLUDES += $(LIBLINPHONE_EXTENDED_C_INCLUDES)
Ghislain MARY's avatar
Ghislain MARY committed
239 240
LOCAL_WHOLE_STATIC_LIBRARIES += $(LIBLINPHONE_EXTENDED_STATIC_LIBS)
LOCAL_SRC_FILES  += $(LIBLINPHONE_EXTENDED_SRC_FILES)
241 242
LOCAL_CFLAGS += $(LIBLINPHONE_EXTENDED_CFLAGS)

Ghislain MARY's avatar
Ghislain MARY committed
243

jehan's avatar
jehan committed
244 245
ifeq ($(BUILD_ZRTP),1)
	LOCAL_STATIC_LIBRARIES += libbzrtp
Ghislain MARY's avatar
Ghislain MARY committed
246 247 248
endif

ifeq ($(BUILD_SRTP),1)
jehan's avatar
jehan committed
249
	LOCAL_STATIC_LIBRARIES += libsrtp
Ghislain MARY's avatar
Ghislain MARY committed
250 251 252 253 254 255 256 257 258 259 260 261
endif

ifeq ($(BUILD_SQLITE),1)
LOCAL_CFLAGS += -DMSG_STORAGE_ENABLED
LOCAL_STATIC_LIBRARIES += liblinsqlite
LOCAL_C_INCLUDES += \
        $(LOCAL_PATH)/../../externals/sqlite3/
endif

ifeq ($(BUILD_OPUS),1)
LOCAL_STATIC_LIBRARIES += libopus
endif
262 263
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_EXPORT_CFLAGS := $(LOCAL_CFLAGS)
264

265
ifeq ($(_BUILD_VIDEO),1)
266
LOCAL_SHARED_LIBRARIES += \
Sylvain Berfini's avatar
Sylvain Berfini committed
267
	libffmpeg-linphone
268
endif
269

Guillaume Beraudo's avatar
Guillaume Beraudo committed
270
LOCAL_MODULE := liblinphone
271
LOCAL_MODULE_FILENAME := liblinphone-$(TARGET_ARCH_ABI)
272

273 274
include $(BUILD_SHARED_LIBRARY)

275 276 277
LOCAL_CPPFLAGS=$(LOCAL_CFLAGS)
LOCAL_CFLAGS += -Wdeclaration-after-statement

278
$(call import-module,android/cpufeatures)
Yann Diorcet's avatar
Yann Diorcet committed
279