diff options
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/shortpath.cmd | 1 | ||||
-rw-r--r-- | solenv/gbuild/Helper.mk | 36 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_defs.mk | 8 |
3 files changed, 41 insertions, 4 deletions
diff --git a/solenv/bin/shortpath.cmd b/solenv/bin/shortpath.cmd new file mode 100644 index 000000000000..61109f7dc947 --- /dev/null +++ b/solenv/bin/shortpath.cmd @@ -0,0 +1 @@ +@echo %~s1 diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk index a0441dc3a2a2..0f54a81d2cb5 100644 --- a/solenv/gbuild/Helper.mk +++ b/solenv/gbuild/Helper.mk @@ -62,6 +62,42 @@ define gb_Helper_windows_path $(subst /,\\,$(1)) endef + +ifeq ($(OS),WNT) +# path-replacement optimizations, instead of calling cygpath/wslpath all the time, just do it once +# and then do all other path-replacements without the need to spawn processes/shells for that +SRCDIR_CYG := $(shell cygpath -u $(SRCDIR)) +BUILDDIR_CYG := $(shell cygpath -u $(BUILDDIR)) +INSTDIR_CYG := $(shell cygpath -u $(INSTDIR)) +WORKDIR_CYG := $(shell cygpath -u $(WORKDIR)) +TARFILE_LOCATION_CYG := $(shell cygpath -u $(TARFILE_LOCATION)) + +define gb_Helper_cyg_path +$(subst $(TARFILE_LOCATION)/,$(TARFILE_LOCATION_CYG)/,$(subst $(SRCDIR)/,$(SRCDIR_CYG)/,$(subst $(BUILDDIR)/,$(BUILDDIR_CYG)/,$(subst $(INSTDIR)/,$(INSTDIR_CYG)/,$(subst $(WORKDIR)/,$(WORKDIR_CYG)/,$(1)))))) +endef + +ifneq ($(MSYSTEM),) +# paths to reach into windows realm from within wsl +SRCDIR_WSL := $(shell $(WSL) wslpath -u $(SRCDIR)) +BUILDDIR_WSL := $(shell $(WSL) wslpath -u $(BUILDDIR)) +INSTDIR_WSL := $(shell $(WSL) wslpath -u $(INSTDIR)) +WORKDIR_WSL := $(shell $(WSL) wslpath -u $(WORKDIR)) +TARFILE_LOCATION_WSL := $(shell $(WSL) wslpath -u $(TARFILE_LOCATION)) + +define gb_Helper_wsl_path +$(subst $(TARFILE_LOCATION)/,$(TARFILE_LOCATION_WSL)/,$(subst $(SRCDIR)/,$(SRCDIR_WSL)/,$(subst $(BUILDDIR)/,$(BUILDDIR_WSL)/,$(subst $(INSTDIR)/,$(INSTDIR_WSL)/,$(subst $(WORKDIR)/,$(WORKDIR_WSL)/,$(1)))))) +endef +else +# not needed for cygwin +gb_Helper_wsl_path=$(1) +endif + +else +# noop for non-Windows +gb_Helper_wsl_path=$(1) +gb_Helper_cyg_path=$(1) +endif + define gb_Helper_make_clean_target gb_$(1)_get_clean_target = $(WORKDIR)/Clean/$(1)/$$(1) diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index e75fdcc171b1..871bbfdc6189 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -243,7 +243,7 @@ gb_COMPILERDEBUGOPTFLAGS := ifeq ($(gb_FULLDEPS),$(true)) gb_COMPILERDEPFLAGS := -showIncludes define gb_create_deps -| $(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3); exit $${PIPESTATUS[0]} +| $(call gb_Helper_cyg_path,$(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3)); exit $${PIPESTATUS[0]} endef else gb_COMPILERDEPFLAGS := @@ -317,15 +317,15 @@ endif # Helper class -gb_Helper_set_ld_path := PATH="$(shell cygpath -u $(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER)):$$PATH" +gb_Helper_set_ld_path := $(call gb_Helper_cyg_path,PATH="$(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER):$(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER):$$PATH") define gb_Helper_prepend_ld_path -PATH="$(shell cygpath -u $(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER)):$(1):$$PATH" +PATH="$(call gb_Helper_cyg_path,$(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER):$(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER):$(1):$$PATH") endef # $(1): one directory pathname to append to the ld path define gb_Helper_extend_ld_path -$(gb_Helper_set_ld_path)':$(shell cygpath -u $(1))' +$(gb_Helper_set_ld_path)':$(call gb_Helper_cyg_path,$(1))' endef # common macros to build GPG related libraries |