Android.mk 6.83 KB
Newer Older
1 2
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
3
ANDROID_PRIVATE_LIBDIR := $(LOCAL_PATH)/../../android-libs
Tanguy Pruvot's avatar
Tanguy Pruvot committed
4

5
LOCAL_MODULE    := libvlcjni
Tanguy Pruvot's avatar
Tanguy Pruvot committed
6

7
LOCAL_SRC_FILES := libvlcjni.c libvlcjni-util.c libvlcjni-track.c
8
LOCAL_SRC_FILES += libvlcjni-equalizer.c
Thomas Guillem's avatar
Thomas Guillem committed
9 10
LOCAL_SRC_FILES += libvlcjni-vlcobject.c
LOCAL_SRC_FILES += java_event_thread.c
11
LOCAL_SRC_FILES += libvlcjni-media.c libvlcjni-medialist.c libvlcjni-mediadiscoverer.c
12
LOCAL_SRC_FILES += vout.c native_crash_handler.c thumbnailer.c
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
13
ifneq ($(APP_PLATFORM),android-21)
14
# compat functions not needed after android-21
15 16
LOCAL_SRC_FILES += compat/pthread-condattr.c compat/pthread-rwlocks.c
LOCAL_SRC_FILES += compat/pthread-once.c compat/eventfd.c compat/sem.c compat/pipe2.c
17
LOCAL_SRC_FILES += compat/localtime.c
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
LOCAL_SRC_FILES += compat/wchar/wcpcpy.c
LOCAL_SRC_FILES += compat/wchar/wcpncpy.c
LOCAL_SRC_FILES += compat/wchar/wcscasecmp.c
LOCAL_SRC_FILES += compat/wchar/wcscat.c
LOCAL_SRC_FILES += compat/wchar/wcschr.c
LOCAL_SRC_FILES += compat/wchar/wcscmp.c
LOCAL_SRC_FILES += compat/wchar/wcscoll.c
LOCAL_SRC_FILES += compat/wchar/wcscpy.c
LOCAL_SRC_FILES += compat/wchar/wcscspn.c
LOCAL_SRC_FILES += compat/wchar/wcsdup.c
LOCAL_SRC_FILES += compat/wchar/wcslcat.c
LOCAL_SRC_FILES += compat/wchar/wcslcpy.c
LOCAL_SRC_FILES += compat/wchar/wcslen.c
LOCAL_SRC_FILES += compat/wchar/wcsncasecmp.c
LOCAL_SRC_FILES += compat/wchar/wcsncat.c
LOCAL_SRC_FILES += compat/wchar/wcsncmp.c
LOCAL_SRC_FILES += compat/wchar/wcsncpy.c
LOCAL_SRC_FILES += compat/wchar/wcsnlen.c
LOCAL_SRC_FILES += compat/wchar/wcspbrk.c
LOCAL_SRC_FILES += compat/wchar/wcsrchr.c
LOCAL_SRC_FILES += compat/wchar/wcsspn.c
LOCAL_SRC_FILES += compat/wchar/wcsstr.c
LOCAL_SRC_FILES += compat/wchar/wcstok.c
LOCAL_SRC_FILES += compat/wchar/wcswidth.c
LOCAL_SRC_FILES += compat/wchar/wcsxfrm.c
LOCAL_SRC_FILES += compat/wchar/wmemchr.c
LOCAL_SRC_FILES += compat/wchar/wmemcmp.c
LOCAL_SRC_FILES += compat/wchar/wmemcpy.c
LOCAL_SRC_FILES += compat/wchar/wmemmove.c
LOCAL_SRC_FILES += compat/wchar/wmemset.c
Thomas Guillem's avatar
Thomas Guillem committed
48
endif
Tanguy Pruvot's avatar
Tanguy Pruvot committed
49

50 51
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include

52
ARCH=$(APP_ABI)
53

54
LOCAL_CFLAGS := -std=gnu99
Edward Wang's avatar
Edward Wang committed
55
ifeq ($(ARCH), armeabi)
Edward Wang's avatar
Edward Wang committed
56
	LOCAL_CFLAGS += -DHAVE_ARMEABI
57 58 59
	# Needed by ARMv6 Thumb1 (the System Control coprocessor/CP15 is mandatory on ARMv6)
	# On newer ARM architectures we can use Thumb2
	LOCAL_ARM_MODE := arm
