summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Resch <andrewresch@gmail.com>2008-11-30 01:11:26 +0000
committerAndrew Resch <andrewresch@gmail.com>2008-11-30 01:11:26 +0000
commit18cc95933a0c0d1c9185b51cf2a2d7ef48957df6 (patch)
tree3062c9f16ca5208b73f79792a90e157e3b71df27
parentaeb6b96987552312fc2f251da9539a68f17475ec (diff)
downloaddeluge-18cc95933a0c0d1c9185b51cf2a2d7ef48957df6.tar.gz
deluge-18cc95933a0c0d1c9185b51cf2a2d7ef48957df6.tar.bz2
deluge-18cc95933a0c0d1c9185b51cf2a2d7ef48957df6.zip
Better libtorrent check in setup
-rw-r--r--setup.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index abf9ca7d3..80464c7a8 100644
--- a/setup.py
+++ b/setup.py
@@ -176,7 +176,18 @@ for source in _sources:
break
_ext_modules = []
-if windows_check() or not os.path.exists(os.path.join(sysconfig.get_config_var("LIBDIR"), "libtorrent-rasterbar.so.1")):
+
+# Check for a system libtorrent and if found, then do not build the libtorrent extension
+build_libtorrent = True
+try:
+ import libtorrent
+except ImportError:
+ build_libtorrent = True
+else:
+ if libtorrent.version_major == 0 and libtorrent.version_minor == 14:
+ build_libtorrent = False
+
+if build_libtorrent:
# There isn't a system libtorrent library, so let's build the one included with deluge
libtorrent = Extension(
'libtorrent',