diff --git a/wscript b/wscript index 82119fa..b812d76 100644 --- a/wscript +++ b/wscript @@ -1,6 +1,7 @@ # -*- python -*- import os +import subprocess top = '.' out = 'build_directory' @@ -33,10 +34,19 @@ def configure(ctx): atleast_version=cairo_version_required, args='--cflags --libs') - ctx.check_cfg(package='xpyb', - atleast_version=xpyb_version_required, - args='--cflags --libs', - mandatory=False) + try: + p = subprocess.Popen([ctx.env['PYTHON'][0], '-c', 'import xcb'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p.wait() + p.stdout.close() + p.stderr.close() + except OSError: + pass + else: + if p.returncode == 0: + ctx.check_cfg(package='xpyb', + atleast_version=xpyb_version_required, + args='--cflags --libs', + mandatory=False) # add gcc options if env['CC_NAME'] == 'gcc':