From 87e30a4e25e01965678a5622bcba6e3db4b603cf Mon Sep 17 00:00:00 2001 From: Carsten Schoenert Date: Thu, 28 Jul 2016 19:20:31 +0200 Subject: [PATCH] configure.ac: adjust a specific FreeBSD test for dot As FreeBSD uses default the csh (C-shell) or the tcsh (Tennex-shell) with some different output redirection than bash for example, and the user might have installed a other shell we need to grep the version from the dot binary by a csh shell call because this shell be always available. Happily the 'dot -V' command is quite the same on FreeBSD and Linux systems. Maybe we need to change this in the future again. --- configure.ac | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index dc684fb1..04f6e562 100644 --- a/configure.ac +++ b/configure.ac @@ -165,13 +165,29 @@ if test "x$build_documentation" = "xyes"; then HAVE_DOT="NO" USE_CALL_GRAPH="NO" else - AC_MSG_CHECKING([for compatible dot version]) - dot_version=`$DOT -V 2>&1|$GREP -oP '(?<=version\W)@<:@0-9.@:>@*(?=\W(.*))'` + AC_MSG_CHECKING([for compatible dot version (>= 2.26.0)]) + case $host in + *-freebsd1*) + # csh and tcsh have a different output redirection than more recent shells + # cmd >& file # Redirect both stdout and stderr to file. + # cmd >>& file # Append both stdout and stderr to file. + # cmd1 | cmd2 # pipe stdout to cmd2 + # cmd1 |& cmd2 # pipe stdout and stderr to cmd2 + # Using a explicit call with the default always available C-shell on FreeBSD, + # the user may have installed another shell from a port which we don't know here + dot_version=`export DOT=$DOT && csh -c '$DOT -V |& cut -f5 -d" "'` + ;; + + *) + dot_version=`$DOT -V 2>&1 | cut -f5 -d" "` + ;; + + esac AS_VERSION_COMPARE([$dot_version], [2.26.0], [AC_MSG_RESULT([no]) DOT=""], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([yes])]) + [AC_MSG_RESULT([yes $dot_version])], + [AC_MSG_RESULT([yes $dot_version])]) if test "x$DOT" = "x" -a "x$build_documentation" = "xyes"; then AC_MSG_WARN([==> Graphviz dot $dot_version too old. Graphviz 2.26+ required for documentation build.]) AC_MSG_ERROR([==> Install required graphviz version or disable the documentation using --disable-documentation])