summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2016-09-01 14:06:23 -0500
committerEmil Velikov <emil.l.velikov@gmail.com>2016-09-06 15:58:55 +0100
commit244f0aba16a7e197ed30e118a9978e200aee2c64 (patch)
tree45216f18124de9ea0d07f9694a43e35f34e6ee18
parent2593354643b4bad26cd23b72a5e7073b4cad8cd0 (diff)
downloadexternal_mesa3d-244f0aba16a7e197ed30e118a9978e200aee2c64.tar.gz
external_mesa3d-244f0aba16a7e197ed30e118a9978e200aee2c64.tar.bz2
external_mesa3d-244f0aba16a7e197ed30e118a9978e200aee2c64.zip
Android: glsl: add rules to generate ir_expression*.h header files
Recent changes to generate ir_expression*.h header files broke Android builds. This adds the generation rules. This change is complicated due to creating a circular dependency between libmesa_glsl, libmesa_nir, and libmesa_compiler. Normally, we add static libraries so that include paths are added even if there's no linking dependency. That is the case here. Instead, we explicitly add the include path using $(MESA_GEN_GLSL_H) to libmesa_compiler. This in turn requires shuffling the order of make includes. It also uncovered missing dependency tracking of glsl_parser.h. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
-rw-r--r--src/compiler/Android.glsl.gen.mk25
-rw-r--r--src/compiler/Android.glsl.mk1
-rw-r--r--src/compiler/Android.mk12
-rw-r--r--src/mesa/Android.libmesa_dricore.mk6
-rw-r--r--src/mesa/Android.libmesa_st_mesa.mk4
-rw-r--r--src/mesa/program/Android.mk6
6 files changed, 45 insertions, 9 deletions
diff --git a/src/compiler/Android.glsl.gen.mk b/src/compiler/Android.glsl.gen.mk
index 157aa278b3..d7623e5781 100644
--- a/src/compiler/Android.glsl.gen.mk
+++ b/src/compiler/Android.glsl.gen.mk
@@ -41,6 +41,15 @@ LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
$(LIBGLCPP_GENERATED_FILES) \
$(LIBGLSL_GENERATED_FILES))
+LOCAL_EXPORT_C_INCLUDE_DIRS += \
+ $(intermediates)/glsl \
+
+# Modules using libmesa_nir must set LOCAL_GENERATED_SOURCES to this
+MESA_GEN_GLSL_H := $(addprefix $(call local-generated-sources-dir)/, \
+ glsl/ir_expression_operation.h \
+ glsl/ir_expression_operation_constant.h \
+ glsl/ir_expression_operation_strings.h)
+
define local-l-or-ll-to-c-or-cpp
@mkdir -p $(dir $@)
@echo "Mesa Lex: $(PRIVATE_MODULE) <= $<"
@@ -73,8 +82,24 @@ $(intermediates)/glsl/glsl_lexer.cpp: $(LOCAL_PATH)/glsl/glsl_lexer.ll
$(intermediates)/glsl/glsl_parser.cpp: $(LOCAL_PATH)/glsl/glsl_parser.yy
$(call local-yy-to-cpp-and-h,.cpp)
+$(intermediates)/glsl/glsl_parser.h: $(intermediates)/glsl/glsl_parser.cpp
+
$(intermediates)/glsl/glcpp/glcpp-lex.c: $(LOCAL_PATH)/glsl/glcpp/glcpp-lex.l
$(call local-l-or-ll-to-c-or-cpp)
$(intermediates)/glsl/glcpp/glcpp-parse.c: $(LOCAL_PATH)/glsl/glcpp/glcpp-parse.y
$(call glsl_local-y-to-c-and-h)
+
+$(LOCAL_PATH)/glsl/ir.h: $(intermediates)/glsl/ir_expression_operation.h
+
+$(intermediates)/glsl/ir_expression_operation.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
+ @mkdir -p $(dir $@)
+ $(hide) $(MESA_PYTHON2) $< enum > $@
+
+$(intermediates)/glsl/ir_expression_operation_constant.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
+ @mkdir -p $(dir $@)
+ $(hide) $(MESA_PYTHON2) $< constant > $@
+
+$(intermediates)/glsl/ir_expression_operation_strings.h: $(LOCAL_PATH)/glsl/ir_expression_operation.py
+ @mkdir -p $(dir $@)
+ $(hide) $(MESA_PYTHON2) $< strings > $@
diff --git a/src/compiler/Android.glsl.mk b/src/compiler/Android.glsl.mk
index 21c1065a1b..dcc356f185 100644
--- a/src/compiler/Android.glsl.mk
+++ b/src/compiler/Android.glsl.mk
@@ -44,7 +44,6 @@ LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/gallium/auxiliary
LOCAL_STATIC_LIBRARIES := \
- libmesa_compiler \
libmesa_nir
LOCAL_MODULE := libmesa_glsl
diff --git a/src/compiler/Android.mk b/src/compiler/Android.mk
index ac0ced5833..1e81ca5464 100644
--- a/src/compiler/Android.mk
+++ b/src/compiler/Android.mk
@@ -22,7 +22,8 @@
LOCAL_PATH := $(call my-dir)
-include $(LOCAL_PATH)/Makefile.sources
+include $(LOCAL_PATH)/Android.glsl.mk
+include $(LOCAL_PATH)/Android.nir.mk
# ---------------------------------------
# Build libmesa_compiler
@@ -30,19 +31,22 @@ include $(LOCAL_PATH)/Makefile.sources
include $(CLEAR_VARS)
+include $(LOCAL_PATH)/Makefile.sources
LOCAL_SRC_FILES := $(LIBCOMPILER_FILES)
LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa \
$(MESA_TOP)/src/gallium/include \
- $(MESA_TOP)/src/gallium/auxiliary
+ $(MESA_TOP)/src/gallium/auxiliary \
+ $(dir $(MESA_GEN_GLSL_H))
+
+LOCAL_GENERATED_SOURCES += \
+ $(MESA_GEN_GLSL_H)
LOCAL_MODULE := libmesa_compiler
include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)
-include $(LOCAL_PATH)/Android.glsl.mk
-include $(LOCAL_PATH)/Android.nir.mk
diff --git a/src/mesa/Android.libmesa_dricore.mk b/src/mesa/Android.libmesa_dricore.mk
index d7647a76bd..86196ceb36 100644
--- a/src/mesa/Android.libmesa_dricore.mk
+++ b/src/mesa/Android.libmesa_dricore.mk
@@ -60,7 +60,11 @@ LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/mesa/main \
$(MESA_TOP)/src/compiler/nir \
$(MESA_TOP)/src/gallium/include \
- $(MESA_TOP)/src/gallium/auxiliary
+ $(MESA_TOP)/src/gallium/auxiliary \
+ $(dir $(MESA_GEN_GLSL_H))
+
+LOCAL_GENERATED_SOURCES += \
+ $(MESA_GEN_GLSL_H)
LOCAL_WHOLE_STATIC_LIBRARIES += \
libmesa_program
diff --git a/src/mesa/Android.libmesa_st_mesa.mk b/src/mesa/Android.libmesa_st_mesa.mk
index 785b6de25c..3905ddcf24 100644
--- a/src/mesa/Android.libmesa_st_mesa.mk
+++ b/src/mesa/Android.libmesa_st_mesa.mk
@@ -40,6 +40,8 @@ LOCAL_MODULE := libmesa_st_mesa
LOCAL_SRC_FILES := \
$(MESA_GALLIUM_FILES)
+LOCAL_GENERATED_SOURCES := $(MESA_GEN_GLSL_H)
+
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
ifeq ($(TARGET_ARCH),x86)
LOCAL_SRC_FILES += $(X86_FILES)
@@ -63,7 +65,7 @@ LOCAL_C_INCLUDES := \
LOCAL_WHOLE_STATIC_LIBRARIES += \
libmesa_program
-LOCAL_STATIC_LIBRARIES += libmesa_nir
+LOCAL_STATIC_LIBRARIES += libmesa_nir libmesa_glsl
include $(LOCAL_PATH)/Android.gen.mk
include $(MESA_COMMON_MK)
diff --git a/src/mesa/program/Android.mk b/src/mesa/program/Android.mk
index 6f485439d6..c6470e6289 100644
--- a/src/mesa/program/Android.mk
+++ b/src/mesa/program/Android.mk
@@ -44,7 +44,8 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libmesa_program
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_STATIC_LIBRARIES := libmesa_nir
+LOCAL_STATIC_LIBRARIES := libmesa_nir \
+ libmesa_glsl
intermediates := $(call local-generated-sources-dir)
@@ -80,7 +81,8 @@ LOCAL_C_INCLUDES := \
LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
-LOCAL_GENERATED_SOURCES += $(MESA_GEN_NIR_H)
+LOCAL_GENERATED_SOURCES += $(MESA_GEN_NIR_H) \
+ $(MESA_GEN_GLSL_H)
include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)