Newer
Older
"""RQL packaging information.
:copyright: 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: General Public License version 2 - http://www.gnu.org/licenses
__docformat__ = "restructuredtext en"
short_desc = "relationship query language (RQL) utilities"
long_desc = """A library providing the base utilities to handle RQL queries,
such as a parser, a type inferencer.
"""
web = "http://www.logilab.org/project/rql"
ftp = "ftp://ftp.logilab.org/pub/rql"
def gecode_version():
import os, subprocess
if os.path.exists('data/gecode_version.cc'):
try:
res = os.system("g++ -o gecode_version data/gecode_version.cc")
p = subprocess.Popen("./gecode_version", stdout=subprocess.PIPE)
vers = p.stdout.read()
version = [int(c) for c in vers.strip().split('.')]
except OSError:
pass
return version
def encode_version(a,b,c):
return ((a<<16)+(b<<8)+c)
GECODE_VERSION = encode_version(*gecode_version())
if sys.platform != 'win32':
ext_modules = [Extension('rql_solve',
['gecode_solver.cpp'],
libraries=['gecodeint', 'gecodekernel',
'gecodesearch','gecodesupport'],
extra_compile_args=['-DGE_VERSION=%s' % GECODE_VERSION],
]
else:
ext_modules = [ Extension('rql_solve',
['gecode_solver.cpp'],
libraries=['gecodeint', 'gecodekernel',
'gecodesearch','gecodesupport'],
extra_compile_args=['-DGE_VERSION=%s' % GECODE_VERSION],
extra_link_args=['-static-libgcc'],