import option path build-system ; local dependencies = ; local with-irstlm = [ option.get "with-irstlm" ] ; if $(with-irstlm) { lib irstlm : : $(with-irstlm)/lib ; obj IRST.o : IRST.cpp ..//headers : $(with-irstlm)/include ; alias irst : IRST.o irstlm : : : LM_IRST ; dependencies += irst ; echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ; echo "!!! You are linking the IRSTLM library; be sure the release is >= 5.70.02 !!!" ; echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ; } local with-srilm = [ option.get "with-srilm" ] ; if $(with-srilm) { if [ option.get "with-srilm-dynamic" : no : yes ] = yes { alias sri-libs : srilm ; } else { sri-arch = [ option.get "with-srilm-arch" ] ; sri-arch ?= [ _shell $(with-srilm)/sbin/machine-type ] ; sri-lib = $(with-srilm)/lib/$(sri-arch) $(with-srilm)/flm/obj/$(sri-arch) ; lib flm : : $(sri-lib) ; lib misc : flm : $(sri-lib) ; lib dstruct : misc flm : $(sri-lib) ; lib oolm : dstruct misc flm : $(sri-lib) ; alias sri-libs : oolm dstruct misc flm ; } obj SRI.o : SRI.cpp ..//headers : $(with-srilm)/include off ; obj ParallelBackoff.o : ParallelBackoff.cpp ..//headers : $(with-srilm)/include off ; alias sri : SRI.o ParallelBackoff.o sri-libs : : : LM_SRI ; dependencies += sri ; } local with-randlm = [ option.get "with-randlm" ] ; if $(with-randlm) { lib randlm : : $(with-randlm)/lib ; obj Rand.o : Rand.cpp randlm ..//headers : $(with-randlm)/include ; alias rand : Rand.o : : : LM_RAND ; dependencies += rand ; } obj Factory.o : Factory.cpp ..//headers $(dependencies) ; lib LM : Base.cpp Factory.o Implementation.cpp Joint.cpp Ken.cpp MultiFactor.cpp Remote.cpp SingleFactor.cpp ../../../lm//kenlm ..//headers $(dependencies) ; #Huge kludge to force building if different --with options are passed. #Could have used features like on but getting these to apply only to linking was ugly and it still didn't trigger an install (since the install path doesn't encode features). path-constant LM-LOG : bin/lm.log ; #Is there no other way to read a file with bjam? local previous = none ; if [ path.exists $(LM-LOG) ] { previous = [ _shell "cat $(LM-LOG)" ] ; } current = "" ; for local i in srilm irstlm randlm { local optval = [ option.get "with-$(i)" ] ; if $(optval) { current = "$(current) --with-$(i)=$(optval)" ; } } if $(current) != $(previous) { #Write inconsistent while the build is running if [ path.exists $(LM-LOG) ] { local ignored = @($(LM-LOG):E=inconsistent) ; } #Write $(current) to $(LM-LOG) after the build completes. rule post-build ( ok ? ) { if $(ok) { local ignored = @($(LM-LOG):E=$(current)) ; } } IMPORT $(__name__) : post-build : : $(__name__).post-build ; build-system.set-post-build-hook $(__name__).post-build ; always Factory.o ; always LM ; }