[Libreoffice-commits] .: solenv/gbuild
Matus Kukan
mkukan at kemper.freedesktop.org
Fri Apr 13 02:19:51 PDT 2012
solenv/gbuild/Helper.mk | 17 ++++++++++++++++-
solenv/gbuild/platform/WNT_INTEL_MSC.mk | 7 +------
solenv/gbuild/platform/com_GCC_defs.mk | 8 ++------
3 files changed, 19 insertions(+), 13 deletions(-)
New commits:
commit 8fd5ba3749aa740b3c060db775b42f15a5ce50a7
Author: Matúš Kukan <matus.kukan at gmail.com>
Date: Fri Apr 13 11:18:26 2012 +0200
gbuild: improve handling of paths
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 3d41f77..e5106db 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -43,13 +43,28 @@ $(gb_Helper_MISCDUMMY) :
define gb_Helper_abbreviate_dirs
S=$(SRCDIR) && \
$(subst $(SRCDIR)/,$$S/,O=$(OUTDIR)) && \
-$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,W=$(WORKDIR) && $(subst $(WORKDIR)/,$$W/,$(1))))
+$(subst $(SRCDIR)/,$$S/,W=$(WORKDIR)) && \
+$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,$(subst $(WORKDIR)/,$$W/,\
+$(call gb_Helper_unix_path,$(1)))))
endef
define gb_Helper_abbreviate_dirs_native
$(call gb_Helper_native_path,$(call gb_Helper_abbreviate_dirs,$(1)))
endef
+# Convert path to native notation
+# 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)
+define gb_Helper_native_path
+$(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE),$(call gb_Helper_unix_path,$(1)))
+endef
+
+# $(gb_Helper_SRCDIR_NATIVE) can't be substring of $(SRCDIR)
+define gb_Helper_unix_path
+$(subst $(gb_Helper_SRCDIR_NATIVE),$(SRCDIR),$(1))
+endef
+
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 fff0b8a..a6d88ff 100644
--- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
@@ -244,15 +244,10 @@ 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_set_ld_path := PATH="$${PATH}:$(OUTDIR)/bin"
-gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR))
-# Convert path to native notation
-define gb_Helper_native_path
-$(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE),$(1))
-endef
-
# Convert path to file URL.
define gb_Helper_make_url
file:///$(strip $(1))
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 8287624..cf4dcab 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -115,7 +115,7 @@ gb_COMPILERNOOPTFLAGS := -O0
gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC)))
gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
-
+# Helper class
ifeq ($(OS_FOR_BUILD),MACOSX)
gb_Helper_LIBRARY_PATH_VAR := DYLD_LIBRARY_PATH
@@ -134,11 +134,6 @@ define gb_Helper_extend_ld_path
$(gb_Helper_set_ld_path)$(foreach dir,$(1),:$(dir))
endef
-# Convert path to native notation
-define gb_Helper_native_path
-$(1)
-endef
-
# Convert path to file URL.
define gb_Helper_make_url
file://$(strip $(1))
@@ -146,5 +141,6 @@ endef
gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/lib
gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/lib
+gb_Helper_SRCDIR_NATIVE := $(SRCDIR)
gb_Helper_get_rcfile = $(1)rc
More information about the Libreoffice-commits
mailing list