blob: e2ac75b4998ee1d34fc6bc2564d02aea803b156d [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/libgnutls.a \
47 $(RING_CONTRIB)/lib/libnettle.a \
48 $(RING_CONTRIB)/lib/libhogweed.a \
Adrien Béraud04d822c2015-04-02 17:44:36 -040049 $(RING_CONTRIB)/lib/libogg.a \
50 $(RING_CONTRIB)/lib/libFLAC.a \
Adrien Béraud899420c2015-06-03 15:09:19 -040051 $(RING_CONTRIB)/lib/libavcodec.a \
52 $(RING_CONTRIB)/lib/libavfilter.a \
53 $(RING_CONTRIB)/lib/libavformat.a \
54 $(RING_CONTRIB)/lib/libavdevice.a \
55 $(RING_CONTRIB)/lib/libavutil.a \
56 $(RING_CONTRIB)/lib/libswscale.a \
57 $(RING_CONTRIB)/lib/libz.a \
58 $(RING_CONTRIB)/lib/libupnp.a \
59 $(RING_CONTRIB)/lib/libthreadutil.a \
60 $(RING_CONTRIB)/lib/libiconv.a \
61 $(RING_CONTRIB)/lib/libixml.a \
62 $(RING_CONTRIB)/lib/libgmp.a \
63 $(RING_CONTRIB)/lib/libopendht.a
Adrien Béraud04d822c2015-04-02 17:44:36 -040064
65ifeq ($(ARCH),$(filter $(ARCH),x86))
66CPP_STATIC += $(RING_CONTRIB)/lib/libpjlib-util-i686-pc-linux-android.a \
67 $(RING_CONTRIB)/lib/libpj-i686-pc-linux-android.a
68else
69CPP_STATIC += $(RING_CONTRIB)/lib/libpjlib-util-arm-unknown-linux-androideabi.a \
70 $(RING_CONTRIB)/lib/libpj-arm-unknown-linux-androideabi.a
71endif
72
73LOCAL_SRC_FILES := ring_wrapper.cpp
74
75# RING_BUILD_DIR contains config.h, which we need
76LOCAL_C_INCLUDES += $(LOCAL_PATH) \
77 $(RING_BUILD_DIR) \
78 $(RING_SRC_DIR) \
79 $(RING_SRC_DIR)/src \
80 $(RING_SRC_DIR)/contrib/$(TARGET_TUPLE)/include
81
82LOCAL_MODULE := libringjni
83
Adrien Béraudb179bab2015-10-08 12:04:22 -040084LOCAL_CFLAGS += -fpic
85
Adrien Béraud04d822c2015-04-02 17:44:36 -040086LOCAL_CPPFLAGS += -DCCPP_PREFIX \
87 -DPROGSHAREDIR=\"${MY_DATADIR}/ring\" \
88 -DHAVE_CONFIG_H \
89 -DHAVE_SPEEX_CODEC \
90 -DHAVE_GSM_CODEC \
Adrien Béraudb179bab2015-10-08 12:04:22 -040091 -w -frtti -fpic \
Adrien Béraud04d822c2015-04-02 17:44:36 -040092 -std=c++11 -fexceptions -fpermissive \
93 -DAPP_NAME=\"Ring\" \
94 -DSWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON \
95 -DDEBUG_DIRECTOR_OWNED \
96 -DPJ_AUTOCONF=1
97
98LOCAL_LDFLAGS := -L$(RING_CONTRIB)/lib \
99
100LOCAL_LDLIBS += -lz \
101 -llog \
102 -lOpenSLES \
Adrien Béraud899420c2015-06-03 15:09:19 -0400103 $(RING_BUILD_DIR)/src/.libs/libring.a \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400104
105
106ifeq ($(ARCH),$(filter $(ARCH),x86))
107LOCAL_LDLIBS += -lpj-i686-pc-linux-android \
108 -lpjsip-simple-i686-pc-linux-android \
109 -lpjlib-util-i686-pc-linux-android \
110 -lpjsip-ua-i686-pc-linux-android \
111 -lpjmedia-i686-pc-linux-android \
112 -lpjnath-i686-pc-linux-android \
113 -lpjmedia-audiodev-i686-pc-linux-android \
114 -lsrtp-i686-pc-linux-android \
115 -lpjsip-i686-pc-linux-android \
116 -lresample-i686-pc-linux-android
117
118else
119LOCAL_LDLIBS += -lpj-arm-unknown-linux-androideabi \
120 -lpjsip-simple-arm-unknown-linux-androideabi \
121 -lpjlib-util-arm-unknown-linux-androideabi \
122 -lpjsip-ua-arm-unknown-linux-androideabi \
123 -lpjmedia-arm-unknown-linux-androideabi \
124 -lpjnath-arm-unknown-linux-androideabi \
125 -lpjmedia-audiodev-arm-unknown-linux-androideabi \
126 -lsrtp-arm-unknown-linux-androideabi \
127 -lpjsip-arm-unknown-linux-androideabi \
128 -lresample-arm-unknown-linux-androideabi
129endif
130
Adrien Béraudb179bab2015-10-08 12:04:22 -0400131LOCAL_LDLIBS += -lhogweed \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400132 -lspeexdsp -lvorbisfile -lyaml-cpp \
Adrien Béraud899420c2015-06-03 15:09:19 -0400133 -lFLAC -liax -lnettle \
134 -logg \
135 -lpcre -lsamplerate -luuid \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400136 -lsndfile -lvorbis \
Adrien Béraud899420c2015-06-03 15:09:19 -0400137 -lspeex -lvorbisenc \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400138 -lgmp -lgnutls -lopendht \
Adrien Béraud899420c2015-06-03 15:09:19 -0400139 -lavformat -lavcodec -lavutil \
Adrien Béraud1c670912015-10-12 22:27:22 -0400140 -lopus -lspeex \
Adrien Béraud04d822c2015-04-02 17:44:36 -0400141 $(CPP_STATIC)
142
143
144include $(BUILD_SHARED_LIBRARY)
145
146########### Codecs ###############
147
148#include $(CLEAR_VARS)
149#LOCAL_MODULE := ulaw
150#LOCAL_SRC_FILES := ../$(RING_BUILD_DIR)/src/audio/codecs/libcodec_ulaw.so
151#include $(PREBUILT_SHARED_LIBRARY)