check for distro type to hopefully fix '-mt' no '-mnt' for good.

This commit is contained in:
Marcos Pinto 2007-05-23 19:51:21 +00:00
parent b1c4b4d448
commit bc3a9e5b8a
1 changed files with 29 additions and 8 deletions

View File

@ -87,6 +87,15 @@ if ARCH == "x64":
# it has been removed to prevent confusion. # it has been removed to prevent confusion.
if not OS == "win": if not OS == "win":
if os.WEXITSTATUS(os.system('grep -q "Debian GNU/Linux 4.0" /etc/issue')) == 0:
boosttype = 'nomt'
elif os.WEXITSTATUS(os.system('grep -q "Ubuntu 7.04" /etc/issue')) == 0:
boosttype = 'nomt'
elif os.WEXITSTATUS(os.system('grep -q "Ubuntu 6.06" /etc/issue')) == 0:
boosttype = 'nomt'
else:
boosttype = 'mt'
removals = ['-g', '-DNDEBUG', '-O2', '-Wstrict-prototypes'] removals = ['-g', '-DNDEBUG', '-O2', '-Wstrict-prototypes']
additions = ['-DNDEBUG', '-O2'] additions = ['-DNDEBUG', '-O2']
@ -104,6 +113,8 @@ if not OS == "win":
for addition in additions: for addition in additions:
cv_opt = cv_opt + " " + addition cv_opt = cv_opt + " " + addition
sysconfig.get_config_vars()["OPT"] = ' '.join(cv_opt.split()) sysconfig.get_config_vars()["OPT"] = ' '.join(cv_opt.split())
else:
librariestype = 'mt'
# NOTE: The Rasterbar Libtorrent source code is in the libtorrent/ directory # NOTE: The Rasterbar Libtorrent source code is in the libtorrent/ directory
# inside of Deluge's source tarball. On several occasions, it has been # inside of Deluge's source tarball. On several occasions, it has been
@ -115,14 +126,24 @@ if not OS == "win":
# we will probably begin to build against a system libtorrent, but at the # we will probably begin to build against a system libtorrent, but at the
# moment, we are including the source code to make packaging on Debian and # moment, we are including the source code to make packaging on Debian and
# Ubuntu possible. # Ubuntu possible.
if boosttype == "nomt":
librariestype = ['boost_filesystem', 'boost_date_time',
'boost_regex', 'boost_serialization',
'boost_thread',
'z', 'pthread']
print 'Libraries nomt'
elif boosttype == "mt":
librariestype = ['boost_filesystem-mt', 'boost_date_time-mt',
'boost_regex-mt', 'boost_serialization-mt',
'boost_thread-mt',
'z', 'pthread']
print 'Libraries mt'
deluge_core = Extension('deluge_core', deluge_core = Extension('deluge_core',
include_dirs = ['./libtorrent', './libtorrent/include', include_dirs = ['./libtorrent', './libtorrent/include',
'./libtorrent/include/libtorrent', './libtorrent/include/libtorrent',
'/usr/include/python' + python_version], '/usr/include/python' + python_version],
libraries = ['boost_filesystem-mt', 'boost_date_time-mt', libraries = librariestype,
'boost_regex-mt', 'boost_serialization-mt',
'boost_thread-mt', 'z', 'pthread'],
extra_compile_args = EXTRA_COMPILE_ARGS, extra_compile_args = EXTRA_COMPILE_ARGS,
sources = ['src/deluge_core.cpp', sources = ['src/deluge_core.cpp',
'libtorrent/src/alert.cpp', 'libtorrent/src/alert.cpp',