build: silence libtool warning on probes.o

Libtool supports linking directly against .o files on some platforms
(such as Linux), which happens to be the only place where we are
actually doing that (for the dtrace-generated probes.o files).  However,
it raises a big stink about the non-portability, even though we don't
attempt it on platforms where it would actually fail:

  CCLD   libvirt_driver_qemu.la

*** Warning: Linking the shared library libvirt_driver_qemu.la against
the non-libtool
*** objects  libvirt_qemu_probes.o is not portable!

This shuts libtool up by creating a proper .lo file that matches
what libtool normally expects.

* src/Makefile.am (%_probes.lo): New rule.
(libvirt_probes.stp, libvirt_qemu_probes.stp): Simplify into...
(%_probes.stp): ...shorter rule.
(CLEANFILES): Clean new .lo files.
(libvirt_la_BUILT_LIBADD, libvirt_driver_qemu_la_LIBADD)
(libvirt_lxc_LDADD, virt_aa_helper_LDADD): Link against .lo file.
* tests/Makefile.am (PROBES_O, qemu_LDADDS): Likewise.
This commit is contained in:
Eric Blake 2012-05-25 09:57:56 -06:00
parent 4878a33125
commit 0159295d29
2 changed files with 20 additions and 12 deletions

View File

@ -1246,7 +1246,7 @@ libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
libvirt_la_DEPENDENCIES = $(libvirt_la_BUILT_LIBADD) $(LIBVIRT_SYMBOL_FILE)
if WITH_DTRACE_PROBES
libvirt_la_BUILT_LIBADD += libvirt_probes.o
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
libvirt_la_DEPENDENCIES += libvirt_probes.o
nodist_libvirt_la_SOURCES = libvirt_probes.h
if WITH_REMOTE
@ -1256,7 +1256,7 @@ endif WITH_REMOTE
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp
if WITH_QEMU
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.o
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
libvirt_driver_qemu_la_DEPENDENCIES = libvirt_qemu_probes.o
@ -1272,6 +1272,15 @@ tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
%_probes.o: %_probes.d
$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<
%_probes.lo: %_probes.o
$(AM_V_GEN)printf %s\\n \
'# $@ - a libtool object file' \
'# Generated by libtool (GNU libtool) 2.4' \
'# Actually generated by Makefile.am, in order to shut up libtool' \
"pic_object='$<'" \
"non_pic_object='$<'" \
> $@
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
$(srcdir)/rpc/virkeepaliveprotocol.x \
$(srcdir)/remote/remote_protocol.x \
@ -1280,14 +1289,13 @@ RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
libvirt_functions.stp: $(RPC_PROBE_FILES) $(srcdir)/rpc/gensystemtap.pl
$(AM_V_GEN)perl -w $(srcdir)/rpc/gensystemtap.pl $(RPC_PROBE_FILES) > $@
libvirt_probes.stp: libvirt_probes.d $(srcdir)/dtrace2systemtap.pl
$(AM_V_GEN)perl -w $(srcdir)/dtrace2systemtap.pl $(bindir) $(sbindir) $(libdir) $< > $@
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl
$(AM_V_GEN)perl -w $(srcdir)/dtrace2systemtap.pl \
$(bindir) $(sbindir) $(libdir) $< > $@
libvirt_qemu_probes.stp: libvirt_qemu_probes.d $(srcdir)/dtrace2systemtap.pl
$(AM_V_GEN)perl -w $(srcdir)/dtrace2systemtap.pl $(bindir) $(sbindir) $(libdir) $< > $@
CLEANFILES += libvirt_probes.h libvirt_probes.o \
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
libvirt_qemu_probes.h libvirt_qemu_probes.o \
libvirt_qemu_probes.lo\
libvirt_functions.stp libvirt_probes.stp \
libvirt_qemu_probes.stp
endif
@ -1479,7 +1487,7 @@ libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \
$(RT_LIBS) $(DBUS_LIBS) \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_lxc_LDADD += libvirt_probes.o
libvirt_lxc_LDADD += libvirt_probes.lo
endif
if WITH_SECDRIVER_SELINUX
libvirt_lxc_LDADD += $(SELINUX_LIBS)
@ -1524,7 +1532,7 @@ virt_aa_helper_LDADD = \
libvirt_util.la \
../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
virt_aa_helper_LDADD += libvirt_probes.o
virt_aa_helper_LDADD += libvirt_probes.lo
endif
virt_aa_helper_CFLAGS = \
-I$(top_srcdir)/src/conf \

View File

@ -31,7 +31,7 @@ endif
PROBES_O =
if WITH_DTRACE_PROBES
PROBES_O += ../src/libvirt_probes.o
PROBES_O += ../src/libvirt_probes.lo
endif
LDADDS = \
@ -295,7 +295,7 @@ if WITH_NETWORK
qemu_LDADDS += ../src/libvirt_driver_network.la
endif
if WITH_DTRACE_PROBES
qemu_LDADDS += ../src/libvirt_qemu_probes.o
qemu_LDADDS += ../src/libvirt_qemu_probes.lo
endif
qemu_LDADDS += $(LDADDS)