added -m to set the location of the modules

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@630 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.2
Jan Kneschke 18 years ago
parent c18d4565cd
commit c7ec5012e0

@ -436,6 +436,7 @@ typedef struct {
buffer *event_handler;
buffer *modules_dir;
array *modules;
unsigned short max_worker;

@ -112,12 +112,13 @@ int plugins_load(server *srv) {
buffer_reset(srv->tmp_buf);
/* for make distcheck */
if (NULL != (inst = strstr(LIBRARY_DIR, "/_inst/lib"))) {
buffer_copy_string_len(srv->tmp_buf, LIBRARY_DIR, strlen(LIBRARY_DIR) - strlen(inst));
if (NULL != (inst = strstr(srv->srvconf.modules_dir->ptr, "/_inst/lib"))) {
buffer_copy_string_len(srv->tmp_buf, srv->srvconf.modules_dir->ptr,
strlen(srv->srvconf.modules_dir->ptr) - strlen(inst));
buffer_append_string(srv->tmp_buf, "/_build/src/.libs");
buffer_append_string(srv->tmp_buf, inst + strlen("/_inst/lib") );
} else {
buffer_copy_string(srv->tmp_buf, LIBRARY_DIR);
buffer_copy_string_buffer(srv->tmp_buf, srv->srvconf.modules_dir);
}
buffer_append_string(srv->tmp_buf, "/");
buffer_append_string(srv->tmp_buf, modules);

@ -161,6 +161,7 @@ static server *server_init(void) {
assert(srv->fdwaitqueue);
srv->srvconf.modules = array_init();
srv->srvconf.modules_dir = buffer_init_string(LIBRARY_DIR);
/* use syslog */
srv->errorlog_fd = -1;
@ -197,6 +198,7 @@ static void server_free(server *srv) {
CLEAN(srvconf.bindhost);
CLEAN(srvconf.event_handler);
CLEAN(srvconf.pid_file);
CLEAN(srvconf.modules_dir);
CLEAN(tmp_chunk_len);
#undef CLEAN
@ -274,6 +276,7 @@ static void show_help (void) {
" - a light and fast webserver\n" \
"usage:\n" \
" -f <name> filename of the config-file\n" \
" -m <name> module directory (default: "LIBRARY_DIR")\n" \
" -p print the parsed config-file in internal form, and exit\n" \
" -t test the config-file, and exit\n" \
" -D don't go to background (default: go to background)\n" \
@ -330,7 +333,7 @@ int main (int argc, char **argv) {
#endif
srv->srvconf.dont_daemonize = 0;
while(-1 != (o = getopt(argc, argv, "f:hvDpt"))) {
while(-1 != (o = getopt(argc, argv, "f:m:hvDpt"))) {
switch(o) {
case 'f':
if (config_read(srv, optarg)) {
@ -338,6 +341,9 @@ int main (int argc, char **argv) {
return -1;
}
break;
case 'm':
buffer_copy_string(srv->srvconf.modules_dir, optarg);
break;
case 'p': print_config = 1; break;
case 't': test_config = 1; break;
case 'D': srv->srvconf.dont_daemonize = 1; break;

Loading…
Cancel
Save