mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-02 14:44:21 +00:00
Handle OS X better in the build system - patch from hydri
This commit is contained in:
parent
16cc7be912
commit
718c789c8e
30
setup.py
30
setup.py
@ -51,6 +51,12 @@ def windows_check():
|
|||||||
else:
|
else:
|
||||||
return False
|
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
|
# Try to get SVN revision number to append to version
|
||||||
revision_string = ""
|
revision_string = ""
|
||||||
try:
|
try:
|
||||||
@ -133,7 +139,7 @@ _library_dirs = [
|
|||||||
_include_dirs = [
|
_include_dirs = [
|
||||||
'./libtorrent',
|
'./libtorrent',
|
||||||
'./libtorrent/include',
|
'./libtorrent/include',
|
||||||
'./libtorrent/include/libtorrent',
|
'./libtorrent/include/libtorrent'
|
||||||
]
|
]
|
||||||
|
|
||||||
if windows_check():
|
if windows_check():
|
||||||
@ -156,6 +162,12 @@ if windows_check():
|
|||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
_include_dirs += ['/usr/include/python' + python_version]
|
_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 = [
|
_libraries = [
|
||||||
'boost_filesystem',
|
'boost_filesystem',
|
||||||
'boost_date_time',
|
'boost_date_time',
|
||||||
@ -167,12 +179,22 @@ else:
|
|||||||
'z'
|
'z'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
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
|
# Modify the libs if necessary for systems with only -mt boost libs
|
||||||
for lib in _libraries:
|
for lib in _libraries:
|
||||||
if lib[:6] == "boost_":
|
if lib[:6] == "boost_":
|
||||||
# If there is a -mt version use that
|
for lib_prefix in _library_dirs:
|
||||||
if os.path.exists(os.path.join(sysconfig.get_config_var("LIBDIR"), "lib" + lib + "-mt.so")):
|
for lib_suffix in _lib_extensions:
|
||||||
_libraries[_libraries.index(lib)] = lib + "-mt"
|
# 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") + \
|
_sources = glob.glob("./libtorrent/src/*.cpp") + \
|
||||||
glob.glob("./libtorrent/src/*.c") + \
|
glob.glob("./libtorrent/src/*.c") + \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user