aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.mk144
-rw-r--r--common.mk267
2 files changed, 0 insertions, 411 deletions
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 92f443dc..00000000
--- a/Android.mk
+++ /dev/null
@@ -1,144 +0,0 @@
-# This is the top-level build file for the Android HW OpenGL ES emulation
-# in Android.
-#
-# You must define BUILD_EMULATOR_OPENGL to 'true' in your environment to
-# build the following files.
-#
-# Also define BUILD_EMULATOR_OPENGL_DRIVER to 'true' to build the gralloc
-# stuff as well.
-#
-# Top-level for all modules
-GOLDFISH_OPENGL_PATH := $(call my-dir)
-
-HARDWARE_GOOGLE_GFXSTREAM_PATH := $(GOLDFISH_OPENGL_PATH)/../../../hardware/google/gfxstream
-
-ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
-ENABLE_GOLDFISH_OPENGL_FOLDER := true
-else
-ifneq ($(filter $(GOLDFISH_OPENGL_PATH),$(PRODUCT_SOONG_NAMESPACES)),)
-ENABLE_GOLDFISH_OPENGL_FOLDER := true
-endif
-endif
-
-ifeq (true,$(ENABLE_GOLDFISH_OPENGL_FOLDER))
-
-# There are two kinds of builds for goldfish-opengl:
-# 1. The standard guest build, denoted by BUILD_EMULATOR_OPENGL
-# 2. The host-side build, denoted by GOLDFISH_OPENGL_BUILD_FOR_HOST
-#
-# Variable controlling whether the build for goldfish-opengl
-# libraries (including their Android.mk's) should be triggered.
-GOLDFISH_OPENGL_SHOULD_BUILD := false
-
-# In the host build, some libraries have name collisions with
-# other libraries, so we have this variable here to control
-# adding a suffix to the names of libraries. Should be blank
-# for the guest build.
-GOLDFISH_OPENGL_LIB_SUFFIX :=
-
-# Directory containing common headers used by several modules
-# This is always set to a module's LOCAL_C_INCLUDES
-# See the definition of emugl-begin-module in common.mk
-EMUGL_COMMON_INCLUDES := \
- $(HARDWARE_GOOGLE_GFXSTREAM_PATH)/guest/iostream/include/libOpenglRender \
- $(HARDWARE_GOOGLE_GFXSTREAM_PATH)/guest/include
-
-# This is always set to a module's LOCAL_CFLAGS
-# See the definition of emugl-begin-module in common.mk
-EMUGL_COMMON_CFLAGS :=
-
-# Whether or not to build the Vulkan library.
-GFXSTREAM := false
-
-# Host build
-ifeq (true,$(GOLDFISH_OPENGL_BUILD_FOR_HOST))
-
-GOLDFISH_OPENGL_SHOULD_BUILD := true
-GOLDFISH_OPENGL_LIB_SUFFIX := _host
-
-GFXSTREAM := true
-
-# Set modern defaults for the codename, version, etc.
-PLATFORM_VERSION_CODENAME:=Q
-PLATFORM_SDK_VERSION:=29
-IS_AT_LEAST_OPD1:=true
-
-# The host-side Android framework implementation
-HOST_EMUGL_PATH := $(GOLDFISH_OPENGL_PATH)/../../../external/qemu/android/android-emugl
-EMUGL_COMMON_INCLUDES += $(HOST_EMUGL_PATH)/guest
-
-EMUGL_COMMON_CFLAGS += \
- -DPLATFORM_SDK_VERSION=29 \
- -DGOLDFISH_HIDL_GRALLOC \
- -DHOST_BUILD \
- -DANDROID \
- -DGL_GLEXT_PROTOTYPES \
- -fvisibility=default \
- -DPAGE_SIZE=4096 \
- -DGFXSTREAM \
- -DENABLE_ANDROID_HEALTH_MONITOR \
- -Wno-unused-parameter
-
-endif # GOLDFISH_OPENGL_BUILD_FOR_HOST
-
-ifeq (true,$(BUILD_EMULATOR_OPENGL)) # Guest build
-
-GOLDFISH_OPENGL_SHOULD_BUILD := true
-
-EMUGL_COMMON_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
-
-ifeq (O, $(PLATFORM_VERSION_CODENAME))
-EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC
-endif
-
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25 && echo isApi26OrHigher),isApi26OrHigher)
-EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC
-endif
-
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 18 && echo PreJellyBeanMr2),PreJellyBeanMr2)
- ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
- EMUGL_COMMON_CFLAGS += -DHAVE_ARM_TLS_REGISTER
- endif
-endif
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 16 && echo PreJellyBean),PreJellyBean)
- EMUGL_COMMON_CFLAGS += -DALOG_ASSERT=LOG_ASSERT
- EMUGL_COMMON_CFLAGS += -DALOGE=LOGE
- EMUGL_COMMON_CFLAGS += -DALOGW=LOGW
- EMUGL_COMMON_CFLAGS += -DALOGD=LOGD
- EMUGL_COMMON_CFLAGS += -DALOGV=LOGV
-endif
-
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 27 && echo isApi28OrHigher),isApi28OrHigher)
- GFXSTREAM := true
- EMUGL_COMMON_CFLAGS += -DGFXSTREAM
-endif
-
-# Include common definitions used by all the modules included later
-# in this build file. This contains the definition of all useful
-# emugl-xxxx functions.
-#
-include $(GOLDFISH_OPENGL_PATH)/common.mk
-
-endif # BUILD_EMULATOR_OPENGL (guest build)
-
-ifeq (true,$(GOLDFISH_OPENGL_SHOULD_BUILD))
-
-# Uncomment the following line if you want to enable debug traces
-# in the GLES emulation libraries.
-# EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1
-
-# IMPORTANT: ORDER IS CRUCIAL HERE
-#
-# For the import/export feature to work properly, you must include
-# modules below in correct order. That is, if module B depends on
-# module A, then it must be included after module A below.
-#
-# This ensures that anything exported by module A will be correctly
-# be imported by module B when it is declared.
-#
-# Note that the build system will complain if you try to import a
-# module that hasn't been declared yet anyway.
-#
-endif
-
-endif # ENABLE_GOLDFISH_OPENGL_FOLDER
diff --git a/common.mk b/common.mk
deleted file mode 100644
index 79917126..00000000
--- a/common.mk
+++ /dev/null
@@ -1,267 +0,0 @@
-# This top-level build file is included by all modules that implement
-# the hardware OpenGL ES emulation for Android.
-#
-# We use it to ensure that all sub-Makefiles are included in the right
-# order for various variable definitions and usage to happen in the correct
-# order.
-#
-
-# The following macros are used to start a new GLES emulation module.
-#
-# This will define LOCAL_MODULE as $1, plus a few other variables
-# needed by the build system (e.g. LOCAL_MODULE_TAGS, LOCAL_MODULE_CLASS...)
-#
-# NOTE: You still need to define LOCAL_PATH before this
-#
-# Usage example:
-#
-# $(call emugl-begin-static-library,<name>)
-# LOCAL_SRC_FILES := ....
-# LOCAL_C_INCLUDES += ....
-# $(call emugl-end-module)
-#
-emugl-begin-static-library = $(call emugl-begin-module,$1,STATIC_LIBRARY)
-emugl-begin-shared-library = $(call emugl-begin-module,$1,SHARED_LIBRARY)
-
-# Internal list of all declared modules (used for sanity checking)
-_emugl_modules :=
-_emugl_HOST_modules :=
-
-# do not use directly, see functions above instead
-emugl-begin-module = \
- $(eval include $(CLEAR_VARS)) \
- $(eval LOCAL_MODULE := $1) \
- $(eval LOCAL_MODULE_CLASS := $(patsubst HOST_%,%,$(patsubst %EXECUTABLE,%EXECUTABLES,$(patsubst %LIBRARY,%LIBRARIES,$2)))) \
- $(eval LOCAL_IS_HOST_MODULE := $(if $3,true,))\
- $(eval LOCAL_C_INCLUDES := $(EMUGL_COMMON_INCLUDES)) \
- $(eval LOCAL_CFLAGS := $(EMUGL_COMMON_CFLAGS)) \
- $(eval _EMUGL_INCLUDE_TYPE := $(BUILD_$2)) \
- $(call _emugl-init-module,$1,$2,$3)
-
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo TREBLE),TREBLE)
- emugl-begin-module += $(eval LOCAL_VENDOR_MODULE := true)
-endif
-
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23 && echo PreMarshmallow),PreMarshmallow)
- emugl-begin-module += $(eval include external/stlport/libstlport.mk)
-endif
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 21 && echo PreLollipop),PreLollipop)
- emugl-begin-module += $(eval LOCAL_PRELINK_MODULE := false)
-endif
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 19 && echo PreKitkat),PreKitkat)
- emugl-begin-module += $(eval LOCAL_MODULE_TAGS := debug)
- emugl-begin-module += $(eval LOCAL_SHARED_LIBRARIES += libstlport)
-endif
-
-# Used to end a module definition, see function definitions above
-emugl-end-module = \
- $(eval include $(_EMUGL_INCLUDE_TYPE))\
- $(eval _EMUGL_INCLUDE_TYPE :=) \
- $(eval _emugl_$(_emugl_HOST)modules += $(_emugl_MODULE))\
- $(if $(EMUGL_DEBUG),$(call emugl-dump-module)) \
- $(if $(CMAKE_GENERATE), $(call dump-json-module))
-
-# Managing module exports and imports.
-#
-# A module can 'import' another module, by calling emugl-import. This will
-# make the current LOCAL_MODULE inherit various definitions exported from
-# the imported module.
-#
-# Module exports are defined by calling emugl-export. Here is an example:
-#
-# $(call emugl-begin-static-library,foo)
-# LOCAL_SRC_FILES := foo.c
-# $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
-# $(call emugl-export,SHARED_LIBRARIES,libcutils)
-# $(call emugl-end-module)
-#
-# $(call emugl-begin-shared-library,bar)
-# LOCAL_SRC_FILES := bar.cpp
-# $(call emugl-import,foo)
-# $(call emugl-end-module)
-#
-# Here, we define a static library named 'foo' which exports an include
-# path and a shared library requirement, and a shared library 'bar' which
-# imports it.
-#
-# What this means is that:
-#
-# - 'bar' will automatically inherit foo's LOCAL_PATH in its LOCAL_C_INCLUDES
-# - 'bar' will automatically inherit libcutils in its own LOCAL_SHARED_LIBRARIES
-#
-# Note that order of declaration matters. If 'foo' is defined after 'bar' in
-# the example above, nothing will work correctly because dependencies are
-# computed at import time.
-#
-#
-# IMPORTANT: Imports are transitive, i.e. when module A imports B,
-# it automatically imports anything imported by B too.
-
-# This is the list of recognized export types we support for now.
-EMUGL_EXPORT_TYPES := \
- CFLAGS \
- LDLIBS \
- LDFLAGS \
- C_INCLUDES \
- SHARED_LIBRARIES \
- STATIC_LIBRARIES \
- ADDITIONAL_DEPENDENCIES
-
-ifdef IS_AT_LEAST_OPD1
-EMUGL_EXPORT_TYPES += HEADER_LIBRARIES
-endif
-
-# Initialize a module in our database
-# $1: Module name
-# $2: Module type
-# $3: "HOST" for a host module, empty for a target one.
-_emugl-init-module = \
- $(eval _emugl_HOST := $(if $3,HOST_,))\
- $(eval _emugl_MODULE := $(_emugl_HOST)$1)\
- $(if $(filter $(_emugl_$(_emugl_HOST)modules),$(_emugl_MODULE)),\
- $(error There is already a $(if $3,host,) module named $1!)\
- )\
- $(eval _mod = $(_emugl_MODULE)) \
- $(eval _emugl.$(_mod).type := $(patsubst HOST_%,%,$2))\
- $(eval _emugl.$(_mod).imports :=) \
- $(eval _emugl,$(_mod).moved :=) \
- $(foreach _type,$(EMUGL_EXPORT_TYPES),\
- $(eval _emugl.$(_mod).export.$(_type) :=)\
- )
-
-# Called to indicate that a module exports a given local variable for its
-# users. This also adds this to LOCAL_$1
-# $1: Local variable type (e.g. CFLAGS, LDLIBS, etc...)
-# $2: Value(s) to append to the export
-emugl-export = \
- $(eval _emugl.$(_emugl_MODULE).export.$1 += $2)\
- $(eval LOCAL_$1 := $2 $(LOCAL_$1))
-
-emugl-export-outer = \
- $(eval _emugl.$(_emugl_MODULE).export.$1 += $2)
-
-# Called to indicate that a module imports the exports of another module
-# $1: list of modules to import
-#
-emugl-import = \
- $(foreach _imod,$1,\
- $(call _emugl-module-import,$(_emugl_HOST)$(_imod))\
- )
-
-_emugl-module-import = \
- $(eval _mod := $(_emugl_MODULE))\
- $(if $(filter-out $(_emugl_$(_emugl_HOST)modules),$1),\
- $(info Unknown imported emugles module: $1)\
- $(if $(_emugl_HOST),\
- $(eval _names := $(patsubst HOST_%,%,$(_emugl_HOST_modules))),\
- $(eval _names := $(_emugl_modules))\
- )\
- $(info Please one of the following names: $(_names))\
- $(error Aborting)\
- )\
- $(if $(filter-out $(_emugl.$(_mod).imports),$1),\
- $(eval _emugl.$(_mod).imports += $1)\
- $(foreach _sub,$(_emugl.$1.imports),\
- $(call _emugl-module-import,$(_sub))\
- )\
- $(foreach _type,$(EMUGL_EXPORT_TYPES),\
- $(eval LOCAL_$(_type) := $(_emugl.$1.export.$(_type)) $(LOCAL_$(_type)))\
- )\
- $(if $(filter EXECUTABLE SHARED_LIBRARY,$(_emugl.$(_emugl_MODULE).type)),\
- $(if $(filter STATIC_LIBRARY,$(_emugl.$1.type)),\
- $(eval LOCAL_STATIC_LIBRARIES := $(1:HOST_%=%) $(LOCAL_STATIC_LIBRARIES))\
- )\
- $(if $(filter SHARED_LIBRARY,$(_emugl.$1.type)),\
- $(if $(_emugl.$1.moved),,\
- $(eval LOCAL_SHARED_LIBRARIES := $(1:HOST_%=%) $(LOCAL_SHARED_LIBRARIES))\
- )\
- )\
- )\
- )
-
-_emugl-dump-list = \
- $(foreach _list_item,$(strip $1),$(info . $(_list_item)))
-
-emugl-dump-module = \
- $(info MODULE=$(_emugl_MODULE))\
- $(info . HOST=$(_emugl_HOST))\
- $(info . TYPE=$(_emugl.$(_emugl_MODULE).type))\
- $(info . IMPORTS=$(_emugl.$(_emugl_MODULE).imports))\
- $(foreach _type,$(EMUGL_EXPORT_TYPES),\
- $(if $(filter C_INCLUDES ADDITIONAL_DEPENDENCIES,$(_type)),\
- $(info . EXPORT.$(_type) :=)\
- $(call _emugl-dump-list,$(_emugl.$(_emugl_MODULE).export.$(_type)))\
- $(info . LOCAL_$(_type) :=)\
- $(call _emugl-dump-list,$(LOCAL_$(_type)))\
- ,\
- $(info . EXPORT.$(_type) := $(strip $(_emugl.$(_emugl_MODULE).export.$(_type))))\
- $(info . LOCAL_$(_type) := $(strip $(LOCAL_$(_type))))\
- )\
- )\
- $(info . LOCAL_SRC_FILES := $(LOCAL_SRC_FILES))\
-
-# This function can be called to generate the wrapper source files.
-# LOCAL_MODULE and LOCAL_MODULE_CLASS must be defined or the build will abort.
-# Source files will be stored in the local intermediates directory that will
-# be automatically added to your LOCAL_C_INCLUDES.
-# Usage:
-# $(call emugl-gen-wrapper,<input-dir>,<basename>)
-#
-emugl-gen-wrapper = \
- $(eval _emugl_out := $(call local-intermediates-dir)) \
- $(call emugl-gen-wrapper-generic,$(_emugl_out),$1,$2) \
- $(call emugl-export,C_INCLUDES,$(_emugl_out))
-
-# DO NOT CALL DIRECTLY, USE emugl-gen-wrapper instead.
-#
-# The following function can be called to generate GL library wrapper
-# Usage is:
-#
-# $(call emugl-gen-wrapper-generic,<dst-dir>,<src-dir>,<basename>)
-#
-# <dst-dir> is the destination directory where the generated sources are stored
-# <src-dir> is the source directory where to find <basename>.attrib, etc..
-# <basename> is the emugen basename (see host/tools/emugen/README)
-#
-emugl-gen-wrapper-generic = $(eval $(emugl-gen-wrapper-generic-ev))
-
-define emugl-gen-wrapper-generic-ev
-_emugl_wrap := $$1/$$3
-_emugl_src := $$2/$$3
-GEN := $$(_emugl_wrap)_wrapper_entry.cpp \
- $$(_emugl_wrap)_wrapper_context.cpp \
- $$(_emugl_wrap)_wrapper_context.h \
- $$(_emugl_wrap)_wrapper_proc.h
-
-$$(GEN): PRIVATE_PATH := $$(LOCAL_PATH)
-$$(GEN): PRIVATE_CUSTOM_TOOL := $$(EMUGL_EMUGEN) -W $$1 -i $$2 $$3
-$$(GEN): $$(EMUGL_EMUGEN) $$(_emugl_src).attrib $$(_emugl_src).in $$(_emugl_src).types
- $$(transform-generated-source)
-
-$$(call emugl-export,ADDITIONAL_DEPENDENCIES,$$(GEN))
-LOCAL_GENERATED_SOURCES += $$(GEN)
-LOCAL_C_INCLUDES += $$1
-
-#ifneq ($$(HOST_OS),windows)
-$$(call emugl-export,LDFLAGS,-ldl)
-#endif
-
-endef
-
-# Call this function when your shared library must be placed in a non-standard
-# library path (i.e. not under /system/lib
-# $1: library sub-path,relative to /system/lib
-# For example: $(call emugl-set-shared-library-subpath,egl)
-
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 21 && echo PreLollipop),PreLollipop)
- emugl-set-shared-library-subpath = \
- $(eval LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$1)\
- $(eval LOCAL_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/$1)\
- $(eval _emugl.$(LOCAL_MODULE).moved := true)\
- $(call emugl-export-outer,ADDITIONAL_DEPENDENCIES,$(LOCAL_MODULE_PATH)/$(LOCAL_MODULE)$(TARGET_SHLIB_SUFFIX))
-else
- emugl-set-shared-library-subpath = \
- $(eval LOCAL_MODULE_RELATIVE_PATH := $1)\
- $(eval _emugl.$(LOCAL_MODULE).moved := true)
-endif
-