diff --git a/ChangeLog b/ChangeLog index 37cddf4268..d52e6a7b0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Thu Feb 28 18:04:59 CET 2008 Jim Meyering + + 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 * src/qemu_conf.c: applied patch from Cole Robinson to use virErrorMsg diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am index 9da4e219e0..d8e4868801 100644 --- a/docs/examples/Makefile.am +++ b/docs/examples/Makefile.am @@ -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 diff --git a/docs/examples/index.html b/docs/examples/index.html index ceff46a43f..793a391079 100644 --- a/docs/examples/index.html +++ b/docs/examples/index.html @@ -4,4 +4,4 @@ of the example:

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 make -install step or when installing the libvirt development package:

gcc -o example example.c `pkg-config libvirt --libs`

Informations Examples

info1.c: Extract informations about Xen domain 0

Demonstrate the basic use of the library to connect to the hypervisor and extract domain informations.

Uses:

Usage:

info1

Author: Daniel Veillard

Scheduling Examples

suspend.c: Suspend a domain and then resume its execution

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.

Uses:

Usage:

suspend [id]

Author: Daniel Veillard

+install step or when installing the libvirt development package:

gcc -o example example.c `pkg-config libvirt --libs`

Informations Examples

info1.c: Extract informations about Xen domain 0

Demonstrate the basic use of the library to connect to the hypervisor and extract domain informations.

Uses:

Usage:

info1

Author: Daniel Veillard

Scheduling Examples

suspend.c: Suspend a domain and then resume its execution

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.

Uses:

Usage:

suspend [id]

Author: Daniel Veillard

diff --git a/docs/examples/index.py b/docs/examples/index.py index 8f386ed339..6be80c5550 100755 --- a/docs/examples/index.py +++ b/docs/examples/index.py @@ -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 diff --git a/qemud/Makefile.am b/qemud/Makefile.am index 3094b18f2e..8cbcebed0a 100644 --- a/qemud/Makefile.am +++ b/qemud/Makefile.am @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index 9c4810a5da..8821faa455 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/libvirt_sym.version b/src/libvirt_sym.version index 15c05dc357..694e0415b5 100644 --- a/src/libvirt_sym.version +++ b/src/libvirt_sym.version @@ -166,10 +166,10 @@ __virEventRegisterImpl; - __virStateInitialize; - __virStateCleanup; - __virStateReload; - __virStateActive; + __virStateInitialize; + __virStateCleanup; + __virStateReload; + __virStateActive; __virDrvSupportsFeature; diff --git a/tests/Makefile.am b/tests/Makefile.am index fb9bcff583..644715e1ab 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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