From 85df6265d11148d11a8a35acf06715ddc412f692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Tue, 14 Aug 2012 05:13:21 +0000 Subject: [PATCH] Quick & dirty fix to make Boost Build construct consistent Jamfile module names in cases when they are requested via different but equivalent location paths, e.g. 'd:/fOO' and 'D:\Foo\Bar\..'. This should fix currently reported Boost library documentation build failures but the used path normalization implementation still needs to be cleaned up. [SVN r80026] --- v2/build/project.jam | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/v2/build/project.jam b/v2/build/project.jam index 960d1283e..208dd14e8 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -166,6 +166,22 @@ rule module-name ( jamfile-location ) # Root the path, so that locations are always unambiguous. Without this, # we can not decide if '../../exe/program1' and '.' are the same paths. local normalized = [ path.root $(jamfile-location) [ path.pwd ] ] ; + + # Quick & dirty fix to get the same module name when we supply two + # equivalent location paths, e.g. 'd:\Foo' & 'D:\fOo\bar\..' on Windows. + # Note that our current implementation will not work correctly if the + # given location references an empty folder, but in that case any later + # attempt to load a Jamfile from this location will fail anyway. + # FIXME: Implement this cleanly. Support for this type of path + # normalization already exists internally in Boost Jam and the current + # fix relies on the GLOB builtin rule using that support. Most likely we + # just need to add a new builtin rule to do this explicitly. + normalized = [ NORMALIZE_PATH $(normalized) ] ; + local glob-result = [ GLOB [ path.native $(normalized) ] : * ] ; + if $(glob-result) + { + normalized = $(glob-result[1]:D) ; + } .module.$(jamfile-location) = Jamfile<$(normalized)> ; } return $(.module.$(jamfile-location)) ;