summaryrefslogtreecommitdiffstats
path: root/storage/mroonga/vendor/groonga/src/httpd/nginx-module/config
blob: b79eef6ba17db52c67f7a6e303f3ee986aae0b80 (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
# -*- sh -*-

groonga_strip_switch()
{
  # skip "-I" from "-I/usr/..."
  tail -c +3
}

if [ "$GROONGA_HTTPD_IN_TREE" = yes ]; then
  groonga_cflags="-I${GROONGA_HTTPD_IN_TREE_INCLUDE_PATH}"
  groonga_cflags="${groonga_cflags} -DNGX_HTTP_GROONGA_LOG_PATH=\\\"\"${GROONGA_HTTPD_GROONGA_LOG_PATH}\"\\\""
  groonga_cflags="${groonga_cflags} -DNGX_HTTP_GROONGA_QUERY_LOG_PATH=\\\"\"${GROONGA_HTTPD_GROONGA_QUERY_LOG_PATH}\"\\\""
  groonga_libs="-L${GROONGA_HTTPD_IN_TREE_LINK_PATH}"
  if [ "${GROONGA_HTTPD_WITH_ONIGMO}" = "yes" ]; then
  groonga_libs="$groonga_libs -L${GROONGA_HTTPD_ONIGMO_IN_TREE_LINK_PATH}"
  fi
  groonga_libs="$groonga_libs -lgroonga"
  if [ -n "${GROONGA_HTTPD_RPATH}" ]; then
    groonga_libs="$groonga_libs -Wl,-rpath -Wl,${GROONGA_HTTPD_RPATH}"
  fi

  ngx_addon_name=ngx_http_groonga_module
  HTTP_MODULES="$HTTP_MODULES ngx_http_groonga_module"
  NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_groonga_module.c"
  CFLAGS="$CFLAGS $groonga_cflags"
  CORE_LIBS="$CORE_LIBS $groonga_libs"

  return 0
fi

groonga_cflags="$(pkg-config --cflags groonga)"
groonga_feature_path="$(pkg-config --cflags-only-I groonga |
                        groonga_strip_switch)"
groonga_libs="$(pkg-config --libs groonga)"

ngx_feature="groonga"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <groonga.h>"
ngx_feature_path="$groonga_feature_path"
ngx_feature_libs="$groonga_libs"
ngx_feature_test="grn_get_version()"
. auto/feature

if [ $ngx_found = yes ]; then
  ngx_addon_name=ngx_http_groonga_module
  HTTP_MODULES="$HTTP_MODULES ngx_http_groonga_module"
  NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_groonga_module.c"
  CFLAGS="$CFLAGS $groonga_cflags"
  CORE_LIBS="$CORE_LIBS $groonga_libs"
else
  cat << END
$0: error: the groonga module requires the Groonga library.
END
  exit 1
fi