From 50fe9b46b313ba7a46de2cdbdefea9fa5360e9f3 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 26 Aug 2004 08:21:24 +0000 Subject: [PATCH] Fixes. Restore the check for file existance for NT/achive. Remove conditional setting of .cygpath variable, since it's not used anywhere. [SVN r24738] --- v2/tools/msvc.jam | 64 +++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index 503ba1be8..9abe5e6ed 100644 --- a/v2/tools/msvc.jam +++ b/v2/tools/msvc.jam @@ -293,25 +293,45 @@ flags msvc.link FINDLIBS_SA ; flags msvc.link LIBRARY_OPTION msvc : "" : unchecked ; -# Declare action for creating static libraries -# If library exists, remove it before adding files. See -# http://article.gmane.org/gmane.comp.lib.boost.build/4241 -# for rationale. rule archive ( targets + : sources * : properties * ) { common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ; } -actions archive -{ - $(RM) "$(<[1])" - $(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(<[2])" -} rule link ( targets + : sources * : properties * ) { common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ; } + +rule link.dll ( targets + : sources * : properties * ) +{ + common.response-file $(targets) : $(sources) : $(targets[3]) : $(properties) ; + DEPENDS $(<) : [ on $(<) return $(DEF_FILE) ] ; +} + +# Declare action for creating static libraries +# If library exists, remove it before adding files. See +# http://article.gmane.org/gmane.comp.lib.boost.build/4241 +# for rationale. +if [ os.name ] in NT +{ + # The 'DEL' command would issue a message to stdout + # if the file does not exist, so need a check. + actions archive + { + if exist "$(<[1])" DEL "$(<[1])" + $(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(<[2])" + } +} +else +{ + actions archive + { + $(RM) "$(<[1])" + $(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(<[2])" + } +} # incremental linking a DLL causes no end of problems: if the # actual exports don't change, the import .lib file is never @@ -319,32 +339,6 @@ rule link ( targets + : sources * : properties * ) # rebuilt every time. I'm not sure that incremental linking is # such a great idea in general, but in this case I'm sure we # don't want it. - -if [ os.name ] in NT -{ - rule link.dll ( targets + : sources * : properties * ) - { - common.response-file $(targets) : $(sources) : $(targets[3]) : $(properties) ; - DEPENDS $(<) : [ on $(<) return $(DEF_FILE) ] ; - } - - rule archive ( targets + : sources * : properties * ) - { - common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ; - } - -} -else # CYGWIN -{ - rule link.dll ( targets + : sources + : properties * ) - { - common.response-file $(targets) : $(sources) : $(targets[3]) : $(properties) ; - .cygpath = "cygpath -d " ; - DEPENDS $(<) : [ on $(<) return $(DEF_FILE) ] ; - } - -} - actions link bind DEF_FILE { $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(USER_LINKFLAGS) @"$(<[2]:W)"