diff --git a/src/tools/common.jam b/src/tools/common.jam index 284018cd6..8ff4bf41f 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -424,21 +424,22 @@ actions copy # Cause creation of response file, containing the sources in 'sources' # All the targets in 'targets' will depend on response file, and response # file will be created before the targets are built. -rule response-file ( targets + : sources * : the-response-file : properties * ) +rule response-file ( targets + : sources * : the-response-file ? : properties * ) { - # Manufacture a fake target for response file. - # If response file is in targets, we're in trouble. - # The actions for response file are already generated, and bjam thinks it's - # created. So setting dependency on response file will not help to create - # it before other targets. So, we need another target. + # TODO: now 'the-response-file' is just ignored. Need to remove + # the argument altother and adjust callers. - local g = [ utility.ungrist $(the-response-file:G) ] ; - local rsp = $(the-response-file:G=$(g)-rsp) ; - LOCATE on $(rsp) = [ on $(the-response-file) return $(LOCATE) ] ; + # Create a target for response file. Not that we add 'rsp' to the target + # name (without stripping suffix), so that response file names for c.exe + # and c.obj are different. + local rsp = $(targets[1]).rsp ; + RSP on $(targets) = $(rsp) ; + LOCATE on $(rsp) = [ on $(targets[1]) return $(LOCATE) ] ; DEPENDS $(targets) : $(rsp) ; - # Cause RSP to be recreated if sources are out-of-date. - DEPENDS $(rsp) : $(sources) ; - + # Note: we don't need dependecy from response file on sources + # because response file only needs the names of the sources. + TEMPORARY $(rsp) ; + # Add libraries from property to the list of sources. local libraries ; for local p in $(properties) @@ -457,7 +458,7 @@ rule response-file ( targets + : sources * : the-response-file : properties * ) } sources += $(xlibraries) ; - + response-file-1 $(rsp) : $(sources[1]) ; if $(sources[2-]) { diff --git a/src/tools/como-win.jam b/src/tools/como-win.jam index 12fa5fe1a..33ad6dfe6 100644 --- a/src/tools/como-win.jam +++ b/src/tools/como-win.jam @@ -42,12 +42,12 @@ generators.register-c-compiler como-win.compile.c : C : OBJ generators.register-linker como-win.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB - : EXE RSP + : EXE : como win ; # Note that status of shared libraries support is not clear, so we don't # define the link.dll generator. generators.register-archiver como-winc.archive - : OBJ : STATIC_LIB RSP + : OBJ : STATIC_LIB : como win ; flags como-win C++FLAGS off : --no_exceptions ; @@ -92,9 +92,9 @@ rule link ( targets + : sources * : properties * ) } # for como, we repeat all libraries so that dependencies are always resolved -actions link bind LIBRARIES +actions link bind LIBRARIES RSP { - $(CONFIG_COMMAND) --no_version --no_prelink_verbose $(LINKFLAGS) -o "$(<[1]:S=)" @"$(<[2])" "$(LIBRARIES)" "$(FINDLIBS:S=.lib)" + $(CONFIG_COMMAND) --no_version --no_prelink_verbose $(LINKFLAGS) -o "$(<[1]:S=)" @"$(RSP:W)" "$(LIBRARIES)" "$(FINDLIBS:S=.lib)" && del "$(RSP)" } actions compile.c @@ -114,9 +114,9 @@ rule archive ( targets + : sources * : properties * ) common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ; } -actions updated together piecemeal archive +actions updated together piecemeal archive bind RSP { - $(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object @"$(>)" - lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" @"$(>)" + $(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object @"$(RSP:W)" + lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" @"$(RSP:W)" && del "$(RSP)" } diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index d79ff321e..e10ec052c 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -227,12 +227,12 @@ rule default-paths ( version ? ) # is it possible to combine these? # make the generators non-composing, so that they don't convert each source # into separate rsp file. -generators.register-linker msvc.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : EXE RSP : msvc ; -generators.register-linker msvc.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB RSP : msvc ; - -generators.register-archiver msvc.archive : OBJ : STATIC_LIB RSP : msvc ; -generators.register-c-compiler msvc.compile.c++ : CPP : OBJ RSP(%_cpp) : msvc ; -generators.register-c-compiler msvc.compile.c : C : OBJ RSP(%_cpp) : msvc ; +generators.register-linker msvc.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : EXE : msvc ; +generators.register-linker msvc.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB : msvc ; + +generators.register-archiver msvc.archive : OBJ : STATIC_LIB : msvc ; +generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : msvc ; +generators.register-c-compiler msvc.compile.c : C : OBJ : msvc ; generators.register-standard msvc.compile.rc : RC : OBJ(%_res) : msvc ; generators.override msvc.compile.rc : rc.resource-compile ; @@ -246,7 +246,15 @@ flags msvc.compile CFLAGS off : /Od ; flags msvc.compile CFLAGS off : /Ob0 ; flags msvc.compile CFLAGS on : /Ob1 ; flags msvc.compile CFLAGS full : /Ob2 ; -flags msvc.compile CFLAGS on : /EHsc ; + +feature.feature asynch-exceptions : off on : propagated ; +feature.feature extern-c-nothrow : off on : propagated ; + +flags msvc.compile CFLAGS CPP/on/off : /EHs ; +flags msvc.compile CFLAGS CPP/on/on : /EHa ; +flags msvc.compile CFLAGS CPP/on/off : /EHc- ; +flags msvc.compile CFLAGS CPP/on/on : /EHc ; + flags msvc.compile CFLAGS on : /GR ; flags msvc.compile CFLAGS off/shared : /MD ; flags msvc.compile CFLAGS on/shared : /MDd ; @@ -255,7 +263,6 @@ flags msvc.compile CFLAGS off/static/on/static/single : /MLd ; flags msvc.compile CFLAGS off/static/multi : /MT ; flags msvc.compile CFLAGS on/static/multi : /MTd ; -flags msvc.compile CFLAGS CPP : /EHsc ; flags msvc.compile USER_CFLAGS : ; flags msvc.compile.c++ USER_CFLAGS : ; @@ -267,13 +274,13 @@ flags msvc.compile UNDEFS ; flags msvc.compile INCLUDES ; # The actions differ only by explicit selection of input language -actions compile.c +actions compile.c bind RSP { - $(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(<[2]:W)" -c -Fo"$(<[1]:W)" + $(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(RSP:W)" -c -Fo"$(<[1]:W)" && del "$(RSP)" } -actions compile.c++ +actions compile.c++ bind RSP { - $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(<[2]:W)" -c -Fo"$(<[1]:W)" + $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(RSP:W)" -c -Fo"$(<[1]:W)" } actions compile.rc @@ -331,18 +338,18 @@ 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 + actions archive bind RSP { if exist "$(<[1])" DEL "$(<[1])" - $(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(<[2])" + $(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(RSP)" && del "$(RSP)" } } else { - actions archive + actions archive bind RSP { $(RM) "$(<[1])" - $(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(<[2])" + $(.LD) /lib /NOLOGO /out:"$(<[1])" @"$(RSP)" && del "$(RSP)" } } @@ -352,20 +359,20 @@ else # 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. -actions link bind DEF_FILE +actions link bind DEF_FILE RSP { - $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(USER_LINKFLAGS) @"$(<[2]:W)" + $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /LIBPATH:"$(LINKPATH:W)" $(USER_LINKFLAGS) @"$(RSP:W)" && del "$(RSP)" } -actions link.dll bind DEF_FILE +actions link.dll bind DEF_FILE RSP { - $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"$(<[3]:W)" + $(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"$(RSP:W)" && del "$(RSP)" $(MANIFEST)$(<[1]).manifest $(OUTPUTRESOURCE)$(<[1]);#2 } rule compile.c++ ( targets + : sources * : properties * ) { - common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ; + common.response-file $(targets) : $(sources) : $(response-file) : $(properties) ; } rule compile.c ( targets + : sources * : properties * )