2011-08-17 03:07:01 +00:00
|
|
|
# Mesa 3-D graphics library
|
|
|
|
#
|
|
|
|
# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
|
|
|
|
# Copyright (C) 2010-2011 LunarG Inc.
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
# copy of this software and associated documentation files (the "Software"),
|
|
|
|
# to deal in the Software without restriction, including without limitation
|
|
|
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
# and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
# Software is furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included
|
|
|
|
# in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
# DEALINGS IN THE SOFTWARE.
|
|
|
|
|
2011-11-26 03:20:05 +00:00
|
|
|
ifeq ($(LOCAL_IS_HOST_MODULE),true)
|
2016-02-02 20:45:08 +00:00
|
|
|
LOCAL_CFLAGS += -D_GNU_SOURCE
|
2011-11-26 03:20:05 +00:00
|
|
|
endif
|
|
|
|
|
2011-08-17 03:07:01 +00:00
|
|
|
LOCAL_C_INCLUDES += \
|
2015-03-27 16:13:50 +00:00
|
|
|
$(MESA_TOP)/src \
|
2011-08-17 03:07:01 +00:00
|
|
|
$(MESA_TOP)/include
|
|
|
|
|
2015-03-27 14:18:24 +00:00
|
|
|
MESA_VERSION := $(shell cat $(MESA_TOP)/VERSION)
|
2011-11-25 03:59:02 +00:00
|
|
|
LOCAL_CFLAGS += \
|
2017-11-27 19:32:19 +00:00
|
|
|
-Wno-error \
|
2016-01-29 18:52:27 +00:00
|
|
|
-Wno-unused-parameter \
|
2016-06-07 23:27:33 +00:00
|
|
|
-Wno-pointer-arith \
|
|
|
|
-Wno-missing-field-initializers \
|
|
|
|
-Wno-initializer-overrides \
|
|
|
|
-Wno-mismatched-tags \
|
2017-06-06 11:31:05 +00:00
|
|
|
-DVERSION=\"$(MESA_VERSION)\" \
|
2013-07-25 22:45:45 +00:00
|
|
|
-DPACKAGE_VERSION=\"$(MESA_VERSION)\" \
|
2017-03-21 18:51:19 +00:00
|
|
|
-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"
|
2011-11-25 03:59:02 +00:00
|
|
|
|
2017-05-03 19:35:14 +00:00
|
|
|
# XXX: The following __STDC_*_MACROS defines should not be needed.
|
|
|
|
# It's likely due to a bug elsewhere, but let's temporarily add them
|
|
|
|
# here to fix the radeonsi build.
|
2011-08-17 03:07:01 +00:00
|
|
|
LOCAL_CFLAGS += \
|
2017-06-04 04:53:01 +00:00
|
|
|
-DANDROID_API_LEVEL=$(PLATFORM_SDK_VERSION) \
|
2017-01-18 19:40:31 +00:00
|
|
|
-DENABLE_SHADER_CACHE \
|
2017-05-03 19:35:14 +00:00
|
|
|
-D__STDC_CONSTANT_MACROS \
|
|
|
|
-D__STDC_LIMIT_MACROS \
|
2015-03-27 20:10:35 +00:00
|
|
|
-DHAVE___BUILTIN_EXPECT \
|
|
|
|
-DHAVE___BUILTIN_FFS \
|
|
|
|
-DHAVE___BUILTIN_FFSLL \
|
|
|
|
-DHAVE_FUNC_ATTRIBUTE_FLATTEN \
|
|
|
|
-DHAVE_FUNC_ATTRIBUTE_UNUSED \
|
|
|
|
-DHAVE_FUNC_ATTRIBUTE_FORMAT \
|
|
|
|
-DHAVE_FUNC_ATTRIBUTE_PACKED \
|
2017-01-19 07:10:34 +00:00
|
|
|
-DHAVE_FUNC_ATTRIBUTE_ALIAS \
|
2017-12-05 00:35:48 +00:00
|
|
|
-DHAVE_FUNC_ATTRIBUTE_NORETURN \
|
|
|
|
-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL \
|
|
|
|
-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT \
|
2015-03-27 20:10:35 +00:00
|
|
|
-DHAVE___BUILTIN_CTZ \
|
|
|
|
-DHAVE___BUILTIN_POPCOUNT \
|
|
|
|
-DHAVE___BUILTIN_POPCOUNTLL \
|
|
|
|
-DHAVE___BUILTIN_CLZ \
|
|
|
|
-DHAVE___BUILTIN_CLZLL \
|
|
|
|
-DHAVE___BUILTIN_UNREACHABLE \
|
2012-09-19 05:09:26 +00:00
|
|
|
-DHAVE_PTHREAD=1 \
|
2017-08-21 19:27:42 +00:00
|
|
|
-DHAVE_DLADDR \
|
2017-02-18 22:10:24 +00:00
|
|
|
-DHAVE_DL_ITERATE_PHDR \
|
2017-12-12 08:01:56 +00:00
|
|
|
-DHAVE_LINUX_FUTEX_H \
|
2017-12-28 23:29:10 +00:00
|
|
|
-DHAVE_ZLIB \
|
2017-05-30 12:22:18 +00:00
|
|
|
-DMAJOR_IN_SYSMACROS \
|
2011-08-17 03:07:01 +00:00
|
|
|
-fvisibility=hidden \
|
|
|
|
-Wno-sign-compare
|
|
|
|
|
2017-01-26 13:24:02 +00:00
|
|
|
LOCAL_CPPFLAGS += \
|
|
|
|
-D__STDC_CONSTANT_MACROS \
|
|
|
|
-D__STDC_FORMAT_MACROS \
|
2017-03-21 18:51:20 +00:00
|
|
|
-D__STDC_LIMIT_MACROS \
|
|
|
|
-Wno-error=non-virtual-dtor \
|
|
|
|
-Wno-non-virtual-dtor
|
2017-01-26 13:24:02 +00:00
|
|
|
|
2016-02-02 20:45:08 +00:00
|
|
|
# mesa requires at least c99 compiler
|
|
|
|
LOCAL_CONLYFLAGS += \
|
|
|
|
-std=c99
|
|
|
|
|
2011-08-17 03:07:01 +00:00
|
|
|
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
|
|
|
|
ifeq ($(TARGET_ARCH),x86)
|
|
|
|
LOCAL_CFLAGS += \
|
2017-03-21 18:51:16 +00:00
|
|
|
-DUSE_X86_ASM
|
2012-08-16 10:59:12 +00:00
|
|
|
|
2011-08-17 03:07:01 +00:00
|
|
|
endif
|
|
|
|
endif
|
2017-07-31 22:15:14 +00:00
|
|
|
ifeq ($(ARCH_ARM_HAVE_NEON),true)
|
|
|
|
LOCAL_CFLAGS_arm += -DUSE_ARM_ASM
|
|
|
|
endif
|
|
|
|
LOCAL_CFLAGS_arm64 += -DUSE_AARCH64_ASM
|
2011-08-17 03:07:01 +00:00
|
|
|
|
2016-10-28 09:54:17 +00:00
|
|
|
ifneq ($(LOCAL_IS_HOST_MODULE),true)
|
2016-06-07 23:27:34 +00:00
|
|
|
LOCAL_CFLAGS += -DHAVE_LIBDRM
|
|
|
|
LOCAL_SHARED_LIBRARIES += libdrm
|
|
|
|
endif
|
|
|
|
|
2017-09-15 13:50:09 +00:00
|
|
|
LOCAL_CFLAGS_32 += -DDEFAULT_DRIVER_DIR=\"/vendor/lib/$(MESA_DRI_MODULE_REL_PATH)\"
|
|
|
|
LOCAL_CFLAGS_64 += -DDEFAULT_DRIVER_DIR=\"/vendor/lib64/$(MESA_DRI_MODULE_REL_PATH)\"
|
|
|
|
LOCAL_PROPRIETARY_MODULE := true
|
2016-05-04 02:02:39 +00:00
|
|
|
|
2011-08-17 03:07:01 +00:00
|
|
|
# uncomment to keep the debug symbols
|
|
|
|
#LOCAL_STRIP_MODULE := false
|
|
|
|
|
|
|
|
ifeq ($(strip $(LOCAL_MODULE_TAGS)),)
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
|
|
|
endif
|
2016-02-24 18:56:27 +00:00
|
|
|
|
|
|
|
# Quiet down the build system and remove any .h files from the sources
|
|
|
|
LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))
|