Kaydet (Commit) 6de8f97c authored tarafından Nick Treleaven's avatar Nick Treleaven

Remove GNU regex now we have GRegex

üst 05949500
......@@ -14,7 +14,6 @@ Note: features included in brackets have lower priority.
o common default highlighting styles configurable for all
programming languages (done for C-like filetypes using
filetypes.common named styles)
o use GRegex only and remove GNU regex
o asynchronous build commands on Windows
o (filetype-independent run command in build dialog & keybinding)
o (better custom filetype support)
......
......@@ -38,7 +38,7 @@ AC_PROG_LN_S
# autoscan start
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h fnmatch.h glob.h regex.h stdlib.h sys/time.h])
AC_CHECK_HEADERS([fcntl.h fnmatch.h glob.h stdlib.h sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
......@@ -78,10 +78,10 @@ AC_ARG_ENABLE([deprecated],
# Check for binary relocation support
GEANY_CHECK_BINRELOC
# CTags source compatibility (we actually use GRegex instead of POSIX regcomp)
AC_DEFINE([HAVE_REGCOMP], [1], [Should always be 1, required for CTags.])
# Plugins support
GEANY_CHECK_PLUGINS
# check whether to use included GNU regex library
GEANY_CHECK_GNU_REGEX
# check for mingw specific settings
GEANY_CHECK_MINGW
......
......@@ -1789,17 +1789,15 @@ body.</p>
<h3><a class="toc-backref" href="#id74">Regular expressions</a></h3>
<p>You can use regular expressions in the Find and Replace dialogs
by selecting the <em>Use regular expressions</em> check box (see <a class="reference internal" href="#matching-options">Matching
options</a>). The syntax is POSIX compatible, as described in the table
below.</p>
options</a>). The syntax is Perl compatible. Basic syntax is described
in the table below. For full details, see
<a class="reference external" href="http://www.geany.org/manual/gtk/glib/glib-regex-syntax.html">http://www.geany.org/manual/gtk/glib/glib-regex-syntax.html</a>.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<ol class="last arabic simple">
<li>The <em>Use escape sequences</em> dialog option always applies for regular
expressions.</li>
<li>Searching backwards with regular expressions is not supported.</li>
<li>\b, \d, \s, \w are GNU extensions and may not be available
on non-GNU POSIX systems unless you built Geany with the
<tt class="docutils literal"><span class="pre">--enable-gnu-regex</span></tt> option (this is always used on Windows).</li>
</ol>
</div>
<p><strong>In a regular expression, the following characters are interpreted:</strong></p>
......@@ -5001,7 +4999,7 @@ only for Makefile). These settings don't override auto-detection if activated.<
Values that are set in the [build-menu] section will override those in this section.</p>
<dl class="docutils">
<dt>error_regex</dt>
<dd><p class="first">This is a GNU-style extended regular expression to parse a filename
<dd><p class="first">This is a regular expression to parse a filename
and line number from build output. If undefined, Geany will fall
back to its default error message parsing.</p>
<p>Only the first two matches will be read by Geany. Geany will look for
......
......@@ -1389,16 +1389,14 @@ Regular expressions
You can use regular expressions in the Find and Replace dialogs
by selecting the *Use regular expressions* check box (see `Matching
options`_). The syntax is POSIX compatible, as described in the table
below.
options`_). The syntax is Perl compatible. Basic syntax is described
in the table below. For full details, see
http://www.geany.org/manual/gtk/glib/glib-regex-syntax.html.
.. note::
1. The *Use escape sequences* dialog option always applies for regular
expressions.
2. Searching backwards with regular expressions is not supported.
3. \\b, \\d, \\s, \\w are GNU extensions and may not be available
on non-GNU POSIX systems unless you built Geany with the
``--enable-gnu-regex`` option (this is always used on Windows).
**In a regular expression, the following characters are interpreted:**
......@@ -4118,7 +4116,7 @@ As of Geany 0.19 this section is supplemented by the `[build-menu] section`_.
Values that are set in the [build-menu] section will override those in this section.
error_regex
This is a GNU-style extended regular expression to parse a filename
This is a regular expression to parse a filename
and line number from build output. If undefined, Geany will fall
back to its default error message parsing.
......
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)
GEANY_STATUS_ADD([GNU regex library], [built-in])
else
AM_CONDITIONAL([USE_INCLUDED_REGEX], false)
GEANY_STATUS_ADD([GNU regex library], [system])
fi
])
......@@ -42,12 +42,6 @@
#include "SciLexer.h"
#include "geany.h"
#ifdef HAVE_REGEX_H
# include <regex.h>
#else
# include "gnuregex.h"
#endif
#include "support.h"
#include "editor.h"
#include "document.h"
......
......@@ -92,11 +92,7 @@ GeanyStatus main_status;
CommandLineOptions cl_options; /* fields initialised in parse_command_line_options */
static const gchar geany_lib_versions[] = "GTK %u.%u.%u, GLib %u.%u.%u"
#ifdef USE_INCLUDED_REGEX
", built-in regex"
#endif
;
static const gchar geany_lib_versions[] = "GTK %u.%u.%u, GLib %u.%u.%u";
static gboolean want_plugins;
......
......@@ -5,18 +5,11 @@ INCLUDES = -I$(srcdir)/include $(GTK_CFLAGS) -I$(srcdir)/mio -I$(srcdir)
AM_CFLAGS = -DG_LOG_DOMAIN=\""Tagmanager"\"
# regex.c is the GNU regex implementation needed for Windows
EXTRA_DIST = regex.c \
EXTRA_DIST =\
makefile.win32
noinst_LIBRARIES = libtagmanager.a
if USE_INCLUDED_REGEX
regex_sources = regex.c
else
regex_sources =
endif
libtagmanager_a_SOURCES =\
general.h\
keyword.h\
......@@ -88,6 +81,5 @@ libtagmanager_a_SOURCES =\
tm_tag.c\
tm_symbol.c\
tm_file_entry.c\
tm_tagmanager.c \
$(regex_sources)
tm_tagmanager.c
noinst_HEADERS = \
gnuregex.h
tagmanager_includedir = $(includedir)/geany/tagmanager
tagmanager_include_HEADERS = \
tm_project.h \
......
This diff is collapsed.
......@@ -690,15 +690,7 @@ extern void freeRegexResources (void)
/* Check for broken regcomp() on Cygwin */
extern void checkRegex (void)
{
#if 0 && defined (HAVE_REGEX) && defined (CHECK_REGCOMP)
regex_t patbuf;
int errcode;
if (regcomp (&patbuf, "/hello/", 0) != 0)
{
error (WARNING, "Disabling broken regex");
regexBroken = TRUE;
}
#endif
/* not needed now we have GRegex */
}
/* vi:set tabstop=4 shiftwidth=4: */
This diff is collapsed.
......@@ -144,7 +144,7 @@
/* Define to 1 if you have the `realpath' function. */
#define HAVE_REALPATH 1
/* Define to 1 if you have the `regcomp' function. */
/* Should always be 1, required for CTags. */
#define HAVE_REGCOMP 1
/* Define to 1 if you have the `setenv' function. */
......@@ -321,6 +321,3 @@
/* Define if you want to detect a running instance */
#define HAVE_SOCKET 1
/* Define if include regex library should be used */
#define USE_INCLUDED_REGEX 1
......@@ -107,17 +107,7 @@ def configure(conf):
conf.check_cc(header_name='sys/stat.h', mandatory=False)
conf.define('HAVE_STDLIB_H', 1) # are there systems without stdlib.h?
conf.define('STDC_HEADERS', 1) # an optimistic guess ;-)
if conf.options.gnu_regex:
_add_to_env_and_define(conf, 'HAVE_REGCOMP', 1)
_add_to_env_and_define(conf, 'USE_INCLUDED_REGEX', 1)
else:
try:
conf.check_cc(header_name='regex.h')
conf.check_cc(function_name='regcomp', header_name='regex.h')
except ConfigurationError:
_add_to_env_and_define(conf, 'HAVE_REGCOMP', 1)
_add_to_env_and_define(conf, 'USE_INCLUDED_REGEX', 1)
_add_to_env_and_define(conf, 'HAVE_REGCOMP', 1) # needed for CTags
conf.check_cc(function_name='fgetpos', header_name='stdio.h', mandatory=False)
conf.check_cc(function_name='ftruncate', header_name='unistd.h', mandatory=False)
......@@ -215,7 +205,6 @@ def configure(conf):
conf.msg('Using GTK version', gtk_version)
conf.msg('Build with plugin support', conf.options.no_plugins and 'no' or 'yes')
conf.msg('Use virtual terminal support', conf.options.no_vte and 'no' or 'yes')
conf.msg('GNU regex library', conf.env['USE_INCLUDED_REGEX'] and 'built-in' or 'system')
if revision is not None:
conf.msg('Compiling Git revision', revision)
......@@ -234,8 +223,6 @@ def options(opt):
opt.add_option('--disable-vte', action='store_true', default=False,
help='compile without support for an embedded virtual terminal [[default: No]',
dest='no_vte')
opt.add_option('--enable-gnu-regex', action='store_true', default=False,
help='compile with included GNU regex library [default: No]', dest='gnu_regex')
# Paths
opt.add_option('--mandir', type='string', default='',
help='man documentation', dest='mandir')
......@@ -273,8 +260,6 @@ def build(bld):
# Tagmanager
if bld.env['USE_INCLUDED_REGEX'] == 1:
tagmanager_sources.add('tagmanager/regex.c')
bld.new_task_gen(
features = ['c', 'cstlib'],
source = tagmanager_sources,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment