]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/tools/build/src/tools/clang-linux.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / clang-linux.jam
index f6dcda9f3e0f792c968d651d4627b9995f268806..b1c2ad95b57dd047174f02ea29353242dcb9274c 100644 (file)
@@ -5,6 +5,7 @@
 #  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 ;
@@ -48,9 +49,9 @@ rule init ( version ? :  command * : options * ) {
     : $(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" ] ] ;
   }
@@ -60,7 +61,15 @@ rule init ( version ? :  command * : options * ) {
     
   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]) ;
 }
 
 ###############################################################################
@@ -92,10 +101,6 @@ toolset.flags clang-linux.compile OPTIONS <rtti>off : -fno-rtti ;
 # 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) {
@@ -118,10 +123,6 @@ actions compile.c++.with-pch bind PCH_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) {
@@ -146,25 +147,21 @@ actions compile.c.with-pch bind PCH_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 "$(<)" "$(>)"
 }
 
 ###############################################################################
@@ -173,8 +170,6 @@ actions compile.c.pch
 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 ;
 }
@@ -184,29 +179,10 @@ actions link bind LIBRARIES {
 }
 
 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)