mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-19 03:57:21 +00:00
added a commodity mongodb plugin for system without mongoclient shared library
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "../../uwsgi.h"
|
||||
#include <uwsgi.h>
|
||||
|
||||
#include "client/dbclient.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "../../uwsgi.h"
|
||||
#include <uwsgi.h>
|
||||
|
||||
void uwsgi_imperial_monitor_mongodb(struct uwsgi_emperor_scanner *);
|
||||
void uwsgi_imperial_monitor_mongodb_init(struct uwsgi_emperor_scanner *);
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import os
|
||||
|
||||
NAME='emperor_mongodb'
|
||||
|
||||
CFLAGS = ['-I/usr/include/mongo','-I/usr/local/include/mongo']
|
||||
LDFLAGS = []
|
||||
LIBS = ['-lmongoclient', '-lboost_thread','-lboost_filesystem']
|
||||
|
||||
LIBS = []
|
||||
if not 'UWSGI_MONGODB_NOLIB' in os.environ:
|
||||
LIBS.append('-lmongoclient')
|
||||
LIBS.append('-lboost_thread')
|
||||
LIBS.append('-lboost_filesystem')
|
||||
|
||||
GCC_LIST = ['plugin', 'emperor_mongodb.cc']
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <uwsgi.h>
|
||||
|
||||
#include "client/dbclient.h"
|
||||
|
||||
extern "C" int uwsgi_mongodb_version() {
|
||||
// this is only a hack to force the linked to embed libmongoclient.a
|
||||
mongo::DBClientConnection c;
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <uwsgi.h>
|
||||
|
||||
/*
|
||||
|
||||
a fake plugin used for preloading mongodb library when only available as static.
|
||||
|
||||
*/
|
||||
|
||||
int uwsgi_mongodb_version(void);
|
||||
|
||||
struct uwsgi_plugin mongodb_plugin = {
|
||||
.name = "mongodb",
|
||||
.init = uwsgi_mongodb_version,
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
NAME='mongodb'
|
||||
|
||||
CFLAGS = ['-I/usr/include/mongo','-I/usr/local/include/mongo']
|
||||
LDFLAGS = []
|
||||
LIBS = ['-lmongoclient', '-lboost_thread','-lboost_filesystem']
|
||||
|
||||
GCC_LIST = ['plugin', 'foobar.cc']
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import os
|
||||
|
||||
NAME='stats_pusher_mongodb'
|
||||
|
||||
CFLAGS = ['-I/usr/include/mongo','-I/usr/local/include/mongo']
|
||||
LDFLAGS = []
|
||||
LIBS = ['-lmongoclient', '-lboost_thread','-lboost_filesystem']
|
||||
|
||||
LIBS = []
|
||||
if not 'UWSGI_MONGODB_NOLIB' in os.environ:
|
||||
LIBS.append('-lmongoclient')
|
||||
LIBS.append('-lboost_thread')
|
||||
LIBS.append('-lboost_filesystem')
|
||||
|
||||
GCC_LIST = ['plugin', 'stats_pusher_mongodb.cc']
|
||||
|
||||
Reference in New Issue
Block a user