mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-22 10:09:14 +00:00
Handle OS X better in the build system - patch from hydri
This commit is contained in:
parent
87e77565fc
commit
7d10b60811
1 changed files with 27 additions and 4 deletions
31
setup.py
31
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
|
||||||
|
|
||||||
if not os.environ.has_key("CC"):
|
if not os.environ.has_key("CC"):
|
||||||
os.environ["CC"] = "gcc"
|
os.environ["CC"] = "gcc"
|
||||||
|
|
||||||
|
@ -110,7 +116,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():
|
||||||
|
@ -133,6 +139,11 @@ if windows_check():
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
_include_dirs += ['/usr/include/python' + python_version]
|
_include_dirs += ['/usr/include/python' + python_version]
|
||||||
|
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',
|
||||||
|
@ -144,12 +155,24 @@ else:
|
||||||
'z'
|
'z'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
dynamic_lib_extension = ".so"
|
||||||
|
if osx_check():
|
||||||
|
dynamic_lib_extension = ".dylib"
|
||||||
|
|
||||||
|
_lib_extensions = ['-mt-1_36', '-mt-1_35', '-mt']
|
||||||
|
_library_dirs += [sysconfig.get_config_var("LIBDIR"), '/opt/local/lib']
|
||||||
|
|
||||||
# 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…
Add table
Add a link
Reference in a new issue