Permalink
Fetching contributors…
Cannot retrieve contributors at this time
327 lines (259 sloc) 7.27 KB
ngx_addon_name=ngx_http_js_module
# feature check stolen from ngx_postgres_module
ngx_feature_name=
ngx_feature_run=no
ngx_found=no
NGX_HTTP_JS_HEADERS="0"
if [ $SPIDERMONKEY_INC ]; then
ngx_feature_incs="
#define XP_UNIX
#include <js/jsapi.h>
"
ngx_feature_test=
ngx_feature="js/jsapi.h in $SPIDERMONKEY_INC"
ngx_feature_path="$SPIDERMONKEY_INC"
ngx_feature_libs=
. auto/feature
fi
# auto discovery
# look for headers in js/*
if [ $ngx_found = no ]; then
ngx_feature_incs="
#define XP_UNIX
#include <js/jsapi.h>
"
ngx_feature_test=
ngx_feature="js/jsapi.h"
ngx_feature_path=
ngx_feature_libs=
. auto/feature
fi
# FreeBSD
if [ $ngx_found = no ]; then
ngx_feature_incs="
#define XP_UNIX
#include <js/jsapi.h>
"
ngx_feature_test=
ngx_feature="js/jsapi.h in /usr/local/include"
ngx_feature_path="/usr/local/include"
ngx_feature_libs=
. auto/feature
fi
# /opt
if [ $ngx_found = no ]; then
ngx_feature_incs="
#define XP_UNIX
#include <js/jsapi.h>
"
ngx_feature_test=
ngx_feature="js/jsapi.h in /opt/include"
ngx_feature_path="/opt/include"
ngx_feature_libs=
. auto/feature
fi
# look for headers in mozjs/*
if [ $ngx_found = no ]; then
NGX_HTTP_JS_HEADERS="1"
fi
if [ $ngx_found = no ]; then
ngx_feature_incs="
#define XP_UNIX
#include <mozjs/jsapi.h>
"
ngx_feature_test=
ngx_feature="mozjs/jsapi.h"
ngx_feature_path=
ngx_feature_libs=
. auto/feature
fi
# FreeBSD
if [ $ngx_found = no ]; then
ngx_feature_incs="
#define XP_UNIX
#include <mozjs/jsapi.h>
"
ngx_feature_test=
ngx_feature="mozjs/jsapi.h in /usr/local/include"
ngx_feature_path="/usr/local/include"
ngx_feature_libs=
. auto/feature
fi
# look for headers in *
if [ $ngx_found = no ]; then
NGX_HTTP_JS_HEADERS="2"
fi
if [ $ngx_found = no ]; then
ngx_feature_incs="
#define XP_UNIX
#include <jsapi.h>
"
ngx_feature_test=
ngx_feature="jsapi.h"
ngx_feature_path=
ngx_feature_libs=
. auto/feature
fi
# FreeBSD
if [ $ngx_found = no ]; then
ngx_feature_incs="
#define XP_UNIX
#include <jsapi.h>
"
ngx_feature_test=
ngx_feature="jsapi.h in /usr/local/include"
ngx_feature_path="/usr/local/include"
ngx_feature_libs=
. auto/feature
fi
if [ $ngx_found = no ]; then
echo
echo $0: error: the $ngx_addon_name addon requires the jsapi headers.
echo
exit 1
fi
have=NGX_HTTP_JS_HEADERS value="$NGX_HTTP_JS_HEADERS" . auto/define
CORE_INCS="$CORE_INCS $ngx_feature_path"
ngx_found=no
if [ $SPIDERMONKEY_LIB ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libmozjs in $SPIDERMONKEY_LIB"
ngx_feature_path=
ngx_feature_libs="-L$SPIDERMONKEY_LIB -lmozjs"
. auto/feature
fi
# look for mozjs library
if [ $ngx_found = no ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libmozjs"
ngx_feature_path=
ngx_feature_libs="-lmozjs"
. auto/feature
fi
# FreeBSD
if [ $ngx_found = no ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libmozjs in /usr/local/lib"
ngx_feature_path=
ngx_feature_libs="-L/usr/local/lib -lmozjs"
. auto/feature
fi
# /opt
if [ $ngx_found = no ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libmozjs in /opt/lib"
ngx_feature_path=
ngx_feature_libs="-L/opt/lib -lmozjs"
. auto/feature
fi
# look for js library
if [ $ngx_found = no ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libjs"
ngx_feature_path=
ngx_feature_libs="-ljs"
. auto/feature
fi
# FreeBSD
if [ $ngx_found = no ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libjs in /usr/local/lib"
ngx_feature_path=
ngx_feature_libs="-L/usr/local/lib -ljs"
. auto/feature
fi
# FreeBSD port
if [ $ngx_found = no ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libjs (with libm) in /usr/local/lib"
ngx_feature_path=
ngx_feature_libs="-L/usr/local/lib -lm -ljs"
. auto/feature
fi
# OpenBSD port
if [ $ngx_found = no ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libjs (with pthread) in /usr/local/lib"
ngx_feature_path=
ngx_feature_libs="-L/usr/local/lib -ljs -pthread"
. auto/feature
fi
# OpenBSD port (with non-base compiler)
if [ $ngx_found = no ]; then
ngx_feature_incs=
ngx_feature_test=
ngx_feature="libjs (with libpthread) in /usr/local/lib"
ngx_feature_path=
ngx_feature_libs="-L/usr/local/lib -ljs -lpthread"
. auto/feature
fi
if [ $ngx_found = no ]; then
echo
echo $0: error: the $ngx_addon_name addon requires the js library.
echo
exit 1
fi
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
if [ "$HTTP_JS_COLOR" = "yes" ]; then
have=NGX_HTTP_JS_COLORED . auto/have
fi
ngx_feature_name="NGX_HTTP_JS_SET_STRINGS_ARE_UTF8"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_test="JS_SetCStringsAreUTF8();"
ngx_feature="JS_SetCStringsAreUTF8()"
ngx_feature_path="$CORE_INCS"
ngx_feature_libs="$CORE_LIBS"
ngx_found=no
. auto/feature
ngx_feature_name="NGX_HTTP_JS_JS_SETGCZEAL"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_test="JS_SetGCZeal();"
ngx_feature="JS_SetGCZeal()"
ngx_feature_path="$CORE_INCS"
ngx_feature_libs="$CORE_LIBS"
ngx_found=no
. auto/feature
CFLAGS="-I $ngx_addon_dir/src/ $CFLAGS"
HTTP_MODULES="$HTTP_MODULES $ngx_addon_name"
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name"
NGX_ADDON_DEPS="$ngx_addon_dir/src/nginx_js_macroses.h"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ngx_http_jsapi.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_js_module.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ngx_http_js_module.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/nginx_js_glue.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/nginx_js_glue.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/strings_util.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/strings_util.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/global.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/global.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/environment.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/environment.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/Nginx.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/Nginx.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/Request.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/Request.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/Request/HeadersIn.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/Request/HeadersIn.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/Request/HeadersIn/Cookies.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/Request/HeadersIn/Cookies.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/Request/HeadersOut.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/Request/HeadersOut.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/Request/Variables.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/Request/Variables.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/Chain.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/Chain.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/File.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/File.h"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/classes/Dir.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/classes/Dir.h"
have=NGX_HTTP_JS_MODULE . auto/have