blob: c48ccb3e7910f305af577eb8b586a0a2b4971c96 [file] [log] [blame]
Alexandre Lisionfed2a642014-01-10 12:05:47 -05001 # Copyright (C) 2004-2014 Savoir-Faire Linux Inc.
2 #
Alexandre Lision8690e6f2014-08-01 10:15:12 -04003 # Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
4 # Adrien Beraud <adrien.beraud@gmail.com>
Alexandre Lisionfed2a642014-01-10 12:05:47 -05005 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19 # Additional permission under GNU GPL version 3 section 7:
20 #
21 # If you modify this program, or any covered work, by linking or
22 # combining it with the OpenSSL project's OpenSSL library (or a
23 # modified version of that library), containing parts covered by the
24 # terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
25 # grants you additional permission to convey the resulting work.
26 # Corresponding Source for a non-source form of such a combination
27 # shall include the source code for the parts of OpenSSL used as well
28 # as that of the covered work.
29
alision3ea8f3c2013-07-16 17:35:35 -040030LOCAL_PATH:= $(call my-dir)
alision3ea8f3c2013-07-16 17:35:35 -040031
Alexandre Lisiondecfb822014-10-16 17:21:51 -040032$(info PWD=$(PWD))
Alexandre Lision0ac06852014-08-06 09:54:30 -040033$(info SFLPHONE_CONTRIB=$(SFLPHONE_CONTRIB))
Alexandre Lisiondecfb822014-10-16 17:21:51 -040034$(info SFLPHONE_SRC_DIR=$(SFLPHONE_SRC_DIR))
35$(info SFLPHONE_BUILD_DIR=$(SFLPHONE_BUILD_DIR))
alision3ea8f3c2013-07-16 17:35:35 -040036
Alexandre Lision399db752014-09-03 10:27:56 -040037include $(CLEAR_VARS)
Alexandre Lision399db752014-09-03 10:27:56 -040038
alision3ea8f3c2013-07-16 17:35:35 -040039VERSION="1.1.0"
40MY_PREFIX=/sdcard
41MY_DATADIR=/data/data
alision3ea8f3c2013-07-16 17:35:35 -040042
Alexandre Lision449ca842014-08-05 11:22:50 -040043ARCH=$(ANDROID_ABI)
44
Alexandre Lision399db752014-09-03 10:27:56 -040045CPP_STATIC= $(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(CXXSTL)/libs/$(ARCH)/libgnustl_static.a \
46 $(SFLPHONE_CONTRIB)/lib/libucommon.a \
47 $(SFLPHONE_CONTRIB)/lib/libccrtp.a \
Alexandre Lision399db752014-09-03 10:27:56 -040048 $(SFLPHONE_CONTRIB)/lib/libogg.a \
49 $(SFLPHONE_CONTRIB)/lib/libFLAC.a \
50 $(SFLPHONE_CONTRIB)/lib/libgcrypt.a \
51 $(SFLPHONE_CONTRIB)/lib/libgpg-error.a \
52
Alexandre Lisiondecfb822014-10-16 17:21:51 -040053ifeq ($(ARCH),$(filter $(ARCH),x86))
54CPP_STATIC += $(SFLPHONE_CONTRIB)/lib/libpjlib-util-i686-pc-linux-android.a \
55 $(SFLPHONE_CONTRIB)/lib/libpj-i686-pc-linux-android.a
56else
57CPP_STATIC += $(SFLPHONE_CONTRIB)/lib/libpjlib-util-arm-unknown-linux-androideabi.a \
58 $(SFLPHONE_CONTRIB)/lib/libpj-arm-unknown-linux-androideabi.a
59endif
60
Alexandre Lision719259d2014-08-07 12:10:13 -040061LOCAL_SRC_FILES := sflphone_wrapper.cpp
Alexandre Lisionc4691872014-01-31 12:04:39 -050062
Tristan Matthewsb117a4a2014-10-09 11:34:56 -040063# SFLPHONE_BUILD_DIR contains config.h, which we need
Alexandre Lision0ac06852014-08-06 09:54:30 -040064LOCAL_C_INCLUDES += $(LOCAL_PATH) \
Tristan Matthewsb117a4a2014-10-09 11:34:56 -040065 $(SFLPHONE_BUILD_DIR) \
Alexandre Lision47b6aaa2014-10-17 15:12:12 -040066 $(SFLPHONE_SRC_DIR)/daemon \
67 $(SFLPHONE_SRC_DIR)/daemon/src \
68 $(SFLPHONE_SRC_DIR)/daemon/contrib/$(TARGET_TUPLE)/include
alision3ea8f3c2013-07-16 17:35:35 -040069
Alexandre Lision9abb7c92014-08-04 19:22:55 -040070LOCAL_MODULE := libsflphonejni
alision3ea8f3c2013-07-16 17:35:35 -040071
Alexandre Lisionb73dab52014-10-10 12:22:51 -040072LOCAL_CPPFLAGS += -DCCPP_PREFIX \
Alexandre Lisiona1ad1c32013-10-15 16:35:20 -040073 -DPROGSHAREDIR=\"${MY_DATADIR}/sflphone\" \
74 -DHAVE_CONFIG_H \
Alexandre Lision62138172013-10-17 11:52:45 -040075 -DHAVE_SPEEX_CODEC \
Alexandre Lisiona1ad1c32013-10-15 16:35:20 -040076 -DHAVE_GSM_CODEC \
Alexandre Lisionb73dab52014-10-10 12:22:51 -040077 -w -frtti \
Alexandre Lision907ed2e2014-02-04 10:33:09 -050078 -std=c++11 -fexceptions -fpermissive \
Alexandre Lision05c77392014-10-10 12:32:07 -040079 -DAPP_NAME=\"Ring\" \
Alexandre Lisiona1ad1c32013-10-15 16:35:20 -040080 -DSWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON \
81 -DDEBUG_DIRECTOR_OWNED \
82 -DPJ_AUTOCONF=1
alision3ea8f3c2013-07-16 17:35:35 -040083
Alexandre Lisiondecfb822014-10-16 17:21:51 -040084LOCAL_LDFLAGS := -L$(SFLPHONE_CONTRIB)/lib \
85
Alexandre Lision17b60c32014-02-03 14:37:59 -050086LOCAL_LDLIBS += -lz \
87 -llog \
88 -lOpenSLES \
Tristan Matthewseaaa5ba2014-10-09 04:23:06 -040089 $(SFLPHONE_BUILD_DIR)/src/.libs/libsflphone.a \
Alexandre Lisiondecfb822014-10-16 17:21:51 -040090
91
92ifeq ($(ARCH),$(filter $(ARCH),x86))
93LOCAL_LDLIBS += -lpj-i686-pc-linux-android \
94 -lpjsip-simple-i686-pc-linux-android \
95 -lpjlib-util-i686-pc-linux-android \
96 -lpjsip-ua-i686-pc-linux-android \
97 -lpjmedia-i686-pc-linux-android \
98 -lpjnath-i686-pc-linux-android \
99 -lpjmedia-audiodev-i686-pc-linux-android \
100 -lsrtp-i686-pc-linux-android \
101 -lpjsip-i686-pc-linux-android \
102 -lresample-i686-pc-linux-android
103
104else
105LOCAL_LDLIBS += -lpj-arm-unknown-linux-androideabi \
106 -lpjsip-simple-arm-unknown-linux-androideabi \
107 -lpjlib-util-arm-unknown-linux-androideabi \
108 -lpjsip-ua-arm-unknown-linux-androideabi \
109 -lpjmedia-arm-unknown-linux-androideabi \
110 -lpjnath-arm-unknown-linux-androideabi \
111 -lpjmedia-audiodev-arm-unknown-linux-androideabi \
112 -lsrtp-arm-unknown-linux-androideabi \
113 -lpjsip-arm-unknown-linux-androideabi \
114 -lresample-arm-unknown-linux-androideabi
115endif
116
117LOCAL_LDLIBS += -lexpat -lhogweed \
Tristan Matthews1b5d1322014-09-29 17:29:16 -0400118 -lspeexdsp -lvorbisfile -lyaml-cpp \
Alexandre Lisiondecfb822014-10-16 17:21:51 -0400119 -lFLAC -liax -lgcrypt -lnettle \
120 -logg -lucommon \
121 -lpcre -lsamplerate -luuid -lccrtp -lgpg-error -lpcrecpp \
122 -lsndfile -lvorbis \
123 -lcommoncpp -lspeex -lvorbisenc \
Alexandre Lision449ca842014-08-05 11:22:50 -0400124 $(CPP_STATIC)
alision3ea8f3c2013-07-16 17:35:35 -0400125
Alexandre Lisiondecfb822014-10-16 17:21:51 -0400126
Alexandre Lision7c6f4a62013-09-05 13:27:01 -0400127include $(BUILD_SHARED_LIBRARY)
Alexandre Lision399db752014-09-03 10:27:56 -0400128
129########### Codecs ###############
130
131include $(CLEAR_VARS)
132LOCAL_MODULE := ulaw
Tristan Matthewseaaa5ba2014-10-09 04:23:06 -0400133LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_ulaw.so
Alexandre Lision399db752014-09-03 10:27:56 -0400134include $(PREBUILT_SHARED_LIBRARY)
135
136include $(CLEAR_VARS)
137LOCAL_MODULE := alaw
Tristan Matthewseaaa5ba2014-10-09 04:23:06 -0400138LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_alaw.so
Alexandre Lision399db752014-09-03 10:27:56 -0400139include $(PREBUILT_SHARED_LIBRARY)
140
141include $(CLEAR_VARS)
142LOCAL_MODULE := g722
Tristan Matthewseaaa5ba2014-10-09 04:23:06 -0400143LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_g722.so
Alexandre Lision399db752014-09-03 10:27:56 -0400144include $(PREBUILT_SHARED_LIBRARY)
145
146include $(CLEAR_VARS)
Alexandre Lision142afb42014-11-17 10:48:09 -0500147LOCAL_MODULE := speex
148LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_speex.so
Alexandre Lision399db752014-09-03 10:27:56 -0400149include $(PREBUILT_SHARED_LIBRARY)
150
151include $(CLEAR_VARS)
152LOCAL_MODULE := opus
Tristan Matthewseaaa5ba2014-10-09 04:23:06 -0400153LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_opus.so
Alexandre Lision399db752014-09-03 10:27:56 -0400154include $(PREBUILT_SHARED_LIBRARY)
155
156include $(CLEAR_VARS)
157LOCAL_MODULE := gsm
Tristan Matthewseaaa5ba2014-10-09 04:23:06 -0400158LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_gsm.so
Alexandre Lision399db752014-09-03 10:27:56 -0400159include $(PREBUILT_SHARED_LIBRARY)
160
161include $(CLEAR_VARS)
162LOCAL_MODULE := g729
Tristan Matthewseaaa5ba2014-10-09 04:23:06 -0400163LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_g729.so
Alexandre Lision399db752014-09-03 10:27:56 -0400164include $(PREBUILT_SHARED_LIBRARY)