diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-08-20 17:24:12 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-08-20 17:24:12 -0500 |
commit | 105ed49aca83e88a4f8e11d0815e2f275bd8939e (patch) | |
tree | 1107c02bc609e11ef718e9975fd8ab6e3fa959f8 /solenv | |
parent | 0c2876b7f4d74c678d328e1064301962766dae11 (diff) |
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.
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 12 | ||||
-rw-r--r-- | solenv/gbuild/platform/macosx.mk | 26 | ||||
-rw-r--r-- | solenv/gbuild/platform/unxgcc.mk | 11 | ||||
-rw-r--r-- | solenv/gbuild/platform/windows.mk | 11 |
4 files changed, 51 insertions, 9 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index cc999a7ce6be..7e626e370402 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -229,14 +229,8 @@ gb_YaccObject_get_grammar = $(1)/$(2).y gb_YACC := bison # YaccObject class -define gb_YaccObject__command -$(call gb_Output_announce,$(2),$(true),YAC,3) -$(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(dir $(1)) && \ - $(gb_YACC) $(T_YACCFLAGS) -d -o $(1) $(3) ) - -endef - +# defined by platform +# gb_YaccObject__command(grammar-file, stem-for-message, source-target, include-target) # ObjCxxObject class # @@ -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_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__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 define gb_LinkTarget_add_noexception_object diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 5f9fe9e4e509..e89692b9abde 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -38,6 +38,7 @@ gb_GCCP := gcc gb_AR := ar gb_AWK := awk gb_CLASSPATHSEP := : +gb_YACC := bison # use CC/CXX if they are nondefaults ifneq ($(origin CC),default) @@ -163,7 +164,32 @@ define gb_Helper_convert_native $(1) 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 define gb_CObject__command diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index 74276dd08e3b..d82c12112689 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -37,6 +37,7 @@ gb_GCCP := gcc gb_AR := ar gb_AWK := awk gb_CLASSPATHSEP := : +gb_YACC := bison # use CC/CXX if they are nondefaults ifneq ($(origin CC),default) @@ -186,6 +187,16 @@ define gb_Helper_convert_native $(1) 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 # $(call gb_CObject__command,object,relative-source,source,dep-file) diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk index 93d0df271972..e69643f36fa6 100644 --- a/solenv/gbuild/platform/windows.mk +++ b/solenv/gbuild/platform/windows.mk @@ -39,6 +39,7 @@ gb_LINK := link gb_AWK := awk gb_CLASSPATHSEP := ; gb_RC := rc +gb_YACC := bison # use CC/CXX if they are nondefaults ifneq ($(origin CC),default) @@ -260,6 +261,16 @@ $(patsubst $(SRCDIR)%,$(gb_Helper_SRCDIR_NATIVE)%, \ $(1))))) 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 define gb_CObject__command |