summaryrefslogtreecommitdiff
path: root/setupinfo.py
diff options
context:
space:
mode:
authorscoder <none@none>2008-03-11 18:38:32 +0100
committerscoder <none@none>2008-03-11 18:38:32 +0100
commit31695ed5a48bb50c204b79240306fa41798c068a (patch)
tree1839af4b11800f49b03a62b755cf8723a34b0ef2 /setupinfo.py
parent0607fe9f11759368d7dca114410783b7a646534a (diff)
downloadpython-lxml-31695ed5a48bb50c204b79240306fa41798c068a.tar.gz
[svn r3413] r3756@delle: sbehnel | 2008-03-11 18:37:41 +0100
print library version and library dirs at build time as a hint (not only) to MacOS-X users --HG-- branch : trunk
Diffstat (limited to 'setupinfo.py')
-rw-r--r--setupinfo.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/setupinfo.py b/setupinfo.py
index cf5e4a72..65906728 100644
--- a/setupinfo.py
+++ b/setupinfo.py
@@ -29,12 +29,25 @@ def ext_modules(static_include_dirs, static_library_dirs, static_cflags):
else:
modules = EXT_MODULES
+ lib_version = libxslt_version()
+ print("Using build configuration of libxslt %s" % lib_version)
+
_include_dirs = include_dirs(static_include_dirs)
_library_dirs = library_dirs(static_library_dirs)
_cflags = cflags(static_cflags)
_define_macros = define_macros()
_libraries = libraries()
+ if _library_dirs:
+ message = "Building against libxml2/libxslt in "
+ if len(_library_dirs) > 1:
+ print(message + "one of the following directories:")
+ for dir in _library_dirs:
+ print(" " + dir)
+ else:
+ print(message + "the following directory: " +
+ _library_dirs[0])
+
if OPTION_AUTO_RPATH:
runtime_library_dirs = _library_dirs
else:
@@ -128,8 +141,7 @@ def define_macros():
macros.append(('WITHOUT_THREADING', None))
return macros
-def flags(option):
- cmd = "%s --%s" % (find_xslt_config(), option)
+def run_command(cmd):
try:
import subprocess
except ImportError:
@@ -141,10 +153,21 @@ def flags(option):
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
rf, ef = p.stdout, p.stderr
errors = ef.read()
+ output = rf.read()
+ return output or '', errors or ''
+
+def libxslt_version():
+ cmd = "%s --version" % find_xslt_config()
+ output, errors = run_command(cmd)
if errors:
print("ERROR: %s" % errors)
print("** make sure the development packages of libxml2 and libxslt are installed **\n")
- return str(rf.read()).split()
+ return output.strip()
+
+def flags(option):
+ cmd = "%s --%s" % (find_xslt_config(), option)
+ output, _ = run_command(cmd)
+ return output.split()
XSLT_CONFIG = None