Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-03-26 15:21:55 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-03-26 15:21:55 +0300
commitd364211d9088667ddb98136e0c9a29b913c31717 (patch)
tree9d6685d510a063f8e153ef096d78823bedc49250 /jam-files
parent1064aaacbe4e7dd0571f35ef0eba3a2efc212859 (diff)
More bjam fiddling.
Diffstat (limited to 'jam-files')
-rw-r--r--jam-files/check-environment.jam42
-rw-r--r--jam-files/sanity.jam8
2 files changed, 50 insertions, 0 deletions
diff --git a/jam-files/check-environment.jam b/jam-files/check-environment.jam
new file mode 100644
index 000000000..32866683b
--- /dev/null
+++ b/jam-files/check-environment.jam
@@ -0,0 +1,42 @@
+# get stuff from environment variables if not set on the command line
+# unless blocked explicitly
+for local what in cmph irstlm
+{
+ if ! [ option.get "with-$(what)" ] && ! [ option.get "no-$(what)" : : no ]
+ {
+ local where = [ os.environ "$(what:U)_ROOT" ] ;
+ if $(where)
+ {
+ echo "setting option with-$(what) from environment variable "
+ "$(what:U)_ROOT ." ;
+ option.set "with-$(what)" : $(where) ;
+ }
+ }
+ local where = [ option.get "with-$(what)" ] ;
+}
+
+# if --with-moses-regtest is specified without a directory
+local regtest = [ option.get "with-moses-regtest" : no : yes ] ;
+if $(regtest) = yes
+{ # regtests requested but no path given
+ echo "Regression tests requested but no path given." ;
+ local $(where) = [ os.environ "MOSES_REGTEST_ROOT" ] ;
+ if ! $(where)
+ {
+ local HOME = [ os.environ "HOME" ] ;
+ if [ path.exists $(HOME)/moses-regression-tests ]
+ {
+ echo "Using ~/moses-regression-tests as the default." ;
+ option.set "with-moses-regtest" : "~/moses-regression-tests" ;
+ }
+ }
+ else
+ {
+ if [ path.exists $(where) ]
+ {
+ echo "Using $(where) from environment variable MOSES_REGTEST_ROOT."
+ option.set "with-moses-regtest" : $(where) ;
+ }
+ }
+}
+
diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam
index e991b7eb2..b16343c7b 100644
--- a/jam-files/sanity.jam
+++ b/jam-files/sanity.jam
@@ -22,6 +22,14 @@ rule shell_or_fail ( cmd ) {
}
}
+rule shell_or_die ( cmd ) {
+ local ret = [ SHELL $(cmd) : exit-status ] ;
+ if $(ret[2]) != 0 {
+ exit $(cmd) failed : 1 ;
+ }
+ return [ trim-nl $(ret[1]) ] ;
+}
+
cxxflags = [ os.environ "CXXFLAGS" ] ;
cflags = [ os.environ "CFLAGS" ] ;
ldflags = [ os.environ "LDFLAGS" ] ;