Skip to content

Commit

Permalink
Support installing expression rewriters
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 8, 2015
1 parent 349ccd0 commit a09a2f3
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
4 changes: 4 additions & 0 deletions configure.ac
Expand Up @@ -253,6 +253,7 @@ AC_CONFIG_FILES([
plugins/token_filters/Makefile
plugins/sharding/Makefile
plugins/functions/Makefile
plugins/expression_rewriters/Makefile
examples/Makefile
examples/dictionary/Makefile
examples/dictionary/edict/Makefile
Expand Down Expand Up @@ -1385,6 +1386,9 @@ AC_SUBST(sharding_pluginsdir)
function_pluginsdir="\${pluginsdir}/functions"
AC_SUBST(function_pluginsdir)

expression_rewriter_pluginsdir="\${pluginsdir}/expression_rewriters"
AC_SUBST(expression_rewriter_pluginsdir)

AC_MSG_CHECKING(for the suffix of plugin shared libraries)
shrext_cmds=$(./libtool --config | grep '^shrext_cmds=')
eval $shrext_cmds
Expand Down
3 changes: 2 additions & 1 deletion plugins/Makefile.am
Expand Up @@ -6,7 +6,8 @@ SUBDIRS = \
ruby \
token_filters \
sharding \
functions
functions \
expression_rewriters

EXTRA_DIST = \
CMakeLists.txt
Expand Down
26 changes: 26 additions & 0 deletions plugins/expression_rewriters/CMakeLists.txt
@@ -0,0 +1,26 @@
# Copyright(C) 2015 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# 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

if(NOT GRN_EMBED)
if(GRN_WITH_MRUBY)
set(GRN_RELATIVE_EXPRESSION_REWRITER_PLUGINS_DIR
"${GRN_RELATIVE_PLUGINS_DIR}/expression_rewriters")

read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/sources.am
EXPRESSION_REWRITERS)
install(FILES ${EXPRESSION_REWRITERS}
DESTINATION "${GRN_RELATIVE_SEXPRESSION_REWRITER_PLUGINS_DIR}")
endif()
endif()
9 changes: 9 additions & 0 deletions plugins/expression_rewriters/Makefile.am
@@ -0,0 +1,9 @@
EXTRA_DIST = \
CMakeLists.txt

if WITH_MRUBY
dist_expression_rewriter_plugins_DATA = \
$(expression_rewriters)
endif

include sources.am
2 changes: 2 additions & 0 deletions plugins/expression_rewriters/sources.am
@@ -0,0 +1,2 @@
expression_rewriters = \
optimizer.rb

0 comments on commit a09a2f3

Please sign in to comment.