Re: [PATCH] Fix dlopen dependency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 9, 2011 at 21:47, Matthias Bolte
<matthias.bolte@xxxxxxxxxxxxxx> wrote:
> Since the addition of the lock manager framework in 6a943419c528fdd7
> dlopen is always required, but the checks in configure wasn't changed
> to reflect that. This didn't show up directly because the VirtualBox
> driver linking dlopen in covered it. But disabling the VirtualBox
> driver makes the build fail due to missing dlopen.
>
> Change the dlopen check in configure to pick up dlopen when available.
>
> Reported by Ruben Kerkhof.
> ---
> Âconfigure.ac  Â|  46 ++++++++++++++++++++++++++--------------------
> Âsrc/Makefile.am | Â Â2 +-
> Â2 files changed, 27 insertions(+), 21 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 985b8c2..f816696 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -417,6 +417,28 @@ fi
>
>
> Âdnl
> +dnl check for libdl
> +dnl
> +
> +dlfcn_found=yes
> +dlopen_found=yes
> +
> +AC_CHECK_HEADER([dlfcn.h],, [dlfcn_found=no])
> +AC_SEARCH_LIBS([dlopen], [dl],, [dlopen_found=no])
> +
> +case $ac_cv_search_dlopen:$host_os in
> + Â'none required'* | *:mingw* | *:msvc*) DLOPEN_LIBS= ;;
> + Âno*) AC_MSG_ERROR([Unable to find dlopen()]) ;;
> + Â*) if test "x$dlfcn_found" != "xyes"; then
> + Â Â Â AC_MSG_ERROR([Unable to find dlfcn.h])
> + Â Â fi
> + Â Â DLOPEN_LIBS=$ac_cv_search_dlopen ;;
> +esac
> +
> +AC_SUBST([DLOPEN_LIBS])
> +
> +
> +dnl
> Âdnl check for VirtualBox XPCOMC location
> Âdnl
>
> @@ -432,14 +454,6 @@ AC_DEFINE_UNQUOTED([VBOX_XPCOMC_DIR], ["$vbox_xpcomc_dir"],
> Â Â Â Â Â Â Â Â Â Â[Location of directory containing VirtualBox XPCOMC library])
>
> Âif test "x$with_vbox" = "xyes"; then
> - Â ÂAC_SEARCH_LIBS([dlopen], [dl],,)
> - Â Âcase $ac_cv_search_dlopen:$host_os in
> - Â Â Â'none required'* | *:mingw* | *:msvc*) DLOPEN_LIBS= ;;
> - Â Â Âno*) AC_MSG_ERROR([Unable to find dlopen()]) ;;
> - Â Â Â*) DLOPEN_LIBS=$ac_cv_search_dlopen ;;
> - Â Âesac
> - Â ÂAC_SUBST([DLOPEN_LIBS])
> -
> Â Â case "$host" in
> Â Â Â *-*-mingw* | *-*-msvc*) MSCOM_LIBS="-lole32 -loleaut32" ;;
> Â Â Â *) MSCOM_LIBS= ;;
> @@ -2138,19 +2152,10 @@ AC_ARG_WITH([driver-modules],
>
> ÂDRIVER_MODULE_CFLAGS=
> ÂDRIVER_MODULE_LIBS=
> -if test "x$with_driver_modules" = "xyes" ; then
> - Âold_cflags="$CFLAGS"
> - Âold_libs="$LIBS"
> - Âfail=0
> - ÂAC_CHECK_HEADER([dlfcn.h],[],[fail=1])
> - ÂAC_SEARCH_LIBS([dlopen], [dl], [], [fail=1])
> - Âtest $fail = 1 &&
> - Â Â ÂAC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules])
> -
> - ÂCFLAGS="$old_cflags"
> - ÂLIBS="$old_libs"
> -fi
> Âif test "$with_driver_modules" = "yes"; then
> + Âif test "$dlfcn_found" != "yes" || test "$dlopen_found" != "yes"; then
> + Â ÂAC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules])
> + Âfi
> Â DRIVER_MODULE_CFLAGS="-export-dynamic"
> Â case $ac_cv_search_dlopen in
> Â Â no*) DRIVER_MODULE_LIBS= ;;
> @@ -2468,6 +2473,7 @@ AC_MSG_NOTICE([])
> ÂAC_MSG_NOTICE([Libraries])
> ÂAC_MSG_NOTICE([])
> ÂAC_MSG_NOTICE([ Âlibxml: $LIBXML_CFLAGS $LIBXML_LIBS])
> +AC_MSG_NOTICE([ Âdlopen: $DLOPEN_LIBS])
> Âif test "$with_esx" = "yes" ; then
> ÂAC_MSG_NOTICE([ libcurl: $LIBCURL_CFLAGS $LIBCURL_LIBS])
> Âelse
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 3612a24..4f9bfc9 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -526,7 +526,7 @@ libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
>
> Âlibvirt_driver_la_CFLAGS = $(NUMACTL_CFLAGS) $(GNUTLS_CFLAGS) \
> Â Â Â Â Â Â Â Â-I@top_srcdir@/src/conf $(AM_CFLAGS)
> -libvirt_driver_la_LIBADD = $(NUMACTL_LIBS) $(GNUTLS_LIBS)
> +libvirt_driver_la_LIBADD = $(NUMACTL_LIBS) $(GNUTLS_LIBS) $(DLOPEN_LIBS)
>
> ÂUSED_SYM_FILES = libvirt_private.syms
>
> --
> 1.7.0.4

Works fine, thanks!

Tested-by: Ruben Kerkhof <ruben@xxxxxxxxxxxxxxxx>

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]