summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-08-27 14:43:45 +0000
committerJan Kneschke <jan@kneschke.de>2005-08-27 14:43:45 +0000
commitc7ec5012e0ee1e50277ff807379352b21245b224 (patch)
tree13e1350bc49fca9deccdf9e3b1790dc9082a5adc
parentc18d4565cdf5e547481741e39ffbcfbd30c996eb (diff)
downloadlighttpd-git-c7ec5012e0ee1e50277ff807379352b21245b224.tar.gz
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
-rw-r--r--src/base.h1
-rw-r--r--src/plugin.c7
-rw-r--r--src/server.c8
3 files changed, 12 insertions, 4 deletions
diff --git a/src/base.h b/src/base.h
index e98d4917..aadff6c0 100644
--- a/src/base.h
+++ b/src/base.h
@@ -436,6 +436,7 @@ typedef struct {
buffer *event_handler;
+ buffer *modules_dir;
array *modules;
unsigned short max_worker;
diff --git a/src/plugin.c b/src/plugin.c
index c3d87f13..f612ba24 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -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);
diff --git a/src/server.c b/src/server.c
index fc58344b..017a6191 100644
--- a/src/server.c
+++ b/src/server.c
@@ -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;