common.mk 4.3 KB
Newer Older
Sylvain Berfini's avatar
Sylvain Berfini committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
##
## 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
##  GNU General Public License for more details.
##
##  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_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 \
	sal.c \
	sal_eXosip2.c \
	sal_eXosip2_presence.c \
	sal_eXosip2_sdp.c \
	offeranswer.c \
	callbacks.c \
	linphonecall.c \
	conference.c \
46
	ec-calibrator.c \
Simon Morlat's avatar
Simon Morlat committed
47 48
	linphone_tunnel_config.c \
	message_storage.c
Sylvain Berfini's avatar
Sylvain Berfini committed
49

50
ifndef LINPHONE_VERSION
Simon Morlat's avatar
Simon Morlat committed
51
LINPHONE_VERSION = "Devel"
52 53
endif

Sylvain Berfini's avatar
Sylvain Berfini committed
54 55 56
LOCAL_CFLAGS += \
	-D_BYTE_ORDER=_LITTLE_ENDIAN \
	-DORTP_INET6 \
57 58
	-DINET6 \
	-DOSIP_MT \
Sylvain Berfini's avatar
Sylvain Berfini committed
59
	-DENABLE_TRACE \
60
	-DHAVE_CONFIG_H \
61
	-DLINPHONE_VERSION=\"$(LINPHONE_VERSION)\" \
Sylvain Berfini's avatar
Sylvain Berfini committed
62 63 64 65 66 67 68 69 70 71 72
	-DLINPHONE_PLUGINS_DIR=\"\\tmp\" \

LOCAL_CFLAGS += -DIN_LINPHONE

ifeq ($(LINPHONE_VIDEO),1)
LOCAL_CFLAGS += -DVIDEO_ENABLED
ifeq ($(BUILD_X264),1)
LOCAL_CFLAGS += -DHAVE_X264
endif
endif

73 74 75 76
ifeq ($(USE_JAVAH),1)
LOCAL_CFLAGS += -DUSE_JAVAH
endif

Sylvain Berfini's avatar
Sylvain Berfini committed
77 78 79
LOCAL_C_INCLUDES += \
	$(LOCAL_PATH) \
	$(LOCAL_PATH)/include \
80
	$(LOCAL_PATH)/../build/android \
Sylvain Berfini's avatar
Sylvain Berfini committed
81 82 83
	$(LOCAL_PATH)/../oRTP/include \
	$(LOCAL_PATH)/../mediastreamer2/include \
	$(LOCAL_PATH)/../../externals/exosip/include \
84 85
	$(LOCAL_PATH)/../../externals/osip/include \
	$(LOCAL_PATH)/../../../gen
Sylvain Berfini's avatar
Sylvain Berfini committed
86 87 88 89 90 91 92 93 94 95 96 97

LOCAL_LDLIBS += -llog -ldl



LOCAL_STATIC_LIBRARIES := \
	cpufeatures \
	libmediastreamer2 \
	libortp \
	libeXosip2 \
	libosip2 \
	libgsm 
98 99 100 101 102
ifeq ($(BUILD_REMOTE_PROVISIONING),1)
LOCAL_STATIC_LIBRARIES += \
	libxml2lpc \
	liblpc2xml
endif
Sylvain Berfini's avatar
Sylvain Berfini committed
103 104 105 106

ifeq ($(BUILD_TUNNEL),1)
LOCAL_CFLAGS +=-DTUNNEL_ENABLED
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../tunnel/include $(LOCAL_PATH)/../../tunnel/src
Ghislain MARY's avatar
Ghislain MARY committed
107
LOCAL_SRC_FILES +=  linphone_tunnel.cc TunnelManager.cc
Sylvain Berfini's avatar
Sylvain Berfini committed
108 109 110 111 112
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_SHARED_LIBRARIES += libtunnelclient
else
LOCAL_STATIC_LIBRARIES += libtunnelclient
endif
Ghislain MARY's avatar
Ghislain MARY committed
113 114
else
LOCAL_SRC_FILES += linphone_tunnel_stubs.c
Sylvain Berfini's avatar
Sylvain Berfini committed
115 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
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

ifeq ($(BUILD_G729),1)
LOCAL_CFLAGS += -DHAVE_G729
LOCAL_SHARED_LIBRARIES += libbcg729
LOCAL_STATIC_LIBRARIES += libmsbcg729
endif

ifeq ($(LINPHONE_VIDEO),1)
LOCAL_LDLIBS    += -lGLESv2
LOCAL_STATIC_LIBRARIES += libvpx
ifeq ($(BUILD_X264),1)
LOCAL_STATIC_LIBRARIES += \
	libmsx264 \
	libx264
endif
endif

161 162 163 164 165
ifeq ($(BUILD_UPNP),1)
LOCAL_CFLAGS += -DBUILD_UPNP
LOCAL_SRC_FILES += upnp.c
endif

Sylvain Berfini's avatar
Sylvain Berfini committed
166 167 168 169 170 171 172 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 198 199 200 201 202 203
LOCAL_STATIC_LIBRARIES += libspeex 

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

ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS += -DHAVE_ILBC=1
LOCAL_STATIC_LIBRARIES += libmsilbc
endif

LOCAL_C_INCLUDES += $(LIBLINPHONE_EXTENDED_C_INCLUDES) 
LOCAL_WHOLE_STATIC_LIBRARIES += $(LIBLINPHONE_EXTENDED_STATIC_LIBS)
LOCAL_SRC_FILES  += $(LIBLINPHONE_EXTENDED_SRC_FILES)

ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
	LOCAL_SHARED_LIBRARIES += liblinssl liblincrypto
	ifeq ($(BUILD_GPLV3_ZRTP),1)
	LOCAL_SHARED_LIBRARIES += libzrtpcpp
	endif

	ifeq ($(BUILD_SRTP),1)
	LOCAL_SHARED_LIBRARIES += libsrtp
	endif
else
	LOCAL_LDLIBS += -lz
	#LOCAL_STATIC_LIBRARIES += libz libdl
	LOCAL_STATIC_LIBRARIES += \
		libssl-static libcrypto-static
	ifeq ($(BUILD_GPLV3_ZRTP),1)
		LOCAL_STATIC_LIBRARIES += libzrtpcpp-static
	endif

	ifeq ($(BUILD_SRTP),1)
		LOCAL_STATIC_LIBRARIES += libsrtp-static
	endif
endif