summaryrefslogtreecommitdiff
path: root/src/egl/Android.mk
blob: 143531ad6a33ba0ba2e6afe509665842c81e53c4 (plain)
1
2
3
4
5
6
7
8
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
40
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Android.mk for EGL

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# from main/Makefile
SOURCES = \
	eglapi.c \
	eglarray.c \
	eglconfig.c \
	eglcontext.c \
	eglcurrent.c \
	egldisplay.c \
	egldriver.c \
	eglfallbacks.c \
	eglglobals.c \
	eglimage.c \
	egllog.c \
	eglmisc.c \
	eglmode.c \
	eglscreen.c \
	eglstring.c \
	eglsurface.c \
	eglsync.c

LOCAL_SRC_FILES := \
	$(addprefix main/, $(SOURCES))

LOCAL_CFLAGS := \
	-DPTHREADS \
	-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_ANDROID \
	-D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \
	-D_EGL_OS_UNIX=1 \
	-fvisibility=hidden \
	-Wno-sign-compare

ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_ANDROID
endif
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GALLIUM
endif

LOCAL_C_INCLUDES := \
	external/mesa/include

LOCAL_MODULE := libmesa_egl

include $(BUILD_STATIC_LIBRARY)

ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
	drivers/android/egl_android.c \
	drivers/android/droid.c \
	drivers/android/droid_core.c \
	drivers/android/droid_image.c

LOCAL_CFLAGS := \
	-D_EGL_MAIN=_eglBuiltInDriverANDROID \
	-DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" \
	-DPTHREADS \
	-fvisibility=hidden \
	-Wno-sign-compare

LOCAL_C_INCLUDES := \
	external/mesa/include \
	external/mesa/src/mapi \
	external/mesa/src/egl/main \
	external/mesa/src/gralloc \
	external/drm \
	external/drm/include/drm \
	external/mesa/src/mesa/drivers

LOCAL_MODULE := libmesa_classic_egl

include $(BUILD_STATIC_LIBRARY)

# build libGLES if gallium is not enabled
ifneq ($(strip $(MESA_BUILD_GALLIUM)),true)
include $(CLEAR_VARS)

LOCAL_SRC_FILES :=
LOCAL_CFLAGS :=
LOCAL_C_INCLUDES :=

LOCAL_STATIC_LIBRARIES :=
  
LOCAL_WHOLE_STATIC_LIBRARIES := \
	libmesa_classic_egl \
	libmesa_egl

LOCAL_SHARED_LIBRARIES := \
	libglapi \
	libdrm \
	libdl \
	libhardware \
	liblog \
	libcutils

LOCAL_MODULE := libGLES_mesa
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl

include $(BUILD_SHARED_LIBRARY)
endif # MESA_BUILD_GALLIUM

endif # MESA_BUILD_CLASSIC