added --perl-local-lib

This commit is contained in:
roberto@natty32
2011-05-02 17:12:32 +02:00
parent c45df83f19
commit 7cbe751a39
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -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*);
+10
View File
@@ -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;