--- xulrunner-18.0/mozilla/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py.orig 2013-01-05 00:44:41.000000000 +0100 +++ xulrunner-18.0/mozilla/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py 2013-01-13 20:13:40.033894757 +0100 @@ -114,6 +114,12 @@ if dir and not os.path.exists(dir): os.makedirs(dir) +def append_relative(base, rel): + if rel == '': + return base + else: + return base + '/' + rel + def GetFlavor(params): """Returns |params.flavor| if it's set, the system's default flavor else.""" flavors = { @@ -142,9 +148,9 @@ def WriteMakefile(filename, data, build_file, depth, topsrcdir, srcdir, relative_path, extra_data=None): if not os.path.isabs(topsrcdir): - topsrcdir = depth + "/" + topsrcdir + topsrcdir = append_relative(depth, topsrcdir) if not os.path.isabs(srcdir): - srcdir = depth + "/" + srcdir + srcdir = append_relative(depth, srcdir) #TODO: should compare with the existing file and not overwrite it if the # contents are the same! ensure_directory_exists(filename) @@ -261,7 +267,7 @@ qualified_target) build_file = os.path.abspath(build_file) rel_path, output_file = self.CalculateMakefilePath(build_file, target) - subdepth = self.depth + "/" + getdepth(rel_path) + subdepth = append_relative(self.depth, getdepth(rel_path)) if self.WriteTargetMakefile(output_file, rel_path, qualified_target, spec, build_file, subdepth): # If WriteTargetMakefile returns True, then this is a useful target dirs.append(rel_path) @@ -399,7 +405,7 @@ # The relative path from objdir to gyp_file_dir srcdir = gyp.common.RelativePath(gyp_file_dir, objdir) # The absolute path to the source dir - abs_srcdir = topsrcdir + "/" + relative_srcdir + abs_srcdir = append_relative(topsrcdir, relative_srcdir) # The path to get up to the root of the objdir from the output dir. depth = getdepth(relative_srcdir) # The output directory. @@ -408,9 +414,9 @@ makefile_path = os.path.join(output_dir, "Makefile") def topsrcdir_path(path): - return "$(topsrcdir)/" + swapslashes(gyp.common.RelativePath(path, topsrcdir)) + return append_relative("$(topsrcdir)", swapslashes(gyp.common.RelativePath(path, topsrcdir))) def objdir_path(path): - return "$(DEPTH)/" + swapslashes(gyp.common.RelativePath(path, objdir)) + return append_relative("$(DEPTH)", swapslashes(gyp.common.RelativePath(path, objdir))) # Find the list of targets that derive from the gyp file(s) being built. needed_targets = set()