[PATCH] config: use simpler regexp syntax to get dot version

Pekka Paalanen ppaalanen at gmail.com
Wed Apr 8 00:15:02 PDT 2015


On Thu,  2 Apr 2015 19:20:00 -0700
Bill Spitzak <spitzak at gmail.com> wrote:

> I wasted a lot of time before I figured out that I needed to add those
> square brackets to get this to work. Sigh...
> 
> ---
>  configure.ac |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 6bbec59..271eec3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -141,7 +141,7 @@ if test "x$enable_documentation" = "xyes"; then
>  		AC_MSG_ERROR([Documentation build requested but graphviz's dot not found. Install graphviz or disable the documentation using --disable-documentation])
>  	fi
>  	AC_MSG_CHECKING([for compatible dot version])
> -	dot_version=`$DOT -V 2>&1|$GREP -oP '(?<=version\W)@<:@0-9.@:>@*(?=\W(.*))'`
> +	dot_version=`$DOT -V 2>&1|$GREP -o ['[0-9]*\.[0-9]*\.[0-9]*']`
>  	AS_VERSION_COMPARE([$dot_version], [2.26.0],
>  	                   [AC_MSG_RESULT([no])
>  	                    AC_MSG_ERROR([Graphviz dot $dot_version too old. Graphviz 2.26+ required for documentation build. Install required graphviz version or disable the documentation using --disable-documentation])],

For the record, I think those @<:@ and @:>@ are square brackets. They
are just an M4 escape thing to prevent M4 from interpreting those
square brackets and possibly removing them.

Oh yeah, "quadrigraphs":
http://stackoverflow.com/questions/2308721/how-do-i-escape-text-in-autoconf-m4

It's just another way to protect the square brackets. Your way should
work fine here too, since these are not M4 macro arguments.


Thanks,
pq


More information about the wayland-devel mailing list