Skip to content

Commit

Permalink
configure.ac: fix the check for unittests
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
whot committed Feb 15, 2022
1 parent 15bb122 commit 5eb768c
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5eb768c

Please sign in to comment.