Android.mk 5.3 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
LOCAL_CPP_EXTENSION := .cc

LOCAL_SRC_FILES := \
	linphonecore.c \
	misc.c  \
	enum.c \
	presence.c \
	proxy.c \
	friend.c \
	authentication.c \
	lpconfig.c \
	chat.c \
	sipsetup.c \
	siplogin.c \
	address.c \
	linphonecore_jni.cc \
	bellesip_sal/sal_address_impl.c \
	bellesip_sal/sal_impl.c \
	bellesip_sal/sal_op_call.c \
	bellesip_sal/sal_op_call_transfer.c \
	bellesip_sal/sal_op_impl.c \
	bellesip_sal/sal_op_message.c \
	bellesip_sal/sal_op_presence.c \
	bellesip_sal/sal_op_registration.c \
	bellesip_sal/sal_op_publish.c \
	bellesip_sal/sal_op_info.c \
	bellesip_sal/sal_op_events.c \
	bellesip_sal/sal_sdp.c \
	sal.c \
	offeranswer.c \
	callbacks.c \
	linphonecall.c \
	conference.c \
	ec-calibrator.c \
	linphone_tunnel_config.c \
	message_storage.c \
	info.c \
63
	event.c \
64 65 66
	xml.c \
	xml2lpc.c \
	lpc2xml.c \
67 68
	remote_provisioning.c \
	quality_reporting.c
Ghislain MARY's avatar
Ghislain MARY committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

ifndef LINPHONE_VERSION
LINPHONE_VERSION = "Devel"
endif

LOCAL_CFLAGS += \
	-D_BYTE_ORDER=_LITTLE_ENDIAN \
	-DORTP_INET6 \
	-DINET6 \
	-DENABLE_TRACE \
	-DHAVE_CONFIG_H \
	-DLINPHONE_VERSION=\"$(LINPHONE_VERSION)\" \
	-DLINPHONE_PLUGINS_DIR=\"\\tmp\" \
	-DUSE_BELLESIP

LOCAL_CFLAGS += -DIN_LINPHONE

ifeq ($(_BUILD_VIDEO),1)
LOCAL_CFLAGS += -DVIDEO_ENABLED
ifeq ($(BUILD_X264),1)
LOCAL_CFLAGS += -DHAVE_X264
endif
91 92 93
ifeq ($(BUILD_OPENH264),1)
LOCAL_CFLAGS += -DHAVE_OPENH264
endif
Ghislain MARY's avatar
Ghislain MARY committed
94 95
endif

Margaux Clerc's avatar
Margaux Clerc committed
96 97 98 99
ifeq ($(BUILD_CONTACT_HEADER),1)
LOCAL_CFLAGS += -DSAL_OP_CALL_FORCE_CONTACT_IN_RINGING
endif

Ghislain MARY's avatar
Ghislain MARY committed
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
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 \
	$(LOCAL_PATH)/../../externals/build/libxml2

115
LOCAL_LDLIBS += -llog -ldl
Ghislain MARY's avatar
Ghislain MARY committed
116 117 118 119 120 121 122 123 124 125 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

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

163 164 165 166 167 168
ifeq ($(BUILD_WEBRTC_ISAC),1)
LOCAL_CFLAGS += -DHAVE_ISAC
LOCAL_STATIC_LIBRARIES += libwebrtc_isacfix_neon
LOCAL_STATIC_LIBRARIES += libwebrtc_spl libwebrtc_isacfix libmsisac
endif

Ghislain MARY's avatar
Ghislain MARY committed
169 170 171 172 173 174 175 176 177 178 179 180 181
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
182 183 184 185 186
ifeq ($(BUILD_OPENH264),1)
LOCAL_STATIC_LIBRARIES += \
	libmsopenh264 \
	libwels
endif
Ghislain MARY's avatar
Ghislain MARY committed
187 188 189 190 191 192 193 194 195 196 197 198 199
endif

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

LOCAL_STATIC_LIBRARIES += libspeex 

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

200
ifneq ($(TARGET_ARCH_ABI),armeabi)
Ghislain MARY's avatar
Ghislain MARY committed
201 202 203 204
LOCAL_CFLAGS += -DHAVE_ILBC=1
LOCAL_STATIC_LIBRARIES += libmsilbc
endif

205
LOCAL_C_INCLUDES += $(LIBLINPHONE_EXTENDED_C_INCLUDES)
Ghislain MARY's avatar
Ghislain MARY committed
206 207
LOCAL_WHOLE_STATIC_LIBRARIES += $(LIBLINPHONE_EXTENDED_STATIC_LIBS)
LOCAL_SRC_FILES  += $(LIBLINPHONE_EXTENDED_SRC_FILES)
208 209
LOCAL_CFLAGS += $(LIBLINPHONE_EXTENDED_CFLAGS)

Ghislain MARY's avatar
Ghislain MARY committed
210

jehan's avatar
jehan committed
211 212
ifeq ($(BUILD_ZRTP),1)
	LOCAL_STATIC_LIBRARIES += libbzrtp
Ghislain MARY's avatar
Ghislain MARY committed
213 214 215
endif

ifeq ($(BUILD_SRTP),1)
jehan's avatar
jehan committed
216
	LOCAL_STATIC_LIBRARIES += libsrtp
Ghislain MARY's avatar
Ghislain MARY committed
217 218 219 220 221 222 223 224 225 226 227 228 229 230
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
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) 
LOCAL_EXPORT_CFLAGS := $(LOCAL_CFLAGS) 
231

232
ifeq ($(_BUILD_VIDEO),1)
233
LOCAL_SHARED_LIBRARIES += \
Ghislain MARY's avatar
Ghislain MARY committed
234 235 236
	libavcodec-linphone \
	libswscale-linphone \
	libavutil-linphone
237
endif
238

Guillaume Beraudo's avatar
Guillaume Beraudo committed
239
LOCAL_MODULE := liblinphone
240
LOCAL_MODULE_FILENAME := liblinphone-$(TARGET_ARCH_ABI)
241

242 243
include $(BUILD_SHARED_LIBRARY)

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