]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
build: vbox: avoid build failure when linking with --no-add-needed
authorDiego Elio Pettenò <flameeyes@gmail.com>
Thu, 4 Mar 2010 15:48:10 +0000 (16:48 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 4 Mar 2010 16:25:22 +0000 (17:25 +0100)
With the recent changes to the linking defaults in Fedora 13 (namely
enabling --no-add-needed behaviour by default), we have to pass the
dlopen()-providing libraries directly at the link of the module; use the
same AC_SEARCH_LIBS function as used before to look for it and add it to
the Makefile.

configure.ac
src/Makefile.am

index d5d62eaa1a91511b8b104c56c0065aba56fbbc07..923d7b8ea24af81c9b463eeea24ab8f5bebccce6 100644 (file)
@@ -303,6 +303,12 @@ fi
 AM_CONDITIONAL([WITH_OPENVZ], [test "$with_openvz" = "yes"])
 
 if test "x$with_vbox" = "xyes"; then
+    AC_SEARCH_LIBS([dlopen], [dl], [], [AC_MSG_ERROR([Unable to find dlopen()])])
+    case $ac_cv_search_dlopen in
+      no*) DLOPEN_LIBS= ;;
+      *) DLOPEN_LIBS=$ac_cv_search_dlopen ;;
+    esac
+    AC_SUBST([DLOPEN_LIBS])
     AC_DEFINE_UNQUOTED([WITH_VBOX], 1, [whether VirtualBox driver is enabled])
 fi
 AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"])
index 2051e5d7ca85bc25f187b458d3a01f5d99cafcea..67f8b6d54851ffad414488c0634ce100de507675 100644 (file)
@@ -463,6 +463,7 @@ libvirt_driver_vbox_la_CFLAGS = \
 if WITH_DRIVER_MODULES
 libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version
 endif
+libvirt_driver_vbox_la_LIBADD = $(DLOPEN_LIBS)
 libvirt_driver_vbox_la_SOURCES = $(VBOX_DRIVER_SOURCES)
 endif