blob: 37b98fd96c2e3115be060e4d52bf4e41585474a6 [file] [log] [blame]
Adrien Béraud04d822c2015-04-02 17:44:36 -04001 # 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
30LOCAL_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
37include $(CLEAR_VARS)
38
39VERSION="1.1.0"
40MY_PREFIX=/sdcard
41MY_DATADIR=/data/data
42
43ARCH=$(ANDROID_ABI)
44
45CPP_STATIC= $(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(CXXSTL)/libs/$(ARCH)/libgnustl_static.a \
Adrien Béraud899420c2015-06-03 15:09:19 -040046 $(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éraud04d822c2015-04-02 17:44:36 -040050 $(RING_CONTRIB)/lib/libogg.a \
51 $(RING_CONTRIB)/lib/libFLAC.a \
Adrien Béraud899420c2015-06-03 15:09:19 -040052 $(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éraud04d822c2015-04-02 17:44:36 -040065
66ifeq ($(ARCH),$(filter $(ARCH),x86))
67CPP_STATIC += $(RING_CONTRIB)/lib/libpjlib-util-i686-pc-linux-android.a \
68 $(RING_CONTRIB)/lib/libpj-i686-pc-linux-android.a
69else
70CPP_STATIC += $(RING_CONTRIB)/lib/libpjlib-util-arm-unknown-linux-androideabi.a \
71 $(RING_CONTRIB)/lib/libpj-arm-unknown-linux-androideabi.a
72endif
73
74LOCAL_SRC_FILES := ring_wrapper.cpp
75
76# RING_BUILD_DIR contains config.h, which we need
77LOCAL_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
83LOCAL_MODULE := libringjni
84
85LOCAL_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
97LOCAL_LDFLAGS := -L$(RING_CONTRIB)/lib \
98
99LOCAL_LDLIBS += -lz \
100 -llog \
101 -lOpenSLES \
Adrien Béraud899420c2015-06-03 15:09:19 -0400102 $(RING_BUILD_DIR)/src/.libs/libring.a \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400103
104
105ifeq ($(ARCH),$(filter $(ARCH),x86))
106LOCAL_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
117else
118LOCAL_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
128endif
129
130LOCAL_LDLIBS += -lexpat -lhogweed \
131 -lspeexdsp -lvorbisfile -lyaml-cpp \
Adrien Béraud899420c2015-06-03 15:09:19 -0400132 -lFLAC -liax -lnettle \
133 -logg \
134 -lpcre -lsamplerate -luuid \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400135 -lsndfile -lvorbis \
Adrien Béraud899420c2015-06-03 15:09:19 -0400136 -lspeex -lvorbisenc \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400137 -lgmp -lgnutls -lopendht \
Adrien Béraud899420c2015-06-03 15:09:19 -0400138 -lavformat -lavcodec -lavutil \
Adrien Béraud372f7d02015-06-16 17:20:04 -0400139 -lopus -lx264 -lspeex \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400140 $(CPP_STATIC)
141
142
143include $(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)