[Libreoffice-commits] .: solenv/gbuild
Norbert Thiebaud
nthiebaud at kemper.freedesktop.org
Sat Aug 20 15:24:29 PDT 2011
solenv/gbuild/LinkTarget.mk | 12 +++---------
solenv/gbuild/platform/macosx.mk | 26 ++++++++++++++++++++++++++
solenv/gbuild/platform/unxgcc.mk | 11 +++++++++++
solenv/gbuild/platform/windows.mk | 11 +++++++++++
4 files changed, 51 insertions(+), 9 deletions(-)
New commits:
commit 105ed49aca83e88a4f8e11d0815e2f275bd8939e
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sat Aug 20 17:24:12 2011 -0500
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.
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index cc999a7..7e626e3 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 5f9fe9e..e89692b 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 74276dd..d82c121 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 93d0df2..e69643f 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
More information about the Libreoffice-commits
mailing list