介紹:
Boost使用的編譯系統(tǒng)叫做Boost.Jam(Bjam),是一個基于FTJam的構(gòu)造工具,而FTJam又基于Perforce Jam
細(xì)節(jié):
Jam是make(1)(如果你使用UNIX就知道make(1)是什么,在這里簡單說明,make(1)是指系統(tǒng)工具類中,名叫make的東西)的一個替代品,Jam的目標(biāo)是讓構(gòu)造簡單的東西更加容易,而讓構(gòu)造復(fù)雜的東西變得簡單。下面是一個例子:
Main smail : main.c map.c resolve.c deliver.c
misc.c parser.y alias.c pw.c headers.c
scanner.l getpath.c str.c ;
Smail從一打文件進(jìn)行構(gòu)造.Jam自動管理依賴的頭文件.
Jam非常易于移植:它能在UNIX,VMS,Mac和NT平臺上.多數(shù)Jamfiles在上述平臺上本身就是可移植的.
Jam is unintrusive: it is small, it has negligible CPU overhead, and it doesn't create any of its own funny files (c.f. Odin, nmake, SunOS make).
Jam can build large projects spread across many directories in one pass, without recursing, tracking the relationships among all files. Jam can do this with multiple, concurrent processes.
Jam isn't under the blinkin GNU copyright, so you can incorporate it into commercial products.
構(gòu)造Boost.Jam
構(gòu)造好了Bjam以后,要安裝它只需要將生成的執(zhí)行文件拷貝到PATH變量指定的某個路徑下就可以了。各個平臺都有相應(yīng)平臺的初始構(gòu)造腳本用來構(gòu)造可執(zhí)行程序。這些腳本都接收一個可選參數(shù),用來編譯構(gòu)造的工具集的名稱。如果沒有給工具集參數(shù)沒有給,或做可用工具集的檢測,并選用一個。構(gòu)造腳本接受的參數(shù)如:
<build script name> [toolset]
無參數(shù)的運行腳本可能是最好的選擇。
Boost發(fā)布的Boost.Jam的源代碼在BOOST_ROOT/tools/build/jam_src.
如果腳本檢測適當(dāng)?shù)墓ぞ呒】赡苁且驗槟愕墓ぞ呒荒茏詣訖z測。在這些情況下,你需要在腳本參數(shù)那里指定工具集,當(dāng)然這假定工具集在PATH中可以找到.注意:編譯Boost.Jam的工具集和構(gòu)造Boost的工具集是獨立的。