]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Avoid link errors with "configure --disable-shared".
authorJim Meyering <meyering@redhat.com>
Thu, 28 Feb 2008 17:06:32 +0000 (17:06 +0000)
committerJim Meyering <meyering@redhat.com>
Thu, 28 Feb 2008 17:06:32 +0000 (17:06 +0000)
* src/Makefile.am: Create a convenience library, libvirt_test.la,
and don't restrict access to *its* symbols.
* tests/Makefile.am (LDADDS): Add ../src/libvirt_test.la, so that
"configure --disable-shared" no longer provokes link errors.
(LIBVIRT): Remove definition.
(LDADDS): Remove use.
($(LIBVIRT)): Remove rule.
(LDADDS): Use the new convenience library instead.
(CLEANFILES): Define.
* docs/examples/index.py (dump_Makefile): Append $(COVERAGE_LDFLAGS),
to the LDADDS definition, to avoid link error with the combination of
--enable-test-coverage and --disable-shared.
* docs/examples/Makefile.am: Regenerate.
* docs/examples/index.html: Likewise.
* qemud/Makefile.am (libvirtd_LDFLAGS): Append $(COVERAGE_LDFLAGS).
* src/libvirt_sym.version: Remove some SP-before-TAB.

ChangeLog
docs/examples/Makefile.am
docs/examples/index.html
docs/examples/index.py
qemud/Makefile.am
src/Makefile.am
src/libvirt_sym.version
tests/Makefile.am

index 37cddf4268fe95307d426289de72a78339eed255..d52e6a7b0e13fa8cb90f9dcc4ba23d24de88568e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+Thu Feb 28 18:04:59 CET 2008 Jim Meyering <meyering@redhat.com>
+
+       Avoid link errors with "configure --disable-shared".
+       * src/Makefile.am: Create a convenience library, libvirt_test.la,
+       and don't restrict access to *its* symbols.
+       * tests/Makefile.am (LDADDS): Add ../src/libvirt_test.la, so that
+       "configure --disable-shared" no longer provokes link errors.
+       (LIBVIRT): Remove definition.
+       (LDADDS): Remove use.
+       ($(LIBVIRT)): Remove rule.
+       (LDADDS): Use the new convenience library instead.
+       (CLEANFILES): Define.
+       * docs/examples/index.py (dump_Makefile): Append $(COVERAGE_LDFLAGS),
+       to the LDADDS definition, to avoid link error with the combination of
+       --enable-test-coverage and --disable-shared.
+       * docs/examples/Makefile.am: Regenerate.
+       * docs/examples/index.html: Likewise.
+       * qemud/Makefile.am (libvirtd_LDFLAGS): Append $(COVERAGE_LDFLAGS).
+       * src/libvirt_sym.version: Remove some SP-before-TAB.
+
 Thu Feb 28 12:16:39 CET 2008 Daniel Veillard <veillard@redhat.com>
 
        * src/qemu_conf.c: applied patch from Cole Robinson to use virErrorMsg
index 9da4e219e08eee7e21fef63363c75ae196e16b4a..d8e4868801a4ea4e3ff33175833a5988e1766d4b 100644 (file)
@@ -3,7 +3,7 @@
 SUBDIRS=python
 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include
 DEPS = $(top_builddir)/src/libvirt.la
-LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la
+LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la       $(COVERAGE_LDFLAGS)
 
 rebuild: examples.xml index.html
 
index ceff46a43f1483f12643fae9e0989313d9b30d56..793a3910797b3e71868d34b6292e50abf7760793 100644 (file)
@@ -4,4 +4,4 @@
     of the example:</p><ul><li><p><a href="#Informations">Informations</a> :</p><ul><li><a href="#info1.c">info1.c</a>: Extract informations about Xen domain 0</li></ul></li><li><p><a href="#Scheduling">Scheduling</a> :</p><ul><li><a href="#suspend.c">suspend.c</a>: Suspend a domain and then resume its execution</li></ul></li></ul><p> Getting the compilation options and libraries dependancies needed
 to generate binaries from the examples is best done on Linux/Unix by using
 the pkg-config data which should have been installed as part of <i>make
