Преглед изворни кода

Implement symlinks support for installing shared libraries.
Also fix top-level Boost Jamfile. Seems like V2 can now install Boost.


[SVN r26835]

Vladimir Prus пре 21 година
родитељ
комит
ec2b42585e
2 измењених фајлова са 42 додато и 16 уклоњено
  1. 41 15
      Jamfile.v2
  2. 1 1
      tools/build

+ 41 - 15
Jamfile.v2

@@ -12,21 +12,29 @@
 
 import modules ;
 import set ;
+import stage ;
+
+constant BOOST_VERSION : 1.32.0 ;
 
 project boost
     : requirements <include>$(BOOST_ROOT)
       # disable auto-linking for all targets here,
       # primarily because it caused troubles with V2
       <define>BOOST_ALL_NO_LIB=1
-      <tag>@stage.add-variant
+      # Used to encode variant in target name. See the
+      # 'tag' rule below.
+      <tag>@$(__name__).tag
     : usage-requirements <include>$(BOOST_ROOT)
     : build-dir bin.v2  
     ;
 
-# The code hereselects the libraries that must be built and builds
+# The code here selects the libraries that must be built and builds
 # and creates two targets:
 # 'stage', which builds only libraries and placed them in one location
 # 'install', which places both libraries and headers in system location
+
+
+
 rule libraries-to-install ( existing-libraries * )
 {
    local argv = [ modules.peek : ARGV ] ;
@@ -70,7 +78,7 @@ rule libraries-to-install ( existing-libraries * )
 ARGV = [ modules.peek : ARGV ] ;
 
 # what kind of layout are we doing?
-local layout = [ MATCH "^--layout=(.*)" : $(ARGV) ] ;
+layout = [ MATCH "^--layout=(.*)" : $(ARGV) ] ;
 layout ?= versioned ;
 layout-$(layout) = true ;
 
@@ -118,26 +126,45 @@ libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ] ] ;
 libraries = [ libraries-to-install $(libraries) ] ;
 
 
-local rename-rule ;
-if $(layout) = versioned
+# This rule is called by Boost.Build to determine the name of 
+# target. We use it to encode build variant, compiler name and
+# boost version in the target name 
+rule tag ( name : type ? : property-set )
 {
-    rename-rule = stage.add-variant-and-compiler ;
-}
-else
-{
-    rename-rule = stage.add-variant ;
+    if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
+    {        
+        if $(layout) = versioned
+        {
+            name = [ stage.add-variant-and-compiler $(name) 
+              : $(type) : $(property-set) ] ;
+            
+            if [ $(property-set).get <os> ] = NT
+            {
+                return $(name:B)_$(BOOST_VERSION)$(name:S) ;
+            }
+            else
+            {
+                return $(name:B)_$(BOOST_VERSION)$(name:S).$(BOOST_VERSION)  ;
+            }                                                  
+        }
+        else
+        {
+            return [ stage.add-variant-and-compiler $(name) 
+              : $(type) : $(property-set) ] ;
+        }        
+    }                   
 }
 
 # Install to system location.
 
 alias install : install-libs install-headers ;
 
-stage install-libs : libs/$(libraries)/build   
+install install-libs : libs/$(libraries)/build   
   : <so-version>1.32.0 
     <location>$(lib-locate) 
   ;
 
-stage install-headers : 
+install install-headers : 
   [ glob boost/compatibility/cpp_c_headers/c* ]
   [ glob boost/*.hpp boost/*/*.hpp *.ipp *.h *.inc ]
   :  
@@ -145,9 +172,8 @@ stage install-headers :
   ;  
 
 # Install just library.
-stage stage : libs/$(libraries)/build 
-  : <so-version>1.32.0 
-    <location>$(stage-locate)
+install stage : libs/$(libraries)/build 
+  : <location>$(stage-locate)
   ;
 
 explicit install install-libs install-headers stage ;        

+ 1 - 1
tools/build

@@ -1 +1 @@
-Subproject commit c40b9809eec7db27ba27eadc7673631f5b17d433
+Subproject commit 9d1b318b43f0bb7fe34c3aaf23d00272bc0650c8

粤ICP备19079148号