prepare for embedded plugins builder

This commit is contained in:
Unbit
2013-11-21 14:10:41 +01:00
parent c01cf1f6be
commit 25dc608fa3
4 changed files with 24 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
#include <uwsgi.h>
/*
steps:
mkdir(.uwsgi_plugin_builder)
generate .uwsgi_plugin_builder/uwsgi.h
setenv(CFLAGS=uwsgi_cflags)
pipe uwsgiconfig.py to python passing args
*/
int uwsgi_build_plugin(char *directory) {
return 0;
}
+4
View File
@@ -907,6 +907,7 @@ static struct uwsgi_option uwsgi_base_options[] = {
{"exit", optional_argument, 0, "force exit() of the instance", uwsgi_opt_exit, NULL, UWSGI_OPT_IMMEDIATE},
{"cflags", no_argument, 0, "report uWSGI CFLAGS (useful for building external plugins)", uwsgi_opt_cflags, NULL, UWSGI_OPT_IMMEDIATE},
{"dot-h", no_argument, 0, "dump the uwsgi.h used for building the core (useful for building external plugins)", uwsgi_opt_dot_h, NULL, UWSGI_OPT_IMMEDIATE},
{"build-plugin", no_argument, 0, "build a uWSGI plugin for the current binary", uwsgi_opt_build_plugin, NULL, UWSGI_OPT_IMMEDIATE},
{"version", no_argument, 0, "print uWSGI version", uwsgi_opt_print, UWSGI_VERSION, 0},
{0, 0, 0, 0, 0, 0, 0}
};
@@ -4506,6 +4507,9 @@ void uwsgi_opt_dot_h(char *opt, char *filename, void *foobar) {
exit(0);
}
void uwsgi_opt_build_plugin(char *opt, char *directory, void *foobar) {
_exit(uwsgi_build_plugin(directory));
}
void uwsgi_opt_connect_and_read(char *opt, char *address, void *foobar) {
+3
View File
@@ -3761,6 +3761,7 @@ char *uwsgi_substitute(char *, char *, char *);
void uwsgi_opt_add_custom_option(char *, char *, void *);
void uwsgi_opt_cflags(char *, char *, void *);
void uwsgi_opt_build_plugin(char *, char *, void *);
void uwsgi_opt_dot_h(char *, char *, void *);
void uwsgi_opt_connect_and_read(char *, char *, void *);
void uwsgi_opt_extract(char *, char *, void *);
@@ -4528,6 +4529,8 @@ struct uwsgi_protocol *uwsgi_register_protocol(char *, void (*)(struct uwsgi_soc
void uwsgi_protocols_register(void);
int uwsgi_build_plugin(char *dir);
#ifdef __cplusplus
}
#endif
+1 -1
View File
@@ -546,7 +546,7 @@ class uConf(object):
'core/setup_utils', 'core/clock', 'core/init', 'core/buffer', 'core/reader', 'core/writer', 'core/alarm', 'core/cron', 'core/hooks',
'core/plugins', 'core/lock', 'core/cache', 'core/daemons', 'core/errors', 'core/hash', 'core/master_events', 'core/chunked',
'core/queue', 'core/event', 'core/signal', 'core/strings', 'core/progress', 'core/timebomb', 'core/ini', 'core/fsmon', 'core/mount',
'core/metrics',
'core/metrics', 'core/plugins_builder',
'core/rpc', 'core/gateway', 'core/loop', 'core/cookie', 'core/querystring', 'core/rb_timers', 'core/transformations', 'core/uwsgi']
# add protocols
self.gcc_list.append('proto/base')