mosesdecoder/contrib/server/Jamfile

42 lines
1.3 KiB
Plaintext
Raw Normal View History

2011-11-30 12:53:13 +04:00
#If you get compilation errors here, make sure you have xmlrpc-c installed properly, including the abyss server option.
2011-11-21 21:19:24 +04:00
import option ;
2011-11-30 12:53:13 +04:00
import path ;
2011-11-21 21:19:24 +04:00
2011-11-28 22:24:23 +04:00
with-xmlrpc-c = [ option.get "with-xmlrpc-c" ] ;
if $(with-xmlrpc-c) {
build-moses-server = true ;
2011-11-30 16:51:24 +04:00
xmlrpc-command = $(with-xmlrpc-c)/bin/xmlrpc-c-config ;
if ! [ path.exists $(xmlrpc-command) ] {
exit Could not find $(xmlrpc-command) : 1 ;
2011-11-30 12:53:13 +04:00
}
2011-11-21 21:19:24 +04:00
} else {
2011-11-30 16:51:24 +04:00
xmlrpc-check = [ _shell "xmlrpc-c-config --features 2>/dev/null" : exit-status ] ;
if $(xmlrpc-check[2]) = 0 {
if [ MATCH "(abyss-server)" : $(xmlrpc-check[1]) ] {
build-moses-server = true ;
} else {
echo "Found xmlrpc-c but it does not have abyss-server. Skipping mosesserver." ;
}
2011-11-21 21:19:24 +04:00
}
2011-11-30 16:51:24 +04:00
xmlrpc-command = "xmlrpc-c-config" ;
2011-11-21 21:19:24 +04:00
}
2011-11-30 12:53:13 +04:00
rule shell_or_die ( cmd ) {
local ret = [ _shell $(cmd) : exit-status ] ;
if $(ret[2]) != 0 {
exit "Failed to run $(cmd)" : 1 ;
}
return $(ret[1]) ;
}
2011-11-28 22:24:23 +04:00
if $(build-moses-server) = true
2011-11-21 21:19:24 +04:00
{
2011-11-30 16:51:24 +04:00
xmlrpc-linkflags = [ shell_or_die "$(xmlrpc-command) c++2 abyss-server --libs" ] ;
xmlrpc-cxxflags = [ shell_or_die "$(xmlrpc-command) c++2 abyss-server --cflags" ] ;
2011-11-21 21:19:24 +04:00
exe mosesserver : mosesserver.cpp ../../moses//moses ../../OnDiskPt//OnDiskPt ../../moses-cmd/IOWrapper.cpp : <linkflags>$(xmlrpc-linkflags) <cxxflags>$(xmlrpc-cxxflags) ;
2011-11-21 21:19:24 +04:00
} else {
alias mosesserver ;
}