# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
+import common ;
import toolset ;
import feature ;
import toolset : flags ;
: $(command) ] ;
# Determine the version
- local command-string = $(command:J=" ") ;
-
if $(command) {
+ local command-string = \"$(command)\" ;
+ command-string = $(command-string:J=" ") ;
version ?= [ MATCH "version ([0-9.]+)"
: [ SHELL "$(command-string) --version" ] ] ;
}
common.handle-options clang-linux : $(condition) : $(command) : $(options) ;
- gcc.init-link-flags clang-linux gnu $(condition) ;
+ gcc.init-link-flags clang linux $(condition) ;
+
+ # - Ranlib.
+ local ranlib = [ feature.get-values <ranlib> : $(options) ] ;
+ toolset.flags clang-linux.archive .RANLIB $(condition) : $(ranlib[1]) ;
+
+ # - Archive builder.
+ local archiver = [ feature.get-values <archiver> : $(options) ] ;
+ toolset.flags clang-linux.archive .AR $(condition) : $(archiver[1]) ;
}
###############################################################################
# C and C++ compilation
rule compile.c++ ( targets * : sources * : properties * ) {
- setup-threading $(targets) : $(sources) : $(properties) ;
- gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
- gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
-
local pth-file = [ on $(<) return $(PCH_FILE) ] ;
if $(pth-file) {
rule compile.c ( targets * : sources * : properties * )
{
- setup-threading $(targets) : $(sources) : $(properties) ;
- gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
- gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
-
local pth-file = [ on $(<) return $(PCH_FILE) ] ;
if $(pth-file) {
###############################################################################
# PCH emission
+RM = [ common.rm-command ] ;
+
rule compile.c++.pch ( targets * : sources * : properties * ) {
- setup-threading $(targets) : $(sources) : $(properties) ;
- gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
- gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
}
actions compile.c++.pch {
- rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)"
+ $(RM) -f "$(<)" && "$(CONFIG_COMMAND)" -c -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)"
}
rule compile.c.pch ( targets * : sources * : properties * ) {
- setup-threading $(targets) : $(sources) : $(properties) ;
- gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
- gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
}
actions compile.c.pch
{
- rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)"
+ $(RM) -f "$(<)" && "$(CONFIG_COMMAND)" -c -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)"
}
###############################################################################
SPACE = " " ;
rule link ( targets * : sources * : properties * ) {
- setup-threading $(targets) : $(sources) : $(properties) ;
- gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ;
}
}
rule link.dll ( targets * : sources * : properties * ) {
- setup-threading $(targets) : $(sources) : $(properties) ;
- gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ;
}
-rule setup-threading ( targets * : sources * : properties * )
-{
-
- local target = [ feature.get-values target-os : $(properties) ] ;
-
- switch $(target)
- {
- case windows :
- local threading = [ feature.get-values threading : $(properties) ] ;
- if $(threading) = multi
- {
- OPTIONS on $(targets) += -pthread ;
- }
- case * : gcc.setup-threading $(targets) : $(sources) : $(properties) ;
- }
-}
-
# Differ from 'link' above only by -shared.
actions link.dll bind LIBRARIES {
"$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)