Alexandre Lision | fed2a64 | 2014-01-10 12:05:47 -0500 | [diff] [blame] | 1 | # Copyright (C) 2004-2014 Savoir-Faire Linux Inc. |
| 2 | # |
Alexandre Lision | 8690e6f | 2014-08-01 10:15:12 -0400 | [diff] [blame] | 3 | # Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com> |
| 4 | # Adrien Beraud <adrien.beraud@gmail.com> |
Alexandre Lision | fed2a64 | 2014-01-10 12:05:47 -0500 | [diff] [blame] | 5 | # |
| 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 | |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 30 | LOCAL_PATH:= $(call my-dir) |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 31 | |
Alexandre Lision | decfb82 | 2014-10-16 17:21:51 -0400 | [diff] [blame] | 32 | $(info PWD=$(PWD)) |
Alexandre Lision | 0ac0685 | 2014-08-06 09:54:30 -0400 | [diff] [blame] | 33 | $(info SFLPHONE_CONTRIB=$(SFLPHONE_CONTRIB)) |
Alexandre Lision | decfb82 | 2014-10-16 17:21:51 -0400 | [diff] [blame] | 34 | $(info SFLPHONE_SRC_DIR=$(SFLPHONE_SRC_DIR)) |
| 35 | $(info SFLPHONE_BUILD_DIR=$(SFLPHONE_BUILD_DIR)) |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 36 | |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 37 | include $(CLEAR_VARS) |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 38 | |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 39 | VERSION="1.1.0" |
| 40 | MY_PREFIX=/sdcard |
| 41 | MY_DATADIR=/data/data |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 42 | |
Alexandre Lision | 449ca84 | 2014-08-05 11:22:50 -0400 | [diff] [blame] | 43 | ARCH=$(ANDROID_ABI) |
| 44 | |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 45 | CPP_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 Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 48 | $(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 Lision | decfb82 | 2014-10-16 17:21:51 -0400 | [diff] [blame] | 53 | ifeq ($(ARCH),$(filter $(ARCH),x86)) |
| 54 | CPP_STATIC += $(SFLPHONE_CONTRIB)/lib/libpjlib-util-i686-pc-linux-android.a \ |
| 55 | $(SFLPHONE_CONTRIB)/lib/libpj-i686-pc-linux-android.a |
| 56 | else |
| 57 | CPP_STATIC += $(SFLPHONE_CONTRIB)/lib/libpjlib-util-arm-unknown-linux-androideabi.a \ |
| 58 | $(SFLPHONE_CONTRIB)/lib/libpj-arm-unknown-linux-androideabi.a |
| 59 | endif |
| 60 | |
Alexandre Lision | 719259d | 2014-08-07 12:10:13 -0400 | [diff] [blame] | 61 | LOCAL_SRC_FILES := sflphone_wrapper.cpp |
Alexandre Lision | c469187 | 2014-01-31 12:04:39 -0500 | [diff] [blame] | 62 | |
Tristan Matthews | b117a4a | 2014-10-09 11:34:56 -0400 | [diff] [blame] | 63 | # SFLPHONE_BUILD_DIR contains config.h, which we need |
Alexandre Lision | 0ac0685 | 2014-08-06 09:54:30 -0400 | [diff] [blame] | 64 | LOCAL_C_INCLUDES += $(LOCAL_PATH) \ |
Tristan Matthews | b117a4a | 2014-10-09 11:34:56 -0400 | [diff] [blame] | 65 | $(SFLPHONE_BUILD_DIR) \ |
Alexandre Lision | 47b6aaa | 2014-10-17 15:12:12 -0400 | [diff] [blame] | 66 | $(SFLPHONE_SRC_DIR)/daemon \ |
| 67 | $(SFLPHONE_SRC_DIR)/daemon/src \ |
| 68 | $(SFLPHONE_SRC_DIR)/daemon/contrib/$(TARGET_TUPLE)/include |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 69 | |
Alexandre Lision | 9abb7c9 | 2014-08-04 19:22:55 -0400 | [diff] [blame] | 70 | LOCAL_MODULE := libsflphonejni |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 71 | |
Alexandre Lision | b73dab5 | 2014-10-10 12:22:51 -0400 | [diff] [blame] | 72 | LOCAL_CPPFLAGS += -DCCPP_PREFIX \ |
Alexandre Lision | a1ad1c3 | 2013-10-15 16:35:20 -0400 | [diff] [blame] | 73 | -DPROGSHAREDIR=\"${MY_DATADIR}/sflphone\" \ |
| 74 | -DHAVE_CONFIG_H \ |
Alexandre Lision | 6213817 | 2013-10-17 11:52:45 -0400 | [diff] [blame] | 75 | -DHAVE_SPEEX_CODEC \ |
Alexandre Lision | a1ad1c3 | 2013-10-15 16:35:20 -0400 | [diff] [blame] | 76 | -DHAVE_GSM_CODEC \ |
Alexandre Lision | b73dab5 | 2014-10-10 12:22:51 -0400 | [diff] [blame] | 77 | -w -frtti \ |
Alexandre Lision | 907ed2e | 2014-02-04 10:33:09 -0500 | [diff] [blame] | 78 | -std=c++11 -fexceptions -fpermissive \ |
Alexandre Lision | 05c7739 | 2014-10-10 12:32:07 -0400 | [diff] [blame] | 79 | -DAPP_NAME=\"Ring\" \ |
Alexandre Lision | a1ad1c3 | 2013-10-15 16:35:20 -0400 | [diff] [blame] | 80 | -DSWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON \ |
| 81 | -DDEBUG_DIRECTOR_OWNED \ |
| 82 | -DPJ_AUTOCONF=1 |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 83 | |
Alexandre Lision | decfb82 | 2014-10-16 17:21:51 -0400 | [diff] [blame] | 84 | LOCAL_LDFLAGS := -L$(SFLPHONE_CONTRIB)/lib \ |
| 85 | |
Alexandre Lision | 17b60c3 | 2014-02-03 14:37:59 -0500 | [diff] [blame] | 86 | LOCAL_LDLIBS += -lz \ |
| 87 | -llog \ |
| 88 | -lOpenSLES \ |
Tristan Matthews | eaaa5ba | 2014-10-09 04:23:06 -0400 | [diff] [blame] | 89 | $(SFLPHONE_BUILD_DIR)/src/.libs/libsflphone.a \ |
Alexandre Lision | decfb82 | 2014-10-16 17:21:51 -0400 | [diff] [blame] | 90 | |
| 91 | |
| 92 | ifeq ($(ARCH),$(filter $(ARCH),x86)) |
| 93 | LOCAL_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 | |
| 104 | else |
| 105 | LOCAL_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 |
| 115 | endif |
| 116 | |
| 117 | LOCAL_LDLIBS += -lexpat -lhogweed \ |
Tristan Matthews | 1b5d132 | 2014-09-29 17:29:16 -0400 | [diff] [blame] | 118 | -lspeexdsp -lvorbisfile -lyaml-cpp \ |
Alexandre Lision | decfb82 | 2014-10-16 17:21:51 -0400 | [diff] [blame] | 119 | -lFLAC -liax -lgcrypt -lnettle \ |
| 120 | -logg -lucommon \ |
| 121 | -lpcre -lsamplerate -luuid -lccrtp -lgpg-error -lpcrecpp \ |
| 122 | -lsndfile -lvorbis \ |
| 123 | -lcommoncpp -lspeex -lvorbisenc \ |
Alexandre Lision | 449ca84 | 2014-08-05 11:22:50 -0400 | [diff] [blame] | 124 | $(CPP_STATIC) |
alision | 3ea8f3c | 2013-07-16 17:35:35 -0400 | [diff] [blame] | 125 | |
Alexandre Lision | decfb82 | 2014-10-16 17:21:51 -0400 | [diff] [blame] | 126 | |
Alexandre Lision | 7c6f4a6 | 2013-09-05 13:27:01 -0400 | [diff] [blame] | 127 | include $(BUILD_SHARED_LIBRARY) |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 128 | |
| 129 | ########### Codecs ############### |
| 130 | |
| 131 | include $(CLEAR_VARS) |
| 132 | LOCAL_MODULE := ulaw |
Tristan Matthews | eaaa5ba | 2014-10-09 04:23:06 -0400 | [diff] [blame] | 133 | LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_ulaw.so |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 134 | include $(PREBUILT_SHARED_LIBRARY) |
| 135 | |
| 136 | include $(CLEAR_VARS) |
| 137 | LOCAL_MODULE := alaw |
Tristan Matthews | eaaa5ba | 2014-10-09 04:23:06 -0400 | [diff] [blame] | 138 | LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_alaw.so |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 139 | include $(PREBUILT_SHARED_LIBRARY) |
| 140 | |
| 141 | include $(CLEAR_VARS) |
| 142 | LOCAL_MODULE := g722 |
Tristan Matthews | eaaa5ba | 2014-10-09 04:23:06 -0400 | [diff] [blame] | 143 | LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_g722.so |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 144 | include $(PREBUILT_SHARED_LIBRARY) |
| 145 | |
| 146 | include $(CLEAR_VARS) |
Alexandre Lision | 142afb4 | 2014-11-17 10:48:09 -0500 | [diff] [blame] | 147 | LOCAL_MODULE := speex |
| 148 | LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_speex.so |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 149 | include $(PREBUILT_SHARED_LIBRARY) |
| 150 | |
| 151 | include $(CLEAR_VARS) |
| 152 | LOCAL_MODULE := opus |
Tristan Matthews | eaaa5ba | 2014-10-09 04:23:06 -0400 | [diff] [blame] | 153 | LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_opus.so |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 154 | include $(PREBUILT_SHARED_LIBRARY) |
| 155 | |
| 156 | include $(CLEAR_VARS) |
| 157 | LOCAL_MODULE := gsm |
Tristan Matthews | eaaa5ba | 2014-10-09 04:23:06 -0400 | [diff] [blame] | 158 | LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_gsm.so |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 159 | include $(PREBUILT_SHARED_LIBRARY) |
| 160 | |
| 161 | include $(CLEAR_VARS) |
| 162 | LOCAL_MODULE := g729 |
Tristan Matthews | eaaa5ba | 2014-10-09 04:23:06 -0400 | [diff] [blame] | 163 | LOCAL_SRC_FILES := ../$(SFLPHONE_BUILD_DIR)/src/audio/codecs/libcodec_g729.so |
Alexandre Lision | 399db75 | 2014-09-03 10:27:56 -0400 | [diff] [blame] | 164 | include $(PREBUILT_SHARED_LIBRARY) |