mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-06-16 02:15:48 +00:00
added --perl-local-lib
This commit is contained in:
@@ -14,6 +14,7 @@ struct uwsgi_perl {
|
||||
int fd;
|
||||
char *psgibuffer;
|
||||
char *psgi;
|
||||
char *locallib;
|
||||
PerlInterpreter *main;
|
||||
pthread_key_t u_interpreter;
|
||||
PerlInterpreter **interp;
|
||||
@@ -26,6 +27,7 @@ struct uwsgi_perl {
|
||||
|
||||
#define LONG_ARGS_PERL_BASE 17000 + ((5 + 1) * 1000)
|
||||
#define LONG_ARGS_PSGI LONG_ARGS_PERL_BASE + 1
|
||||
#define LONG_ARGS_PERL_LOCAL_LIB LONG_ARGS_PERL_BASE + 2
|
||||
|
||||
void init_perl_embedded_module(void);
|
||||
int psgi_response(struct wsgi_request *, PerlInterpreter *, AV*);
|
||||
|
||||
@@ -8,6 +8,7 @@ struct uwsgi_perl uperl;
|
||||
struct option uwsgi_perl_options[] = {
|
||||
|
||||
{"psgi", required_argument, 0, LONG_ARGS_PSGI},
|
||||
{"perl-local-lib", required_argument, 0, LONG_ARGS_PERL_LOCAL_LIB},
|
||||
{0, 0, 0, 0},
|
||||
|
||||
};
|
||||
@@ -142,6 +143,12 @@ int uwsgi_perl_init(){
|
||||
PL_origalen = 1;
|
||||
perl_parse(uperl.main, xs_init, 4, embedding, NULL);
|
||||
|
||||
if (uperl.locallib) {
|
||||
char *ll = uwsgi_concat3("use local::lib '", uperl.locallib, "' ;");
|
||||
uwsgi_log("using %s as local::lib directory\n", uperl.locallib);
|
||||
perl_eval_pv(ll, 0);
|
||||
free(ll);
|
||||
}
|
||||
perl_eval_pv("use IO::Handle;", 0);
|
||||
perl_eval_pv("use IO::File;", 0);
|
||||
|
||||
@@ -536,6 +543,9 @@ int uwsgi_perl_manage_options(int i, char *optarg) {
|
||||
case LONG_ARGS_PSGI:
|
||||
uperl.psgi = optarg;
|
||||
return 1;
|
||||
case LONG_ARGS_PERL_LOCAL_LIB:
|
||||
uperl.locallib = optarg;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user