From: Daniel P. Berrange Date: Mon, 28 May 2012 11:31:21 +0000 (+0100) Subject: Fix Win32 build by linking to ole32 X-Git-Tag: v0.9.13-rc1~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cd77b6b2f04048c387df2b58a9e003b505b85da;p=thirdparty%2Flibvirt.git Fix Win32 build by linking to ole32 The CoTaskMemFree function requires the ole32 DLL to be linked against. Currently this is only done for the VirtualBox driver. Also add it to libvirt_util.la * configure.ac: Unconditionally add ole32 DLL to Win32 * src/Makefile.am: Link old32 to libvirt_util.la --- diff --git a/configure.ac b/configure.ac index 54f51ee31b..ac7a13762d 100644 --- a/configure.ac +++ b/configure.ac @@ -554,12 +554,6 @@ AC_DEFINE_UNQUOTED([VBOX_XPCOMC_DIR], ["$vbox_xpcomc_dir"], [Location of directory containing VirtualBox XPCOMC library]) if test "x$with_vbox" = "xyes"; then - case "$host" in - *-*-mingw* | *-*-msvc*) MSCOM_LIBS="-lole32 -loleaut32" ;; - *) MSCOM_LIBS= ;; - esac - AC_SUBST([MSCOM_LIBS]) - AC_DEFINE_UNQUOTED([WITH_VBOX], 1, [whether VirtualBox driver is enabled]) fi AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"]) @@ -2364,16 +2358,23 @@ MINGW_EXTRA_LDFLAGS= WIN32_EXTRA_CFLAGS= LIBVIRT_SYMBOL_FILE=libvirt.syms LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' +MSCOM_LIBS= case "$host" in *-*-cygwin*) CYGWIN_EXTRA_LDFLAGS="-no-undefined" CYGWIN_EXTRA_LIBADD="${INTLLIBS}" + MSCOM_LIBS="-lole32 -loleaut32" + if test "x$PYTHON_VERSION" != "x"; then CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" fi ;; *-*-mingw*) MINGW_EXTRA_LDFLAGS="-no-undefined" + MSCOM_LIBS="-lole32 -loleaut32" + ;; + *-*-msvc*) + MSCOM_LIBS="-lole32 -loleaut32" ;; esac case "$host" in @@ -2406,6 +2407,7 @@ AC_SUBST([WIN32_EXTRA_CFLAGS]) AC_SUBST([LIBVIRT_SYMBOL_FILE]) AC_SUBST([LIBVIRT_QEMU_SYMBOL_FILE]) AC_SUBST([VERSION_SCRIPT_FLAGS]) +AC_SUBST([MSCOM_LIBS]) dnl Look for windres to build a Windows icon resource. diff --git a/src/Makefile.am b/src/Makefile.am index 0574d20e9f..18942620a4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -583,7 +583,7 @@ libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \ $(DBUS_CFLAGS) libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \ $(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \ - $(RT_LIBS) $(DBUS_LIBS) + $(RT_LIBS) $(DBUS_LIBS) $(MSCOM_LIBS) noinst_LTLIBRARIES += libvirt_conf.la