Index: build/v2/tools/intel-linux.jam =================================================================== --- build/v2/tools/intel-linux.jam (revision 51497) +++ build/v2/tools/intel-linux.jam (working copy) @@ -13,6 +13,7 @@ import common ; import errors ; import generators ; +import type ; feature.extend-subfeature toolset intel : platform : linux ; @@ -22,6 +23,12 @@ generators.override intel-linux.prebuilt : builtin.prebuilt ; generators.override intel-linux.searched-lib-generator : searched-lib-generator ; +# Override default do-nothing generators. +generators.override intel-linux.compile.c.pch : pch.default-c-pch-generator ; +generators.override intel-linux.compile.c++.pch : pch.default-cpp-pch-generator ; + +type.set-generated-target-suffix PCH : intel linux : pchi ; + toolset.inherit-rules intel-linux : gcc ; toolset.inherit-flags intel-linux : gcc : off on full space @@ -87,24 +94,48 @@ { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } -actions compile.c++ +actions compile.c++ bind PCH_FILE { - "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)" } rule compile.c ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } -actions compile.c +actions compile.c bind PCH_FILE { - "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -use-pch"$(PCH_FILE)" -c -o "$(<)" "$(>)" } +rule compile.c++.pch ( targets * : sources * : properties * ) +{ + gcc.setup-threading $(targets) : $(sources) : $(properties) ; + gcc.setup-fpic $(targets) : $(sources) : $(properties) ; +} + +actions compile.c++.pch +{ + rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" +} + +rule compile.c.pch ( targets * : sources * : properties * ) +{ + gcc.setup-threading $(targets) : $(sources) : $(properties) ; + gcc.setup-fpic $(targets) : $(sources) : $(properties) ; +} + +actions compile.c.pch +{ + rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -pch-create "$(<)" "$(>)" +} + rule link ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; @@ -129,3 +160,6 @@ { "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) } + + +