[libvirt] [PATCH 4/4] build: use automake subdir-objects

Eric Blake eblake at redhat.com
Mon Sep 9 15:51:35 UTC 2013


Automake 2.0 will enable subdir-objects by default; in preparation
for that change, automake 1.14 outputs LOADS of warnings:

daemon/Makefile.am:38: warning: source file '../src/remote/remote_protocol.c' is in a subdirectory,
daemon/Makefile.am:38: but option 'subdir-objects' is disabled
automake-1.14: warning: possible forward-incompatibility.
automake-1.14: At least a source file is in a subdirectory, but the 'subdir-objects'
automake-1.14: automake option hasn't been enabled.  For now, the corresponding output
automake-1.14: object file(s) will be placed in the top-level directory.  However,
automake-1.14: this behaviour will change in future Automake versions: they will
automake-1.14: unconditionally cause object files to be placed in the same subdirectory
automake-1.14: of the corresponding sources.
automake-1.14: You are advised to start using 'subdir-objects' option throughout your
automake-1.14: project, to avoid future incompatibilities.
daemon/Makefile.am:38: warning: source file '../src/remote/lxc_protocol.c' is in a subdirectory,
daemon/Makefile.am:38: but option 'subdir-objects' is disabled
...

As automake 1.9 also supported this option, and the previous patches
fixed up the code base to work with it, it is safe to now turn it on
unconditionally.

* configure.ac (AM_INIT_AUTOMAKE): Enable subdir-objects.
* .gitignore: Ignore .dirstamp directories.
* src/Makefile.am (PDWTAGS, *-protocol-struct): Adjust to
new subdir-object location of .lo files.

Signed-off-by: Eric Blake <eblake at redhat.com>
---
 .gitignore      |  1 +
 configure.ac    |  2 +-
 src/Makefile.am | 15 ++++++++-------
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8a94748..2b8652f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@
 *~
 .#*
 .deps
+.dirstamp
 .gdb_history
 .git
 .git-module-status
diff --git a/configure.ac b/configure.ac
index a639f59..a5d0373 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 dnl Make automake keep quiet about wildcards & other GNUmake-isms; also keep
 dnl quiet about the fact that we intentionally cater to automake 1.9
-AM_INIT_AUTOMAKE([-Wno-portability -Wno-obsolete tar-ustar])
+AM_INIT_AUTOMAKE([-Wno-portability -Wno-obsolete tar-ustar subdir-objects])
 AM_MAINTAINER_MODE([enable])

 # Maintainer note - comment this line out if you plan to rerun
diff --git a/src/Makefile.am b/src/Makefile.am
index 90b7554..711da32 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -367,12 +367,13 @@ r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
 struct_prefix = (remote_|qemu_|lxc_|keepalive|vir(Net|LockSpace|LXCMonitor))

 # Depending on configure options, libtool creates one or both of
-# {,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want the
-# newest of the two, in case configure options changed and a stale
+# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
+# the newest of the two, in case configure options changed and a stale
 # file is left around from an earlier build.
 PDWTAGS = \
 	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
-	  o=`ls -t $(<:.lo=.$(OBJEXT)) .libs/$(<:.lo=.$(OBJEXT))	\
+	  o=`ls -t $(<:.lo=.$(OBJEXT))					\
+	     $(subst /,/.libs/,$(<:.lo=.$(OBJEXT)))			\
 	    2>/dev/null | sed -n 1p`;					\
 	  test -f "$$o" || { echo ".o for $< not found" >&2; exit 1; };	\
 	  pdwtags --verbose $$o > $(@F)-t1 2> $(@F)-t2;			\
@@ -445,16 +446,16 @@ check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)
 $(srcdir)/remote_protocol-struct \
 	$(srcdir)/qemu_protocol-struct \
 	$(srcdir)/lxc_protocol-struct: \
-		$(srcdir)/%-struct: libvirt_driver_remote_la-%.lo
+		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
 	$(PDWTAGS)
 $(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
-		$(srcdir)/%-struct: libvirt_net_rpc_la-%.lo
+		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
 	$(PDWTAGS)
 $(srcdir)/lxc_monitor_protocol-struct: \
-		$(srcdir)/%-struct: libvirt_driver_lxc_impl_la-%.lo
+		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
 	$(PDWTAGS)
 $(srcdir)/lock_protocol-struct: \
-		$(srcdir)/%-struct: lockd_la-%.lo
+		$(srcdir)/%-struct: locking/lockd_la-%.lo
 	$(PDWTAGS)

 else !WITH_REMOTE
-- 
1.8.3.1




More information about the libvir-list mailing list