diff --git a/Jamroot.jam b/Jamroot.jam index f96fcd4a21..afe7421c71 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -1,4 +1,4 @@ -# Copyright 2019 Rene Rivera +# Copyright 2019-2024 Rene Rivera # Copyright 2017 Steven Watanabe # Copyright 2016 Vladimir Prus # Copyright 2017 Edward Diener @@ -13,7 +13,6 @@ import errors ; import feature ; import indirect ; import os ; -# import package ; import path ; import set ; import stage : add-install-dir ; @@ -130,7 +129,7 @@ obj jamgram.obj explicit jamgram.obj ; local b2_src = - [ glob src/engine/*.cpp src/engine/modules/*.cpp : + [ glob src/engine/*.cpp : src/engine/*nt.cpp src/engine/*unix.cpp src/engine/*vms.cpp src/engine/yyacc.cpp src/engine/mkjambase.cpp src/engine/check_*.cpp @@ -180,15 +179,25 @@ add-install-dir b2bindir-portable : : b2prefix-portable ; add-install-dir b2coredir-portable : .b2 : b2prefix-portable ; add-install-dir b2examplesdir-portable : .b2/examples : b2prefix-portable ; -local ext = "" ; -if [ os.on-windows ] || [ os.on-vms ] +rule b2-exe ( props * ) { - ext = ".exe" ; + local target-os = [ feature.get-values : $(props) ] ; + local host-os = [ feature.get-values : $(props) ] ; + if $(target-os) != $(host-os) + { + return b2 ; + } + else if $(target-os) in windows vms + { + return src/engine/b2.exe ; + } + return src/engine/b2 ; } install b2-engine - : $(SELF)/src/engine/b2$(ext) - : standard:(b2bindir-standard) + : + : @b2-exe + standard:(b2bindir-standard) portable:(b2bindir-portable) ; explicit b2-engine ; diff --git a/doc/src/history.adoc b/doc/src/history.adoc index 1146aad184..0d56386dad 100644 --- a/doc/src/history.adoc +++ b/doc/src/history.adoc @@ -9,6 +9,8 @@ * Fix `import-search` failing to find imports on Windows bacause of incorrect native vs. non-native path handling. -- _René Ferdinand Rivera Morell_ +* Support cross-compile install of B2, using `target-os=xyz`. + -- _René Ferdinand Rivera Morell_ == Version 5.0.0