From 3c8ede75a164a884c115a648ef15fa66823f339e Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Fri, 27 Jul 2018 13:22:49 -0700 Subject: [PATCH] Fix issues related to cxxtest in configure.ac (#2226) Fixes #2188. There were two issues related to cxxtest in configure.ac: - `AC_PATH_PROGS` was used wrong (the third argument is a value to assign to the first argument and cannot be used for arbitrary commands) - The `test` command always executes both sides of an "and" (`-a`), so `basename` was called without arguments when `CXXTESTGEN` was empty This commit fixes both issues. --- configure.ac | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 1480879c8..f802fa1c0 100644 --- a/configure.ac +++ b/configure.ac @@ -1078,26 +1078,26 @@ else # cxxtest under /bin/cxxtest AC_PATH_PROGS(CXXTESTGEN, cxxtestgen.pl cxxtestgen.py cxxtestgen, - [ - AC_MSG_NOTICE([unit tests disabled, \ - could not find cxxtestgen.pl or \ - cxxtestgen.py or cxxtestgen]) - CXXTEST= - ], + [], [$CXXTEST:$CXXTEST/bin:$PATH]) - if test -n "$CXXTESTGEN" -a "`basename $CXXTESTGEN`" = "cxxtestgen.pl"; then - if test -z "$PERL"; then - AC_CHECK_PROGS(PERL, perl, perl, []) - else - AC_CHECK_PROG(PERL, "$PERL", "$PERL", []) - fi + if test -n "$CXXTESTGEN"; then + if "`basename $CXXTESTGEN`" = "cxxtestgen.pl"; then + if test -z "$PERL"; then + AC_CHECK_PROGS(PERL, perl, perl, []) + else + AC_CHECK_PROG(PERL, "$PERL", "$PERL", []) + fi - if test -z "$PERL"; then - AC_MSG_WARN([unit tests disabled, perl not found.]) - CXXTESTGEN= - CXXTEST= + if test -z "$PERL"; then + AC_MSG_WARN([unit tests disabled, perl not found.]) + CXXTESTGEN= + CXXTEST= + fi fi + else + AC_MSG_NOTICE([unit tests disabled, could not find cxxtestgen.pl or cxxtestgen.py or cxxtestgen]) + CXXTEST= fi # check if CxxTest headers exist and set include paths accordingly -- 2.30.2