This commit is contained in:
parent
b4252f3cdd
commit
6c74a8d4ad
23
setup.py
23
setup.py
|
@ -24,18 +24,27 @@ from distutils.core import setup, Extension
|
||||||
## Modify the build arguments
|
## Modify the build arguments
|
||||||
from distutils import sysconfig
|
from distutils import sysconfig
|
||||||
|
|
||||||
|
pythonVersion = platform.python_version()[0:3]
|
||||||
|
|
||||||
removals = ['-g', '-DNDEBUG', '-O2', '-Wstrict-prototypes']
|
removals = ['-g', '-DNDEBUG', '-O2', '-Wstrict-prototypes']
|
||||||
additions = ['-DNDEBUG', '-O2']
|
additions = ['-DNDEBUG', '-O2']
|
||||||
|
|
||||||
cv_opt = sysconfig.get_config_vars()["CFLAGS"]
|
if pythonVersion == '2.4':
|
||||||
for removal in removals:
|
cv_opt = sysconfig.get_config_vars()["CFLAGS"]
|
||||||
cv_opt = cv_opt.replace(removal, " ")
|
for removal in removals:
|
||||||
for addition in additions:
|
cv_opt = cv_opt.replace(removal, " ")
|
||||||
cv_opt = cv_opt + " " + addition
|
for addition in additions:
|
||||||
sysconfig.get_config_vars()["CFLAGS"] = ' '.join(cv_opt.split())
|
cv_opt = cv_opt + " " + addition
|
||||||
|
sysconfig.get_config_vars()["CFLAGS"] = ' '.join(cv_opt.split())
|
||||||
|
else:
|
||||||
|
cv_opt = sysconfig.get_config_vars()["OPT"]
|
||||||
|
for removal in removals:
|
||||||
|
cv_opt = cv_opt.replace(removal, " ")
|
||||||
|
for addition in additions:
|
||||||
|
cv_opt = cv_opt + " " + addition
|
||||||
|
sysconfig.get_config_vars()["OPT"] = ' '.join(cv_opt.split())
|
||||||
|
|
||||||
|
|
||||||
pythonVersion = platform.python_version()[0:3]
|
|
||||||
|
|
||||||
|
|
||||||
deluge_core = Extension('deluge_core',
|
deluge_core = Extension('deluge_core',
|
||||||
|
|
Loading…
Reference in New Issue