From 5eb768c3a6eb0f6543e68d0cc0a6fc8cbc1060c4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 15 Feb 2022 09:58:31 +1000 Subject: [PATCH] configure.ac: fix the check for unittests Leftover from ad8de30. Because we now only have one thing to check, let's always check for dl and handle the special "auto" case based on the outcome of the dl check. Fixes #248 Signed-off-by: Peter Hutterer --- configure.ac | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 6f36465c..fc892cee 100644 --- a/configure.ac +++ b/configure.ac @@ -134,26 +134,18 @@ AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], [UNITTESTS=$enableval], [UNITTESTS=auto]) -# If unittests aren't explicitly disabled, check for required support -if test "x$UNITTESTS" != xno ; then - # Check for the availability of dlsym and friends - AC_CHECK_LIB([dl], [dlsym], - [libdl_available="yes"], - [libdl_available="no"] - ) -fi +# Check for the availability of dlsym and friends +AC_CHECK_LIB([dl], [dlsym], + [libdl_available="yes"], + [libdl_available="no"] +) +# If unittests aren't explicitly enabled, check for required support if test "x$UNITTESTS" = xauto; then - if test "x$linker_can_wrap" = xyes; then - UNITTESTS=yes - else - UNITTESTS=no - fi + UNITTESTS=$libdl_available fi + if test "x$UNITTESTS" = xyes; then - if test "x$linker_can_wrap" = xno; then - AC_MSG_ERROR([ld -wrap support required to build unit tests]) - fi if test "x$libdl_available" = xno; then AC_MSG_ERROR([dlsym required to build unit tests]) fi