summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAndrew Resch <andrewresch@gmail.com>2008-10-23 08:05:02 +0000
committerAndrew Resch <andrewresch@gmail.com>2008-10-23 08:05:02 +0000
commit718c789c8ede356f5c2f8d6f1c53f1d588bbfccb (patch)
tree3cc636d13b4514db54b7cd44ce58ef417de61bb2 /setup.py
parent16cc7be912b37ca4f42b95dd2d4375f718ab09af (diff)
downloaddeluge-718c789c8ede356f5c2f8d6f1c53f1d588bbfccb.tar.gz
deluge-718c789c8ede356f5c2f8d6f1c53f1d588bbfccb.tar.bz2
deluge-718c789c8ede356f5c2f8d6f1c53f1d588bbfccb.zip
Handle OS X better in the build system - patch from hydri
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py34
1 files changed, 28 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 2a25ea533..7957918a9 100644
--- a/setup.py
+++ b/setup.py
@@ -51,6 +51,12 @@ def windows_check():
else:
return False
+def osx_check():
+ if platform.system() in ("Darwin"):
+ return True
+ else:
+ return False
+
# Try to get SVN revision number to append to version
revision_string = ""
try:
@@ -133,7 +139,7 @@ _library_dirs = [
_include_dirs = [
'./libtorrent',
'./libtorrent/include',
- './libtorrent/include/libtorrent',
+ './libtorrent/include/libtorrent'
]
if windows_check():
@@ -156,6 +162,12 @@ if windows_check():
]
else:
_include_dirs += ['/usr/include/python' + python_version]
+ _library_dirs += [sysconfig.get_config_var("LIBDIR"), '/opt/local/lib']
+ if osx_check():
+ _include_dirs += [
+ '/opt/local/include/boost-1_35',
+ '/opt/local/include/boost-1_36'
+ ]
_libraries = [
'boost_filesystem',
'boost_date_time',
@@ -167,13 +179,23 @@ else:
'z'
]
- # Modify the libs if necessary for systems with only -mt boost libs
+ dynamic_lib_extension = ".so"
+ if osx_check():
+ dynamic_lib_extension = ".dylib"
+
+ _lib_extensions = ['-mt-1_36', '-mt-1_35', '-mt']
+
+ # Modify the libs if necessary for systems with only -mt boost libs
for lib in _libraries:
if lib[:6] == "boost_":
- # If there is a -mt version use that
- if os.path.exists(os.path.join(sysconfig.get_config_var("LIBDIR"), "lib" + lib + "-mt.so")):
- _libraries[_libraries.index(lib)] = lib + "-mt"
-
+ for lib_prefix in _library_dirs:
+ for lib_suffix in _lib_extensions:
+ # If there is a -mt version use that
+ if os.path.exists(os.path.join(lib_prefix, "lib" + lib + lib_suffix + dynamic_lib_extension)):
+ _libraries[_libraries.index(lib)] = lib + lib_suffix
+ lib = lib + lib_suffix
+ break
+
_sources = glob.glob("./libtorrent/src/*.cpp") + \
glob.glob("./libtorrent/src/*.c") + \
glob.glob("./libtorrent/src/kademlia/*.cpp") + \