Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Android.common.mk 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Mesa 3-D graphics library
  2. #
  3. # Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
  4. # Copyright (C) 2010-2011 LunarG Inc.
  5. #
  6. # Permission is hereby granted, free of charge, to any person obtaining a
  7. # copy of this software and associated documentation files (the "Software"),
  8. # to deal in the Software without restriction, including without limitation
  9. # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. # and/or sell copies of the Software, and to permit persons to whom the
  11. # Software is furnished to do so, subject to the following conditions:
  12. #
  13. # The above copyright notice and this permission notice shall be included
  14. # in all copies or substantial portions of the Software.
  15. #
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  22. # DEALINGS IN THE SOFTWARE.
  23. ifeq ($(LOCAL_IS_HOST_MODULE),true)
  24. LOCAL_CFLAGS += -D_GNU_SOURCE
  25. endif
  26. LOCAL_C_INCLUDES += \
  27. $(MESA_TOP)/src \
  28. $(MESA_TOP)/include
  29. MESA_VERSION := $(shell cat $(MESA_TOP)/VERSION)
  30. LOCAL_CFLAGS += \
  31. -Wno-error \
  32. -Werror=incompatible-pointer-types \
  33. -Wno-unused-parameter \
  34. -Wno-pointer-arith \
  35. -Wno-missing-field-initializers \
  36. -Wno-initializer-overrides \
  37. -Wno-mismatched-tags \
  38. -DPACKAGE_VERSION=\"$(MESA_VERSION)\" \
  39. -DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/issues\"
  40. # XXX: The following __STDC_*_MACROS defines should not be needed.
  41. # It's likely due to a bug elsewhere, but let's temporarily add them
  42. # here to fix the radeonsi build.
  43. LOCAL_CFLAGS += \
  44. -DANDROID_API_LEVEL=$(PLATFORM_SDK_VERSION) \
  45. -DENABLE_SHADER_CACHE \
  46. -D__STDC_CONSTANT_MACROS \
  47. -D__STDC_LIMIT_MACROS \
  48. -DHAVE___BUILTIN_EXPECT \
  49. -DHAVE___BUILTIN_FFS \
  50. -DHAVE___BUILTIN_FFSLL \
  51. -DHAVE_DLFCN_H \
  52. -DHAVE_FUNC_ATTRIBUTE_FLATTEN \
  53. -DHAVE_FUNC_ATTRIBUTE_UNUSED \
  54. -DHAVE_FUNC_ATTRIBUTE_FORMAT \
  55. -DHAVE_FUNC_ATTRIBUTE_PACKED \
  56. -DHAVE_FUNC_ATTRIBUTE_ALIAS \
  57. -DHAVE_FUNC_ATTRIBUTE_NORETURN \
  58. -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL \
  59. -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT \
  60. -DHAVE___BUILTIN_CTZ \
  61. -DHAVE___BUILTIN_POPCOUNT \
  62. -DHAVE___BUILTIN_POPCOUNTLL \
  63. -DHAVE___BUILTIN_CLZ \
  64. -DHAVE___BUILTIN_CLZLL \
  65. -DHAVE___BUILTIN_UNREACHABLE \
  66. -DHAVE_PTHREAD=1 \
  67. -DHAVE_DLADDR \
  68. -DHAVE_DL_ITERATE_PHDR \
  69. -DHAVE_LINUX_FUTEX_H \
  70. -DHAVE_ENDIAN_H \
  71. -DHAVE_ZLIB \
  72. -DMAJOR_IN_SYSMACROS \
  73. -DVK_USE_PLATFORM_ANDROID_KHR \
  74. -fvisibility=hidden \
  75. -fno-math-errno \
  76. -fno-trapping-math \
  77. -Wno-sign-compare
  78. LOCAL_CPPFLAGS += \
  79. -D__STDC_CONSTANT_MACROS \
  80. -D__STDC_FORMAT_MACROS \
  81. -D__STDC_LIMIT_MACROS \
  82. -Wno-error=non-virtual-dtor \
  83. -Wno-non-virtual-dtor
  84. # mesa requires at least c99 compiler
  85. LOCAL_CONLYFLAGS += \
  86. -std=c99
  87. # c11 timespec_get is part of bionic as well
  88. # https://android-review.googlesource.com/c/718518
  89. # This means releases from P and earlier won't need this
  90. ifeq ($(filter 5 6 7 8 9, $(MESA_ANDROID_MAJOR_VERSION)),)
  91. LOCAL_CFLAGS += -DHAVE_TIMESPEC_GET
  92. endif
  93. # Android's libc began supporting shm in Oreo
  94. ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo true),true)
  95. LOCAL_CFLAGS += -DHAVE_SYS_SHM_H
  96. endif
  97. ifeq ($(strip $(MESA_ENABLE_ASM)),true)
  98. ifeq ($(TARGET_ARCH),x86)
  99. LOCAL_CFLAGS += \
  100. -DUSE_X86_ASM
  101. endif
  102. endif
  103. ifeq ($(ARCH_ARM_HAVE_NEON),true)
  104. LOCAL_CFLAGS_arm += -DUSE_ARM_ASM
  105. endif
  106. LOCAL_CFLAGS_arm64 += -DUSE_AARCH64_ASM
  107. ifneq ($(LOCAL_IS_HOST_MODULE),true)
  108. LOCAL_CFLAGS += -DHAVE_LIBDRM
  109. LOCAL_SHARED_LIBRARIES += libdrm
  110. endif
  111. LOCAL_CFLAGS_32 += -DDEFAULT_DRIVER_DIR=\"/vendor/lib/$(MESA_DRI_MODULE_REL_PATH)\"
  112. LOCAL_CFLAGS_64 += -DDEFAULT_DRIVER_DIR=\"/vendor/lib64/$(MESA_DRI_MODULE_REL_PATH)\"
  113. LOCAL_PROPRIETARY_MODULE := true
  114. # uncomment to keep the debug symbols
  115. #LOCAL_STRIP_MODULE := false
  116. ifeq ($(strip $(LOCAL_MODULE_TAGS)),)
  117. LOCAL_MODULE_TAGS := optional
  118. endif
  119. # Quiet down the build system and remove any .h files from the sources
  120. LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))