From 29849aca0fed3dc4fb3fa9941a251c86bd3713f9 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Wed, 15 Jul 2020 22:26:44 +0300 Subject: [PATCH] Android: Fixes for Q and R Fix Android-Q build: - Use AOSP prebuilt bison by specifying $(BISON) variable - Use AOSP prebuilt flex by specifying $(LEX) variable Fix Android-R build: - Add M4 environmet variable for Android R and higher (See [1]) [1] - https://cs.android.com/android/_/android/platform/build/+/2bfffb9f48a78de12faf5da77424c0cecb70d6eb:Changes.md;dlc=997661002af1282d938e88c3c723037e42e5d283 Signed-off-by: Roman Stratiienko Reviewed-by: Eric Engestrom Tested-by: Mauro Rossi Part-of: --- Android.mk | 5 +++++ src/compiler/Android.glsl.gen.mk | 2 +- src/freedreno/Android.ir3.mk | 6 +++--- src/mesa/program/Android.mk | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Android.mk b/Android.mk index c15c2b78bac..6181bbe8f31 100644 --- a/Android.mk +++ b/Android.mk @@ -44,6 +44,11 @@ MESA_DRI_LDFLAGS := -Wl,--build-id=sha1 MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk MESA_PYTHON2 := python MESA_PYTHON3 := python3 +ifeq ($(filter 5 6 7 8 9 10, $(MESA_ANDROID_MAJOR_VERSION)),) +MESA_LEX := M4=$(M4) $(LEX) +else +MESA_LEX := $(LEX) +endif # Lists to convert driver names to boolean variables # in form of . diff --git a/src/compiler/Android.glsl.gen.mk b/src/compiler/Android.glsl.gen.mk index 1308de2db97..a32c4ca6a50 100644 --- a/src/compiler/Android.glsl.gen.mk +++ b/src/compiler/Android.glsl.gen.mk @@ -53,7 +53,7 @@ MESA_GEN_GLSL_H := $(addprefix $(call local-generated-sources-dir)/, \ define local-l-or-ll-to-c-or-cpp @mkdir -p $(dir $@) @echo "Mesa Lex: $(PRIVATE_MODULE) <= $<" - $(hide) $(LEX) --nounistd -o$@ $< + $(hide) $(MESA_LEX) --nounistd -o$@ $< endef define glsl_local-y-to-c-and-h diff --git a/src/freedreno/Android.ir3.mk b/src/freedreno/Android.ir3.mk index dec251798aa..3ae72dfea10 100644 --- a/src/freedreno/Android.ir3.mk +++ b/src/freedreno/Android.ir3.mk @@ -73,7 +73,7 @@ ir3_parser_deps := \ $(intermediates)/ir3/ir3_lexer.c: $(ir3_lexer_deps) @mkdir -p $(dir $@) @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" - $(hide) flex -o $@ $< + $(hide) $(MESA_LEX) -o $@ $< $(intermediates)/ir3/ir3_nir_imul.c: $(ir3_nir_imul_deps) @mkdir -p $(dir $@) @@ -86,12 +86,12 @@ $(intermediates)/ir3/ir3_nir_trig.c: $(ir3_nir_trig_deps) $(intermediates)/ir3/ir3_parser.c: $(ir3_parser_deps) @mkdir -p $(dir $@) @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" - $(hide) bison $< --name-prefix=ir3_yy --output=$@ + $(hide) $(BISON) $< --name-prefix=ir3_yy --output=$@ $(intermediates)/ir3/ir3_parser.h: $(ir3_parser_deps) @mkdir -p $(dir $@) @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" - $(hide) bison $< --name-prefix=ir3_yy --defines=$@ + $(hide) $(BISON) $< --name-prefix=ir3_yy --defines=$@ include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/src/mesa/program/Android.mk b/src/mesa/program/Android.mk index c6470e6289e..6b4e1916747 100644 --- a/src/mesa/program/Android.mk +++ b/src/mesa/program/Android.mk @@ -23,7 +23,7 @@ LOCAL_PATH := $(call my-dir) define local-l-to-c @mkdir -p $(dir $@) @echo "Mesa Lex: $(PRIVATE_MODULE) <= $<" - $(hide) $(LEX) -o$@ $< + $(hide) $(MESA_LEX) -o$@ $< endef define mesa_local-y-to-c-and-h -- 2.30.2