Update of /cvsroot/boost/boost/tools/build/v2/tools
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10123/tools/build/v2/tools

Modified Files:
      Tag: RC_1_34_0
        python.jam msvc.jam gcc.jam darwin.jam common.jam builtin.jam 
Log Message:
** This comment represents the aggregate changes merged from the **
** bbv2python branch.                                            **

gcc.jam: build and use import libraries on Cygwin and Windows, but
         accept DLL-only linking with prebuilt DLLs.

builtin.jam: fix default-host-os so that <target-os> actually becomes
             a functional feature.  Improve English in comments

property-set.jam: add str method so we can print them in generator
                  debugging output.

generators.jam: improved debugging output

build-system.jam: add missing semicolon

python.jam: 
* fix cross-NT/CYGWIN build support
* add condition to the build requirements of the python targets

os.jam: 
* add the ability to get constants for a particular OS

builtin.jam:
* remove "optional" attribute from host-os
* fix confusing indents

python.jam
----------

* Removed comments about known problems because they make no sense.

* Unified MacOS initialization with NT and *nix

* Updated comment describing init behavior

* Support for passing Python command as first argument

* Removed unused get-python-interpreter and get-python-version rules,
  since they can't work with that interface.  Working versions of
  these will be reinstated for Doug Gregor in the near future.

* When invoking Python to collect configuration info, collect it all at at once.

* When a Cygwin symlink is found by an NT build of bjam, give hints
  about where to find the file it points at.

* Lots of refactoring

* Make the logic work plausibly even when no Python executable can be found


darwin.jam
----------

* Simplified logic for setting up FRAMEWORK_PATH

* Corrected logic for setting up -framework option


feature.jam
-----------

* Make feature.defaults, feature.attributes, feature.values, and
  feature.get-values resilient to feature names being passed without
  grist.


gcc.jam, python.jam, builtin.jam
--------------------------------

* Include some progress volodya has made toward support for 
<suppress-import-lib>


Index: python.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/python.jam,v
retrieving revision 1.12.2.33
retrieving revision 1.12.2.34
diff -u -d -r1.12.2.33 -r1.12.2.34
--- python.jam  6 Feb 2007 21:52:48 -0000       1.12.2.33
+++ python.jam  15 Mar 2007 04:02:23 -0000      1.12.2.34
@@ -15,12 +15,6 @@
 #
 # Extensions that use Boost.Python must explicitly link to it.
 
-# Known problems: 
-# - the directory where extension is generated is different from V2
-# - the ext + py -> pyd_run_output generator is declared to take 
-#   SHARED_LIB, not PYTHON_EXTENSION. That's because we reuse 
-#   'lib-target-class', which creates SHARED_LIB explicitly.
-
 import type ;
 import testing ;
[...1201 lines suppressed...]
+    # os.  The only OSes where we can run pythons for other OSes
+    # currently are NT and CYGWIN, so we only need to handle those
+    # cases.
+    local target-os = [ feature.get-values target-os : $(properties) ] ;
+    # oddly, host-os isn't in properties, so grab the default value.
+    local host-os = [ feature.defaults host-os ] ; 
+    host-os = $(host-os:G=) ;
+    if $(target-os) != $(host-os)
+    {
+        PYTHONPATH = 
+          [ sequence.transform $(host-os)-to-$(target-os)-path : $(PYTHONPATH) 
] ;
+    }
+    local path-separator = 
+      [ os.path-separator [ translate-os $(target-os) ] ] ;
+    local set-PYTHONPATH = 
+      [ common.variable-setting-command PYTHONPATH : 
$(PYTHONPATH:J=$(path-separator)) ] ;
+    LAUNCHER on $(target) = $(set-PYTHONPATH) [ on $(target) return $(PYTHON) 
] ;
 }
 
 rule bpl-test ( name : sources * : requirements * )

Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.76.2.16
retrieving revision 1.76.2.17
diff -u -d -r1.76.2.16 -r1.76.2.17
--- msvc.jam    24 Feb 2007 11:41:19 -0000      1.76.2.16
+++ msvc.jam    15 Mar 2007 04:02:23 -0000      1.76.2.17
@@ -301,7 +301,7 @@
                     setup-option = x86 x86_amd64 x86_iPF ;
                     
                     # Use a native x64 compiler if possible
-                    if [ os.environ PROCESSOR_ARCHITECTURE ] = AMD64
+                    if [ MATCH ^(AMD64) : [ os.environ PROCESSOR_IDENTIFIER ] ]
                     {
                         setup-option = x86 amd64 x86_IPF ;
                     }