-install</i> step or when installing the libvirt development package:</p><pre>gcc -o example example.c `pkg-config libvirt --libs`</pre><h2><a name="Informations" id="Informations"></a>Informations Examples</h2><h3><a name="info1.c" href="info1.c" id="info1.c">info1.c</a>: Extract informations about Xen domain 0</h3><p>Demonstrate the basic use of the library to connect to the hypervisor and extract domain informations.</p><p>Uses:</p><ul><li> line 29: Function <a href="../html/libvirt-libvirt.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a> from libvirt.h</li><li> line 36: Function <a href="../html/libvirt-libvirt.html#virDomainLookupByID">virDomainLookupByID</a> from libvirt.h</li><li> line 43: Function <a href="../html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a> from libvirt.h</li><li> line 53: Function <a href="../html/libvirt-libvirt.html#virDomainFree">virDomainFree</a> from libvirt.h</li><li> line 55: Function <a href="../html/libvirt-libvirt.html#virConnectClose">virConnectClose</a> from libvirt.h</li></ul><p>Usage:</p><p>info1</p><p>Author: Daniel Veillard</p><h2><a name="Scheduling" id="Scheduling"></a>Scheduling Examples</h2><h3><a name="suspend.c" href="suspend.c" id="suspend.c">suspend.c</a>: Suspend a domain and then resume its execution</h3><p>Demonstrate the basic use of the library to suspend and resume a domain. If no id is given on the command line this script will suspend and resume the first domain found which is not Domain 0.</p><p>Uses:</p><ul><li> line 30: Function <a href="../html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a> from libvirt.h</li><li> line 49: Function <a href="../html/libvirt-libvirt.html#virDomainLookupByID">virDomainLookupByID</a> from libvirt.h</li><li> line 61: Function <a href="../html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a> from libvirt.h</li><li> line 72: Function <a href="../html/libvirt-libvirt.html#virDomainResume">virDomainResume</a> from libvirt.h</li><li> line 92: Function <a href="../html/libvirt-libvirt.html#virDomainFree">virDomainFree</a> from libvirt.h</li><li> line 99: Function <a href="../html/libvirt-libvirt.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a> from libvirt.h</li><li> line 110: Function <a href="../html/libvirt-libvirt.html#virConnectListDomains">virConnectListDomains</a> from libvirt.h</li><li> line 131: Function <a href="../html/libvirt-libvirt.html#virConnectClose">virConnectClose</a> from libvirt.h</li></ul><p>Usage:</p><p>suspend [id]</p><p>Author: Daniel Veillard</p></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
+install</i> step or when installing the libvirt development package:</p><pre>gcc -o example example.c `pkg-config libvirt --libs`</pre><h2><a name="Informations" id="Informations"></a>Informations Examples</h2><h3><a name="info1.c" href="info1.c" id="info1.c">info1.c</a>: Extract informations about Xen domain 0</h3><p>Demonstrate the basic use of the library to connect to the hypervisor and extract domain informations.</p><p>Uses:</p><ul><li> line 29: Function <a href="../html/libvirt-libvirt.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a> from libvirt.h</li><li> line 36: Function <a href="../html/libvirt-libvirt.html#virDomainLookupByID">virDomainLookupByID</a> from libvirt.h</li><li> line 43: Function <a href="../html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a> from libvirt.h</li><li> line 53: Function <a href="../html/libvirt-libvirt.html#virDomainFree">virDomainFree</a> from libvirt.h</li><li> line 55: Function <a href="../html/libvirt-libvirt.html#virConnectClose">virConnectClose</a> from libvirt.h</li></ul><p>Usage:</p><p>info1</p><p>Author: Daniel Veillard</p><h2><a name="Scheduling" id="Scheduling"></a>Scheduling Examples</h2><h3><a name="suspend.c" href="suspend.c" id="suspend.c">suspend.c</a>: Suspend a domain and then resume its execution</h3><p>Demonstrate the basic use of the library to suspend and resume a domain. If no id is given on the command line this script will suspend and resume the first domain found which is not Domain 0.</p><p>Uses:</p><ul><li> line 31: Function <a href="../html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a> from libvirt.h</li><li> line 50: Function <a href="../html/libvirt-libvirt.html#virDomainLookupByID">virDomainLookupByID</a> from libvirt.h</li><li> line 62: Function <a href="../html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a> from libvirt.h</li><li> line 73: Function <a href="../html/libvirt-libvirt.html#virDomainResume">virDomainResume</a> from libvirt.h</li><li> line 93: Function <a href="../html/libvirt-libvirt.html#virDomainFree">virDomainFree</a> from libvirt.h</li><li> line 100: Function <a href="../html/libvirt-libvirt.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a> from libvirt.h</li><li> line 111: Function <a href="../html/libvirt-libvirt.html#virConnectListDomains">virConnectListDomains</a> from libvirt.h</li><li> line 132: Function <a href="../html/libvirt-libvirt.html#virConnectClose">virConnectClose</a> from libvirt.h</li></ul><p>Usage:</p><p>suspend [id]</p><p>Author: Daniel Veillard</p></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&amp;component=libvirt&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=MODIFIED&amp;short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr">Open bugs</a></li><li><a href="http://virt-manager.et.redhat.com/">virt-manager</a></li><li><a href="http://search.cpan.org/~danberr/Sys-Virt-0.1.0/">Perl bindings</a></li><li><a href="http://libvirt.org/ocaml/">OCaml bindings</a></li><li><a href="http://libvirt.org/ruby/">Ruby bindings</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
index 8f386ed33933caf1d202f91224d5341d7d7a0ebc..6be80c5550e3946b1d53bd883ffa767626bf0acd 100755 (executable)
@@ -225,7 +225,8 @@ def dump_Makefile():
 SUBDIRS=python
 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include
 DEPS = $(top_builddir)/src/libvirt.la
-LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la
+LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \
+       $(COVERAGE_LDFLAGS)
 
 rebuild: examples.xml index.html
 
