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 \ |
| 46 | $(RING_CONTRIB)/lib/libucommon.a \ |
| 47 | $(RING_CONTRIB)/lib/libccrtp.a \ |
| 48 | $(RING_CONTRIB)/lib/libogg.a \ |
| 49 | $(RING_CONTRIB)/lib/libFLAC.a \ |
| 50 | $(RING_CONTRIB)/lib/libgcrypt.a \ |
| 51 | $(RING_CONTRIB)/lib/libgpg-error.a \ |
| 52 | |
| 53 | ifeq ($(ARCH),$(filter $(ARCH),x86)) |
| 54 | CPP_STATIC += $(RING_CONTRIB)/lib/libpjlib-util-i686-pc-linux-android.a \ |
| 55 | $(RING_CONTRIB)/lib/libpj-i686-pc-linux-android.a |
| 56 | else |
| 57 | CPP_STATIC += $(RING_CONTRIB)/lib/libpjlib-util-arm-unknown-linux-androideabi.a \ |
| 58 | $(RING_CONTRIB)/lib/libpj-arm-unknown-linux-androideabi.a |
| 59 | endif |
| 60 | |
| 61 | LOCAL_SRC_FILES := ring_wrapper.cpp |
| 62 | |
| 63 | # RING_BUILD_DIR contains config.h, which we need |
| 64 | LOCAL_C_INCLUDES += $(LOCAL_PATH) \ |
| 65 | $(RING_BUILD_DIR) \ |
| 66 | $(RING_SRC_DIR) \ |
| 67 | $(RING_SRC_DIR)/src \ |
| 68 | $(RING_SRC_DIR)/contrib/$(TARGET_TUPLE)/include |
| 69 | |
| 70 | LOCAL_MODULE := libringjni |
| 71 | |
| 72 | LOCAL_CPPFLAGS += -DCCPP_PREFIX \ |
| 73 | -DPROGSHAREDIR=\"${MY_DATADIR}/ring\" \ |
| 74 | -DHAVE_CONFIG_H \ |
| 75 | -DHAVE_SPEEX_CODEC \ |
| 76 | -DHAVE_GSM_CODEC \ |
| 77 | -w -frtti \ |
| 78 | -std=c++11 -fexceptions -fpermissive \ |
| 79 | -DAPP_NAME=\"Ring\" \ |
| 80 | -DSWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON \ |
| 81 | -DDEBUG_DIRECTOR_OWNED \ |
| 82 | -DPJ_AUTOCONF=1 |
| 83 | |
| 84 | LOCAL_LDFLAGS := -L$(RING_CONTRIB)/lib \ |
| 85 | |
| 86 | LOCAL_LDLIBS += -lz \ |
| 87 | -llog \ |
| 88 | -lOpenSLES \ |
| 89 | $(RING_BUILD_DIR)/src/.libs/libdring.a \ |
| 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 \ |
| 118 | -lspeexdsp -lvorbisfile -lyaml-cpp \ |
| 119 | -lFLAC -liax -lgcrypt -lnettle \ |
| 120 | -logg -lucommon \ |
| 121 | -lpcre -lsamplerate -luuid -lccrtp -lgpg-error -lpcrecpp \ |
| 122 | -lsndfile -lvorbis \ |
| 123 | -lcommoncpp -lspeex -lvorbisenc \ |
| 124 | -lgmp -lgnutls -lopendht \ |
| 125 | $(CPP_STATIC) |
| 126 | |
| 127 | |
| 128 | include $(BUILD_SHARED_LIBRARY) |
| 129 | |
| 130 | ########### Codecs ############### |
| 131 | |
| 132 | #include $(CLEAR_VARS) |
| 133 | #LOCAL_MODULE := ulaw |
| 134 | #LOCAL_SRC_FILES := ../$(RING_BUILD_DIR)/src/audio/codecs/libcodec_ulaw.so |
| 135 | #include $(PREBUILT_SHARED_LIBRARY) |