From f69526f8bfec5ad5e11ff9fd13bc9735a906b0d2 Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Sun, 18 Sep 2011 06:57:19 +0200 Subject: [PATCH] parse plugin-specific options --- plugins/python/uwsgiplugin.py | 1 + uwsgiconfig.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/plugins/python/uwsgiplugin.py b/plugins/python/uwsgiplugin.py index c230335b..4b46e88f 100644 --- a/plugins/python/uwsgiplugin.py +++ b/plugins/python/uwsgiplugin.py @@ -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) ] diff --git a/uwsgiconfig.py b/uwsgiconfig.py index 2d3db611..410d76fc 100644 --- a/uwsgiconfig.py +++ b/uwsgiconfig.py @@ -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)