-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathconfig
120 lines (106 loc) · 4.36 KB
/
config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Copyright (c) 2011-2012, Simpl <[email protected]>
# Copyright (c) 2011-2012, FRiCKLE <[email protected]>
# Copyright (c) 2011-2012, Piotr Sikora <[email protected]>
# All rights reserved.
#
# This project was fully funded by Simpl (www.simpl.it) for use on
# the open-source website Tagmata (www.tagmata.com).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NGX_VERSION=`grep nginx_version src/core/nginx.h | sed -e 's/^.* \(.*\)$/\1/'`
if [ -z "$NGX_VERSION" -o "$NGX_VERSION" -lt 1001004 ]; then
echo "$0: error: ngx_mongo module requires nginx-1.1.4+."
exit 1
fi
if ! `grep "NGX_HAVE_LITTLE_ENDIAN 1" $NGX_AUTO_CONFIG_H >/dev/null 2>&1`; then
echo "$0: error: ngx_mongo module works only on little endian platforms."
exit 1
fi
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <yajl/yajl_parse.h>"
ngx_feature_test="(void) yajl_alloc(NULL, NULL, NULL)"
if [ -n "$LIBYAJL_INC" -o -n "$LIBYAJL_LIB" ]; then
# specified by LIBYAJL_INC and LIBYAJL_LIB
ngx_feature="yajl library in directories specified by LIBYAJL_INC ($LIBYAJL_INC) and LIBYAJL_LIB ($LIBYAJL_LIB)"
ngx_feature_path="$LIBYAJL_INC"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R$LIBYAJL_LIB -L$LIBYAJL_LIB -lyajl"
else
ngx_feature_libs="-L$LIBYAJL_LIB -lyajl"
fi
. auto/feature
else
# auto-discovery
ngx_feature="yajl library"
ngx_feature_path=
ngx_feature_libs="-lyajl"
. auto/feature
if [ $ngx_found = no ]; then
# FreeBSD, OpenBSD
ngx_feature="yajl library in /usr/local/"
ngx_feature_path="/usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lyajl"
else
ngx_feature_libs="-L/usr/local/lib -lyajl"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# NetBSD
ngx_feature="yajl library in /usr/pkg/"
ngx_feature_path="/usr/pkg/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lyajl"
else
ngx_feature_libs="-L/usr/pkg/lib -lyajl"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="yajl library in /opt/local/"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lyajl"
else
ngx_feature_libs="-L/opt/local/lib -lyajl"
fi
. auto/feature
fi
fi
if [ $ngx_found = no ]; then
echo "$0: error: ngx_mongo module requires libyajl."
exit 1
fi
ngx_addon_name="ngx_http_mongo_module and ngx_http_mongo_json_filter_module"
USE_MD5=YES
CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
HTTP_MODULES="$HTTP_MODULES ngx_http_mongo_module"
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_mongo_json_filter_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS
$ngx_addon_dir/src/ngx_http_mongo_module.c
$ngx_addon_dir/src/ngx_http_mongo_json_filter_module.c"
have=NGX_HTTP_MONGO_MODULE . auto/have
have=NGX_HTTP_MONGO_JSON_FILTER_MODULE . auto/have