From 37889ffab861ff8538e4c5ff66d24709023de645 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 1 Nov 2022 10:52:12 +0100 Subject: configure.ac: Rework cython detection slightly Detecting cython version runs cython needlessly many times (one for AS_ECHO(), one for major and one for minor version extraction). Speaking of AS_ECHO(), the argument needs escaping as it's not a single shell word. Instead of fixing the escaping, let's rework the check a bit so that cython is executed just once and AS_ECHO() is then replaced with AC_MSG_CHECKING() AC_MSG_RESULT() combo. The need for escaping can be seen with newer autotools-2.71. Signed-off-by: Michal Privoznik Acked-by: Tom Hromatka Signed-off-by: Paul Moore --- configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 3e87734..dfe3db0 100644 --- a/configure.ac +++ b/configure.ac @@ -95,9 +95,11 @@ dnl cython checks dnl #### AC_CHECK_PROGS(cython, cython3 cython, "no") AS_IF([test "$cython" != no], [ - AS_ECHO("checking cython version... $($cython -V 2>&1 | cut -d' ' -f 3)") - CYTHON_VER_MAJ=$($cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 1); - CYTHON_VER_MIN=$($cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 2); + AC_MSG_CHECKING([cython version]) + CYTHON_VER_FULL=$(cython -V 2>&1 | cut -d' ' -f 3); + CYTHON_VER_MAJ=$(echo $CYTHON_VER_FULL | cut -d'.' -f 1); + CYTHON_VER_MIN=$(echo $CYTHON_VER_FULL | cut -d'.' -f 2); + AC_MSG_RESULT([$CYTHON_VER_FULL]) ],[ CYTHON_VER_MAJ=0 CYTHON_VER_MIN=0 -- cgit v1.2.1