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

4 5
include $(CLEAR_VARS)
LOCAL_MODULE := libvlc
6
ARCH=$(APP_ABI)
Edward Wang's avatar
Edward Wang committed
7
ifeq ($(ARCH), armeabi)
8
	LOCAL_ARM_MODE := arm
Edward Wang's avatar
Edward Wang committed
9
endif
10
LOCAL_SRC_FILES += libvlcjni-modules.c libvlcjni-symbols.c
11 12 13 14
LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
	$(VLC_MODULES) \
	$(VLC_BUILD_DIR)/lib/.libs/libvlc.a \
	$(VLC_BUILD_DIR)/src/.libs/libvlccore.a \
15
	$(VLC_BUILD_DIR)/compat/.libs/libcompat.a \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
16
	-ldl -lz -lm -llog \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
17
	-ldvbpsi -lmatroska -lebml -ltag \
18
	-logg -lFLAC -ltheora -lvorbis \
Thomas Guillem's avatar
Thomas Guillem committed
19
	-la52 -lsoxr \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
20
	-lavformat -lavcodec -lswscale -lavutil -lpostproc -lgsm -lopenjpeg \
21
	-lliveMedia -lUsageEnvironment -lBasicUsageEnvironment -lgroupsock \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
22
	-lspeex -lspeexdsp \
Sébastien Toque's avatar
Sébastien Toque committed
23
	-lxml2 -lpng -lgnutls -lgcrypt -lgpg-error \
24
	-lnettle -lhogweed -lgmp \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
25
	-lharfbuzz -lfreetype -liconv -lass -lfribidi -lopus \
26
	-lEGL -lGLESv2 -ljpeg \
27
	-ldvdnav -ldvdread -ldvdcss \
Thomas Guillem's avatar
Thomas Guillem committed
28
	-ldsm -ltasn1 \
Thomas Guillem's avatar
Thomas Guillem committed
29
	-lmad \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
30
	-lzvbi \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
31
	-lssh2 -lnfs \
32
	-lmodplug \
Thomas Guillem's avatar
Thomas Guillem committed
33
	-lupnp -lthreadutil -lixml \
Thomas Guillem's avatar
Thomas Guillem committed
34
	-larchive \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
35
	-lmpg123 \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
36
	-llua \
37
	-lmicrodns \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
38
	$(EXTRA_LDFLAGS)
39

40
LOCAL_SHARED_LIBRARIES:= libcompat.7
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := libvlcjni

LOCAL_SRC_FILES := libvlcjni.c
LOCAL_SRC_FILES += libvlcjni-mediaplayer.c
LOCAL_SRC_FILES += libvlcjni-vlcobject.c
LOCAL_SRC_FILES += libvlcjni-media.c libvlcjni-medialist.c libvlcjni-mediadiscoverer.c
LOCAL_SRC_FILES += libvlcjni-dialog.c
LOCAL_SRC_FILES += native_crash_handler.c thumbnailer.c
LOCAL_SRC_FILES += std_logger.c

LOCAL_LDLIBS := -llog
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include

ARCH=$(APP_ABI)

LOCAL_CFLAGS := -std=gnu99
ifeq ($(ARCH), armeabi)
	LOCAL_CFLAGS += -DHAVE_ARMEABI
	# 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
endif
ifeq ($(ARCH), armeabi-v7a)
	LOCAL_CFLAGS += -DHAVE_ARMEABI_V7A
endif

LOCAL_SHARED_LIBRARIES:= libvlc
71

72 73
include $(BUILD_SHARED_LIBRARY)

74 75 76 77 78 79 80 81
####################
# DUMMY COMPAT LIB #
####################

include $(CLEAR_VARS)
LOCAL_MODULE := libcompat.7
include $(BUILD_SHARED_LIBRARY)

82 83 84 85
################
# PRIVATE LIBS #
################

