Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38dc09d3 authored by Dan Willemsen's avatar Dan Willemsen
Browse files

Use our prebuilt M4 for flex and bison

And ensure we've got all the proper dependencies.

Bug: 117561006
Test: treehugger
Change-Id: Ia9690b2c0d73a48744c8e33fe83196d02b1e904d
parent 3801c82e
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -816,7 +816,7 @@ y_yacc_cs := $(addprefix \
    $(intermediates)/,$(y_yacc_sources:.y=.c))
    $(intermediates)/,$(y_yacc_sources:.y=.c))
ifneq ($(y_yacc_cs),)
ifneq ($(y_yacc_cs),)
$(y_yacc_cs): $(intermediates)/%.c: \
$(y_yacc_cs): $(intermediates)/%.c: \
    $(TOPDIR)$(LOCAL_PATH)/%.y $(BISON) $(BISON_DATA) \
    $(TOPDIR)$(LOCAL_PATH)/%.y $(BISON) $(BISON_DATA) $(M4) \
    $(my_additional_dependencies)
    $(my_additional_dependencies)
	$(call transform-y-to-c-or-cpp)
	$(call transform-y-to-c-or-cpp)
$(call track-src-file-gen,$(y_yacc_sources),$(y_yacc_cs))
$(call track-src-file-gen,$(y_yacc_sources),$(y_yacc_cs))
@@ -829,7 +829,7 @@ yy_yacc_cpps := $(addprefix \
    $(intermediates)/,$(yy_yacc_sources:.yy=$(LOCAL_CPP_EXTENSION)))
    $(intermediates)/,$(yy_yacc_sources:.yy=$(LOCAL_CPP_EXTENSION)))
ifneq ($(yy_yacc_cpps),)
ifneq ($(yy_yacc_cpps),)
$(yy_yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
$(yy_yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
    $(TOPDIR)$(LOCAL_PATH)/%.yy $(BISON) $(BISON_DATA) \
    $(TOPDIR)$(LOCAL_PATH)/%.yy $(BISON) $(BISON_DATA) $(M4) \
    $(my_additional_dependencies)
    $(my_additional_dependencies)
	$(call transform-y-to-c-or-cpp)
	$(call transform-y-to-c-or-cpp)
$(call track-src-file-gen,$(yy_yacc_sources),$(yy_yacc_cpps))
$(call track-src-file-gen,$(yy_yacc_sources),$(yy_yacc_cpps))
@@ -845,6 +845,7 @@ l_lex_sources := $(filter %.l,$(my_src_files))
l_lex_cs := $(addprefix \
l_lex_cs := $(addprefix \
    $(intermediates)/,$(l_lex_sources:.l=.c))
    $(intermediates)/,$(l_lex_sources:.l=.c))
ifneq ($(l_lex_cs),)
ifneq ($(l_lex_cs),)
$(l_lex_cs): $(LEX) $(M4)
$(l_lex_cs): $(intermediates)/%.c: \
$(l_lex_cs): $(intermediates)/%.c: \
    $(TOPDIR)$(LOCAL_PATH)/%.l
    $(TOPDIR)$(LOCAL_PATH)/%.l
	$(transform-l-to-c-or-cpp)
	$(transform-l-to-c-or-cpp)
@@ -857,6 +858,7 @@ ll_lex_sources := $(filter %.ll,$(my_src_files))
ll_lex_cpps := $(addprefix \
ll_lex_cpps := $(addprefix \
    $(intermediates)/,$(ll_lex_sources:.ll=$(LOCAL_CPP_EXTENSION)))
    $(intermediates)/,$(ll_lex_sources:.ll=$(LOCAL_CPP_EXTENSION)))
ifneq ($(ll_lex_cpps),)
ifneq ($(ll_lex_cpps),)
$(ll_lex_cpps): $(LEX) $(M4)
$(ll_lex_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
$(ll_lex_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
    $(TOPDIR)$(LOCAL_PATH)/%.ll
    $(TOPDIR)$(LOCAL_PATH)/%.ll
	$(transform-l-to-c-or-cpp)
	$(transform-l-to-c-or-cpp)
+1 −0
Original line number Original line Diff line number Diff line
@@ -553,6 +553,7 @@ BISON_PKGDATADIR := $(PWD)/prebuilts/build-tools/common/bison
BISON := $(prebuilt_build_tools_bin_noasan)/bison
BISON := $(prebuilt_build_tools_bin_noasan)/bison
YACC := $(BISON) -d
YACC := $(BISON) -d
BISON_DATA := $(wildcard $(BISON_PKGDATADIR)/* $(BISON_PKGDATADIR)/*/*)
BISON_DATA := $(wildcard $(BISON_PKGDATADIR)/* $(BISON_PKGDATADIR)/*/*)
M4 :=$= $(prebuilt_build_tools_bin_noasan)/m4


YASM := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/yasm/yasm
YASM := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/yasm/yasm


+2 −2
Original line number Original line Diff line number Diff line
@@ -889,7 +889,7 @@ endef
define transform-l-to-c-or-cpp
define transform-l-to-c-or-cpp
@echo "Lex: $(PRIVATE_MODULE) <= $<"
@echo "Lex: $(PRIVATE_MODULE) <= $<"
@mkdir -p $(dir $@)
@mkdir -p $(dir $@)
$(hide) $(LEX) -o$@ $<
M4=$(M4) $(LEX) -o$@ $<
endef
endef


###########################################################
###########################################################
@@ -900,7 +900,7 @@ endef
define transform-y-to-c-or-cpp
define transform-y-to-c-or-cpp
@echo "Yacc: $(PRIVATE_MODULE) <= $<"
@echo "Yacc: $(PRIVATE_MODULE) <= $<"
@mkdir -p $(dir $@)
@mkdir -p $(dir $@)
$(YACC) $(PRIVATE_YACCFLAGS) \
M4=$(M4) $(YACC) $(PRIVATE_YACCFLAGS) \
  --defines=$(basename $@).h \
  --defines=$(basename $@).h \
  -o $@ $<
  -o $@ $<
endef
endef