1 dnl @synopsis MC_VERSION
3 dnl Check search type in mc. Currently used glib-regexp or pcre
5 dnl @author Slava Zanko <slavazanko@gmail.com>
6 dnl @version 2009-06-19
8 dnl @copyright Free Software Foundation, Inc.
10 AC_DEFUN([MC_CHECK_SEARCH_TYPE],[
12 AC_ARG_WITH([search-engine],
13 AC_HELP_STRING([--with-search-engine=type],
14 [Select low-level search engine (since glib >= 2.14). [[glib|pcre]]])
16 case x$with_search_engine in
18 SEARCH_TYPE="glib-regexp"
24 SEARCH_TYPE="glib-regexp"
27 AC_MSG_ERROR([Value of the search-engine is incorrect])
31 $PKG_CONFIG --max-version 2.14 glib-2.0
32 if test $? -eq 0; then
33 if test ! x"$with_search_engine" = x -a x"$SEARCH_TYPE" = xglib; then
34 AC_MSG_ERROR([Selected 'glib' search engine, but you don't have glib >= 2.14])
37 if test x"${PCRE_LIBS}" = x; then
38 AC_MSG_ERROR([Your system have glib < 2.14 and don't have pcre library (or pcre devel stuff)])
40 AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre' search type])
42 if test x"$SEARCH_TYPE" = xpcre; then
44 if test x"${PCRE_LIBS}" = x; then
45 AC_MSG_ERROR([Your system don't have pcre library (or pcre devel stuff)])
47 AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre' search type])
49 AC_DEFINE(SEARCH_TYPE_GLIB, 1, [Define to select 'glib-regexp' search type])