mc-check-search-type.m4 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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.
  9. AC_DEFUN([MC_CHECK_SEARCH_TYPE],[
  10. AC_ARG_WITH([search-engine],
  11. AC_HELP_STRING([--with-search-engine=type],
  12. [Select low-level search engine (since glib >= 2.14). [[glib|pcre]]])
  13. )
  14. case x$with_search_engine in
  15. xglib)
  16. SEARCH_TYPE="glib-regexp"
  17. ;;
  18. xpcre)
  19. SEARCH_TYPE="pcre"
  20. ;;
  21. x)
  22. SEARCH_TYPE="glib-regexp"
  23. ;;
  24. *)
  25. AC_MSG_ERROR([Value of the search-engine is incorrect])
  26. ;;
  27. esac
  28. $PKG_CONFIG --max-version 2.14 glib-2.0
  29. if test $? -eq 0; then
  30. if test ! x"$with_search_engine" = x -a x"$SEARCH_TYPE" = xglib; then
  31. AC_MSG_ERROR([Selected 'glib' search engine, but you don't have glib >= 2.14])
  32. fi
  33. AX_PATH_LIB_PCRE
  34. if test x"${PCRE_LIBS}" = x; then
  35. AC_MSG_ERROR([Your system have glib < 2.14 and don't have pcre library (or pcre devel stuff)])
  36. fi
  37. AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre' search type])
  38. else
  39. if test x"$SEARCH_TYPE" = xpcre; then
  40. AX_PATH_LIB_PCRE
  41. if test x"${PCRE_LIBS}" = x; then
  42. AC_MSG_ERROR([Your system don't have pcre library (or pcre devel stuff)])
  43. fi
  44. AC_DEFINE(SEARCH_TYPE_PCRE, 1, [Define to select 'pcre' search type])
  45. else
  46. AC_DEFINE(SEARCH_TYPE_GLIB, 1, [Define to select 'glib-regexp' search type])
  47. fi
  48. fi
  49. ])