From e855b2cb3137f4c2531a2ad0f2b18eef085787fe Mon Sep 17 00:00:00 2001 From: SASANO Takayoshi Date: Tue, 3 Jan 2023 11:13:19 +0900 Subject: [PATCH] avoid libdl detecion on *BSD NetBSD and OpenBSD has no libdl FreeBSD and DragonFlyBSD has libdl but dummy These OSes are no need to use -ldl to use dlopen() --- configure.ac | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 3989a743..aaf869df 100644 --- a/configure.ac +++ b/configure.ac @@ -255,11 +255,19 @@ AC_ARG_WITH(libdl, [ have_libdl="$withval" ], [ have_libdl="yes" ]) HAVE_LIBDL= if test "$have_libdl" = "yes"; then - AC_CHECK_LIB([dl], [dlsym], [HAVE_LIBDL="yes"]) - if test "$HAVE_LIBDL" = "yes" ; then - ALSA_DEPLIBS="$ALSA_DEPLIBS -ldl" + case $host_os in + netbsd* | freebsd* | dragonfly* | openbsd*) + HAVE_LIBDL=yes AC_DEFINE([HAVE_LIBDL], 1, [Have libdl]) - fi + ;; + *) + AC_CHECK_LIB([dl], [dlsym], [HAVE_LIBDL="yes"]) + if test "$HAVE_LIBDL" = "yes" ; then + ALSA_DEPLIBS="$ALSA_DEPLIBS -ldl" + AC_DEFINE([HAVE_LIBDL], 1, [Have libdl]) + fi + ;; + esac else AC_MSG_RESULT(no) fi