Kouhei Sutou 2018-11-09 10:35:39 +0900 (Fri, 09 Nov 2018) Revision: 0251e2bed20aed42cf37c4bc5a55f76076317cf2 https://github.com/groonga/groonga/commit/0251e2bed20aed42cf37c4bc5a55f76076317cf2 Message: Add GRN_VERSION* macros Added files: include/groonga/version.h.in Modified files: .gitignore CMakeLists.txt benchmark/Makefile.am configure.ac groonga-httpd-conf.sh.in include/CMakeLists.txt include/groonga.h include/groonga/Makefile.am lib/Makefile.am lib/mrb/Makefile.am lib/proc/Makefile.am lib/ts/Makefile.am plugins/functions/Makefile.am plugins/query_expanders/Makefile.am plugins/suggest/Makefile.am plugins/token_filters/Makefile.am plugins/tokenizers/Makefile.am src/Makefile.am src/httpd/configure src/suggest/Makefile.am test/unit/Makefile.am test/unit/core/Makefile.am test/unit/core/dat/Makefile.am test/unit/fixtures/Makefile.am test/unit/fixtures/plugins/Makefile.am test/unit/fixtures/stress/Makefile.am test/unit/lib/Makefile.am test/unit/story/Makefile.am test/unit/util/Makefile.am Modified: .gitignore (+1 -0) =================================================================== --- .gitignore 2018-11-08 18:21:52 +0900 (559e82e3d) +++ .gitignore 2018-11-09 10:35:39 +0900 (89df088dc) @@ -65,6 +65,7 @@ cmake_install.cmake /stamp-h1 /CMakeCache.txt /install_manifest.txt +/include/groonga/version.sh /src/groonga /src/groonga-benchmark /src/grnslap Modified: CMakeLists.txt (+12 -0) =================================================================== --- CMakeLists.txt 2018-11-08 18:21:52 +0900 (1b07e9ef4) +++ CMakeLists.txt 2018-11-09 10:35:39 +0900 (b14481dc8) @@ -1,4 +1,5 @@ # Copyright(C) 2012-2018 Brazil +# Copyright(C) 2018 Kouhei Sutou <kou****@clear*****> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -60,9 +61,19 @@ else() endif() endif() string(REGEX REPLACE "(^.*=|\n)" "" GRN_VERSION "${GRN_VERSION}") +string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.([^.-]+)$" "\\1" + GRN_VERSION_MAJOR "${VERSION}") +string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.([^.-]+)$" "\\2" + GRN_VERSION_MINOR "${VERSION}") +string(REGEX REPLACE "^([^.]+)\\.([^.]+)\\.([^.-]+)$" "\\3" + GRN_VERSION_MICRO "${VERSION}") string(REGEX REPLACE "\\." "," GRN_VERSION_RC "${GRN_VERSION}") string(REGEX REPLACE "-.*$" "" GRN_VERSION_RC "${GRN_VERSION_RC}") +configure_file( + include/groonga/version.h.in + ${CMAKE_CURRENT_BINARY_DIR}/include/groonga/version.h) + include(CheckIncludeFile) include(CheckFunctionExists) include(CheckLibraryExists) @@ -224,6 +235,7 @@ endif() include_directories( BEFORE ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/lib ) Modified: benchmark/Makefile.am (+6 -5) =================================================================== --- benchmark/Makefile.am 2018-11-08 18:21:52 +0900 (a2a8b29ab) +++ benchmark/Makefile.am 2018-11-09 10:35:39 +0900 (f276ce5d3) @@ -23,11 +23,12 @@ EXTRA_DIST = \ bench-query-optimizer-ddl.grn \ geo-select-generate-grn.rb -AM_CPPFLAGS = \ - -I$(srcdir) \ - -I$(srcdir)/lib \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/lib \ +AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(srcdir) \ + -I$(srcdir)/lib \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib \ $(GROONGA_INCLUDEDIR) AM_CFLAGS = \ Modified: configure.ac (+8 -0) =================================================================== --- configure.ac 2018-11-08 18:21:52 +0900 (9bd7957e7) +++ configure.ac 2018-11-09 10:35:39 +0900 (3865feb55) @@ -4,6 +4,13 @@ AC_INIT([groonga], groonga_version, [groon****@razil*****]) AC_CONFIG_MACRO_DIR([m4]) AM_CONFIG_HEADER(config.h) +GRN_VERSION_MAJOR=`echo groonga_version | cut -d. -f1` +AC_SUBST(GRN_VERSION_MAJOR) +GRN_VERSION_MINOR=`echo groonga_version | cut -d. -f2` +AC_SUBST(GRN_VERSION_MINOR) +GRN_VERSION_MICRO=`echo groonga_version | cut -d. -f3` +AC_SUBST(GRN_VERSION_MICRO) + GRN_VERSION_RC=`echo groonga_version | sed -e 's/\./,/g'` AC_SUBST(GRN_VERSION_RC) @@ -1731,6 +1738,7 @@ GROONGA_HTTPD_DEFAULT_DATABASE_PATH="` AC_SUBST(GROONGA_HTTPD_DEFAULT_DATABASE_PATH) AC_OUTPUT([ + include/groonga/version.h lib/metadata.rc packages/rpm/centos/groonga.spec packages/apt/debian/groonga-keyring.postrm Modified: groonga-httpd-conf.sh.in (+2 -1) =================================================================== --- groonga-httpd-conf.sh.in 2018-11-08 18:21:52 +0900 (4dbb400fb) +++ groonga-httpd-conf.sh.in 2018-11-09 10:35:39 +0900 (50429d3a5) @@ -11,7 +11,8 @@ EXEEXT="@EXEEXT@" SED="@SED@" 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_BUILD_INCLUDE_PATH="@abs_top_builddir@/include" +export GROONGA_HTTPD_IN_TREE_SOURCE_INCLUDE_PATH="@abs_top_srcdir@/include" export GROONGA_HTTPD_IN_TREE_LINK_PATH="@abs_top_builddir@/lib/.libs" export GROONGA_HTTPD_PREFIX="${pkgsysconfdir}/httpd" export GROONGA_HTTPD_BIN_PATH="${sbindir}/groonga-httpd${EXEEXT}" Modified: include/CMakeLists.txt (+4 -0) =================================================================== --- include/CMakeLists.txt 2018-11-08 18:21:52 +0900 (7594c6e6c) +++ include/CMakeLists.txt 2018-11-09 10:35:39 +0900 (0535022f4) @@ -1,4 +1,5 @@ # Copyright(C) 2012 Brazil +# Copyright(C) 2018 Kouhei Sutou <kou****@clear*****> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -16,3 +17,6 @@ install(FILES groonga.h DESTINATION "${GRN_INCLUDE_DIR}") install(DIRECTORY groonga DESTINATION "${GRN_INCLUDE_DIR}" FILES_MATCHING PATTERN "*.h") +install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/groonga" + DESTINATION "${GRN_INCLUDE_DIR}" + FILES_MATCHING PATTERN "*.h") Modified: include/groonga.h (+2 -0) =================================================================== --- include/groonga.h 2018-11-08 18:21:52 +0900 (d44ca02dd) +++ include/groonga.h 2018-11-09 10:35:39 +0900 (9be2cd3e8) @@ -19,6 +19,8 @@ #pragma once +#include "groonga/version.h" + #include "groonga/portability.h" #include "groonga/groonga.h" Modified: include/groonga/Makefile.am (+2 -1) =================================================================== --- include/groonga/Makefile.am 2018-11-08 18:21:52 +0900 (75e5cadf8) +++ include/groonga/Makefile.am 2018-11-09 10:35:39 +0900 (39a61668e) @@ -49,4 +49,5 @@ groonga_include_HEADERS = \ window_function.h \ windows.h \ windows_event_logger.h \ - vector.h + vector.h \ + version.h Added: include/groonga/version.h.in (+24 -0) 100644 =================================================================== --- /dev/null +++ include/groonga/version.h.in 2018-11-09 10:35:39 +0900 (1a577fd82) @@ -0,0 +1,24 @@ +/* + Copyright(C) 2018 Kouhei Sutou <kou****@clear*****> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#define GRN_VERION "@GRN_VERSION@" +#define GRN_VERION_MAJOR @GRN_VERSION_MAJOR@ +#define GRN_VERION_MINOR @GRN_VERSION_MINOR@ +#define GRN_VERION_MICRO @GRN_VERSION_MICRO@ Modified: lib/Makefile.am (+1 -0) =================================================================== --- lib/Makefile.am 2018-11-08 18:21:52 +0900 (1f66f35a1) +++ lib/Makefile.am 2018-11-09 10:35:39 +0900 (b5f855217) @@ -33,6 +33,7 @@ BUNDLED_LIBRARIES_CFLAGS = \ DEFAULT_INCLUDES = \ -I$(top_builddir) \ + -I$(top_builddir)/include \ -I$(top_srcdir)/include \ $(BUNDLED_LIBRARIES_CFLAGS) Modified: lib/mrb/Makefile.am (+1 -0) =================================================================== --- lib/mrb/Makefile.am 2018-11-08 18:21:52 +0900 (0e4db6348) +++ lib/mrb/Makefile.am 2018-11-09 10:35:39 +0900 (bc3634612) @@ -3,6 +3,7 @@ SUBDIRS = \ AM_CPPFLAGS = \ -I$(top_builddir) \ + -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ $(MRUBY_CPPFLAGS) Modified: lib/proc/Makefile.am (+1 -0) =================================================================== --- lib/proc/Makefile.am 2018-11-08 18:21:52 +0900 (e4284dc27) +++ lib/proc/Makefile.am 2018-11-09 10:35:39 +0900 (02b76f6b9) @@ -1,5 +1,6 @@ AM_CPPFLAGS = \ -I$(top_builddir) \ + -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib Modified: lib/ts/Makefile.am (+1 -0) =================================================================== --- lib/ts/Makefile.am 2018-11-08 18:21:52 +0900 (f1f21df48) +++ lib/ts/Makefile.am 2018-11-09 10:35:39 +0900 (4bd2ecdcf) @@ -4,6 +4,7 @@ BUNDLED_LIBRARIES_CFLAGS = \ DEFAULT_INCLUDES = \ -I$(top_builddir) \ + -I$(top_builddir)/include \ -I$(top_srcdir)/include \ $(BUNDLED_LIBRARIES_CFLAGS) Modified: plugins/functions/Makefile.am (+1 -0) =================================================================== --- plugins/functions/Makefile.am 2018-11-08 18:21:52 +0900 (f57ee031a) +++ plugins/functions/Makefile.am 2018-11-09 10:35:39 +0900 (28d9d3365) @@ -3,6 +3,7 @@ EXTRA_DIST = \ AM_CPPFLAGS = \ -I$(top_builddir) \ + -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib Modified: plugins/query_expanders/Makefile.am (+4 -3) =================================================================== --- plugins/query_expanders/Makefile.am 2018-11-08 18:21:52 +0900 (96c0911a0) +++ plugins/query_expanders/Makefile.am 2018-11-09 10:35:39 +0900 (d1b99eec3) @@ -1,9 +1,10 @@ EXTRA_DIST = \ CMakeLists.txt -AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir)/include \ +AM_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_LDFLAGS = \ Modified: plugins/suggest/Makefile.am (+4 -3) =================================================================== --- plugins/suggest/Makefile.am 2018-11-08 18:21:52 +0900 (7f321b6c4) +++ plugins/suggest/Makefile.am 2018-11-09 10:35:39 +0900 (18c7e0a06) @@ -5,9 +5,10 @@ AM_CFLAGS = \ $(MESSAGE_PACK_CFLAGS) \ $(MRUBY_CFLAGS) -AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir)/include \ +AM_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_LDFLAGS = \ Modified: plugins/token_filters/Makefile.am (+1 -0) =================================================================== --- plugins/token_filters/Makefile.am 2018-11-08 18:21:52 +0900 (c63bef7ac) +++ plugins/token_filters/Makefile.am 2018-11-09 10:35:39 +0900 (ffaf56eb5) @@ -3,6 +3,7 @@ EXTRA_DIST = \ AM_CPPFLAGS = \ -I$(top_builddir) \ + -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib Modified: plugins/tokenizers/Makefile.am (+4 -3) =================================================================== --- plugins/tokenizers/Makefile.am 2018-11-08 18:21:52 +0900 (9e10612ba) +++ plugins/tokenizers/Makefile.am 2018-11-09 10:35:39 +0900 (59d21a3f1) @@ -1,9 +1,10 @@ EXTRA_DIST = \ CMakeLists.txt -AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir)/include \ +AM_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_LDFLAGS = \ Modified: src/Makefile.am (+1 -0) =================================================================== --- src/Makefile.am 2018-11-08 18:21:52 +0900 (2ee687233) +++ src/Makefile.am 2018-11-09 10:35:39 +0900 (52c4aff21) @@ -30,6 +30,7 @@ AM_LDFLAGS = -no-undefined DEFAULT_INCLUDES = \ -I$(top_builddir) \ + -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ $(GROONGA_INCLUDEDIR) Modified: src/httpd/configure (+2 -1) =================================================================== --- src/httpd/configure 2018-11-08 18:21:52 +0900 (4a900f2f1) +++ src/httpd/configure 2018-11-09 10:35:39 +0900 (329a06743) @@ -69,7 +69,8 @@ if [ "${GROONGA_HTTPD_DEBUG}" = "yes" ]; then configure_args="${configure_args} --with-debug" fi -groonga_cflags="-I${GROONGA_HTTPD_IN_TREE_INCLUDE_PATH}" +groonga_cflags="-I${GROONGA_HTTPD_IN_TREE_BUILD_INCLUDE_PATH}" +groonga_cflags="${groonga_cflags} -I${GROONGA_HTTPD_IN_TREE_SOURCE_INCLUDE_PATH}" groonga_ldflags="-L${GROONGA_HTTPD_IN_TREE_LINK_PATH}" if [ "${GROONGA_HTTPD_WITH_ONIGMO}" = "yes" ]; then groonga_ldflags="$groonga_ldflags -L${GROONGA_HTTPD_ONIGMO_IN_TREE_LINK_PATH}" Modified: src/suggest/Makefile.am (+1 -0) =================================================================== --- src/suggest/Makefile.am 2018-11-08 18:21:52 +0900 (91260016f) +++ src/suggest/Makefile.am 2018-11-09 10:35:39 +0900 (e2ec0a546) @@ -28,6 +28,7 @@ AM_LDFLAGS = -no-undefined DEFAULT_INCLUDES = \ -I$(top_builddir) \ + -I$(top_builddir)/include \ -I$(srcdir) \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ Modified: test/unit/Makefile.am (+5 -4) =================================================================== --- test/unit/Makefile.am 2018-11-08 18:21:52 +0900 (75d97ce81) +++ test/unit/Makefile.am 2018-11-09 10:35:39 +0900 (d99e2dee5) @@ -25,10 +25,11 @@ endif EXTRA_DIST = \ run-test.sh -AM_CPPFLAGS = \ - -I$(srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/lib \ +AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib \ $(GROONGA_INCLUDEDIR) AM_LDFLAGS = -module -rpath $(libdir) -avoid-version Modified: test/unit/core/Makefile.am (+4 -3) =================================================================== --- test/unit/core/Makefile.am 2018-11-08 18:21:52 +0900 (8fa53db0f) +++ test/unit/core/Makefile.am 2018-11-09 10:35:39 +0900 (7ba6c94a0) @@ -69,9 +69,10 @@ noinst_LTLIBRARIES = \ test-id.la endif -AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/lib \ +AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib \ $(GROONGA_INCLUDEDIR) AM_CFLAGS = \ Modified: test/unit/core/dat/Makefile.am (+1 -0) =================================================================== --- test/unit/core/dat/Makefile.am 2018-11-08 18:21:52 +0900 (7a0f2892e) +++ test/unit/core/dat/Makefile.am 2018-11-09 10:35:39 +0900 (79212d0fd) @@ -23,6 +23,7 @@ noinst_LTLIBRARIES = \ endif AM_CPPFLAGS = \ + -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/test/unit/lib \ Modified: test/unit/fixtures/Makefile.am (+6 -5) =================================================================== --- test/unit/fixtures/Makefile.am 2018-11-08 18:21:52 +0900 (c6e9d97ad) +++ test/unit/fixtures/Makefile.am 2018-11-09 10:35:39 +0900 (31c534922) @@ -10,11 +10,12 @@ noinst_LTLIBRARIES = \ suite-groonga-test-fixtures.la endif -AM_CPPFLAGS = \ - -I$(srcdir) \ - -I$(srcdir)/../lib \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/lib \ +AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(srcdir) \ + -I$(srcdir)/../lib \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib \ $(GROONGA_INCLUDEDIR) AM_LDFLAGS = \ Modified: test/unit/fixtures/plugins/Makefile.am (+4 -3) =================================================================== --- test/unit/fixtures/plugins/Makefile.am 2018-11-08 18:21:52 +0900 (8a24a618c) +++ test/unit/fixtures/plugins/Makefile.am 2018-11-09 10:35:39 +0900 (0cb8c2f49) @@ -1,6 +1,7 @@ -AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir)/include \ +AM_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_LDFLAGS = \ Modified: test/unit/fixtures/stress/Makefile.am (+1 -0) =================================================================== --- test/unit/fixtures/stress/Makefile.am 2018-11-08 18:21:52 +0900 (886685a27) +++ test/unit/fixtures/stress/Makefile.am 2018-11-09 10:35:39 +0900 (c79bb9b14) @@ -5,6 +5,7 @@ noinst_LTLIBRARIES = \ endif AM_CPPFLAGS = \ + -I$(top_builddir)/include \ -I$(srcdir) \ -I$(top_srcdir)/test/unit/lib \ -I$(top_srcdir)/include \ Modified: test/unit/lib/Makefile.am (+1 -0) =================================================================== --- test/unit/lib/Makefile.am 2018-11-08 18:21:52 +0900 (823d5997b) +++ test/unit/lib/Makefile.am 2018-11-09 10:35:39 +0900 (715ca616d) @@ -6,6 +6,7 @@ noinst_LTLIBRARIES = \ endif AM_CPPFLAGS = \ + -I$(top_builddir)/include \ -I$(srcdir) \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ Modified: test/unit/story/Makefile.am (+4 -3) =================================================================== --- test/unit/story/Makefile.am 2018-11-08 18:21:52 +0900 (43bb2f78b) +++ test/unit/story/Makefile.am 2018-11-09 10:35:39 +0900 (d7c8e04cc) @@ -3,9 +3,10 @@ noinst_LTLIBRARIES = \ test-taiyaki.la endif -AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/lib \ +AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib \ $(GROONGA_INCLUDEDIR) AM_CFLAGS = \ Modified: test/unit/util/Makefile.am (+4 -3) =================================================================== --- test/unit/util/Makefile.am 2018-11-08 18:21:52 +0900 (00a36fa21) +++ test/unit/util/Makefile.am 2018-11-09 10:35:39 +0900 (9a132e84c) @@ -4,9 +4,10 @@ noinst_LTLIBRARIES = \ test-string.la endif -AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/lib \ +AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib \ $(GROONGA_INCLUDEDIR) AM_CFLAGS = \ -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181109/29093a9d/attachment-0001.html>