86 87 88 89 90 91 92 93 94 95
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)
96 97 98
	$(GEN)$(TARGET_TUPLE)-gcc $< -shared -o $@ --sysroot=$(SYSROOT)

$(ANDROID_PRIVATE_LIBDIR)/%.c: $(ANDROID_PRIVATE_LIBDIR)/%.symbols
99
	$(VERBOSE)rm -f $@ && touch $@
100 101 102 103 104
	$(GEN)for s in `cat $<`; do echo "void $$s() {}" >> $@; done

###########
# libiOMX #
###########
Thomas Guillem's avatar
Thomas Guillem committed
105 106 107

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

108
# no hwbuffer for gingerbread
109
LIBIOMX_INCLUDES_10 := $(LIBIOMX_INCLUDES_COMMON) \
110 111 112
	$(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
113

114
LIBIOMX_INCLUDES_13 := $(LIBIOMX_INCLUDES_COMMON) \
115 116 117 118
	$(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
119

120
LIBIOMX_INCLUDES_14 := $(LIBIOMX_INCLUDES_COMMON) \
121 122 123 124
	$(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
125

126
LIBIOMX_INCLUDES_18 := $(LIBIOMX_INCLUDES_COMMON) \
127 128 129 130
	$(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
131

132
LIBIOMX_INCLUDES_19 := $(LIBIOMX_INCLUDES_COMMON) \
133 134 135 136
	$(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
137

Thomas Guillem's avatar
Thomas Guillem committed
138 139 140 141 142 143
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
144
define build_iomx
145
include $(CLEAR_VARS)
Thomas Guillem's avatar
Thomas Guillem committed
146
LOCAL_MODULE := $(1)
147
LOCAL_SRC_FILES  := $(VLC_SRC_DIR)/modules/codec/omxil/iomx.cpp
Thomas Guillem's avatar
Thomas Guillem committed
148
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
149
LOCAL_LDLIBS     := -L$(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE) -lgcc -lstagefright -lmedia -lutils -lbinder -llog -lcutils -lui
Thomas Guillem's avatar
Thomas Guillem committed
150
LOCAL_CFLAGS     := -Wno-psabi -DANDROID_API=$(2)
151
$(TARGET_OUT)/$(1).so: $(ANDROID_PRIVATE_LIBS)
152
include $(BUILD_SHARED_LIBRARY)
Thomas Guillem's avatar
Thomas Guillem committed
153
endef
154

155 156
# call build_iomx for each libiomx-* in LIBIOMX_LIBS
$(foreach IOMX_MODULE, $(LIBIOMX_LIBS), \
157
	$(eval $(call build_iomx,$(IOMX_MODULE),$(subst libiomx.,,$(IOMX_MODULE)))))
Thomas Guillem's avatar
Thomas Guillem committed
158

159 160 161 162

#######
# ANW #
#######
163
LIBANW_SRC_FILES_COMMON += $(VLC_SRC_DIR)/modules/video_output/android/nativewindowpriv.c
Thomas Guillem's avatar
Thomas Guillem committed
164 165 166 167 168 169

define build_anw
include $(CLEAR_VARS)
LOCAL_MODULE := $(1)
LOCAL_SRC_FILES  := $(LIBANW_SRC_FILES_COMMON)
LOCAL_C_INCLUDES := $(LIBIOMX_INCLUDES_$(2))
170
LOCAL_LDLIBS     := -L$(ANDROID_PRIVATE_LIBDIR)/$(TARGET_TUPLE) -llog -lhardware
Thomas Guillem's avatar
Thomas Guillem committed
171
LOCAL_CFLAGS     := $(LIBIOMX_CFLAGS_COMMON) -DANDROID_API=$(2)
172
$(TARGET_OUT)/$(1).so: $(ANDROID_PRIVATE_LIBS)
Thomas Guillem's avatar
Thomas Guillem committed
173 174 175
include $(BUILD_SHARED_LIBRARY)
endef

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