Alter warning fix
[geany-mirror.git] / m4 / geany-gnu-regex.m4
blobb0808ff154a60f98f4e88905c8ed7d832a31b49c
1 dnl GEANY_CHECK_GNU_REGEX
2 dnl Checks whether to use internal GNU regex library
3 dnl Defines USE_INCLUDED_REGEX both with AC_DEFINE and as an
4 dnl AM_CONDITIONAL
5 AC_DEFUN([GEANY_CHECK_GNU_REGEX],
7         AC_ARG_ENABLE([gnu-regex],
8                         [AS_HELP_STRING([--enable-gnu-regex],
9                                         [compile with included GNU regex library [default=no]])],
10                         ,
11                         [enable_gnu_regex=no])
13         # auto-enable included regex if necessary
14         # FIXME: this may override a user choice
15         AC_CHECK_FUNCS([regcomp], [], [enable_gnu_regex="yes"])
17         if test "x$enable_gnu_regex" = "xyes" ; then
18                 AC_DEFINE([USE_INCLUDED_REGEX], [1], [Define if included GNU regex code should be used.])
19                 AC_DEFINE([HAVE_REGCOMP], [1], [Define if you have the 'regcomp' function.])
20                 AM_CONDITIONAL([USE_INCLUDED_REGEX], true)
21                 GEANY_STATUS_ADD([GNU regex library], [built-in])
22         else
23                 AM_CONDITIONAL([USE_INCLUDED_REGEX], false)
24                 GEANY_STATUS_ADD([GNU regex library], [system])
25         fi