index 3094b18f2e29c7c13a6b6fc4a505f733be69dbfd..8cbcebed0ab6c0ca9b39a650bc5948c530837a9d 100644 (file)
@@ -48,18 +48,22 @@ libvirtd_SOURCES = \
 
 #-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
 libvirtd_CFLAGS = \
-        -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
-        -I$(top_srcdir)/include -I$(top_builddir)/include \
-        $(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
-        $(POLKIT_CFLAGS) \
-        $(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
-        -DSYSCONF_DIR="\"$(sysconfdir)\"" \
+       -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
+       -I$(top_srcdir)/include -I$(top_builddir)/include \
+       $(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
+       $(POLKIT_CFLAGS) \
+       $(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
+       $(COVERAGE_CFLAGS) \
+       -DSYSCONF_DIR="\"$(sysconfdir)\"" \
        -DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
        -DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" \
-        -DGETTEXT_PACKAGE=\"$(PACKAGE)\"
+       -DGETTEXT_PACKAGE=\"$(PACKAGE)\"
+
+libvirtd_LDFLAGS = \
+       $(WARN_CFLAGS) $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) \
+       $(COVERAGE_LDFLAGS)
+       $(POLKIT_LIBS)
 
-libvirtd_LDFLAGS = $(WARN_CFLAGS) $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) \
-                   $(POLKIT_LIBS)
 libvirtd_DEPENDENCIES = ../src/libvirt.la
 libvirtd_LDADD = ../src/libvirt.la ../gnulib/lib/libgnu.la
 
@@ -145,7 +149,6 @@ libvirtd.init: libvirtd.init.in
        chmod a+x $@-t
        mv $@-t $@
 
-CLEANFILES = libvirtd.init
 else
 
 install-init:
@@ -154,3 +157,6 @@ uninstall-init:
 endif # DBUS_INIT_SCRIPTS_RED_HAT
 
 endif # WITH_LIBVIRTD
+
+CLEANFILES = libvirtd.init
+CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
index 9c4810a5dae8a49a4c69258a1c84bbcf5f7d8d40..8821faa45594b866144db5572885423548109ee7 100644 (file)
@@ -99,6 +99,25 @@ libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
                    @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
 libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
 
+# Create an automake "convenience library" version of libvirt_la,
+# just for testing, since the test harness requires access to internal
+# bits and pieces that we don't want to make publicly accessible.
+noinst_LTLIBRARIES = libvirt_test.la
+
+# Convert libvirt_sym.version
+#      to libvirt_test_sym.version, and
+# remove -version-info X.Y.Z (not needed since this is a convenience library.
+test_LDFLAGS =                                         \
+  $$(echo '$(libvirt_la_LDFLAGS)'                      \
+     |sed 's!-Wl,--v.*_sym\.version!!'                 \
+     |sed 's!-version-info @LIBVIRT_VERSION_INFO@!!')
+
+# Just like the above, but with a slightly different set of public symbols.
+libvirt_test_la_SOURCES = $(libvirt_la_SOURCES)
+libvirt_test_la_LIBADD = $(libvirt_la_LIBADD)
+libvirt_test_la_LDFLAGS = $(test_LDFLAGS)
+libvirt_test_la_CFLAGS = $(COVERAGE_CFLAGS)
+
 bin_PROGRAMS = virsh
 
 virsh_SOURCES = virsh.c console.c console.h util-lib.c util-lib.h
index 15c05dc3575cbb68542354a43cae4ea176c3df88..694e0415b5deacd4a69161276b0d7ef007e7f52e 100644 (file)
 
        __virEventRegisterImpl;
 
-       __virStateInitialize;
-       __virStateCleanup;
-       __virStateReload;
-       __virStateActive;
+       __virStateInitialize;
+       __virStateCleanup;
+       __virStateReload;
+       __virStateActive;
 
        __virDrvSupportsFeature;
 
index fb9bcff58394bcefcc218a3702d32b66dab70b90..644715e1ab24c4425e02aa9430d8ba5109001256 100644 (file)
@@ -3,14 +3,6 @@
 SUBDIRS = virshdata confdata sexpr2xmldata \
   xml2sexprdata xmconfigdata xencapsdata
 
-# Wierd libtool related juju...
-#
-# We explicitly want wildcard here instead of just linking
-# to the libvirt.a file. This ensures that when coverage
-# tests are run, all the output data ends up in the correct
-# location. ie, src/ instead of src/.libs.
-LIBVIRT = $(wildcard $(top_builddir)/src/.libs/libvirt_la-*.o)
-
 INCLUDES = \
        -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
        -I$(top_builddir)/include \
@@ -34,7 +26,7 @@ LDADDS = \
         $(SASL_LIBS) \
         $(SELINUX_LIBS) \
         $(WARN_CFLAGS) \
-       $(LIBVIRT) \
+       ../src/libvirt_test.la \
        ../gnulib/lib/libgnu.la \
         $(COVERAGE_LDFLAGS)
 
@@ -132,5 +124,4 @@ reconnect_SOURCES = \
        reconnect.c
 reconnect_LDADD = $(LDADDS)
 
-$(LIBVIRT):
-       -@(cd $(top_builddir)/src && $(MAKE) MAKEFLAGS+=--silent)
+CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda