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

server.jam « jam-files - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1cb2e0d384fa1f9242f840cdebc0f6de8d714c26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# 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 ; }
}