2016-01-04 21:43:19 +03:00
|
|
|
dnl @synopsis mc_CHECK_SEARCH_TYPE
|
2009-06-19 17:34:34 +04:00
|
|
|
dnl
|
|
|
|
dnl Check search type in mc. Currently used glib-regexp or pcre
|
|
|
|
dnl
|
|
|
|
dnl @author Slava Zanko <slavazanko@gmail.com>
|
2023-03-22 21:50:11 +03:00
|
|
|
dnl @author Andrew Borodin <aborodin@vmail.ru>
|
|
|
|
dnl @version 2023-03-22
|
2009-06-19 17:34:34 +04:00
|
|
|
dnl @license GPL
|
|
|
|
dnl @copyright Free Software Foundation, Inc.
|
|
|
|
|
2016-01-04 21:43:19 +03:00
|
|
|
AC_DEFUN([mc_CHECK_SEARCH_TYPE_PCRE],[
|
2009-12-01 15:37:17 +03:00
|
|
|
AX_PATH_LIB_PCRE
|
2023-03-22 21:50:11 +03:00
|
|
|
|
2009-12-01 15:37:17 +03:00
|
|
|
if test x"${PCRE_LIBS}" = x; then
|
2023-03-22 21:50:11 +03:00
|
|
|
AC_MSG_ERROR([$1])
|
2009-12-01 15:37:17 +03:00
|
|
|
fi
|
2023-03-22 21:50:11 +03:00
|
|
|
|
|
|
|
SEARCH_TYPE="pcre"
|
2009-12-01 15:37:17 +03:00
|
|
|
])
|
|
|
|
|
2023-03-22 21:50:11 +03:00
|
|
|
AC_DEFUN([mc_CHECK_SEARCH_TYPE_PCRE2],[
|
|
|
|
AX_CHECK_PCRE2([8], [], [:])
|
2009-12-01 15:37:17 +03:00
|
|
|
|
2023-03-22 21:50:11 +03:00
|
|
|
if test $pcre2_cv_libpcre2 = yes; then
|
|
|
|
SEARCH_TYPE="pcre2"
|
2009-12-01 15:37:17 +03:00
|
|
|
else
|
2023-03-22 21:50:11 +03:00
|
|
|
dnl pcre2 not found -- try pcre
|
|
|
|
AC_MSG_WARN([Cannot find pcre2 library, trying pcre one...])
|
|
|
|
mc_CHECK_SEARCH_TYPE_PCRE([$1])
|
2009-12-01 15:37:17 +03:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2016-01-04 21:43:19 +03:00
|
|
|
AC_DEFUN([mc_CHECK_SEARCH_TYPE],[
|
2009-06-19 17:34:34 +04:00
|
|
|
|
2009-07-07 12:11:29 +04:00
|
|
|
AC_ARG_WITH([search-engine],
|
2011-05-25 17:51:18 +04:00
|
|
|
AS_HELP_STRING([--with-search-engine=type],
|
2023-03-22 21:50:11 +03:00
|
|
|
[Select low-level search engine @<:@glib|pcre|pcre2@:>@])
|
2009-07-07 12:11:29 +04:00
|
|
|
)
|
2023-03-22 21:50:11 +03:00
|
|
|
|
2009-07-07 12:11:29 +04:00
|
|
|
case x$with_search_engine in
|
|
|
|
xglib)
|
|
|
|
SEARCH_TYPE="glib-regexp"
|
|
|
|
;;
|
|
|
|
xpcre)
|
2023-03-22 21:50:11 +03:00
|
|
|
mc_CHECK_SEARCH_TYPE_PCRE([Cannot find pcre library])
|
|
|
|
;;
|
|
|
|
xpcre2)
|
|
|
|
mc_CHECK_SEARCH_TYPE_PCRE2([Neither pcre2 nor pcre library found!])
|
2009-07-07 12:11:29 +04:00
|
|
|
;;
|
|
|
|
x)
|
|
|
|
SEARCH_TYPE="glib-regexp"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR([Value of the search-engine is incorrect])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-12-01 15:37:17 +03:00
|
|
|
if test x"$SEARCH_TYPE" = x"glib-regexp"; then
|
2023-03-22 21:50:11 +03:00
|
|
|
AC_DEFINE(SEARCH_TYPE_GLIB, 1, [Define to select 'glib-regexp' search type])
|
|
|
|
else
|
|
|
|
AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre2' or 'pcre' search type])
|
2009-06-19 17:34:34 +04:00
|
|
|
fi
|
|
|
|
])
|