Android.common.mk revision 848b8605
1848b8605Smrg# Mesa 3-D graphics library
2848b8605Smrg#
3848b8605Smrg# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
4848b8605Smrg# Copyright (C) 2010-2011 LunarG Inc.
5848b8605Smrg#
6848b8605Smrg# Permission is hereby granted, free of charge, to any person obtaining a
7848b8605Smrg# copy of this software and associated documentation files (the "Software"),
8848b8605Smrg# to deal in the Software without restriction, including without limitation
9848b8605Smrg# the rights to use, copy, modify, merge, publish, distribute, sublicense,
10848b8605Smrg# and/or sell copies of the Software, and to permit persons to whom the
11848b8605Smrg# Software is furnished to do so, subject to the following conditions:
12848b8605Smrg#
13848b8605Smrg# The above copyright notice and this permission notice shall be included
14848b8605Smrg# in all copies or substantial portions of the Software.
15848b8605Smrg#
16848b8605Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17848b8605Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18848b8605Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19848b8605Smrg# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20848b8605Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21848b8605Smrg# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22848b8605Smrg# DEALINGS IN THE SOFTWARE.
23848b8605Smrg
24848b8605Smrg# use c99 compiler by default
25848b8605Smrgifeq ($(LOCAL_CC),)
26848b8605Smrgifeq ($(LOCAL_IS_HOST_MODULE),true)
27848b8605SmrgLOCAL_CC := $(HOST_CC) -std=c99
28848b8605Smrgelse
29848b8605SmrgLOCAL_CC := $(TARGET_CC) -std=c99
30848b8605Smrgendif
31848b8605Smrgendif
32848b8605Smrg
33848b8605SmrgLOCAL_C_INCLUDES += \
34848b8605Smrg	$(MESA_TOP)/include
35848b8605Smrg
36848b8605SmrgMESA_VERSION=$(shell cat $(MESA_TOP)/VERSION)
37848b8605Smrg# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
38848b8605SmrgLOCAL_CFLAGS += \
39848b8605Smrg	-DPACKAGE_VERSION=\"$(MESA_VERSION)\" \
40848b8605Smrg	-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
41848b8605Smrg	-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)
42848b8605Smrg
43848b8605SmrgLOCAL_CFLAGS += \
44848b8605Smrg	-DHAVE_PTHREAD=1 \
45848b8605Smrg	-fvisibility=hidden \
46848b8605Smrg	-Wno-sign-compare
47848b8605Smrg
48848b8605Smrgifeq ($(strip $(MESA_ENABLE_ASM)),true)
49848b8605Smrgifeq ($(TARGET_ARCH),x86)
50848b8605SmrgLOCAL_CFLAGS += \
51848b8605Smrg	-DUSE_X86_ASM \
52848b8605Smrg	-DHAVE_DLOPEN \
53848b8605Smrg
54848b8605Smrgendif
55848b8605Smrgendif
56848b8605Smrg
57848b8605SmrgLOCAL_CPPFLAGS += \
58848b8605Smrg	-Wno-error=non-virtual-dtor \
59848b8605Smrg	-Wno-non-virtual-dtor
60848b8605Smrg
61848b8605Smrg# uncomment to keep the debug symbols
62848b8605Smrg#LOCAL_STRIP_MODULE := false
63848b8605Smrg
64848b8605Smrgifeq ($(strip $(LOCAL_MODULE_TAGS)),)
65848b8605SmrgLOCAL_MODULE_TAGS := optional
66848b8605Smrgendif
67