CYGWIN_EXTRA_PYTHON_LIBADD=
MINGW_EXTRA_LDFLAGS=
WIN32_EXTRA_CFLAGS=
+LIBVIRT_SYMBOL_FILE=libvirt.syms
case "$host" in
*-*-cygwin*)
CYGWIN_EXTRA_LDFLAGS="-no-undefined"
if test "x$enable_shared" = "xno"; then
WIN32_EXTRA_CFLAGS="-DLIBVIRT_STATIC"
fi
+ # Also set the symbol file to .def, so src/Makefile generates libvirt.def
+ # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the linker
+ LIBVIRT_SYMBOL_FILE=libvirt.def
;;
esac
AC_SUBST([CYGWIN_EXTRA_LDFLAGS])
AC_SUBST([CYGWIN_EXTRA_PYTHON_LIBADD])
AC_SUBST([MINGW_EXTRA_LDFLAGS])
AC_SUBST([WIN32_EXTRA_CFLAGS])
+AC_SUBST([LIBVIRT_SYMBOL_FILE])
dnl Look for windres to build a Windows icon resource.
libvirt_macvtap.syms \
libvirt_daemon.syms
-BUILT_SOURCES += libvirt.syms
+BUILT_SOURCES += libvirt.syms libvirt.def
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES)
$(AM_V_GEN)rm -f $@-tmp $@ ; \
chmod a-w $@-tmp && \
mv $@-tmp libvirt.syms
+libvirt.def: libvirt.syms
+ $(AM_V_GEN)rm -f -- $@-tmp $@ ; \
+ printf 'EXPORTS\n' > $@-tmp && \
+ sed -e '/^$$/d; /#/d; /:/d; /\}/d; /\*/d; /LIBVIRT_/d; s/[ \t]*\(.*\)\;/ \1/g' $^ >> $@-tmp && \
+ chmod a-w $@-tmp && \
+ mv $@-tmp libvirt.def
+
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
libvirt_la_LIBADD += \
$(CYGWIN_EXTRA_LIBADD) ../gnulib/lib/libgnu.la
-libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)libvirt.syms \
+libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
-version-info $(LIBVIRT_VERSION_INFO) \
$(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
$(LIBXML_LIBS) \
$(DRIVER_MODULE_LIBS) \
$(CYGWIN_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS)
libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
-libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) libvirt.syms
+libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) $(LIBVIRT_SYMBOL_FILE)
# Create an automake "convenience library" version of libvirt_la,
# just for testing, since the test harness requires access to internal
# Remove version script from convenience library
test_LDFLAGS = \
$$(echo '$(libvirt_la_LDFLAGS)' \
- |sed 's!$(VERSION_SCRIPT_FLAGS)libvirt.syms!!' \
+ |sed 's!$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE)!!' \
|sed 's!-version-info $(LIBVIRT_VERSION_INFO)!!')
# Just like the above, but with a slightly different set of public symbols.