parse plugin-specific options

This commit is contained in:
roberto@debian32
2011-09-18 06:57:19 +02:00
parent e249d567a1
commit f69526f8bf
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -4,6 +4,7 @@ from distutils import sysconfig
NAME='python'
GCC_LIST = ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'web3_subhandler', 'pump_subhandler', 'gil', 'uwsgi_pymodule', 'profiler', 'symimporter']
#OBJ_LIST = ['/usr/lib/libpython2.6.a']
CFLAGS = ['-I' + sysconfig.get_python_inc(), '-I' + sysconfig.get_python_inc(plat_specific=True) ]
+9
View File
@@ -726,6 +726,12 @@ def build_plugin(path, uc, cflags, ldflags, libs, name = None):
else:
p_cflags.append("-D%s_plugin=%s_plugin" % (up.NAME, name))
try:
for opt in uc.config.options(name):
p_cflags.append('-DUWSGI_PLUGIN_%s_%s="%s"' % (name.upper(), opt.upper(), uc.config.get(name, opt, '1')))
except:
pass
plugin_dest = uc.get('plugin_dir') + '/' + name + '_plugin'
shared_flag = '-shared'
@@ -746,6 +752,9 @@ def build_plugin(path, uc, cflags, ldflags, libs, name = None):
except:
pass
#for ofile in up.OBJ_LIST:
# gcc_list.insert(0,ofile)
gccline = "%s -fPIC %s -o %s.so %s %s %s %s" % (GCC, shared_flag, plugin_dest, ' '.join(p_cflags), ' '.join(p_ldflags), ' '.join(gcc_list), ' '.join(p_libs) )
print(gccline)