From c7b57e24e2fd49c6fd423f0b3b99c5a72694ac82 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Thu, 6 Oct 2011 00:43:46 +0000 Subject: [PATCH] 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 --- ChangeLog | 3 ++- configure.ac | 18 +----------------- m4/geany-gnu-regex.m4 | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 m4/geany-gnu-regex.m4 diff --git a/ChangeLog b/ChangeLog index 4522ad806..25fcd38da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/configure.ac b/configure.ac index 034f52cc3..6a047ecd6 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/m4/geany-gnu-regex.m4 b/m4/geany-gnu-regex.m4 new file mode 100644 index 000000000..db89961fa --- /dev/null +++ b/m4/geany-gnu-regex.m4 @@ -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 +]) -- 2.11.4.GIT