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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
ngx_addon_name=ngx_nchan_module
nchan_libs=""
#do we have hiredis on the platform?
# it's currently no longer possible to link the platform's hiredis lib,
# because we now use a hacked connect function
# maybe it can be brought back at some later time...
ngx_feature="hiredis with stored sockaddr"
ngx_feature_name="NCHAN_HAVE_HIREDIS_WITH_SOCKADDR"
ngx_feature_run=yes
ngx_feature_path=
ngx_feature_incs=" \
#include <hiredis/hiredis.h>
#include <sys/socket.h>
"
ngx_feature_libs="-lhiredis"
ngx_feature_test=" \
redisContext c; \
if(HIREDIS_SONAME < 0.13) { return 1; } \
if(sizeof(c.sockaddr) != sizeof(struct sockaddr)) { return 1;} \
"
. auto/feature
if [ $ngx_found = no ]; then
_NCHAN_HIREDIS_SRCS="\
${ngx_addon_dir}/src/store/redis/hiredis/alloc.c \
${ngx_addon_dir}/src/store/redis/hiredis/async.c \
${ngx_addon_dir}/src/store/redis/hiredis/dict.c \
${ngx_addon_dir}/src/store/redis/hiredis/hiredis.c \
${ngx_addon_dir}/src/store/redis/hiredis/net.c \
${ngx_addon_dir}/src/store/redis/hiredis/read.c \
${ngx_addon_dir}/src/store/redis/hiredis/sds.c \
${ngx_addon_dir}/src/store/redis/hiredis/sockcompat.c \
"
if [ $USE_OPENSSL = YES ]; then
_NCHAN_HIREDIS_SRCS="$_NCHAN_HIREDIS_SRCS\
${ngx_addon_dir}/src/store/redis/hiredis/ssl.c \
"
fi
ngx_feature_libs=""
else
nchan_libs="$nchan_libs $ngx_feature_libs"
_NCHAN_HIREDIS_SRCS=""
fi
ngx_feature="math lib"
ngx_feature_name="NCHAN_HAVE_MATH"
ngx_feature_run=yes
ngx_feature_path=
ngx_feature_incs="#include <math.h>"
ngx_feature_libs="-lm"
ngx_feature_test="sqrt(20);"
. auto/feature
if [ $ngx_found = yes ]; then
nchan_libs="$nchan_libs $ngx_feature_libs"
fi
#do we have memrchr() on the platform?
ngx_feature="memrchr()"
ngx_feature_name="NCHAN_HAVE_MEMRCHR"
ngx_feature_run=yes
ngx_feature_path=
ngx_feature_libs=
ngx_feature_incs=" \
#include <string.h>
#include <stddef.h>
"
ngx_feature_test=" \
const char *str = \"aboobar\"; \
const void *place = &str[4]; \
const void *found = memrchr(str, 'b', strlen(str)); \
if(place != found) { return 1; } \
"
. auto/feature
_NCHAN_SUBSCRIBERS_SRCS="\
${ngx_addon_dir}/src/subscribers/common.c \
${ngx_addon_dir}/src/subscribers/longpoll.c \
${ngx_addon_dir}/src/subscribers/intervalpoll.c \
${ngx_addon_dir}/src/subscribers/eventsource.c \
${ngx_addon_dir}/src/subscribers/http-chunked.c \
${ngx_addon_dir}/src/subscribers/http-multipart-mixed.c \
${ngx_addon_dir}/src/subscribers/http-raw-stream.c \
${ngx_addon_dir}/src/subscribers/websocket.c \
${ngx_addon_dir}/src/nchan_websocket_publisher.c \
${ngx_addon_dir}/src/subscribers/internal.c \
${ngx_addon_dir}/src/subscribers/memstore_ipc.c \
${ngx_addon_dir}/src/subscribers/memstore_multi.c \
${ngx_addon_dir}/src/subscribers/memstore_redis.c \
${ngx_addon_dir}/src/subscribers/getmsg_proxy.c \
${ngx_addon_dir}/src/subscribers/benchmark.c \
"
_NCHAN_REDIS_STORE_SRCS="\
${_NCHAN_HIREDIS_SRCS} \
${ngx_addon_dir}/src/store/redis/cmp.c \
${ngx_addon_dir}/src/store/redis/redis_lua_commands.c \
${ngx_addon_dir}/src/store/redis/redis_nodeset_parser.c \
${ngx_addon_dir}/src/store/redis/redis_nodeset.c \
${ngx_addon_dir}/src/store/redis/redis_nodeset_stats.c \
${ngx_addon_dir}/src/store/redis/rdsstore.c \
${ngx_addon_dir}/src/store/redis/redis_nginx_adapter.c \
"
_NCHAN_MEMORY_STORE_SRCS="\
${ngx_addon_dir}/src/store/memory/ipc.c \
${ngx_addon_dir}/src/store/memory/ipc-handlers.c \
${ngx_addon_dir}/src/store/memory/groups.c \
${ngx_addon_dir}/src/store/memory/memstore.c \
"
_nchan_util_dir="${ngx_addon_dir}/src/util"
_NCHAN_UTIL_SRCS=" \
$_nchan_util_dir/nchan_debug.c \
$_nchan_util_dir/nchan_list.c \
$_nchan_util_dir/nchan_slist.c \
$_nchan_util_dir/ngx_nchan_hacked_slab.c \
$_nchan_util_dir/shmem.c \
$_nchan_util_dir/nchan_rbtree.c \
$_nchan_util_dir/nchan_reuse_queue.c \
$_nchan_util_dir/nchan_output.c \
$_nchan_util_dir/nchan_util.c \
$_nchan_util_dir/nchan_fake_request.c \
$_nchan_util_dir/nchan_bufchainpool.c \
$_nchan_util_dir/nchan_channel_id.c \
$_nchan_util_dir/nchan_output_info.c \
$_nchan_util_dir/nchan_msg.c \
$_nchan_util_dir/nchan_thingcache.c \
$_nchan_util_dir/nchan_reaper.c \
$_nchan_util_dir/nchan_subrequest.c \
$_nchan_util_dir/nchan_benchmark.c \
$_nchan_util_dir/nchan_stats.c \
$_nchan_util_dir/nchan_accumulator.c \
$_nchan_util_dir/nchan_timequeue.c \
$_nchan_util_dir/hdr_histogram.c \
"
_NCHAN_STORE_SRCS="\
${ngx_addon_dir}/src/store/spool.c \
${ngx_addon_dir}/src/store/ngx_rwlock.c \
${ngx_addon_dir}/src/store/store_common.c \
$_NCHAN_MEMORY_STORE_SRCS \
$_NCHAN_REDIS_STORE_SRCS \
"
_NCHAN_SRCS="\
${ngx_addon_dir}/src/nchan_defs.c \
${ngx_addon_dir}/src/nchan_variables.c \
${ngx_addon_dir}/src/nchan_module.c \
$_NCHAN_UTIL_SRCS \
$_NCHAN_SUBSCRIBERS_SRCS \
$_NCHAN_STORE_SRCS \
"
ngx_module_incs=$ngx_addon_dir/src
have=NGX_HTTP_HEADERS . auto/have
if test -n "$ngx_module_link"; then
ngx_module_type=HTTP
ngx_module_name=$ngx_addon_name
ngx_module_srcs="$_NCHAN_SRCS"
ngx_module_libs=$nchan_libs
. auto/module
else
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $_NCHAN_SRCS"
CORE_LIBS="$CORE_LIBS $nchan_libs"
CORE_INCS="$CORE_INCS $ngx_module_incs"
HTTP_MODULES="$HTTP_MODULES $ngx_addon_name"
fi
|