This file is indexed.

/usr/share/boost-build/src/tools/clang-win.jam is in libboost1.65-tools-dev 1.65.1+dfsg-0ubuntu5.

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
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Copyright Vladimir Prus 2004.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)

# Importing common is needed because the rules we inherit here depend on it.
# That is nasty.
import common ;
import errors ;
import feature ;
import clang ;
import msvc ;
import os ;
import toolset ;
import generators ;
import type ;
import path ;
import set ;

feature.extend-subfeature toolset clang : platform : win ;

toolset.inherit-generators clang-win <toolset>clang <toolset-clang:platform>win : msvc ;
toolset.inherit-flags clang-win : msvc : <debug-symbols>on/<debug-store>object <asynch-exceptions>off <asynch-exceptions>on : YLOPTION ;
toolset.inherit-rules clang-win : msvc ;

# Override default do-nothing generators.
generators.override clang-win.compile.c.pch   : pch.default-c-pch-generator   ;
generators.override clang-win.compile.c++.pch : pch.default-cpp-pch-generator ;
generators.override clang-win.compile.rc : rc.compile.resource ;
generators.override clang-win.compile.mc : mc.compile ;

toolset.flags clang-win.compile PCH_SOURCE <pch>on : <pch-source> ;

toolset.flags clang-win.compile CFLAGS <debug-symbols>on/<debug-store>object : "" ;

# Initializes the intel toolset for windows
rule init ( version ? :     # the compiler version
            command * :     # the command to invoke the compiler itself
            options *       # Additional option: <compatibility>
                            # either 'vc6', 'vc7', 'vc7.1'
                            # or 'native'(default).
          )
{
    local compatibility =
      [ feature.get-values <compatibility> : $(options) ] ;
    local condition = [  common.check-init-parameters clang-win
        : version $(version) : compatibility $(compatibility) ] ;
        
    if ! $(compatibility)
    {
        import errors ;
        errors.error "Please set <compatibility> property for visual studio version!" ;
    }
    local vc_version = [ MATCH vc([0-9]+) : $(compatibility) ] ;
    if ! $(vc_version)
    {
        errors.user-error "Invalid value for compatibility option:"
            $(compatibility) ;
    }
        
    local m = [ MATCH ([0-9]+).* : $(version) ] ;
    local major = $(m[1]) ;
    
    command = [ common.get-invocation-command clang-win : clang-cl.exe :
        $(command) ] ;
        
    common.handle-options clang-win : $(condition) : $(command) : $(options) ;
    
    local setup ;
    setup = [ get-visual-studio-vcvars $(vc_version) ] ; # Get visual studio vcvars bat file path
    
    local target_types ;
    if [ MATCH ^(AMD64) : [ os.environ PROCESSOR_ARCHITECTURE ] ]
    {
        target_types = x86 amd64 ;
    }
    else
    {
        target_types = x86 x86_amd64 ;
    }
    
    for local c in $(target_types)
    {
        local cpu-conditions ;
        local setup-call ;
        setup-call = "call \""$(setup)"\" $(c) > nul " ;
        cpu-conditions = $(condition)/$(.cpu-arch-$(c)) ;
        
        if [ os.name ] = NT
        {
            setup-call = $(setup-call)"
    " ;
        }
        else
        {
            setup-call = "cmd /S /C "$(setup-call)" \"&&\" " ;
        }
        
        if $(.debug-configuration)
        {
            for local cpu-condition in $(cpu-conditions)
            {
                ECHO "notice: [clang-cfg] condition: '$(cpu-condition)', setup: '$(setup-call)'" ;
            }
        }
        
        local compiler ;
        compiler = [ path.native $(command) ] ;
        compiler = "\"$(compiler)\"" ;

        toolset.flags clang-win.compile .CC $(cpu-conditions) : $(setup-call)$(compiler) ;
        toolset.flags clang-win.link .LD $(cpu-conditions) : $(setup-call)link /nologo ;
        toolset.flags clang-win.archive .LD $(cpu-conditions) : $(setup-call)link /lib /nologo ;
        toolset.flags clang-win.link .MT $(cpu-conditions) : $(setup-call)mt -nologo ;
        toolset.flags clang-win.compile .MC $(cpu-conditions) : $(setup-call)mc ;
        toolset.flags clang-win.compile .RC $(cpu-conditions) : $(setup-call)rc ;
    }


    local C++FLAGS ;
    
    if $(vc_version) = 10
    {
        C++FLAGS += -fmsc-version=1600 ;
    }
    else if $(vc_version) = 11
    {
        C++FLAGS += -fmsc-version=1700 ;
    }
    else if $(vc_version) = 12
    {
        C++FLAGS += -fmsc-version=1800 ;
    }

    toolset.flags clang-win CFLAGS $(condition) : $(C++FLAGS) ;

    msvc.configure-version-specific clang-win : $(vc_version) : $(condition) ;
}

local rule get-visual-studio-vcvars ( version )
{
    local env_variable_name ;
    env_variable_name = "VS"$(version:U)"0COMNTOOLS" ;
    
    local vc-path = [ os.environ $(env_variable_name) ] ;
    vc-path = [ path.join $(vc-path) "../../VC/vcvarsall.bat" ] ;
    path.native $(vc-path) ;
}


if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
{
    .debug-configuration = true ;
}

# Copied from msvc.jam
# Supported CPU architectures.
.cpu-arch-x86 =
    <architecture>/<address-model>
    <architecture>/<address-model>32
    <architecture>x86/<address-model>
    <architecture>x86/<address-model>32 ;

.cpu-arch-amd64 =
    <architecture>/<address-model>64
    <architecture>x86/<address-model>64 ;

.cpu-arch-x86_amd64 =
    <architecture>/<address-model>64
    <architecture>x86/<address-model>64 ;

# toolset.flags clang-win.link LIBRARY_OPTION <toolset>clang : "" ;

toolset.flags clang-win YLOPTION ;