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 ;
|
|
|
|
shell-prefix = $(with-xmlrpc-c)/bin/ ;
|
2011-11-30 12:53:13 +04:00
|
|
|
if ! [ path.exists $(shell-prefix)xmlrpc-c-config ] {
|
|
|
|
exit Could not find $(shell-prefix)xmlrpc-c-config : 1 ;
|
|
|
|
}
|
2011-11-21 21:19:24 +04:00
|
|
|
} else {
|
2011-11-26 15:57:09 +04:00
|
|
|
if [ SHELL $(TOP)"/jam-files/test.sh -include xmlrpc-c/base.hpp -lxmlrpc_server_abyss++" ] = 0 {
|
2011-11-28 22:24:23 +04:00
|
|
|
build-moses-server = true ;
|
2011-11-21 21:19:24 +04:00
|
|
|
}
|
2011-11-28 22:41:21 +04:00
|
|
|
shell-prefix = "" ;
|
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 12:53:13 +04:00
|
|
|
xmlrpc-linkflags = [ shell_or_die "$(shell-prefix)xmlrpc-c-config c++2 abyss-server --libs" ] ;
|
|
|
|
xmlrpc-cxxflags = [ shell_or_die "$(shell-prefix)xmlrpc-c-config c++2 abyss-server --cflags" ] ;
|
2011-11-21 21:19:24 +04:00
|
|
|
|
2011-11-28 22:24:23 +04:00
|
|
|
exe mosesserver : mosesserver.cpp ../../moses/src//moses ../../OnDiskPt/src//OnDiskPt : <linkflags>$(xmlrpc-linkflags) <cxxflags>$(xmlrpc-cxxflags) ;
|
2011-11-21 21:19:24 +04:00
|
|
|
} else {
|
|
|
|
alias mosesserver ;
|
|
|
|
}
|