@@ -968,14 +968,19 @@
     {
         if $(.version-$(i)-reg)
         {
-            local vc-path = [ W32_GETREG
-                "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"$(.version-$(i)-reg)
+            local vc-path ;
+            for local x in "" "Wow6432Node\\"
+            {
+                vc-path += [ W32_GETREG
+                
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"$(x)$(.version-$(i)-reg)
                 : "ProductDir" ] ;
+            }
+            
             
             if $(vc-path)
             {
-                vc-path = [ path.native [ path.join [ path.make-NT $(vc-path) 
] "bin" ] ] ;
-                register-configuration $(i) : $(vc-path) ;
+                vc-path = [ path.native [ path.join [ path.make-NT 
$(vc-path[1]) ] "bin" ] ] ;
+                register-configuration $(i) : $(vc-path[1]) ;
             }
         }
     }

Index: gcc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/gcc.jam,v
retrieving revision 1.63.2.20
retrieving revision 1.63.2.21
diff -u -d -r1.63.2.20 -r1.63.2.21
--- gcc.jam     6 Jan 2007 12:39:42 -0000       1.63.2.20
+++ gcc.jam     15 Mar 2007 04:02:23 -0000      1.63.2.21
@@ -44,6 +44,9 @@
 type.set-generated-target-suffix OBJ : <toolset>gcc : o ;
 type.set-generated-target-suffix STATIC_LIB : <toolset>gcc : a ;
 
+type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc <target-os>cygwin : 
dll.a ;
+type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc <target-os>windows 
: a ;
+
 import rc ;
 
 # Initializes the gcc toolset for the given version.
@@ -75,7 +78,7 @@
     #   Autodetect the version and flavor if not given.
     if $(command)
     {
-        # The 'command' variable can have multiple-element. When calling
+        # The 'command' variable can have multiple elements. When calling
         # the SHELL builtin we need a single string.
         local command-string = $(command:J=" ") ;
         local command-info = [ MATCH "^[^ ]+[ ]+[^ ]+[ ]+([^ 
]+)[^(]*[(]?([^)]*)"
@@ -427,8 +430,26 @@
         }
         else
         {
-            return [ unix-linking-generator.run $(project) $(name)
+            local generated-targets = [ unix-linking-generator.run $(project) 
$(name)
                 : $(property-set) : $(sources) ] ;
+            
+            # If more than one target was generated, throw out the
+            # last one, which on windows just leaves the import
+            # library.  Most generators on windows simply don't accept
+            # shared libraries as input, but being able to link
+            # directly to a shared library without an import library
+            # is an important capability of GCC.  Therefore, we remove
+            # the target after the action sees it so that dependent
+            # targets don't try to link to both the import library and
+            # the DLL.
+            if [ $(property-set).get <suppress-import-lib> ] = true
+            {
+                return $(generated-targets[0]) $(generated-targets[-1]) ;
+            }
+            else
+            {
+                return $(generated-targets[1-2]) ;
+            }
         }
     }
 }
@@ -436,9 +457,17 @@
 generators.register [ new gcc-linking-generator gcc.link : LIB OBJ : EXE 
     : <toolset>gcc ] ;
 
-generators.register [ new gcc-linking-generator gcc.link.dll : LIB OBJ : 
SHARED_LIB 
-    : <toolset>gcc ] ;
+.IMPLIB-COMMAND = ;
+.IMPLIB-TYPE = ;
+if [ os.on-windows ]
+{
+    .IMPLIB-COMMAND = "-Wl,--out-implib," ;
+    .IMPLIB-TYPE = IMPORT_LIB ;
+}
 
+generators.register 
+  [ new gcc-linking-generator gcc.link.dll : LIB OBJ : $(.IMPLIB-TYPE) 
SHARED_LIB 
+    : <toolset>gcc ] ;
 
 # Declare flags for linking
 # First, the common flags
@@ -601,7 +630,7 @@
 # Differ from 'link' above only by -shared.
 actions link.dll bind LIBRARIES
 {
-    "$(CONFIG_COMMAND)" -L"$(LINKPATH)" 
-Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" -o "$(<)" 
$(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[1]:D=) -shared $(START-GROUP) 
"$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) 
$(USER_OPTIONS)
+    "$(CONFIG_COMMAND)" -L"$(LINKPATH)" 
-Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o 
"$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared 
$(START-GROUP) "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) 
$(END-GROUP) $(OPTIONS) $(USER_OPTIONS)
 }
 
 # Set up threading support. It's somewhat contrived, so perform it at the end,

Index: darwin.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/darwin.jam,v
retrieving revision 1.18.2.6
retrieving revision 1.18.2.7
diff -u -d -r1.18.2.6 -r1.18.2.7
--- darwin.jam  5 Nov 2006 07:24:37 -0000       1.18.2.6
+++ darwin.jam  15 Mar 2007 04:02:23 -0000      1.18.2.7
@@ -65,14 +65,7 @@
 {
     local framework-path = [ on $(target) return $(FRAMEWORK:D) ] ;
     
-    if $(framework-path)
-    {
-        FRAMEWORK_PATH on $(target) += -F$(framework-path) ;
-    }
-    else
-    {
-        FRAMEWORK_PATH on $(target) = ;
-    }
+    FRAMEWORK_PATH on $(target) += -F$(framework-path) ;
 }
 
 rule link
