Android.mk 4.71 KB
Newer Older
Rafaël Carré's avatar
Rafaël Carré committed
1
2
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
Tanguy Pruvot's avatar
Tanguy Pruvot committed
3

Rafaël Carré's avatar
Rafaël Carré committed
4
LOCAL_MODULE    := libvlcjni
Tanguy Pruvot's avatar
Tanguy Pruvot committed
5

6
LOCAL_SRC_FILES := libvlcjni.c libvlcjni-util.c libvlcjni-track.c libvlcjni-medialist.c aout.c vout.c libvlcjni-equalizer.c native_crash_handler.c
7
LOCAL_SRC_FILES += thumbnailer.c pthread-condattr.c pthread-rwlocks.c pthread-once.c eventfd.c sem.c
8
LOCAL_SRC_FILES += pipe2.c
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
LOCAL_SRC_FILES += wchar/wcpcpy.c
LOCAL_SRC_FILES += wchar/wcpncpy.c
LOCAL_SRC_FILES += wchar/wcscasecmp.c
LOCAL_SRC_FILES += wchar/wcscat.c
LOCAL_SRC_FILES += wchar/wcschr.c
LOCAL_SRC_FILES += wchar/wcscmp.c
LOCAL_SRC_FILES += wchar/wcscoll.c
LOCAL_SRC_FILES += wchar/wcscpy.c
LOCAL_SRC_FILES += wchar/wcscspn.c
LOCAL_SRC_FILES += wchar/wcsdup.c
LOCAL_SRC_FILES += wchar/wcslcat.c
LOCAL_SRC_FILES += wchar/wcslcpy.c
LOCAL_SRC_FILES += wchar/wcslen.c
LOCAL_SRC_FILES += wchar/wcsncasecmp.c
LOCAL_SRC_FILES += wchar/wcsncat.c
LOCAL_SRC_FILES += wchar/wcsncmp.c
LOCAL_SRC_FILES += wchar/wcsncpy.c
LOCAL_SRC_FILES += wchar/wcsnlen.c
LOCAL_SRC_FILES += wchar/wcspbrk.c
LOCAL_SRC_FILES += wchar/wcsrchr.c
LOCAL_SRC_FILES += wchar/wcsspn.c
LOCAL_SRC_FILES += wchar/wcsstr.c
LOCAL_SRC_FILES += wchar/wcstok.c
LOCAL_SRC_FILES += wchar/wcswidth.c
LOCAL_SRC_FILES += wchar/wcsxfrm.c
LOCAL_SRC_FILES += wchar/wmemchr.c
LOCAL_SRC_FILES += wchar/wmemcmp.c
LOCAL_SRC_FILES += wchar/wmemcpy.c
LOCAL_SRC_FILES += wchar/wmemmove.c
LOCAL_SRC_FILES += wchar/wmemset.c

Tanguy Pruvot's avatar
Tanguy Pruvot committed
40

Rafaël Carré's avatar
Rafaël Carré committed
41
42
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include

Edward Wang's avatar
Edward Wang committed
43
ARCH=$(ANDROID_ABI)
Rafaël Carré's avatar
Rafaël Carré committed
44

Rafaël Carré's avatar
Rafaël Carré committed
45
CPP_STATIC=$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++$(CXXSTL)/libs/$(ARCH)/libgnustl_static.a
46

47
LOCAL_CFLAGS := -std=gnu99
Edward Wang's avatar
Edward Wang committed
48
ifeq ($(ARCH), armeabi)
Edward Wang's avatar
Edward Wang committed
49
	LOCAL_CFLAGS += -DHAVE_ARMEABI
50
51
52
	# 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
53
endif
Edward Wang's avatar
Edward Wang committed
54
ifeq ($(ARCH), armeabi-v7a)
Edward Wang's avatar
Edward Wang committed
55
56
	LOCAL_CFLAGS += -DHAVE_ARMEABI_V7A
endif
Rafaël Carré's avatar
Rafaël Carré committed
57
58
59
60
LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
	$(VLC_MODULES) \
	$(VLC_BUILD_DIR)/lib/.libs/libvlc.a \
	$(VLC_BUILD_DIR)/src/.libs/libvlccore.a \
61
	$(VLC_BUILD_DIR)/compat/.libs/libcompat.a \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
62
63
	-ldl -lz -lm -llog \
	-ldvbpsi -lebml -lmatroska -ltag \
64
	-logg -lFLAC -ltheora -lvorbis \
65
	-lmpeg2 -la52 \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
66
	-lavformat -lavcodec -lswscale -lavutil -lpostproc -lgsm -lopenjpeg \
67
	-lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
68
	-lspeex -lspeexdsp \
Sébastien Toque's avatar
Sébastien Toque committed
69
	-lxml2 -lpng -lgnutls -lgcrypt -lgpg-error \
Rafaël Carré's avatar
Rafaël Carré committed
70
	-lnettle -lhogweed -lgmp \
Rafaël Carré's avatar
Rafaël Carré committed
71
	-lfreetype -liconv -lass -lfribidi -lopus \
72
	-lEGL -lGLESv2 -ljpeg \
73
	-ldvdnav -ldvdread -ldvdcss \
Rafaël Carré's avatar
Rafaël Carré committed
74
	$(CPP_STATIC)
Rafaël Carré's avatar
Rafaël Carré committed
75
76

include $(BUILD_SHARED_LIBRARY)
77

Thomas Guillem's avatar
Thomas Guillem committed
78
79
80
81
# libiomx-* build

LIBIOMX_SRC_FILES_COMMON := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
LIBIOMX_INCLUDES_COMMON := $(VLC_SRC_DIR)/modules/codec/omxil
82
LIBIOMX_LDLIBS_COMMON := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder -llog -lcutils -lui
Thomas Guillem's avatar
Thomas Guillem committed
83
LIBIOMX_CFLAGS_COMMON := -Wno-psabi
84
85
86
87
88
# Once we always build this with a version of vlc that contains iomx_hwbuffer.c,
# we can remove this condition
ifneq (,$(wildcard $(LOCAL_PATH)/../$(VLC_SRC_DIR)/modules/codec/omxil/iomx_hwbuffer.c))
LIBIOMX_SRC_FILES_COMMON += ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx_hwbuffer.c
endif
Thomas Guillem's avatar
Thomas Guillem committed
89

90
# no hwbuffer for gingerbread
Thomas Guillem's avatar
Thomas Guillem committed
91
92
LIBIOMX_INCLUDES_gingerbread := $(LIBIOMX_INCLUDES_COMMON) \
	$(ANDROID_SYS_HEADERS_GINGERBREAD)/frameworks/base/include \
93
94
95
96
	$(ANDROID_SYS_HEADERS_GINGERBREAD)/system/core/include \
	$(ANDROID_SYS_HEADERS_GINGERBREAD)/hardware/libhardware/include
LIBIOMX_LDLIBS_gingerbread := $(LIBIOMX_LDLIBS_COMMON)
LIBIOMX_CFLAGS_gingerbread := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=10
Thomas Guillem's avatar
Thomas Guillem committed
97
98
99
100
101
102

LIBIOMX_INCLUDES_hc := $(LIBIOMX_INCLUDES_COMMON) \
	$(ANDROID_SYS_HEADERS_HC)/frameworks/base/include \
	$(ANDROID_SYS_HEADERS_HC)/frameworks/base/native/include \
	$(ANDROID_SYS_HEADERS_HC)/system/core/include \
	$(ANDROID_SYS_HEADERS_HC)/hardware/libhardware/include
103
104
LIBIOMX_LDLIBS_hc := $(LIBIOMX_LDLIBS_COMMON)
LIBIOMX_CFLAGS_hc := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=11
Thomas Guillem's avatar
Thomas Guillem committed
105
106
107
108
109
110

LIBIOMX_INCLUDES_ics := $(LIBIOMX_INCLUDES_COMMON) \
	$(ANDROID_SYS_HEADERS_ICS)/frameworks/base/include \
	$(ANDROID_SYS_HEADERS_ICS)/frameworks/base/native/include \
	$(ANDROID_SYS_HEADERS_ICS)/system/core/include \
	$(ANDROID_SYS_HEADERS_ICS)/hardware/libhardware/include
111
112
LIBIOMX_LDLIBS_ics := $(LIBIOMX_LDLIBS_COMMON) $(LIBIOMX_LDLIBS_HWBUFFER)
LIBIOMX_CFLAGS_ics := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=14
Thomas Guillem's avatar
Thomas Guillem committed
113
114

define build_iomx
115
include $(CLEAR_VARS)
Thomas Guillem's avatar
Thomas Guillem committed
116
117
118
LOCAL_MODULE := $(1)
LOCAL_SRC_FILES  := $(LIBIOMX_SRC_FILES_COMMON)
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
119
120
LOCAL_LDLIBS     := $(LIBIOMX_LDLIBS_$(2))
LOCAL_CFLAGS     := $(LIBIOMX_CFLAGS_$(2))
121
include $(BUILD_SHARED_LIBRARY)
Thomas Guillem's avatar
Thomas Guillem committed
122
endef
123

Thomas Guillem's avatar
Thomas Guillem committed
124
125
126
# call build_iomx for each libiomx-* in LIBVLC_LIBS
$(foreach IOMX_MODULE,$(filter libiomx-%,$(LIBVLC_LIBS)), \
	$(eval $(call build_iomx,$(IOMX_MODULE),$(subst libiomx-,,$(IOMX_MODULE)))))