mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Fixed jam files for the case where xmlrpc-c is not available.
This commit is contained in:
parent
bafe60c3a1
commit
3d2da45bdf
@ -34,7 +34,7 @@ else
|
||||
}
|
||||
else # is curlpp-config in the path ?
|
||||
{
|
||||
local curlpp-check = [ _shell "curlpp-config >/dev/null" : exit-status ] ;
|
||||
local curlpp-check = [ _shell "curlpp-config 2>/dev/null" : exit-status ] ;
|
||||
if $(curlpp-check[2]) = 0 { config = curlpp-config ; }
|
||||
}
|
||||
|
||||
|
@ -1,86 +0,0 @@
|
||||
# import path ;
|
||||
|
||||
import option ;
|
||||
# Is the XMLRPC-C server available?
|
||||
|
||||
rule shell_or_die ( cmd ) {
|
||||
local ret = [ _shell $(cmd) : exit-status ] ;
|
||||
if $(ret[2]) != 0 {
|
||||
exit "Failed to run $(cmd)" : 1 ;
|
||||
}
|
||||
return $(ret[1]) ;
|
||||
}
|
||||
|
||||
build-server = [ option.get "no-xmlrpc-c" : "yes" : "no" ] ;
|
||||
|
||||
if $(build-server) = yes
|
||||
{
|
||||
# by default, we try to build server capabilities into the server
|
||||
xmlrpc-c-path = [ option.get "with-xmlrpc-c" ] ;
|
||||
if $(xmlrpc-c-path) = ""
|
||||
{
|
||||
xmlrpc-c-config-cmd = "xmlrpc-c-config" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlrpc-c-config-cmd = "$(xmlrpc-c-path)/bin/xmlrpc-c-config" ;
|
||||
}
|
||||
|
||||
# check if xmlrpc-config is available
|
||||
xmlrpc-check = [ _shell "$(xmlrpc-c-config-cmd) --features 2>/dev/null" : exit-status ] ;
|
||||
if $(xmlrpc-check[2]) = 0
|
||||
{
|
||||
# xmlrpc-c-config was found. Now check if abyss server is available
|
||||
if [ MATCH "(abyss-server)" : $(xmlrpc-check[1]) ]
|
||||
{
|
||||
# Yes, abyss server is available. Is it the right xmlrpc-c version
|
||||
# Version 1.25.29 does not work.
|
||||
xmlrpc-check = [ _shell "$(xmlrpc-c-config-cmd) --version 2>/dev/null" : exit-status ] ;
|
||||
xmlrpc-c-version = $(xmlrpc-check[1]) ;
|
||||
if [ MATCH "(1.25.29)" : $(xmlrpc-c-version) ]
|
||||
{
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
|
||||
echo "XMLRPC-C: Moses is not compatible with xmlrpc-c version $(xmlrpc-c-version). " ;
|
||||
echo "XMLRPC-C: Use another one or compile without server functionality (--no-xmlrpc-c)." ;
|
||||
echo "XMLRPC-C: Build aborted." ;
|
||||
exit : 1 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
# echo "XMLRPC-C: Found abyss server." ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
|
||||
echo "XMLRPC-C: Found xmlrpc-c but it does not provide the abyss server." ;
|
||||
echo "XMLRPC-C: Use another xmlrpc-c installation that provides one " ;
|
||||
echo "XMLRPC-C: or compile without server functionality (--no-xmlrpc-c)." ;
|
||||
exit : 1 ;
|
||||
}
|
||||
}
|
||||
else if [ option.get "with-xmlrpc-c" ]
|
||||
{
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
|
||||
echo "XMLRPC-C: Could not find $(xmlrpc-c-config-cmd). Build aborted. " ;
|
||||
exit : 1 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
build-server = no ;
|
||||
rule build_server { return no ; }
|
||||
}
|
||||
}
|
||||
|
||||
if $(build-server) = yes
|
||||
{
|
||||
xmlrpc-path = [ _shell "$(xmlrpc-c-config-cmd) --prefix 2>/dev/null" : exit-status ] ;
|
||||
rule build_server { return $(xmlrpc-c-config-cmd) ; }
|
||||
rule xmlrpc_path { return $(xmlrpc-path[1]) ; }
|
||||
}
|
||||
else
|
||||
{
|
||||
rule build_server { return no ; }
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
if [ option.get "no-xmlrpc-c" ]
|
||||
{
|
||||
rule xmlrpc-c ( what ? ) { } # never return anything
|
||||
rule xmlrpc ( what ? ) { } # never return anything
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -23,8 +23,10 @@ else
|
||||
local config ;
|
||||
if ! $(xmlrpc) { config = "xmlrpc-c-config" ; }
|
||||
else { config = "$(xmlrpc)/bin/xmlrpc-c-config" ; }
|
||||
|
||||
# check if xmlrpc-config can be executed
|
||||
xmlrpc-check = [ _shell "$(config) --features 2>/dev/null" : exit-status ] ;
|
||||
|
||||
if $(xmlrpc-check[2]) = 0 # yes it can
|
||||
{
|
||||
# is the abyss server is available ?
|
||||
@ -51,8 +53,35 @@ else
|
||||
echo "XMLRPC-C: or compile without server functionality (--no-xmlrpc-c)." ;
|
||||
exit : 1 ;
|
||||
}
|
||||
local prefix = [ shell_or_die "$(config) --prefix" ] ;
|
||||
local version = [ shell_or_die "$(config) --version" ] ;
|
||||
echo "XMLRPC-C: USING VERSION $(version) FROM $(prefix)" ;
|
||||
|
||||
# now add stuff to the requirements
|
||||
local cflags = [ shell_or_die "$(config) c++2 abyss-server --cflags" ] ;
|
||||
requirements += <define>HAVE_XMLRPC_C ;
|
||||
requirements += <cxxflags>$(xmlrpc-cxxflags) ;
|
||||
|
||||
local libs = [ shell_or_die "$(config) c++2 abyss-server --libs" ] ;
|
||||
for local i in [ SPLIT_BY_CHARACTERS $(libs) : " " ]
|
||||
{
|
||||
local libname = [ MATCH "-l(xmlrpc.*)" : $(i) ] ;
|
||||
if $(libname)
|
||||
{
|
||||
external-lib $(libname) : $(prefix)/lib ;
|
||||
# : : <runtime-link>static:<link>static <runtime-link>shared:<link>shared ;
|
||||
requirements += <library>$(libname) ;
|
||||
}
|
||||
local pathname = [ MATCH "-L(.*)" : $(i) ] ;
|
||||
if $(pathname)
|
||||
{
|
||||
requirements += <library-path>$(pathname) ;
|
||||
}
|
||||
}
|
||||
|
||||
rule xmlrpc { return yes ; }
|
||||
}
|
||||
else if [ option.get "with-xmlrpc-c" ]
|
||||
else if [ option.get "with-xmlrpc-c" ]
|
||||
{
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
|
||||
echo "XMLRPC-C: Could not find $(config). " ;
|
||||
@ -60,34 +89,11 @@ else
|
||||
echo "Use --no-xmlrpc-c to compile moses without server functionality. " ;
|
||||
exit : 1 ;
|
||||
}
|
||||
|
||||
local prefix = [ shell_or_die "$(config) --prefix" ] ;
|
||||
local version = [ shell_or_die "$(config) --version" ] ;
|
||||
echo "XMLRPC-C: USING VERSION $(version) FROM $(prefix)" ;
|
||||
|
||||
# now add stuff to the requirements
|
||||
local cflags = [ shell_or_die "$(config) c++2 abyss-server --cflags" ] ;
|
||||
requirements += <define>HAVE_XMLRPC_C ;
|
||||
requirements += <cxxflags>$(xmlrpc-cxxflags) ;
|
||||
|
||||
local libs = [ shell_or_die "$(config) c++2 abyss-server --libs" ] ;
|
||||
for local i in [ SPLIT_BY_CHARACTERS $(libs) : " " ]
|
||||
{
|
||||
local libname = [ MATCH "-l(xmlrpc.*)" : $(i) ] ;
|
||||
if $(libname)
|
||||
{
|
||||
external-lib $(libname) : $(prefix)/lib ;
|
||||
# : : <runtime-link>static:<link>static <runtime-link>shared:<link>shared ;
|
||||
requirements += <library>$(libname) ;
|
||||
}
|
||||
local pathname = [ MATCH "-L(.*)" : $(i) ] ;
|
||||
if $(pathname)
|
||||
{
|
||||
requirements += <library-path>$(pathname) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
rule xmlrpc ( what ? ) { } # never return anything
|
||||
}
|
||||
|
||||
rule xmlrpc { return yes ; }
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user