Edward Wang's avatar
Edward Wang committed
60
endif
Edward Wang's avatar
Edward Wang committed
61
ifeq ($(ARCH), armeabi-v7a)
Edward Wang's avatar
Edward Wang committed
62 63
	LOCAL_CFLAGS += -DHAVE_ARMEABI_V7A
endif
64
	LOCAL_CFLAGS += -DHAVE_IOMX_DR
65 66 67 68
LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
	$(VLC_MODULES) \
	$(VLC_BUILD_DIR)/lib/.libs/libvlc.a \
	$(VLC_BUILD_DIR)/src/.libs/libvlccore.a \
69
	$(VLC_BUILD_DIR)/compat/.libs/libcompat.a \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
70
	-ldl -lz -lm -llog \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
71
	-ldvbpsi -lmatroska -lebml -ltag \
72
	-logg -lFLAC -ltheora -lvorbis \
73
	-lmpeg2 -la52 \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
74
	-lavformat -lavcodec -lswscale -lavutil -lpostproc -lgsm -lopenjpeg \
75
	-lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
76
	-lspeex -lspeexdsp \
Sébastien Toque's avatar
Sébastien Toque committed
77
	-lxml2 -lpng -lgnutls -lgcrypt -lgpg-error \
78
	-lnettle -lhogweed -lgmp \
Rafaël Carré's avatar
Rafaël Carré committed
79
	-lfreetype -liconv -lass -lfribidi -lopus \
80
	-lEGL -lGLESv2 -ljpeg \
81
	-ldvdnav -ldvdread -ldvdcss \
Thomas Guillem's avatar
Thomas Guillem committed
82
	-ldsm -ltasn1 \
Thomas Guillem's avatar
Thomas Guillem committed
83
	-lmad \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
84
	-lzvbi \
Alexandre Perraud's avatar
Alexandre Perraud committed
85
	-lssh2 \
86
	-lmodplug \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
87
	$(EXTRA_LDFLAGS)
88

89 90 91
$(TARGET_OUT)/$(LOCAL_MODULE).so: $(ANDROID_PRIVATE_LIBS)
include $(BUILD_SHARED_LIBRARY)

92 93 94 95
################
# PRIVATE LIBS #
################

96 97 98 99 100 101 102 103 104 105
ANDROID_PRIVATE_LIBS=$(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)/libstagefright.so \
					 $(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)/libmedia.so \
					 $(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)/libutils.so \
					 $(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)/libcutils.so \
					 $(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)/libbinder.so \
					 $(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)/libui.so \
					 $(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)/libhardware.so

$(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)/%.so: $(ANDROID_PRIVATE_LIBDIR)/%.c
	mkdir -p $(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE)
106 107 108
	$(GEN)$(TARGET_TUPLE)-gcc $< -shared -o $@ --sysroot=$(SYSROOT)

$(ANDROID_PRIVATE_LIBDIR)/%.c: $(ANDROID_PRIVATE_LIBDIR)/%.symbols
109
	$(VERBOSE)rm -f $@ && touch $@
110 111 112 113 114
	$(GEN)for s in `cat $<`; do echo "void $$s() {}" >> $@; done

###########
# libiOMX #
###########
Thomas Guillem's avatar
Thomas Guillem committed
115 116 117

LIBIOMX_INCLUDES_COMMON := $(VLC_SRC_DIR)/modules/codec/omxil

118
# no hwbuffer for gingerbread
119
LIBIOMX_INCLUDES_10 := $(LIBIOMX_INCLUDES_COMMON) \
120 121 122
	$(ANDROID_SYS_HEADERS)/10/frameworks/base/include \
	$(ANDROID_SYS_HEADERS)/10/system/core/include \
	$(ANDROID_SYS_HEADERS)/10/hardware/libhardware/include
Thomas Guillem's avatar
Thomas Guillem committed
123

124
LIBIOMX_INCLUDES_13 := $(LIBIOMX_INCLUDES_COMMON) \
125 126 127 128
	$(ANDROID_SYS_HEADERS)/13/frameworks/base/include \
	$(ANDROID_SYS_HEADERS)/13/frameworks/base/native/include \
	$(ANDROID_SYS_HEADERS)/13/system/core/include \
	$(ANDROID_SYS_HEADERS)/13/hardware/libhardware/include
Thomas Guillem's avatar
Thomas Guillem committed
129

