Navigation Menu

Skip to content

Commit

Permalink
groonga-httpd: support PCRE auto detection
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 6, 2012
1 parent b952d26 commit cde0f69
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
29 changes: 28 additions & 1 deletion configure.ac
Expand Up @@ -1211,6 +1211,29 @@ else
fi
AM_CONDITIONAL(WITH_NGINX, test "$enable_nginx" = "yes")

# PCRE
WITH_PCRE=no
AC_ARG_WITH(pcre,
[AS_HELP_STRING([--without-pcre],
[use PCRE for groonga-httpd. [default=auto-detect]])],
[with_pcre="$witheval"],
[with_pcre="auto"])
if test "x$with_pcre" != "xno"; then
m4_ifdef([PKG_CHECK_MODULES], [
PKG_CHECK_MODULES([PCRE], [libpcre],
[_PKG_CONFIG(PCRE_LIBS_ONLY_L, [libs-only-L], [libpcre])
WITH_PCRE=yes],
[WITH_PCRE=no])
],
[WITH_PCRE=no])
if test "x$with_pcre" = "xyes" -a "$WITH_PCRE" != "yes"; then
AC_MSG_ERROR("No PCRE found")
fi
fi
AC_SUBST(WITH_PCRE)
AC_SUBST(PCRE_CFLAGS)
AC_SUBST(PCRE_LIBS_ONLY_L)

# For package
AC_ARG_WITH(rsync-path,
[AS_HELP_STRING([--with-rsync-path=PATH],
Expand Down Expand Up @@ -1265,7 +1288,6 @@ echo " buildable: ${document_buildable}"
echo " built: ${have_built_document}"
echo " Munin plugins: ${install_munin_plugins}"
echo " Package platform: ${package_platform}"
echo " groonga-httpd: ${enable_nginx}"
echo
echo "Paths:"
echo " Install path prefix: ${prefix}"
Expand Down Expand Up @@ -1308,6 +1330,11 @@ echo "groonga-httpd:"
echo " enable: $enable_nginx"
if test "$enable_nginx" = "yes"; then
echo " default database path: $GROONGA_HTTPD_DEFAULT_DATABASE_PATH"
echo " PCRE: $WITH_PCRE"
if test "$WITH_PCRE" = "yes"; then
echo " CFLAGS: $PCRE_CFLAGS"
echo " LIBS only -L: $PCRE_LIBS_ONLY_L"
fi
fi
echo

Expand Down
3 changes: 3 additions & 0 deletions groonga-httpd-conf.sh.in
Expand Up @@ -15,3 +15,6 @@ export GROONGA_HTTPD_CONF_PATH="${pkgsysconfdir}/httpd/groonga-httpd.conf"
export GROONGA_HTTPD_ERROR_LOG_PATH="${localstatedir}/log/groonga/httpd/error.log"
export GROONGA_HTTPD_HTTP_LOG_PATH="${localstatedir}/log/groonga/httpd/access.log"
export GROONGA_HTTPD_DEBUG="@grn_debug@"
export GROONGA_HTTPD_WITH_PCRE="@WITH_PCRE@"
export GROONGA_HTTPD_PCRE_CFLAGS="@PCRE_CFLAGS@"
export GROONGA_HTTPD_PCRE_LIBS_ONLY_L="@PCRE_LIBS_ONLY_L@"
11 changes: 10 additions & 1 deletion vendor/nginx/configure
Expand Up @@ -33,6 +33,16 @@ if [ "$GROONGA_HTTPD_DEBUG" = "yes" ]; then
configure_args="$configure_args --with-debug"
fi

if [ "$GROONGA_HTTPD_WITH_PCRE" = "yes" ]; then
CFLAGS="$CFLAGS $GROONGA_HTTPD_PCRE_CFLAGS"
LIBS="$LIBS $GROONGA_HTTPD_PCRE_LIBS_ONLY_L"
else
configure_args="$configure_args --without-http_rewrite_module"
fi

export CFLAGS
export LIBS

cd "../nginx-${nginx_version}"

./configure \
Expand All @@ -42,7 +52,6 @@ cd "../nginx-${nginx_version}"
--error-log-path="${GROONGA_HTTPD_ERROR_LOG_PATH}" \
--http-log-path="${GROONGA_HTTPD_HTTP_LOG_PATH}" \
--add-module="${GROONGA_HTTPD_MODULE_PATH}" \
--without-http_rewrite_module \
${configure_args}

if [ "$GROONGA_HTTPD_DEBUG" = "yes" ]; then
Expand Down

0 comments on commit cde0f69

Please sign in to comment.