2010/8/15 Enrico Tröger enrico.troeger@uvena.de:
On Sun, 15 Aug 2010 13:55:11 +1000, Lex wrote:
On 14 August 2010 22:17, Jiří Techet techet@gmail.com wrote:
Hi,
I started implementing the idea of indenting based on regular expressions and have noticed that geany can be compiled without regex support. Obviously in this case the indent thing wouldn't work. I don't quite understand when someone would want to compile geany without regex. By default in configure.ac you use the system regex library. If it doesn't exist, geany is compiled without regex support. Why not to automatically fallback to using the regex
If this is the case, it's a bug. At least IIRC the shipped regex support should be used as fallback. But I didn't use the autotools based build for ages. Anyway, the idea always was to build against the system's regex implementation if available and if not (like on Windows), fall back to the shipped mini implementation.
The Waf based build system builds with the shipped mini implementation if the --enable-gnu-regex option is given. Otherwise it checks whether the system provides something usable and uses this and if not, it uses the shipped variant.
If this doesn't work similar for the autotools, it's probably a bug.
I've checked the wscript and it seems to do the right thing. However unless I miss something in configure.ac, you first check for system regex library and then do:
# Use included GNU regex library AC_ARG_ENABLE(gnu-regex, [AC_HELP_STRING([--enable-gnu-regex], [compile with included GNU regex library [default=no]])], , enable_gnu_regex=no)
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
So if you don't use --enable-gnu-regex, the else branch is taken and if HAVE_REGCOMP wasn't defined in the system then geany is compiled without regex support. I can send a patch to fix that.
If we have regular expression support under any condition, then I would also like to remove all the #ifdef HAVE_REGCOMP in geany sources. There is also code like
#ifndef HAVE_REGCOMP if (!NZV(regstr)) geany_debug("No regex support - maybe you should configure with --enable-gnu-regex!"); return FALSE; #else
which would be a dead code if HAVE_REGCOMP is always defined. Also I don't want to code any fallback solution for the indentation code if regex library is missing in the system.
Jiri
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel