Boost logo

Boost-Build :

From: Alexey Pakhunov (alexeypa_at_[hidden])
Date: 2005-12-01 12:40:06


Alexey Pakhunov wrote:
> Sorry for the delay. I attached the patch that should fix your problem.
> It adds a check whether the manifest has been created by a linker. If it
> wasn't created there is no reason to embed it into the executable/library.

I completely forgot about Cygwin. The attached patch works in both NT
and CYGWIN.

Best regards/Venlig hilsen,
   Alexey Pakhunov.

Index: msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.66
diff -u -r1.66 msvc.jam
--- msvc.jam 23 Nov 2005 08:25:31 -0000 1.66
+++ msvc.jam 1 Dec 2005 17:37:28 -0000
@@ -305,7 +305,7 @@
         if ! [ os.name ] in NT
         {
             prefix = "cmd.exe /S /C call " ;
- suffix = " \"&&\" " ;
+ suffix = " >nul \"&&\" " ;
         }
 
         command = $(prefix)$(setup)" "$(setup-option:E="")$(suffix) ;
@@ -328,6 +328,7 @@
         idl-compiler = [ get-values <idl-compiler> : $(options) ] ;
         idl-compiler ?= midl ;
 
+ manifest-tool = mt ;
 
         for local i in 1 2 3
         {
@@ -350,13 +351,12 @@
                 flags msvc.link .LD $(cond) : $(command[$(i)])$(linker) ;
                 flags msvc.archive .LD $(cond) : $(command[$(i)])$(linker) ;
                 flags msvc.compile .IDL $(cond) : $(command[$(i)])$(idl-compiler) ;
- }
- }
 
- if ! $(below-8.0)
- {
- flags msvc.link MANIFEST $(condition) : "mt -nologo -manifest " ;
- flags msvc.link OUTPUTRESOURCE $(condition) : "-outputresource:" ;
+ if ! [ os.name ] in NT
+ {
+ flags msvc.link .MT $(cond) : $(command[$(i)])$(manifest-tool) ;
+ }
+ }
         }
 
 
@@ -669,18 +669,46 @@
 # manifests are embedded as resourses and are useful in
 # any PE targets (both DLL and EXE)
 
-actions link bind DEF_FILE
+if [ os.name ] in NT
 {
- $(.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)")"
- $(MANIFEST)$(<[1]).manifest $(OUTPUTRESOURCE)$(<[1]);1
-}
+ actions link bind DEF_FILE
+ {
+ $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1])" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH)" $(USER_LINKFLAGS) @"@($(<[1]).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
 
-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)")"
- $(MANIFEST)$(<[1]).manifest $(OUTPUTRESOURCE)$(<[1]);2
+ if exist "$(<[1]).manifest" (
+ mt -nologo -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);1"
+ )
+ }
+
+ actions link.dll bind DEF_FILE
+ {
+ $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1])" /INCREMENTAL:NO /IMPLIB:"$(<[2])" /LIBPATH:"$(LINKPATH)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"@($(<[1]).rsp:E=$(nl)"$(>)" $(nl)$(LIBRARIES) $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" $(nl)"$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)")"
+
+ if exist "$(<[1]).manifest" (
+ mt -nologo -manifest "$(<[1]).manifest" "-outputresource:$(<[1]);2"
+ )
+ }
 }
+else
+{
+ 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)")"
 
+ if test -e "$(<[1]).manifest"; then
+ $(.MT) -nologo -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);1"
+ fi
+ }
+
+ 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)")"
+
+ if test -e "$(<[1]).manifest"; then
+ $(.MT) -nologo -manifest "$(<[1]:W).manifest" "-outputresource:$(<[1]:W);2"
+ fi
+ }
+}
 
 #
 # Autodetection code


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