Android.mk 5.85 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
57 58 59
ifneq (,$(wildcard $(LOCAL_PATH)/../$(VLC_SRC_DIR)/modules/codec/omxil/iomx_hwbuffer.c))
	LOCAL_CFLAGS += -DHAVE_IOMX_DR
endif
Rafaël Carré's avatar
Rafaël Carré committed
60 61 62 63
LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
	$(VLC_MODULES) \
	$(VLC_BUILD_DIR)/lib/.libs/libvlc.a \
	$(VLC_BUILD_DIR)/src/.libs/libvlccore.a \
64
	$(VLC_BUILD_DIR)/compat/.libs/libcompat.a \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
65 66
	-ldl -lz -lm -llog \
	-ldvbpsi -lebml -lmatroska -ltag \
67
	-logg -lFLAC -ltheora -lvorbis \
68
	-lmpeg2 -la52 \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
69
	-lavformat -lavcodec -lswscale -lavutil -lpostproc -lgsm -lopenjpeg \
70
	-lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
71
	-lspeex -lspeexdsp \
Sébastien Toque's avatar
Sébastien Toque committed
72
	-lxml2 -lpng -lgnutls -lgcrypt -lgpg-error \
Rafaël Carré's avatar
Rafaël Carré committed
73
	-lnettle -lhogweed -lgmp \
Rafaël Carré's avatar
Rafaël Carré committed
74
	-lfreetype -liconv -lass -lfribidi -lopus \
75
	-lEGL -lGLESv2 -ljpeg \
76
	-ldvdnav -ldvdread -ldvdcss \
Rafaël Carré's avatar
Rafaël Carré committed
77
	$(CPP_STATIC)
Rafaël Carré's avatar
Rafaël Carré committed
78 79

include $(BUILD_SHARED_LIBRARY)
80

Thomas Guillem's avatar
Thomas Guillem committed
81 82 83 84
# libiomx-* build

LIBIOMX_SRC_FILES_COMMON := ../$(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
LIBIOMX_INCLUDES_COMMON := $(VLC_SRC_DIR)/modules/codec/omxil
85
LIBIOMX_LDLIBS_COMMON := -L$(ANDROID_LIBS) -lgcc -lstagefright -lmedia -lutils -lbinder -llog -lcutils -lui
Thomas Guillem's avatar
Thomas Guillem committed
86
LIBIOMX_CFLAGS_COMMON := -Wno-psabi
87 88 89 90 91
# 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
92

93
# no hwbuffer for gingerbread
Thomas Guillem's avatar
Thomas Guillem committed
94 95
LIBIOMX_INCLUDES_gingerbread := $(LIBIOMX_INCLUDES_COMMON) \
	$(ANDROID_SYS_HEADERS_GINGERBREAD)/frameworks/base/include \
96 97 98 99
	$(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
100 101 102 103 104 105

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
106 107
LIBIOMX_LDLIBS_hc := $(LIBIOMX_LDLIBS_COMMON)
LIBIOMX_CFLAGS_hc := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=11
Thomas Guillem's avatar
Thomas Guillem committed
108 109 110 111 112 113

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
114 115
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
116

117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
LIBIOMX_SRC_FILES_jbmr2 := $(LIBIOMX_SRC_FILES_COMMON) $(LIBIOMX_SRC_FILES_HWBUFFER)
LIBIOMX_INCLUDES_jbmr2 := $(LIBIOMX_INCLUDES_COMMON) \
	$(ANDROID_SYS_HEADERS_JBMR2)/frameworks/native/include \
	$(ANDROID_SYS_HEADERS_JBMR2)/frameworks/av/include \
	$(ANDROID_SYS_HEADERS_JBMR2)/system/core/include \
	$(ANDROID_SYS_HEADERS_JBMR2)/hardware/libhardware/include
LIBIOMX_LDLIBS_jbmr2 := $(LIBIOMX_LDLIBS_COMMON) $(LIBIOMX_LDLIBS_HWBUFFER)
LIBIOMX_CFLAGS_jbmr2 := $(LIBIOMX_CFLAGS_COMMON) $(LIBIOMX_CFLAGS_HWBUFFER) -DANDROID_API=18

LIBIOMX_SRC_FILES_kk := $(LIBIOMX_SRC_FILES_COMMON) $(LIBIOMX_SRC_FILES_HWBUFFER)
LIBIOMX_INCLUDES_kk := $(LIBIOMX_INCLUDES_COMMON) \
	$(ANDROID_SYS_HEADERS_KK)/frameworks/native/include \
	$(ANDROID_SYS_HEADERS_KK)/frameworks/av/include \
	$(ANDROID_SYS_HEADERS_KK)/system/core/include \
	$(ANDROID_SYS_HEADERS_KK)/hardware/libhardware/include
LIBIOMX_LDLIBS_kk := $(LIBIOMX_LDLIBS_COMMON) $(LIBIOMX_LDLIBS_HWBUFFER)
LIBIOMX_CFLAGS_kk := $(LIBIOMX_CFLAGS_COMMON) $(LIBIOMX_CFLAGS_HWBUFFER) -DANDROID_API=19

Thomas Guillem's avatar
Thomas Guillem committed
135
define build_iomx
136
include $(CLEAR_VARS)
Thomas Guillem's avatar
Thomas Guillem committed
137 138 139
LOCAL_MODULE := $(1)
LOCAL_SRC_FILES  := $(LIBIOMX_SRC_FILES_COMMON)
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
140 141
LOCAL_LDLIBS     := $(LIBIOMX_LDLIBS_$(2))
LOCAL_CFLAGS     := $(LIBIOMX_CFLAGS_$(2))
142
include $(BUILD_SHARED_LIBRARY)
Thomas Guillem's avatar
Thomas Guillem committed
143
endef
144

Thomas Guillem's avatar
Thomas Guillem committed
145 146 147
# 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)))))