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()
This commit is contained in:
SASANO Takayoshi 2023-01-03 11:13:19 +09:00
parent 2e82060ebc
commit e855b2cb31

View file

@ -255,11 +255,19 @@ AC_ARG_WITH(libdl,
[ have_libdl="$withval" ], [ have_libdl="yes" ]) [ have_libdl="$withval" ], [ have_libdl="yes" ])
HAVE_LIBDL= HAVE_LIBDL=
if test "$have_libdl" = "yes"; then if test "$have_libdl" = "yes"; then
AC_CHECK_LIB([dl], [dlsym], [HAVE_LIBDL="yes"]) case $host_os in
if test "$HAVE_LIBDL" = "yes" ; then netbsd* | freebsd* | dragonfly* | openbsd*)
ALSA_DEPLIBS="$ALSA_DEPLIBS -ldl" HAVE_LIBDL=yes
AC_DEFINE([HAVE_LIBDL], 1, [Have libdl]) 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 else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
fi fi