/usr/share/boost-build/src/tools/cygwin.jam is in libboost1.62-tools-dev 1.62.0+dfsg-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | # Copyright 2004 Vladimir Prus.
# Copyright 2016 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Provides utility functions for handling cygwin paths
import regex ;
.cygwin-drive-letter-re = ^/cygdrive/([a-z])/(.*) ;
# Like W32_GETREG, except prepend HKEY_CURRENT_USER\SOFTWARE and
# HKEY_LOCAL_MACHINE\SOFTWARE to the first argument, returning the first result
# found. Also accounts for the fact that on 64-bit machines, 32-bit software has
# its own area, under SOFTWARE\Wow6432node.
#
local rule software-registry-value ( path : data ? )
{
local result ;
for local root in HKEY_CURRENT_USER HKEY_LOCAL_MACHINE
{
for local x64elt in "" Wow6432node\\ # Account for 64-bit windows
{
if ! $(result)
{
result = [ W32_GETREG $(root)\\SOFTWARE\\$(x64elt)$(path) : $(data) ] ;
}
}
}
return $(result) ;
}
# :W only works in Cygwin builds of bjam. This one works on NT builds as well.
#
rule cygwin-to-windows-path ( path )
{
path = $(path:R="") ; # strip any trailing slash
local drive-letter = [ SUBST $(path) $(.cygwin-drive-letter-re) $1:/$2 ] ;
if $(drive-letter)
{
path = $(drive-letter) ;
}
else if $(path:R=/x) = $(path) # already rooted?
{
# Look for a cygwin mount that includes each head sequence in $(path).
local head = $(path) ;
local tail = "" ;
while $(head)
{
local root = [ software-registry-value
"Cygnus Solutions\\Cygwin\\mounts v2\\"$(head) : native ] ;
if $(root)
{
path = $(tail:R=$(root)) ;
head = ;
}
tail = $(tail:R=$(head:D=)) ;
if $(head) = /
{
head = ;
}
else
{
head = $(head:D) ;
}
}
}
return [ regex.replace $(path:R="") / \\ ] ;
}
|