From: Michal Privoznik Date: Fri, 25 Sep 2015 11:20:38 +0000 (+0200) Subject: tools: Link libvirt.la and readline to libvirt_shell.a X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1fb8ac4c795ff44379fdddcefb31330e17cea3c2;p=libvirt.git tools: Link libvirt.la and readline to libvirt_shell.a So, our mingw build is broken. It's because while libvirt_shell library is using some of our internal APIs, e.g. virStrndup, and readline API but it's not being linked with nor libvirt.la nor libreadline. Only subsequent users of the library, like virsh, do link to the needed libraries. In fact, I'm surprised Linux linker doesn't care, because how can it make a static library with missing symbols is mystery to me. Signed-off-by: Michal Privoznik --- diff --git a/configure.ac b/configure.ac index 03463b048c..2d0603d391 100644 --- a/configure.ac +++ b/configure.ac @@ -1670,10 +1670,6 @@ if test "$with_pm_utils" = "yes"; then fi AM_CONDITIONAL([WITH_PM_UTILS], [test "$with_pm_utils" = "yes"]) -dnl virsh libraries -VIRSH_LIBS="$VIRSH_LIBS $READLINE_LIBS" -AC_SUBST([VIRSH_LIBS]) - dnl check if the network driver should be compiled AC_ARG_WITH([network], diff --git a/tools/Makefile.am b/tools/Makefile.am index 0a00cee04a..d5638d9b20 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -143,6 +143,8 @@ libvirt_shell_la_LDFLAGS = \ $(NULL) libvirt_shell_la_LIBADD = \ $(LIBXML_LIBS) \ + $(READLINE_LIBS) \ + ../src/libvirt.la \ ../gnulib/lib/libgnu.la \ $(NULL) libvirt_shell_la_SOURCES = vsh.c vsh.h @@ -220,11 +222,9 @@ virsh_LDFLAGS = \ virsh_LDADD = \ $(STATIC_BINARIES) \ $(PIE_LDFLAGS) \ - ../src/libvirt.la \ ../src/libvirt-lxc.la \ ../src/libvirt-qemu.la \ - libvirt_shell.la \ - $(VIRSH_LIBS) + libvirt_shell.la virsh_CFLAGS = \ $(WARN_CFLAGS) \ $(PIE_CFLAGS) \