summaryrefslogtreecommitdiff
path: root/iconv-nginx-module-0.14/config
blob: 2eed0ee9cc924c3dc7583615082ef8ce5e1c39cb (plain)
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
if test -n "$ngx_module_link"; then
    if test -n "$NDK_SRCS"; then
        echo "found ngx_devel_kit for ngx_iconv; looks good."
    else
        echo "error: ngx_devel_kit is required to build ngx_iconv; please put it before ngx_iconv." 1>&2
        exit 1
    fi
else
    if echo $HTTP_MODULES | grep " ndk_http_module" > /dev/null; then
        echo "found ngx_devel_kit for ngx_iconv; looks good."
    else
        echo "error: ngx_devel_kit is required to build ngx_iconv; please put it before ngx_iconv." 1>&2
        exit 1
    fi
fi

ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <iconv.h>"
ngx_feature_test='iconv_t cd =  iconv_open("utf-8","gbk");
iconv_close(cd);'

if [ -n "$LIBICONV_INC" -o -n "$LIBICONV_LIB" ]; then
    ngx_feature="libiconv in directories specified by LIBICONV_INC ($LIBICONV_INC) and LIBICONV_LIB ($LIBICONV_LIB)"
    ngx_feature_path="$LIBICONV_INC"
    . auto/feature

    if [ $ngx_found = no ]; then
        # test also with -liconv
        if [ $NGX_RPATH = YES ]; then
            ngx_feature_libs="-R$LIBICONV_LIB -L$LIBICONV_LIB -liconv"
        else
            ngx_feature_libs="-L$LIBICONV_LIB -liconv"
        fi
        . auto/feature
    fi
else
    # auto-discovery
    ngx_feature="libiconv"
    ngx_feature_path=
    ngx_feature_libs=
    . auto/feature

    if [ $ngx_found = no ]; then
        # test also with -liconv
        ngx_feature_libs="-liconv"
        . auto/feature
    fi

    if [ $ngx_found = no ]; then
        ngx_feature="libiconv 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 -liconv"
        else
            ngx_feature_libs="-L/usr/local/lib -liconv"
        fi
        . auto/feature
    fi

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

    if [ $ngx_found = no ]; then
        # MacPorts
        ngx_feature="libiconv 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 -liconv"
        else
            ngx_feature_libs="-L/opt/local/lib -liconv"
        fi
        . auto/feature
    fi
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_iconv addon requires the iconv library.
END
 exit 1
fi

ngx_addon_name=ngx_http_iconv_module

HTTP_ICONV_DEPS="$ngx_addon_dir/src/ddebug.h"
HTTP_ICONV_SRCS="$ngx_addon_dir/src/ngx_http_iconv_module.c"

if test -n "$ngx_module_link"; then
    ngx_module_type=HTTP_AUX_FILTER
    ngx_module_name=$ngx_addon_name
    ngx_module_incs=
    ngx_module_deps="$HTTP_ICONV_DEPS"
    ngx_module_srcs="$HTTP_ICONV_SRCS"
    ngx_module_libs=

    . auto/module
else
    HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name"
    NGX_ADDON_SRCS="$NGX_ADDON_SRCS $HTTP_ICONV_SRCS"
    NGX_ADDON_DEPS="$NGX_ADDON_DEPS $HTTP_ICONV_DEPS"
fi

CFLAGS="$CFLAGS -DNDK_SET_VAR"