@@ -82,7 +75,7 @@
 
 actions link bind LIBRARIES
 {
-    $(CONFIG_COMMAND) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" 
-l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) 
-framework$(_)$(FRAMEWORK:D=) $(OPTIONS) $(USER_OPTIONS)
+    $(CONFIG_COMMAND) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" 
-l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) 
-framework$(_)$(FRAMEWORK:D=:S=) $(OPTIONS) $(USER_OPTIONS)
     $(NEED_STRIP)strip $(NEED_STRIP)"$(<)"
 }
 
@@ -93,7 +86,7 @@
 
 actions link.dll bind LIBRARIES
 {
-    $(CONFIG_COMMAND) -dynamiclib -L"$(LINKPATH)" -o "$(<)" "$(>)" 
"$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) 
-framework$(_)$(FRAMEWORK:D=) $(OPTIONS) $(USER_OPTIONS)
+    $(CONFIG_COMMAND) -dynamiclib -L"$(LINKPATH)" -o "$(<)" "$(>)" 
"$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(FRAMEWORK_PATH) 
-framework$(_)$(FRAMEWORK:D=:S=) $(OPTIONS) $(USER_OPTIONS)
 }
 
 actions piecemeal archive

Index: common.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/common.jam,v
retrieving revision 1.45.2.12
retrieving revision 1.45.2.13
diff -u -d -r1.45.2.12 -r1.45.2.13
--- common.jam  10 Nov 2006 08:45:45 -0000      1.45.2.12
+++ common.jam  15 Mar 2007 04:02:23 -0000      1.45.2.13
@@ -338,6 +338,10 @@
     if $(command:D)
     {
         if [ path.exists $(command) ]
+          # Both NT and Cygwin will run .exe files by their unqualified names
+          ||  [ os.on-windows ] && [ path.exists $(command).exe ]
+            # Only NT will run .bat files by their unqualified names
+            || [ os.name ] = NT && [ path.exists $(command).bat ]
         {
             return $(command) ;
         }        

Index: builtin.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/builtin.jam,v
retrieving revision 1.189.2.7
retrieving revision 1.189.2.8
diff -u -d -r1.189.2.7 -r1.189.2.8
--- builtin.jam 6 Jan 2007 12:39:42 -0000       1.189.2.7
+++ builtin.jam 15 Mar 2007 04:02:24 -0000      1.189.2.8
@@ -33,14 +33,17 @@
 local os = [ modules.peek : OS ] ;
 feature os : $(os) : propagated link-incompatible ;
 
+.os-names = amiga aix bsd cygwin darwin dos emx freebsd hpux
+        linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos
+        svr4 sysv ultrix unix unixware vms windows ;
+
 # Translates from bjam current OS to the os tags used
 # in host-os and target-os. I.e. it returns the
 # running host-os.
 local rule default-host-os ( )
 {
     local host-os ;
-    local os-list = [ feature.values host-os ] ;
-    if [ os.name ] in $(os-list:U)
+    if [ os.name ] in $(.os-names:U)
     {
         host-os = [ os.name ] ;
     }
@@ -70,18 +73,13 @@
 # to list all the values to prevent unkown value errors.
 # Both set the default value to the current OS to account for
 # the default use case of building on the target OS.
-feature host-os
-    :   amiga aix bsd cygwin darwin dos emx freebsd hpux
-        linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos
-        svr4 sysv ultrix unix unixware vms windows
-    :   optional ;
-        feature.set-default host-os : [ default-host-os ] ;
+feature host-os :  $(.os-names) ;
+feature.set-default host-os : [ default-host-os ] ;
+
 feature target-os
-    :   amiga aix bsd cygwin darwin dos emx freebsd hpux
-        linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos
-        svr4 sysv ultrix unix unixware vms windows
+    :   $(.os-names)
     :   propagated link-incompatible ;
-        feature.set-default target-os : [ default-host-os ] ;
+feature.set-default target-os : [ default-host-os ] ;
 
 
 feature toolset : : implicit propagated symmetric ;
@@ -169,15 +167,17 @@
 feature hardcode-dll-paths : true false : incidental ;
 
 
-# This is internal feature which holds the paths of all dependency
+# An internal feature that holds the paths of all dependency
 # dynamic libraries. On Windows, it's needed so that we can all
-# those paths to PATH, when running applications.
+# those paths to PATH when running applications.
 # On Linux, it's needed to add proper -rpath-link command line options.
 feature xdll-path : : free path ;
 
 #provides means to specify def-file for windows dlls.
 feature def-file : : free dependency ;
 
+feature.feature suppress-import-lib : false true : incidental ; 
+
 # This is internal feature which is used to store the name of 
 # bjam action to call when building a target.
 feature.feature action : : free ;
@@ -726,7 +726,7 @@
         }
                         
         # Hardcode dll paths only when linking executables.
-        # Pros: don't need to relinking libraries when installing.
+        # Pros: don't need to relink libraries when installing.
         # Cons: "standalone" libraries (plugins, python extensions)
         # can't hardcode paths to dependent libraries.
         if [ $(property-set).get <hardcode-dll-paths> ] = true


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to