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.mk 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. # BOARD_GPU_DRIVERS should be defined. The valid values are
  24. #
  25. # classic drivers: i915 i965
  26. # gallium drivers: swrast freedreno i915g nouveau kmsro r300g r600g radeonsi vc4 virgl vmwgfx etnaviv iris
  27. #
  28. # The main target is libGLES_mesa. For each classic driver enabled, a DRI
  29. # module will also be built. DRI modules will be loaded by libGLES_mesa.
  30. MESA_TOP := $(call my-dir)
  31. MESA_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
  32. ifneq ($(filter 2 4, $(MESA_ANDROID_MAJOR_VERSION)),)
  33. $(error "Android 4.4 and earlier not supported")
  34. endif
  35. MESA_DRI_MODULE_REL_PATH := dri
  36. MESA_DRI_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$(MESA_DRI_MODULE_REL_PATH)
  37. MESA_DRI_MODULE_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/$(MESA_DRI_MODULE_REL_PATH)
  38. MESA_DRI_LDFLAGS := -Wl,--build-id=sha1
  39. MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk
  40. MESA_PYTHON2 := python
  41. # Lists to convert driver names to boolean variables
  42. # in form of <driver name>.<boolean make variable>
  43. classic_drivers := i915.HAVE_I915_DRI i965.HAVE_I965_DRI
  44. gallium_drivers := \
  45. swrast.HAVE_GALLIUM_SOFTPIPE \
  46. freedreno.HAVE_GALLIUM_FREEDRENO \
  47. i915g.HAVE_GALLIUM_I915 \
  48. nouveau.HAVE_GALLIUM_NOUVEAU \
  49. kmsro.HAVE_GALLIUM_KMSRO \
  50. r300g.HAVE_GALLIUM_R300 \
  51. r600g.HAVE_GALLIUM_R600 \
  52. radeonsi.HAVE_GALLIUM_RADEONSI \
  53. vmwgfx.HAVE_GALLIUM_VMWGFX \
  54. vc4.HAVE_GALLIUM_VC4 \
  55. virgl.HAVE_GALLIUM_VIRGL \
  56. etnaviv.HAVE_GALLIUM_ETNAVIV \
  57. iris.HAVE_GALLIUM_IRIS
  58. ifeq ($(BOARD_GPU_DRIVERS),all)
  59. MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., , $(classic_drivers)))
  60. MESA_BUILD_GALLIUM := $(filter HAVE_%, $(subst ., , $(gallium_drivers)))
  61. else
  62. # Warn if we have any invalid driver names
  63. $(foreach d, $(BOARD_GPU_DRIVERS), \
  64. $(if $(findstring $(d).,$(classic_drivers) $(gallium_drivers)), \
  65. , \
  66. $(warning invalid GPU driver: $(d)) \
  67. ) \
  68. )
  69. MESA_BUILD_CLASSIC := $(strip $(foreach d, $(BOARD_GPU_DRIVERS), $(patsubst $(d).%,%, $(filter $(d).%, $(classic_drivers)))))
  70. MESA_BUILD_GALLIUM := $(strip $(foreach d, $(BOARD_GPU_DRIVERS), $(patsubst $(d).%,%, $(filter $(d).%, $(gallium_drivers)))))
  71. endif
  72. ifeq ($(filter x86%,$(TARGET_ARCH)),)
  73. MESA_BUILD_CLASSIC :=
  74. endif
  75. $(foreach d, $(MESA_BUILD_CLASSIC) $(MESA_BUILD_GALLIUM), $(eval $(d) := true))
  76. # host and target must be the same arch to generate matypes.h
  77. ifeq ($(TARGET_ARCH),$(HOST_ARCH))
  78. MESA_ENABLE_ASM := true
  79. else
  80. MESA_ENABLE_ASM := false
  81. endif
  82. ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),)
  83. MESA_ENABLE_LLVM := true
  84. endif
  85. define mesa-build-with-llvm
  86. $(if $(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5), \
  87. $(warning Unsupported LLVM version in Android $(MESA_ANDROID_MAJOR_VERSION)),) \
  88. $(if $(filter 6,$(MESA_ANDROID_MAJOR_VERSION)), \
  89. $(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 -DMESA_LLVM_VERSION_STRING="3.7")) \
  90. $(if $(filter 7,$(MESA_ANDROID_MAJOR_VERSION)), \
  91. $(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0308 -DMESA_LLVM_VERSION_STRING="3.8")) \
  92. $(if $(filter 8,$(MESA_ANDROID_MAJOR_VERSION)), \
  93. $(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 -DMESA_LLVM_VERSION_STRING="3.9")) \
  94. $(if $(filter P,$(MESA_ANDROID_MAJOR_VERSION)), \
  95. $(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 -DMESA_LLVM_VERSION_STRING="3.9")) \
  96. $(eval LOCAL_SHARED_LIBRARIES += libLLVM)
  97. endef
  98. # add subdirectories
  99. SUBDIRS := \
  100. src/gbm \
  101. src/loader \
  102. src/mapi \
  103. src/compiler \
  104. src/mesa \
  105. src/util \
  106. src/egl \
  107. src/amd \
  108. src/broadcom \
  109. src/intel \
  110. src/mesa/drivers/dri \
  111. src/vulkan
  112. INC_DIRS := $(call all-named-subdir-makefiles,$(SUBDIRS))
  113. INC_DIRS += $(call all-named-subdir-makefiles,src/gallium)
  114. include $(INC_DIRS)