130
LIBIOMX_INCLUDES_14 := $(LIBIOMX_INCLUDES_COMMON) \
131 132 133 134
	$(ANDROID_SYS_HEADERS)/14/frameworks/base/include \
	$(ANDROID_SYS_HEADERS)/14/frameworks/base/native/include \
	$(ANDROID_SYS_HEADERS)/14/system/core/include \
	$(ANDROID_SYS_HEADERS)/14/hardware/libhardware/include
Thomas Guillem's avatar
Thomas Guillem committed
135

136
LIBIOMX_INCLUDES_18 := $(LIBIOMX_INCLUDES_COMMON) \
137 138 139 140
	$(ANDROID_SYS_HEADERS)/18/frameworks/native/include \
	$(ANDROID_SYS_HEADERS)/18/frameworks/av/include \
	$(ANDROID_SYS_HEADERS)/18/system/core/include \
	$(ANDROID_SYS_HEADERS)/18/hardware/libhardware/include
141

142
LIBIOMX_INCLUDES_19 := $(LIBIOMX_INCLUDES_COMMON) \
143 144 145 146
	$(ANDROID_SYS_HEADERS)/19/frameworks/native/include \
	$(ANDROID_SYS_HEADERS)/19/frameworks/av/include \
	$(ANDROID_SYS_HEADERS)/19/system/core/include \
	$(ANDROID_SYS_HEADERS)/19/hardware/libhardware/include
147

Thomas Guillem's avatar
Thomas Guillem committed
148 149 150 151 152 153
LIBIOMX_INCLUDES_21 := $(LIBIOMX_INCLUDES_COMMON) \
	$(ANDROID_SYS_HEADERS)/21/frameworks/native/include \
	$(ANDROID_SYS_HEADERS)/21/frameworks/av/include \
	$(ANDROID_SYS_HEADERS)/21/system/core/include \
	$(ANDROID_SYS_HEADERS)/21/hardware/libhardware/include

Thomas Guillem's avatar
Thomas Guillem committed
154
define build_iomx
155
include $(CLEAR_VARS)
Thomas Guillem's avatar
Thomas Guillem committed
156
LOCAL_MODULE := $(1)
157
LOCAL_SRC_FILES  := $(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
Thomas Guillem's avatar
Thomas Guillem committed
158
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
159
LOCAL_LDLIBS     := -L$(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE) -lgcc -lstagefright -lmedia -lutils -lbinder -llog -lcutils -lui
Thomas Guillem's avatar
Thomas Guillem committed
160
LOCAL_CFLAGS     := -Wno-psabi -DANDROID_API=$(2)
161
$(TARGET_OUT)/$(1).so: $(ANDROID_PRIVATE_LIBS)
162
include $(BUILD_SHARED_LIBRARY)
Thomas Guillem's avatar
Thomas Guillem committed
163
endef
164

165 166
# call build_iomx for each libiomx-* in LIBIOMX_LIBS
$(foreach IOMX_MODULE, $(LIBIOMX_LIBS), \
167
	$(eval $(call build_iomx,$(IOMX_MODULE),$(subst libiomx.,,$(IOMX_MODULE)))))
Thomas Guillem's avatar
Thomas Guillem committed
168

169 170 171 172

#######
# ANW #
#######
173
LIBANW_SRC_FILES_COMMON += $(VLC_SRC_DIR)/modules/video_output/android/nativewindowpriv.c
Thomas Guillem's avatar
Thomas Guillem committed
174 175 176 177 178 179

define build_anw
include $(CLEAR_VARS)
LOCAL_MODULE := $(1)
LOCAL_SRC_FILES  := $(LIBANW_SRC_FILES_COMMON)
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
180
LOCAL_LDLIBS     := -L$(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE) -llog -lhardware
Thomas Guillem's avatar
Thomas Guillem committed
181
LOCAL_CFLAGS     := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=$(2)
182
$(TARGET_OUT)/$(1).so: $(ANDROID_PRIVATE_LIBS)
Thomas Guillem's avatar
Thomas Guillem committed
183 184 185
include $(BUILD_SHARED_LIBRARY)
endef

186
$(foreach ANW_MODULE,$(LIBANW_LIBS), \
Thomas Guillem's avatar
Thomas Guillem committed
187
    $(eval $(call build_anw,$(ANW_MODULE),$(subst libanw.,,$(ANW_MODULE)))))