2009-06-19 17:34:34 +04:00
|
|
|
dnl @synopsis MC_VERSION
|
|
|
|
dnl
|
|
|
|
dnl Check search type in mc. Currently used glib-regexp or pcre
|
|
|
|
dnl
|
|
|
|
dnl @author Slava Zanko <slavazanko@gmail.com>
|
|
|
|
dnl @version 2009-06-19
|
|
|
|
dnl @license GPL
|
|
|
|
dnl @copyright Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
AC_DEFUN([MC_CHECK_SEARCH_TYPE],[
|
|
|
|
|
2009-07-07 12:11:29 +04:00
|
|
|
AC_ARG_WITH([search-engine],
|
2009-07-30 17:48:40 +04:00
|
|
|
AC_HELP_STRING([--with-search-engine=type],
|
|
|
|
[Select low-level search engine (since glib >= 2.14). [[glib|pcre]]])
|
2009-07-07 12:11:29 +04:00
|
|
|
)
|
|
|
|
case x$with_search_engine in
|
|
|
|
xglib)
|
|
|
|
SEARCH_TYPE="glib-regexp"
|
|
|
|
;;
|
|
|
|
xpcre)
|
|
|
|
SEARCH_TYPE="pcre"
|
|
|
|
;;
|
|
|
|
x)
|
|
|
|
SEARCH_TYPE="glib-regexp"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR([Value of the search-engine is incorrect])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-06-19 17:34:34 +04:00
|
|
|
$PKG_CONFIG --max-version 2.14 glib-2.0
|
|
|
|
if test $? -eq 0; then
|
2009-07-26 17:11:53 +04:00
|
|
|
if test ! x"$with_search_engine" = x -a x"$SEARCH_TYPE" = xglib; then
|
2009-07-07 12:11:29 +04:00
|
|
|
AC_MSG_ERROR([Selected 'glib' search engine, but you don't have glib >= 2.14])
|
|
|
|
fi
|
|
|
|
AX_PATH_LIB_PCRE
|
|
|
|
if test x"${PCRE_LIBS}" = x; then
|
|
|
|
AC_MSG_ERROR([Your system have glib < 2.14 and don't have pcre library (or pcre devel stuff)])
|
|
|
|
fi
|
|
|
|
AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre' search type])
|
2009-06-19 17:34:34 +04:00
|
|
|
else
|
2009-07-26 17:11:53 +04:00
|
|
|
if test x"$SEARCH_TYPE" = xpcre; then
|
2009-07-07 12:11:29 +04:00
|
|
|
AX_PATH_LIB_PCRE
|
|
|
|
if test x"${PCRE_LIBS}" = x; then
|
|
|
|
AC_MSG_ERROR([Your system don't have pcre library (or pcre devel stuff)])
|
|
|
|
fi
|
|
|
|
AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre' search type])
|
|
|
|
else
|
|
|
|
AC_DEFINE(SEARCH_TYPE_GLIB, 1, [Define to select 'glib-regexp' search type])
|
|
|
|
fi
|
2009-06-19 17:34:34 +04:00
|
|
|
fi
|
|
|
|
])
|