Move configure logic for internal GNU regex usage to its own file

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@6003 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Colomban Wendling 2011-10-06 00:43:46 +00:00
parent 294a21db88
commit c7b57e24e2
3 changed files with 27 additions and 18 deletions

View File

@ -2,7 +2,8 @@
* autogen.sh, configure.ac:
Modernize configure.ac a bit.
* configure.ac, m4/geany-revision.m4, m4/geany-binreloc.m4:
* configure.ac, m4/geany-revision.m4, m4/geany-binreloc.m4,
m4/geany-gnu-regex.m4:
Extract some configure logic to separate files for better
readability.

View File

@ -92,23 +92,7 @@ fi
# check whether to use included GNU regex library
AC_ARG_ENABLE([gnu-regex],
[AS_HELP_STRING([--enable-gnu-regex],
[compile with included GNU regex library [default=no]])],
,
[enable_gnu_regex=no])
# auto-enable included regex if necessary
# FIXME: this may override a user choice
AC_CHECK_FUNCS([regcomp], [], [enable_gnu_regex="yes"])
if test "x$enable_gnu_regex" = "xyes" ; then
AC_DEFINE([USE_INCLUDED_REGEX], [1], [Define if included GNU regex code should be used.])
AC_DEFINE([HAVE_REGCOMP], [1], [Define if you have the 'regcomp' function.])
AM_CONDITIONAL([USE_INCLUDED_REGEX], true)
else
AM_CONDITIONAL([USE_INCLUDED_REGEX], false)
fi
GEANY_CHECK_GNU_REGEX
# check for mingw specific settings

24
m4/geany-gnu-regex.m4 Normal file
View File

@ -0,0 +1,24 @@
dnl GEANY_CHECK_GNU_REGEX
dnl Checks whether to use internal GNU regex library
dnl Defines USE_INCLUDED_REGEX both with AC_DEFINE and as an
dnl AM_CONDITIONAL
AC_DEFUN([GEANY_CHECK_GNU_REGEX],
[
AC_ARG_ENABLE([gnu-regex],
[AS_HELP_STRING([--enable-gnu-regex],
[compile with included GNU regex library [default=no]])],
,
[enable_gnu_regex=no])
# auto-enable included regex if necessary
# FIXME: this may override a user choice
AC_CHECK_FUNCS([regcomp], [], [enable_gnu_regex="yes"])
if test "x$enable_gnu_regex" = "xyes" ; then
AC_DEFINE([USE_INCLUDED_REGEX], [1], [Define if included GNU regex code should be used.])
AC_DEFINE([HAVE_REGCOMP], [1], [Define if you have the 'regcomp' function.])
AM_CONDITIONAL([USE_INCLUDED_REGEX], true)
else
AM_CONDITIONAL([USE_INCLUDED_REGEX], false)
fi
])