Kouhei Sutou
null+****@clear*****
Thu Jan 17 12:01:08 JST 2013
Kouhei Sutou 2013-01-17 12:01:08 +0900 (Thu, 17 Jan 2013) New Revision: 986fe97562f1bc03a94149360ff68096b1fc0a10 https://github.com/groonga/groonga/commit/986fe97562f1bc03a94149360ff68096b1fc0a10 Log: httpd: move nginx build script to src/httpd/ from vendor/nginx/ src/nginx-module/ is also moved to src/httpd/nginx-module/. Added files: src/httpd/configure Copied files: src/httpd/Makefile.am (from vendor/Makefile.am) Removed files: vendor/nginx/configure Modified files: configure.ac groonga-httpd-conf.sh.in src/Makefile.am vendor/Makefile.am Renamed files: src/httpd/nginx-module/config (from src/nginx-module/config) src/httpd/nginx-module/ngx_http_groonga_module.c (from src/nginx-module/ngx_http_groonga_module.c) Modified: configure.ac (+6 -1) =================================================================== --- configure.ac 2013-01-17 11:30:40 +0900 (18c79bc) +++ configure.ac 2013-01-17 12:01:08 +0900 (dcf6e88) @@ -215,6 +215,7 @@ AC_CONFIG_FILES([ build/cmake_modules/Makefile src/Makefile src/suggest/Makefile + src/httpd/Makefile lib/Makefile lib/dat/Makefile include/Makefile @@ -1237,6 +1238,10 @@ AC_ARG_WITH(groonga-github-com-path, AC_SUBST(GROONGA_GITHUB_COM_PATH) # groonga-httpd +m4_define([nginx_version], m4_include(nginx_version)) +NGINX_VERSION=nginx_version +AC_SUBST(NGINX_VERSION) + AC_ARG_ENABLE(groonga_httpd, [AS_HELP_STRING([--enable-groonga-httpd], [enable nginx used for groonga-httpd. [default=yes]])], @@ -1244,7 +1249,7 @@ AC_ARG_ENABLE(groonga_httpd, [enable_groonga_httpd="yes"]) if test "x$enable_groonga_httpd" != "xno"; then enable_groonga_httpd="yes" - AC_CONFIG_SUBDIRS([vendor/nginx]) + AC_CONFIG_SUBDIRS([src/httpd]) else enable_groonga_httpd="no" fi Modified: groonga-httpd-conf.sh.in (+1 -1) =================================================================== --- groonga-httpd-conf.sh.in 2013-01-17 11:30:40 +0900 (c3eb803) +++ groonga-httpd-conf.sh.in 2013-01-17 12:01:08 +0900 (01ea0c2) @@ -8,7 +8,7 @@ localstatedir="@localstatedir@" SED="@SED@" -export GROONGA_HTTPD_MODULE_PATH="@abs_top_srcdir@/src/nginx-module" +export GROONGA_HTTPD_MODULE_PATH="@abs_top_srcdir@/src/httpd/nginx-module" export GROONGA_HTTPD_IN_TREE_INCLUDE_PATH="@abs_top_srcdir@/include" export GROONGA_HTTPD_IN_TREE_LINK_PATH="@abs_top_builddir@/lib/.libs" export GROONGA_HTTPD_PREFIX="${pkgsysconfdir}/httpd" Modified: src/Makefile.am (+3 -1) =================================================================== --- src/Makefile.am 2013-01-17 11:30:40 +0900 (84bbf4c) +++ src/Makefile.am 2013-01-17 12:01:08 +0900 (02d8d42) @@ -1,4 +1,6 @@ -SUBDIRS = suggest +SUBDIRS = \ + suggest \ + httpd NONEXISTENT_CXX_SOURCE = nonexistent.cpp Copied: src/httpd/Makefile.am (+8 -15) 66% =================================================================== --- vendor/Makefile.am 2013-01-17 11:30:40 +0900 (0842f46) +++ src/httpd/Makefile.am 2013-01-17 12:01:08 +0900 (5412fcd) @@ -1,26 +1,19 @@ -NGINX_DIR = nginx-1.2.1 -MRUBY_DIR = mruby-$(MRUBY_VERSION) - -SUBDIRS = mruby - -EXTRA_DIST = \ - nginx \ - $(NGINX_DIR) \ - mruby \ - $(MRUBY_DIR) +NGINX_DIR = $(top_srcdir)/vendor/nginx-$(NGINX_VERSION) if WITH_GROONGA_HTTPD NGINX_MAKEILE = $(NGINX_DIR)/Makefile NGINX_MAKEFILE_DEPEND_FILES = \ - nginx/configure \ + configure \ Makefile.am \ $(top_builddir)/config.status \ - $(top_srcdir)/src/nginx-module/config + $(srcdir)/nginx-module/config $(NGINX_MAKEILE): $(NGINX_MAKEFILE_DEPEND_FILES) - (cd nginx && \ - $(SHELL) "$(abs_top_srcdir)/vendor/nginx/configure" \ - `../../config.status --config`) + top_srcdir="$(top_srcdir)" \ + top_builddir="$(top_builddir)" \ + abs_top_srcdir="$(abs_top_srcdir)" \ + abs_top_builddir="$(abs_top_builddir)" \ + ./configure `../../config.status --config` # nginx's Makefile specify 'build' as the default rule. # This isn't compatible with the 'all' default rule generated by Automake Added: src/httpd/configure (+72 -0) 100755 =================================================================== --- /dev/null +++ src/httpd/configure 2013-01-17 12:01:08 +0900 (007a3ac) @@ -0,0 +1,72 @@ +#!/bin/sh + +set -x +set -e +set -u + +nginx_version=$(cat "${top_srcdir}/nginx_version") +relative_nginx_directory="vendor/nginx-${nginx_version}" +nginx_directory="${top_srcdir}/${relative_nginx_directory}" + +export GROONGA_HTTPD_IN_TREE=yes +. "${top_builddir}/groonga-httpd-conf.sh" + +eval "$(${top_builddir}/libtool --config)" + +found_libdir_in_search_path="no" +for search_path in "${sys_lib_search_path_spec}" "${sys_lib_dlsearch_path_spec}"; do + if [ "${search_path}" = "${libdir}" ]; then + found_libdir_in_search_path="yes" + break + fi +done +if [ "${found_libdir_in_search_path}" = "no" ]; then + export GROONGA_HTTPD_RPATH="${libdir}" +fi + +if [ "${abs_top_srcdir}/src/httpd" != "$(pwd)" ]; then + nginx_directory_in_build_directory="${abs_top_builddir}/${nginx_directory}" + rm -rf "${nginx_directory_in_build_directory}" + cp -rp \ + "${absolute_source_directory}/${relative_nginx_directory}" \ + "${nginx_directory_in_build_directory}" +fi + +configure_args="" +if [ "${GROONGA_HTTPD_DEBUG}" = "yes" ]; then + configure_args="${configure_args} --with-debug" +fi + +cc_opt="" +ld_opt="" +if [ "${GROONGA_HTTPD_WITH_PCRE}" = "yes" ]; then + cc_opt="${cc_opt} ${GROONGA_HTTPD_PCRE_CFLAGS}" + ld_opt="${ld_opt} ${GROONGA_HTTPD_PCRE_LIBS_ONLY_L}" +else + configure_args="${configure_args} --without-http_rewrite_module" +fi +if [ "${GROONGA_HTTPD_WITH_ZLIB}" != "yes" ]; then + configure_args="${configure_args} --without-http_gzip_module" +fi + + +cd "${nginx_directory}" + +./configure \ + --prefix="${GROONGA_HTTPD_PREFIX}" \ + --sbin-path="${GROONGA_HTTPD_BIN_PATH}" \ + --conf-path="${GROONGA_HTTPD_CONF_PATH}" \ + --error-log-path="${GROONGA_HTTPD_ERROR_LOG_PATH}" \ + --http-log-path="${GROONGA_HTTPD_HTTP_LOG_PATH}" \ + --add-module="${GROONGA_HTTPD_MODULE_PATH}" \ + --pid-path="${GROONGA_HTTPD_PID_PATH}" \ + --with-cc-opt="${cc_opt}" \ + --with-ld-opt="${ld_opt}" \ + ${configure_args} + +if [ "${GROONGA_HTTPD_DEBUG}" = "yes" ]; then + sed -i'' \ + -e '/^CFLAGS =/ s/ -O / -O0 /' \ + -e '/^CFLAGS =/ s/ -g / -ggdb3 /' \ + objs/Makefile +fi Renamed: src/httpd/nginx-module/config (+0 -0) 100% =================================================================== Renamed: src/httpd/nginx-module/ngx_http_groonga_module.c (+0 -0) 100% =================================================================== Modified: vendor/Makefile.am (+0 -30) =================================================================== --- vendor/Makefile.am 2013-01-17 11:30:40 +0900 (0842f46) +++ vendor/Makefile.am 2013-01-17 12:01:08 +0900 (0ed546c) @@ -4,36 +4,6 @@ MRUBY_DIR = mruby-$(MRUBY_VERSION) SUBDIRS = mruby EXTRA_DIST = \ - nginx \ $(NGINX_DIR) \ mruby \ $(MRUBY_DIR) - -if WITH_GROONGA_HTTPD -NGINX_MAKEILE = $(NGINX_DIR)/Makefile -NGINX_MAKEFILE_DEPEND_FILES = \ - nginx/configure \ - Makefile.am \ - $(top_builddir)/config.status \ - $(top_srcdir)/src/nginx-module/config - -$(NGINX_MAKEILE): $(NGINX_MAKEFILE_DEPEND_FILES) - (cd nginx && \ - $(SHELL) "$(abs_top_srcdir)/vendor/nginx/configure" \ - `../../config.status --config`) - -# nginx's Makefile specify 'build' as the default rule. -# This isn't compatible with the 'all' default rule generated by Automake -# So, override the all rule. -all-nginx: $(NGINX_MAKEILE) - (cd $(NGINX_DIR) && $(MAKE) build) -all-local: all-nginx - -clean-nginx: $(NGINX_MAKEILE) - (cd $(NGINX_DIR) && $(MAKE) clean) -clean-local: clean-nginx - -install-exec-nginx: $(NGINX_MAKEILE) - (cd $(NGINX_DIR) && $(MAKE) install) -install-exec-local: install-exec-nginx -endif Deleted: vendor/nginx/configure (+0 -68) 100755 =================================================================== --- vendor/nginx/configure 2013-01-17 11:30:40 +0900 (9f45853) +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -set -e - -nginx_version=1.2.1 - -export GROONGA_HTTPD_IN_TREE=yes -. "../../groonga-httpd-conf.sh" - -eval "`../../libtool --config`" - -found_libdir_in_search_path="no" -for search_path in $sys_lib_search_path_spec $sys_lib_dlsearch_path_spec; do - if [ "$search_path" = "$libdir" ]; then - found_libdir_in_search_path="yes" - break - fi -done -if [ "$found_libdir_in_search_path" = "no" ]; then - export GROONGA_HTTPD_RPATH="${libdir}" -fi - -source_directory="`dirname \"$0\"`" -absolute_source_directory="`cd \"$source_directory\"/../.. && pwd`" - -if [ "$absolute_source_directory/vendor/nginx" != "`pwd`" ]; then - rm -rf ../nginx-${nginx_version} - cp -rp "$absolute_source_directory/vendor/nginx-${nginx_version}" ../ -fi - -configure_args="" -if [ "$GROONGA_HTTPD_DEBUG" = "yes" ]; then - configure_args="$configure_args --with-debug" -fi - -cc_opt="" -ld_opt="" -if [ "$GROONGA_HTTPD_WITH_PCRE" = "yes" ]; then - cc_opt="$cc_opt $GROONGA_HTTPD_PCRE_CFLAGS" - ld_opt="$ld_opt $GROONGA_HTTPD_PCRE_LIBS_ONLY_L" -else - configure_args="$configure_args --without-http_rewrite_module" -fi -if [ "$GROONGA_HTTPD_WITH_ZLIB" != "yes" ]; then - configure_args="$configure_args --without-http_gzip_module" -fi - - -cd "../nginx-${nginx_version}" - -./configure \ - --prefix="${GROONGA_HTTPD_PREFIX}" \ - --sbin-path="${GROONGA_HTTPD_BIN_PATH}" \ - --conf-path="${GROONGA_HTTPD_CONF_PATH}" \ - --error-log-path="${GROONGA_HTTPD_ERROR_LOG_PATH}" \ - --http-log-path="${GROONGA_HTTPD_HTTP_LOG_PATH}" \ - --add-module="${GROONGA_HTTPD_MODULE_PATH}" \ - --pid-path="${GROONGA_HTTPD_PID_PATH}" \ - --with-cc-opt="${cc_opt}" \ - --with-ld-opt="${ld_opt}" \ - ${configure_args} - -if [ "$GROONGA_HTTPD_DEBUG" = "yes" ]; then - sed -i'' \ - -e '/^CFLAGS =/ s/ -O / -O0 /' \ - -e '/^CFLAGS =/ s/ -g / -ggdb3 /' \ - objs/Makefile -fi -------------- next part -------------- HTML����������������������������...Download