[PATCH] gbuild: awful path hackery to fix cygwin paths

Michael Stahl mstahl at redhat.com
Thu May 3 04:24:42 PDT 2012


---
 solenv/gbuild/Helper.mk                 |   14 +++++++++++++-
 solenv/gbuild/platform/WNT_INTEL_MSC.mk |    2 ++
 solenv/gbuild/platform/com_GCC_defs.mk  |    2 ++
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 495a3e0..4c00b45 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -56,14 +56,26 @@ endef
 # First convert to unix style to avoid problems when
 # $(SRCDIR) is substring of $(gb_Helper_SRCDIR_NATIVE)
 # and $(1) already contains $(gb_Helper_SRCDIR_NATIVE)
+ifeq ($(subst $(SRCDIR),,$(OUTDIR)),$(OUTDIR))
 define gb_Helper_native_path
-$(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE),$(call gb_Helper_unix_path,$(1)))
+$(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE),$(subst $(WORKDIR),$(gb_Helper_WORKDIR_NATIVE),$(subst $(OUTDIR),$(gb_Helper_OUTDIR_NATIVE),$(call gb_Helper_unix_path,$(1)))))
 endef
+else
+define gb_Helper_native_path
+$(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE),$(1))
+endef
+endif
 
 # $(gb_Helper_SRCDIR_NATIVE) can't be substring of $(SRCDIR)
+ifeq ($(subst $(SRCDIR),,$(OUTDIR)),$(OUTDIR))
+define gb_Helper_unix_path
+$(subst $(gb_Helper_SRCDIR_NATIVE),$(SRCDIR),$(subst $(gb_Helper_OUTDIR_NATIVE),$(OUTDIR),$(subst $(gb_Helper_WORKDIR_NATIVE),$(WORKDIR),$(1))))
+endef
+else
 define gb_Helper_unix_path
 $(subst $(gb_Helper_SRCDIR_NATIVE),$(SRCDIR),$(1))
 endef
+endif
 
 define gb_Helper_make_clean_target
 gb_$(1)_get_clean_target = $(WORKDIR)/Clean/$(1)/$$(1)
diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
index 9ee08e2..8100c07 100644
--- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
@@ -245,6 +245,8 @@ endif
 gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/bin
 gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/bin
 gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR))
+gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR))
+gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR))
 
 gb_Helper_set_ld_path := PATH="$${PATH}:$(OUTDIR)/bin"
 
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index d84ab64..ea15b69 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -165,5 +165,7 @@ endef
 gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/lib
 gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/lib
 gb_Helper_SRCDIR_NATIVE := $(SRCDIR)
+gb_Helper_OUTDIR_NATIVE := $(OUTDIR)
+gb_Helper_WORKDIR_NATIVE := $(WORKDIR)
 
 gb_Helper_get_rcfile = $(1)rc
-- 
1.7.7.6


--------------000906040402030207020502--



More information about the LibreOffice mailing list