Kaydet (Commit) 105ed49a authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

move yacc command in platform/* due to Mac PPC ancient bison version.

Mac PPC has a very old bison that does not handle .cxx extension well
not does it support --defines=<file>. the result is that the generated
header is called <foo>.cxx.h instead of <foo>.hxx

To deal with that we moved the yacc rule in the platefrom dependent section
and added some renaming magic for the PowerPC case on MacOS.
üst 0c2876b7
...@@ -229,14 +229,8 @@ gb_YaccObject_get_grammar = $(1)/$(2).y ...@@ -229,14 +229,8 @@ gb_YaccObject_get_grammar = $(1)/$(2).y
gb_YACC := bison gb_YACC := bison
# YaccObject class # YaccObject class
define gb_YaccObject__command # defined by platform
$(call gb_Output_announce,$(2),$(true),YAC,3) # gb_YaccObject__command(grammar-file, stem-for-message, source-target, include-target)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(gb_YACC) $(T_YACCFLAGS) -d -o $(1) $(3) )
endef
# ObjCxxObject class # ObjCxxObject class
# #
...@@ -898,7 +892,7 @@ $(call gb_GenCxxObject_get_target,$(2)) : $(call gb_YaccObject_get_target_source ...@@ -898,7 +892,7 @@ $(call gb_GenCxxObject_get_target,$(2)) : $(call gb_YaccObject_get_target_source
$(call gb_LinkTarget_get_target,$(1)) : $(call gb_GenCxxObject_get_target,$(2)) $(call gb_LinkTarget_get_target,$(1)) : $(call gb_GenCxxObject_get_target,$(2))
$(call gb_GenCxxObject_get_target,$(2)) : $(call gb_YaccObject_get_target_source,$(2)) $(call gb_YaccObject_get_target_include,$(2)) $(call gb_GenCxxObject_get_target,$(2)) : $(call gb_YaccObject_get_target_source,$(2)) $(call gb_YaccObject_get_target_include,$(2))
$(call gb_YaccObject_get_target_source,$(2)) $(call gb_YaccObject_get_target_include,$(2)) : $(call gb_YaccObject_get_grammar,$(gb_REPOS),$(2)) $(call gb_YaccObject_get_target_source,$(2)) $(call gb_YaccObject_get_target_include,$(2)) : $(call gb_YaccObject_get_grammar,$(gb_REPOS),$(2))
$$(call gb_YaccObject__command,$$@,$(2),$$<) $$(call gb_YaccObject__command,$(call gb_YaccObject_get_grammar,$(gb_REPOS),$(2)),$(2),$(call gb_YaccObject_get_target_source,$(2)),$(call gb_YaccObject_get_target_include,$(2)))
endef endef
define gb_LinkTarget_add_noexception_object define gb_LinkTarget_add_noexception_object
......
...@@ -38,6 +38,7 @@ gb_GCCP := gcc ...@@ -38,6 +38,7 @@ gb_GCCP := gcc
gb_AR := ar gb_AR := ar
gb_AWK := awk gb_AWK := awk
gb_CLASSPATHSEP := : gb_CLASSPATHSEP := :
gb_YACC := bison
# use CC/CXX if they are nondefaults # use CC/CXX if they are nondefaults
ifneq ($(origin CC),default) ifneq ($(origin CC),default)
...@@ -163,7 +164,32 @@ define gb_Helper_convert_native ...@@ -163,7 +164,32 @@ define gb_Helper_convert_native
$(1) $(1)
endef endef
# YaccObject class
ifeq ($(CPUNAME),POWERPC)
#
# PowerPC mac version of bison is ancient. it does not handle well
# .cxx extension nor does it support --defines=<file>
# the result is that the header is named <foo>.cxx.h instead of <foo>.hxx
# so we queue a mv to rename the header accordingly.
#
define gb_YaccObject__command
$(call gb_Output_announce,$(2),$(true),YAC,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(3)) && \
$(gb_YACC) $(T_YACCFLAGS) -d -o $(3) $(1) && mv $(3).h $(4) )
endef
else
define gb_YaccObject__command
$(call gb_Output_announce,$(2),$(true),YAC,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(3)) && \
$(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(3) $(1) )
endef
endif
# CObject class # CObject class
define gb_CObject__command define gb_CObject__command
......
...@@ -37,6 +37,7 @@ gb_GCCP := gcc ...@@ -37,6 +37,7 @@ gb_GCCP := gcc
gb_AR := ar gb_AR := ar
gb_AWK := awk gb_AWK := awk
gb_CLASSPATHSEP := : gb_CLASSPATHSEP := :
gb_YACC := bison
# use CC/CXX if they are nondefaults # use CC/CXX if they are nondefaults
ifneq ($(origin CC),default) ifneq ($(origin CC),default)
...@@ -186,6 +187,16 @@ define gb_Helper_convert_native ...@@ -186,6 +187,16 @@ define gb_Helper_convert_native
$(1) $(1)
endef endef
# YaccObject class
define gb_YaccObject__command
$(call gb_Output_announce,$(2),$(true),YAC,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(3)) && \
$(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(3) $(1) )
endef
# CObject class # CObject class
# $(call gb_CObject__command,object,relative-source,source,dep-file) # $(call gb_CObject__command,object,relative-source,source,dep-file)
......
...@@ -39,6 +39,7 @@ gb_LINK := link ...@@ -39,6 +39,7 @@ gb_LINK := link
gb_AWK := awk gb_AWK := awk
gb_CLASSPATHSEP := ; gb_CLASSPATHSEP := ;
gb_RC := rc gb_RC := rc
gb_YACC := bison
# use CC/CXX if they are nondefaults # use CC/CXX if they are nondefaults
ifneq ($(origin CC),default) ifneq ($(origin CC),default)
...@@ -260,6 +261,16 @@ $(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \ ...@@ -260,6 +261,16 @@ $(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \
$(1))))) $(1)))))
endef endef
# YaccObject class
define gb_YaccObject__command
$(call gb_Output_announce,$(2),$(true),YAC,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(3)) && \
$(gb_YACC) $(T_YACCFLAGS) --defines=$(4) -o $(3) $(1) )
endef
# CObject class # CObject class
define gb_CObject__command define gb_CObject__command
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment