Bug 506576 -- normalizepath normalizes MSYS paths without inserting a / in between when the first component of the path isn't an actual drive. r=ted
authorSiddharth Agarwal <sid.bugzilla@gmail.com>
Mon, 03 Aug 2009 21:46:05 +0530
changeset 31048 a85f2e5b3b2b34bee7e107c08507fc1aeb04927e
parent 31047 97ec2484a49abbb566d6f11ee5f8375257031424
child 31078 d300a47250567f64030455025a58b7a19626c163
push id8353
push usersid.bugzilla@gmail.com
push dateMon, 03 Aug 2009 16:17:30 +0000
treeherdermozilla-central@a85f2e5b3b2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs506576
milestone1.9.2a1pre
Bug 506576 -- normalizepath normalizes MSYS paths without inserting a / in between when the first component of the path isn't an actual drive. r=ted
config/rules.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1482,17 +1482,17 @@ normalizepath = $(foreach p,$(1),$(shell
 else
 # assume MSYS
 #  We use 'pwd -W' to get DOS form of the path.  However, since the given path
 #  could be a file or a non-existent path, we cannot call 'pwd -W' directly
 #  on the path.  Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
 #  on it, then merge with the rest of the path.
 root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\1|")
 non-root-path = $(shell echo $(1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\2|")
-normalizepath = $(foreach p,$(1),$(if $(filter /%,$(1)),$(shell cd $(call root-path,$(1)) && pwd -W)$(call non-root-path,$(1)),$(1)))
+normalizepath = $(foreach p,$(1),$(if $(filter /%,$(1)),$(patsubst %/,%,$(shell cd $(call root-path,$(1)) && pwd -W))/$(call non-root-path,$(1)),$(1)))
 endif
 else
 normalizepath = $(1)
 endif
 
 _srcdir = $(call normalizepath,$(srcdir))
 ifdef JAVA_SOURCEPATH
 SP = $(subst $(SPACE),$(SEP),$(call normalizepath,$(strip $(JAVA_SOURCEPATH))))