Fix broken filenames and timestamps on really poor busybox devices.
[midnight-commander.git] / m4.include / mc-check-search-type.m4
blob670cb09751ce6e5b8926bba8d011a08e0c16e2c8
1 dnl @synopsis MC_VERSION
2 dnl
3 dnl Check search type in mc. Currently used glib-regexp or pcre
4 dnl
5 dnl @author Slava Zanko <slavazanko@gmail.com>
6 dnl @version 2009-06-19
7 dnl @license GPL
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]]])
15       )
16     case x$with_search_engine in
17     xglib)
18         SEARCH_TYPE="glib-regexp"
19         ;;
20     xpcre)
21         SEARCH_TYPE="pcre"
22         ;;
23     x)
24         SEARCH_TYPE="glib-regexp"
25         ;;
26     *)
27         AC_MSG_ERROR([Value of the search-engine is incorrect])
28         ;;
29     esac
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])
35         fi
36         AX_PATH_LIB_PCRE
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)])
39         fi
40         AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre' search type])
41     else
42         if test x"$SEARCH_TYPE" = xpcre; then
43             AX_PATH_LIB_PCRE
44             if test x"${PCRE_LIBS}" = x; then
45                 AC_MSG_ERROR([Your system don't have pcre library (or pcre devel stuff)])
46             fi
47             AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre' search type])
48         else
49             AC_DEFINE(SEARCH_TYPE_GLIB, 1, [Define to select 'glib-regexp' search type])
50         fi
51     fi