Skip to content
This repository
tag: v0.0.4rc1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 115 lines (101 sloc) 4.2 kb
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
ngx_feature="lua library"
ngx_feature_libs="-llua -lm"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <lauxlib.h>"
ngx_feature_path=
ngx_feature_test="(void) luaL_newstate();"

if [ -n "$LUAJIT_LIB" ]; then
    # explicit set lua lib path
    ngx_feature="lua library in $LUAJIT_LIB and $LUAJIT_INC (specified by the LUAJIT_LIB and LUAJIT_INC env)"
    ngx_feature_path="$LUAJIT_INC"
    if [ $NGX_RPATH = YES ]; then
        ngx_feature_libs="-R$LUAJIT_LIB -L$LUAJIT_LIB -lluajit-5.1 -lm"
    else
        ngx_feature_libs="-L$LUAJIT_LIB -lluajit-5.1 -lm"
    fi

    . auto/feature

    if [ $ngx_found = no ]; then
        cat << END
        $0: error: the ngx_lua addon requires the lua or luajit library and LUAJIT_LIB is defined as $LUAJIT_LIB and LUAJIT_INC $LUAJIT_INC, but we cannot find LuaJIT there.
END
        exit 1
    fi
else
    if [ -n "$LUA_LIB" ]; then
        # explicit set lua lib path
        ngx_feature="lua library in $LUA_LIB and $LUA_INC (specified by the LUA_LIB and LUA_INC env)"
        ngx_feature_path="$LUA_INC"
        if [ $NGX_RPATH = YES ]; then
            ngx_feature_libs="-R$LUA_LIB -L$LUA_LIB -llua -lm"
        else
            ngx_feature_libs="-L$LUA_LIB -llua -lm"
        fi

        . auto/feature

        if [ $ngx_found = no ]; then
            cat << END
            $0: error: the ngx_lua addon requires the lua and luajit library and LUA_LIB is defined as $LUA_LIB and LUA_INC is $LUA_INC, but we cannot find standard Lua there.
END
            exit 1
        fi
    fi
fi

if [ $ngx_found = no ]; then
    ngx_feature="lua library"
    ngx_feature_libs="-llua -lm"
    . auto/feature
fi

if [ $ngx_found = no ]; then
    # FreeBSD, OpenBSD
    ngx_feature="lua 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 -llua -lm"
    else
        ngx_feature_libs="-L/usr/local/lib -llua -lm"
    fi
    . auto/feature
fi

if [ $ngx_found = no ]; then
    # NetBSD
    ngx_feature="lua 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 -lm -llua"
    else
        ngx_feature_libs="-L/usr/pkg/lib -lm -llua"
    fi
    . auto/feature
fi

if [ $ngx_found = no ]; then
    # MacPorts
    ngx_feature="lua 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 -lm -llua"
    else
        ngx_feature_libs="-L/opt/local/lib -lm -llua"
    fi
    . auto/feature
fi

if [ $ngx_found = yes ]; then
    CORE_INCS="$CORE_INCS $ngx_feature_path"
    CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
else
 cat << END
 $0: error: the ngx_lua addon requires the lua library.
END
 exit 1
fi


ngx_addon_name=ngx_http_lua_module
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_lua_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_lua_module.c $ngx_addon_dir/src/ngx_http_lua_directive.c $ngx_addon_dir/src/ngx_http_lua_hook.c $ngx_addon_dir/src/ngx_http_lua_util.c $ngx_addon_dir/src/ngx_http_lua_cache.c $ngx_addon_dir/src/ngx_http_lua_conf.c $ngx_addon_dir/src/ngx_http_lua_contentby.c $ngx_addon_dir/src/ngx_http_lua_setby.c $ngx_addon_dir/src/ngx_http_lua_filter.c $ngx_addon_dir/src/ngx_http_lua_clfactory.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ddebug.h $ngx_addon_dir/src/ngx_http_lua_common.h $ngx_addon_dir/src/ngx_http_lua_directive.h $ngx_addon_dir/src/ngx_http_lua_hook.h $ngx_addon_dir/src/ngx_http_lua_util.h $ngx_addon_dir/src/ngx_http_lua_cache.h $ngx_addon_dir/src/ngx_http_lua_conf.h $ngx_addon_dir/src/ngx_http_lua_contentby.h $ngx_addon_dir/src/ngx_http_lua_setby.h $ngx_addon_dir/src/ngx_http_lua_filter.h $ngx_addon_dir/src/ngx_http_lua_clfactory.h"
CFLAGS="$CFLAGS -DNDK_SET_VAR"
CORE_LIBS="-Wl,-E $CORE_LIBS"
# link with official Lua 5.1.4
#CORE_INCS="$CORE_INCS -I/usr/local/include"
#CORE_LIBS="$CORE_LIBS -L/usr/local/lib -llua -lm"
# link with LuaJIT 2.0
#CORE_INCS="$CORE_INCS -I/usr/local/include/luajit-2.0"
#CORE_LIBS="$CORE_LIBS -L/usr/local/lib -lluajit-5.1"

Something went wrong with that request. Please try again.