Proper version check for xmlrpc-c.

This commit is contained in:
Ulrich Germann 2015-12-06 17:00:46 +00:00
parent d56d900d6a
commit 7fb2e92951
2 changed files with 24 additions and 4 deletions

View File

@ -12,9 +12,9 @@ else
with-xmlrpc-c = [ option.get "with-xmlrpc-c" ] ;
if $(with-xmlrpc-c) {
echo While building mosesserver ... ;
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
echo "!!! You are linking the XMLRPC-C library; Must be v.1.32 (September 2012) or higher !!!" ;
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
# echo "!!! You are linking the XMLRPC-C library; Must be v.1.32 (September 2012) or higher !!!" ;
# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
build-moses-server = true ;
xmlrpc-command = $(with-xmlrpc-c)/bin/xmlrpc-c-config ;

View File

@ -55,8 +55,28 @@ else
}
local prefix = [ shell_or_die "$(config) --prefix" ] ;
local version = [ shell_or_die "$(config) --version" ] ;
echo "XMLRPC-C: USING VERSION $(version) FROM $(prefix)" ;
# Check the version is recent enough:
# If anyone knows a better way to do this, go ahead and fix this.
minversion = 1.32.0 ;
local cmd = "perl -e '@a = split(/\\./,@ARGV[0]); @b = split(/\\./,$ARGV[1]); ++$i while $i < $#a && $a[$i] == $b[$i]; die if $a[$i] < $b[$i];'" ;
local check = [ SHELL "$(cmd) $(version) $(minversion) 2>/dev/null" : exit-status ] ;
if $(check[2]) = 0
{
echo "XMLRPC-C: USING VERSION $(version) FROM $(prefix)" ;
}
else
{
echo "\nCOMPILATION FAILED! YOUR VERSION OF THE XMLRPC-C LIBRARY IS TOO OLD.\n" ;
echo "Moses server functionality requires XMLRPC-C version $(minversion) or newer." ;
echo "The version provided in $(prefix) is $(version). " ;
echo "Install a suitable version if necessary and provide its location with\n " ;
echo " --with-xmlrpc-c=/path/to/correct/version\n" ;
echo "You can also use --no-xmlrpc-c to compile without the xmlrpc-c library, " ;
echo "in which case Moses will work in batch mode, but can't be run as a server. " ;
exit : 1 ;
}
# now add stuff to the requirements
local xmlrpc-cxxflags = [ shell_or_die "$(config) c++2 abyss-server --cflags" ] ;
requirements += <define>HAVE_XMLRPC_C ;