Adrien Béraud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame] | 1 | # Copyright (C) 2004-2014 Savoir-Faire Linux Inc. |
| 2 | # |
| 3 | # Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com> |
| 4 | # Adrien Beraud <adrien.beraud@gmail.com> |
| 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 | |
| 30 | LOCAL_PATH:= $(call my-dir) |
| 31 | |
| 32 | $(info PWD=$(PWD)) |
| 33 | $(info RING_CONTRIB=$(RING_CONTRIB)) |
| 34 | $(info RING_SRC_DIR=$(RING_SRC_DIR)) |
| 35 | $(info RING_BUILD_DIR=$(RING_BUILD_DIR)) |
| 36 | |
| 37 | include $(CLEAR_VARS) |
| 38 | |
| 39 | VERSION="1.1.0" |
| 40 | MY_PREFIX=/sdcard |
| 41 | MY_DATADIR=/data/data |
| 42 | |
| 43 | ARCH=$(ANDROID_ABI) |
| 44 | |
| 45 | CPP_STATIC= $(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(CXXSTL)/libs/$(ARCH)/libgnustl_static.a \ |
Adrien Béraud | 899420c | 2015-06-03 15:09:19 -0400 | [diff] [blame] | 46 | $(RING_CONTRIB)/lib/libexpat.a \ |
| 47 | $(RING_CONTRIB)/lib/libgnutls.a \ |
| 48 | $(RING_CONTRIB)/lib/libnettle.a \ |
| 49 | $(RING_CONTRIB)/lib/libhogweed.a \ |
Adrien Béraud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame] | 50 | $(RING_CONTRIB)/lib/libogg.a \ |
| 51 | $(RING_CONTRIB)/lib/libFLAC.a \ |
Adrien Béraud | 899420c | 2015-06-03 15:09:19 -0400 | [diff] [blame] | 52 | $(RING_CONTRIB)/lib/libavcodec.a \ |
| 53 | $(RING_CONTRIB)/lib/libavfilter.a \ |
| 54 | $(RING_CONTRIB)/lib/libavformat.a \ |
| 55 | $(RING_CONTRIB)/lib/libavdevice.a \ |
| 56 | $(RING_CONTRIB)/lib/libavutil.a \ |
| 57 | $(RING_CONTRIB)/lib/libswscale.a \ |
| 58 | $(RING_CONTRIB)/lib/libz.a \ |
| 59 | $(RING_CONTRIB)/lib/libupnp.a \ |
| 60 | $(RING_CONTRIB)/lib/libthreadutil.a \ |
| 61 | $(RING_CONTRIB)/lib/libiconv.a \ |
| 62 | $(RING_CONTRIB)/lib/libixml.a \ |
| 63 | $(RING_CONTRIB)/lib/libgmp.a \ |
| 64 | $(RING_CONTRIB)/lib/libopendht.a |
Adrien Béraud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame] | 65 | |
| 66 | ifeq ($(ARCH),$(filter $(ARCH),x86)) |
| 67 | CPP_STATIC += $(RING_CONTRIB)/lib/libpjlib-util-i686-pc-linux-android.a \ |
| 68 | $(RING_CONTRIB)/lib/libpj-i686-pc-linux-android.a |
| 69 | else |
| 70 | CPP_STATIC += $(RING_CONTRIB)/lib/libpjlib-util-arm-unknown-linux-androideabi.a \ |
| 71 | $(RING_CONTRIB)/lib/libpj-arm-unknown-linux-androideabi.a |
| 72 | endif |
| 73 | |
| 74 | LOCAL_SRC_FILES := ring_wrapper.cpp |
| 75 | |
| 76 | # RING_BUILD_DIR contains config.h, which we need |
| 77 | LOCAL_C_INCLUDES += $(LOCAL_PATH) \ |
| 78 | $(RING_BUILD_DIR) \ |
| 79 | $(RING_SRC_DIR) \ |
| 80 | $(RING_SRC_DIR)/src \ |
| 81 | $(RING_SRC_DIR)/contrib/$(TARGET_TUPLE)/include |
| 82 | |
| 83 | LOCAL_MODULE := libringjni |
| 84 | |
| 85 | LOCAL_CPPFLAGS += -DCCPP_PREFIX \ |
| 86 | -DPROGSHAREDIR=\"${MY_DATADIR}/ring\" \ |
| 87 | -DHAVE_CONFIG_H \ |
| 88 | -DHAVE_SPEEX_CODEC \ |
| 89 | -DHAVE_GSM_CODEC \ |
| 90 | -w -frtti \ |
| 91 | -std=c++11 -fexceptions -fpermissive \ |
| 92 | -DAPP_NAME=\"Ring\" \ |
| 93 | -DSWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON \ |
| 94 | -DDEBUG_DIRECTOR_OWNED \ |
| 95 | -DPJ_AUTOCONF=1 |
| 96 | |
| 97 | LOCAL_LDFLAGS := -L$(RING_CONTRIB)/lib \ |
| 98 | |
| 99 | LOCAL_LDLIBS += -lz \ |
| 100 | -llog \ |
| 101 | -lOpenSLES \ |
Adrien Béraud | 899420c | 2015-06-03 15:09:19 -0400 | [diff] [blame] | 102 | $(RING_BUILD_DIR)/src/.libs/libring.a \ |
Adrien Béraud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame] | 103 | |
| 104 | |
| 105 | ifeq ($(ARCH),$(filter $(ARCH),x86)) |
| 106 | LOCAL_LDLIBS += -lpj-i686-pc-linux-android \ |
| 107 | -lpjsip-simple-i686-pc-linux-android \ |
| 108 | -lpjlib-util-i686-pc-linux-android \ |
| 109 | -lpjsip-ua-i686-pc-linux-android \ |
| 110 | -lpjmedia-i686-pc-linux-android \ |
| 111 | -lpjnath-i686-pc-linux-android \ |
| 112 | -lpjmedia-audiodev-i686-pc-linux-android \ |
| 113 | -lsrtp-i686-pc-linux-android \ |
| 114 | -lpjsip-i686-pc-linux-android \ |
| 115 | -lresample-i686-pc-linux-android |
| 116 | |
| 117 | else |
| 118 | LOCAL_LDLIBS += -lpj-arm-unknown-linux-androideabi \ |
| 119 | -lpjsip-simple-arm-unknown-linux-androideabi \ |
| 120 | -lpjlib-util-arm-unknown-linux-androideabi \ |
| 121 | -lpjsip-ua-arm-unknown-linux-androideabi \ |
| 122 | -lpjmedia-arm-unknown-linux-androideabi \ |
| 123 | -lpjnath-arm-unknown-linux-androideabi \ |
| 124 | -lpjmedia-audiodev-arm-unknown-linux-androideabi \ |
| 125 | -lsrtp-arm-unknown-linux-androideabi \ |
| 126 | -lpjsip-arm-unknown-linux-androideabi \ |
| 127 | -lresample-arm-unknown-linux-androideabi |
| 128 | endif |
| 129 | |
| 130 | LOCAL_LDLIBS += -lexpat -lhogweed \ |
| 131 | -lspeexdsp -lvorbisfile -lyaml-cpp \ |
Adrien Béraud | 899420c | 2015-06-03 15:09:19 -0400 | [diff] [blame] | 132 | -lFLAC -liax -lnettle \ |
| 133 | -logg \ |
| 134 | -lpcre -lsamplerate -luuid \ |
Adrien Béraud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame] | 135 | -lsndfile -lvorbis \ |
Adrien Béraud | 899420c | 2015-06-03 15:09:19 -0400 | [diff] [blame] | 136 | -lspeex -lvorbisenc \ |
Adrien Béraud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame] | 137 | -lgmp -lgnutls -lopendht \ |
Adrien Béraud | 899420c | 2015-06-03 15:09:19 -0400 | [diff] [blame] | 138 | -lavformat -lavcodec -lavutil \ |
Adrien Béraud | 372f7d0 | 2015-06-16 17:20:04 -0400 | [diff] [blame] | 139 | -lopus -lx264 -lspeex \ |
Adrien Béraud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame] | 140 | $(CPP_STATIC) |
| 141 | |
| 142 | |
| 143 | include $(BUILD_SHARED_LIBRARY) |
| 144 | |
| 145 | ########### Codecs ############### |
| 146 | |
| 147 | #include $(CLEAR_VARS) |
| 148 | #LOCAL_MODULE := ulaw |
| 149 | #LOCAL_SRC_FILES := ../$(RING_BUILD_DIR)/src/audio/codecs/libcodec_ulaw.so |
| 150 | #include $(PREBUILT_SHARED_LIBRARY) |