Skip to content

Commit

Permalink
core: Prefix and build bison host executable if needed
Browse files Browse the repository at this point in the history
This patch prefixed bison with HOST_OUT_EXECUTABLES to ensure using our
`bison` built from source. It also added bison to be a depencency of %.y
and %.yy tasks so that it will be built if needed without any manual
`mka bison`.

Conflicts:
	core/config.mk
Change-Id: Ic207124965c704b3f350e96b58d8e1f2683c2601
  • Loading branch information
xingrz authored and semdoc committed Nov 18, 2017
1 parent c6cde8c commit 65780e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/binary.mk
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ y_yacc_cs := $(addprefix \
ifneq ($(y_yacc_cs),)
$(y_yacc_cs): $(intermediates)/%.c: \
$(TOPDIR)$(LOCAL_PATH)/%.y \
$(my_additional_dependencies)
$(my_additional_dependencies) | $(BISON)
$(call transform-y-to-c-or-cpp)
$(call track-src-file-gen,$(y_yacc_sources),$(y_yacc_cs))

Expand All @@ -904,7 +904,7 @@ yy_yacc_cpps := $(addprefix \
ifneq ($(yy_yacc_cpps),)
$(yy_yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
$(TOPDIR)$(LOCAL_PATH)/%.yy \
$(my_additional_dependencies)
$(my_additional_dependencies) | $(BISON)
$(call transform-y-to-c-or-cpp)
$(call track-src-file-gen,$(yy_yacc_sources),$(yy_yacc_cpps))

Expand Down
3 changes: 3 additions & 0 deletions core/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,9 @@ endif
# To run bison from elsewhere you need to set up enviromental variable
# BISON_PKGDATADIR.
BISON_PKGDATADIR := $(PWD)/external/bison/data
ifeq ($(USE_HOST_BISON),yes)
BISON := $(HOST_OUT_EXECUTABLES)/bison
else
BISON := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/bison/bison
YACC := $(BISON) -d

Expand Down

0 comments on commit 65780e2

Please sign in to comment.