Boost logo

Boost-Build :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-11-15 18:35:04


Hi Volodya,

I have attached a patch that implements what you suggested for msvc.jam
and cw.jam. It was tested successfully with the following Jamfile:

lib kernel32 : : <name>kernel32 ;
lib user32 : : <name>user32 ;

exe hex
   :
     main.cpp user32
   :
     <library>kernel32
   ;

however, let me know if I've missed anything. Thanks for the feedback.

BTW: I will look into the bjam -obatch.bat issue over the next few days,
unless someone else beats me to it :).

- Reece

Index: common.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/common.jam,v
retrieving revision 1.43
diff -u -r1.43 common.jam
--- common.jam 9 Nov 2005 13:56:41 -0000 1.43
+++ common.jam 15 Nov 2005 23:21:28 -0000
@@ -447,34 +447,6 @@
 }
 
 
-# Returns the list of libraries from the <library> property
-# in their actualized form.
-rule resolve-library-files ( properties * )
-{
- local libraries ;
-
- for local p in $(properties)
- {
- if $(p:G) = <library-file> &&
- ! [ type.is-derived [ $(p:G=).type ] SHARED_LIB ]
- {
- libraries += $(p:G=) ;
- }
- }
-
- # Get real jam targets
-
- local xlibraries ;
-
- for local l in $(libraries)
- {
- xlibraries += [ $(l).actualize ] ;
- }
-
- return $(xlibraries) ;
-}
-
-
 # Return a command which can create a file. If 'r' is result of invocation,
 # then
 # r foobar
Index: cw.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/cw.jam,v
retrieving revision 1.8
diff -u -r1.8 cw.jam
--- cw.jam 9 Nov 2005 13:56:41 -0000 1.8
+++ cw.jam 15 Nov 2005 23:20:19 -0000
@@ -177,53 +177,40 @@
 flags cw.link FINDLIBS_ST <find-static-library> ;
 flags cw.link FINDLIBS_SA <find-shared-library> ;
 flags cw.link LIBRARY_OPTION <toolset>cw : "" : unchecked ;
-
-rule archive ( targets + : sources * : properties * )
-{
- flags cw.link LIBRARIES
- [ common.resolve-library-files properties ] ;
-}
-
-rule link ( targets + : sources * : properties * )
-{
- flags cw.link LIBRARIES
- [ common.resolve-library-files properties ] ;
-}
+flags cw.link LIBRARIES_MENTIONED_BY_FILE : <library-file> ;
 
 rule link.dll ( targets + : sources * : properties * )
 {
- flags cw.link LIBRARIES
- [ common.resolve-library-files properties ] ;
     DEPENDS $(<) : [ on $(<) return $(DEF_FILE) ] ;
 }
 
 if [ os.name ] in NT
 {
- actions archive bind
+ actions archive
    {
       if exist "$(<[1])" DEL "$(<[1])"
- $(.LD) -library -o "$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+ $(.LD) -library -o "$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
    }
 }
 else # cygwin
 {
- actions archive bind
+ actions archive
    {
       _bbv2_out_="$(<)"
       if test -f "$_bbv2_out_" ; then
          _bbv2_existing_="$(<:W)"
       fi
- $(.LD) -library -o "$(<:W)" $_bbv2_existing_ @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+ $(.LD) -library -o "$(<:W)" $_bbv2_existing_ @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
    }
 }
 
 actions link bind DEF_FILE
 {
- $(.LD) -o "$(<[1]:W)" -L"$(LINKPATH)" $(LINKFLAGS) $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+ $(.LD) -o "$(<[1]:W)" -L"$(LINKPATH)" $(LINKFLAGS) $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
 }
 
 actions link.dll bind DEF_FILE
 {
- $(.LD) -o "$(<[1]:W)" -implib "$(<[2]:W)" -L"$(LINKPATH)" $(LINKFLAGS) -f "$(DEF_FILE)" $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+ $(.LD) -o "$(<[1]:W)" -implib "$(<[2]:W)" -L"$(LINKPATH)" $(LINKFLAGS) -f "$(DEF_FILE)" $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
 }
 
Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.63
diff -u -r1.63 msvc.jam
--- msvc.jam 9 Nov 2005 13:56:41 -0000 1.63
+++ msvc.jam 15 Nov 2005 23:23:46 -0000
@@ -538,12 +538,12 @@
 flags msvc.compile INCLUDES <include> ;
 
 # The actions differ only by explicit selection of input language
-actions compile.c bind
+actions compile.c
 {
     $(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)"
 }
 
-actions compile.c++ bind
+actions compile.c++
 {
     $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)"
 }
@@ -593,24 +593,11 @@
 flags msvc.link FINDLIBS_ST <find-static-library> ;
 flags msvc.link FINDLIBS_SA <find-shared-library> ;
 flags msvc.link LIBRARY_OPTION <toolset>msvc : "" : unchecked ;
+flags msvc.link LIBRARIES_MENTIONED_BY_FILE : <library-file> ;
 
 
-rule archive ( targets + : sources * : properties * )
-{
- flags msvc.link LIBRARIES
- [ common.resolve-library-files properties ] ;
-}
-
-rule link ( targets + : sources * : properties * )
-{
- flags msvc.link LIBRARIES
- [ common.resolve-library-files properties ] ;
-}
-
 rule link.dll ( targets + : sources * : properties * )
 {
- flags msvc.link LIBRARIES
- [ common.resolve-library-files properties ] ;
     DEPENDS $(<) : [ on $(<) return $(DEF_FILE) ] ;
 }
 
@@ -622,18 +609,18 @@
 {
     # The 'DEL' command would issue a message to stdout
     # if the file does not exist, so need a check.
- actions archive bind
+ actions archive
     {
         if exist "$(<[1])" DEL "$(<[1])"
- $(.LD) /lib /NOLOGO /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+ $(.LD) /lib /NOLOGO /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
     }
 }
 else
 {
- actions archive bind
+ actions archive
     {
         $(RM) "$(<[1])"
- $(.LD) /lib /NOLOGO /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+ $(.LD) /lib /NOLOGO /out:"$(<[1])" @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
     }
 }
         
@@ -651,13 +638,13 @@
 
 actions link bind DEF_FILE
 {
- $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+ $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
     $(MANIFEST)$(<[1]).manifest $(OUTPUTRESOURCE)$(<[1]);#2
 }
 
 actions link.dll bind DEF_FILE
 {
- $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+ $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES_MENTIONED_BY_FILE) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
     $(MANIFEST)$(<[1]).manifest $(OUTPUTRESOURCE)$(<[1]);#2
 }

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk