[libvirt] [dbus PATCH 00/15] Build system fixes, cleanups and tweaks

It all started when I got tests/Makefile.am:17: warning: source file '$(top_srcdir)/src/util.c' is in a subdirectory, tests/Makefile.am:17: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. when running autogen.sh and decided to investigate; before I realized it, I was already deep down the rabbit hole and falling towards Wonderland at an increasingly concerning speed. Andrea Bolognani (15): gitignore: Fix man page pattern gitignore: Fix aclocal.m4 pattern tests: Don't distribute compiled binaries src: Fix typo in PIE_LDFLAGS src: Remove empty CLEANFILES src: Don't list source files in EXTRA_DIST tests: Move includes to AM_CPPFLAGS src: Make CFLAGS and LDFLAGS global configure: Enable libtool src: Build libutil.la separately configure: Enable subdir-objects configure: Enable -Wno-obsolete and tar-pax configure: Use xz for release archives data: Rename some variables to *_in_files autotools: Use consistent style .gitignore | 15 ++++++++-- Makefile.am | 12 ++++++-- configure.ac | 3 +- data/Makefile.am | 40 +++++++++++++++++-------- docs/Makefile.am | 16 +++++++--- libvirt-dbus.spec.in | 2 +- src/Makefile.am | 70 ++++++++++++++++++++++++++------------------ tests/Makefile.am | 36 ++++++++++++++++------- 8 files changed, 130 insertions(+), 64 deletions(-) -- 2.17.1

The man page for libvirt-dbus is in section 8, not 1. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c5e16a9..28a7c57 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,7 @@ vgcore.* /data/system/libvirt-dbus.rules /data/system/org.libvirt.conf -/docs/*.1 +/docs/*.8 /src/libvirt-dbus /src/org.libvirt.service -- 2.17.1

Ignore patterns are shell globs, so '.' doesn't need escaping. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 28a7c57..b792bac 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ vgcore.* /configure /libvirt-dbus-*.tar.gz /libvirt-dbus.spec -/m4/aclocal\.m4 +/m4/aclocal.m4 /run /stamp-h1 -- 2.17.1

On Fri, 2018-06-29 at 18:01 +0200, Andrea Bolognani wrote:
Ignore patterns are shell globs, so '.' doesn't need escaping.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore index 28a7c57..b792bac 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ vgcore.* /configure /libvirt-dbus-*.tar.gz /libvirt-dbus.spec -/m4/aclocal\.m4 +/m4/aclocal.m4 /run /stamp-h1
Actually, never mind: aclocal.m4 is generated in the top-level directory, not in m4/, so the pattern should just be removed altogether. Consider the following diff squashed in, and the commit message updated accordingly. diff --git a/.gitignore b/.gitignore index b792bac..e9127e8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,6 @@ vgcore.* /configure /libvirt-dbus-*.tar.gz /libvirt-dbus.spec -/m4/aclocal.m4 /run /stamp-h1 -- Andrea Bolognani / Red Hat / Virtualization

test_programs is included in EXTRA_DIST, so we need to make sure compiled binaries don't end in there or they will be included in release archives. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- tests/Makefile.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 1fc240b..bf2dbbc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,7 +4,6 @@ test_helpers = \ conftest.py test_programs = \ - $(check_PROGRAMS) \ test_connect.py \ test_domain.py \ test_network.py \ @@ -35,7 +34,10 @@ EXTRA_DIST = \ $(test_programs) \ travis-run -TESTS = $(test_programs) +TESTS = \ + $(check_PROGRAMS) \ + $(test_programs) \ + $(NULL) AM_TESTS_ENVIRONMENT = \ export abs_top_builddir="$(abs_top_builddir)"; \ -- 2.17.1

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3ef3472..de30df1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -40,7 +40,7 @@ libvirt_dbus_LDFLAGS = \ $(LIBVIRT_LDFLAGS) \ $(LIBVIRT_GLIB_LDFLAGS) \ $(RELRO_LDFLAGS) \ - $(PID_LDFLAGS) \ + $(PIE_LDFLAGS) \ $(NULL) libvirt_dbus_LDADD = \ -- 2.17.1

No point in declaring it if we're not going to use it. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index de30df1..4662348 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,7 +19,6 @@ DAEMON_SOURCES = \ EXTRA_DIST = \ $(DAEMON_SOURCES) -CLEANFILES = bin_PROGRAMS = libvirt-dbus -- 2.17.1

All files listed in a *_SOURCE directive are automatically distributed, so listing them explicitly is pointless. This makes DAEMON_SOURCES unnecessary, so we can drop it and list source files in libvirt_dbus_SOURCES directly instead. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/Makefile.am | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 4662348..688dfb5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -DVIRT_DBUS_INTERFACES_DIR=\"$(DBUS_INTERFACES_DIR)\" -DAEMON_SOURCES = \ +bin_PROGRAMS = libvirt-dbus + +libvirt_dbus_SOURCES = \ main.c \ connect.c connect.h \ util.c util.h \ @@ -17,13 +19,6 @@ DAEMON_SOURCES = \ storagevol.c storagevol.h \ $(NULL) -EXTRA_DIST = \ - $(DAEMON_SOURCES) - -bin_PROGRAMS = libvirt-dbus - -libvirt_dbus_SOURCES = $(DAEMON_SOURCES) - libvirt_dbus_CFLAGS = \ $(GIO2_CFLAGS) \ $(GLIB2_CFLAGS) \ -- 2.17.1

Includes should be part of *_CPPFLAGS, not *_CFLAGS; since we have to move the include around anyway, might as well make it global instead of limiting it to the single test binary we're building at the moment. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- tests/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index bf2dbbc..03d51aa 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,3 +1,7 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/src \ + $(NULL) + test_helpers = \ xmldata.py \ libvirttest.py \ @@ -16,7 +20,6 @@ check_PROGRAMS = \ test_util_SOURCES = \ test_util.c $(top_srcdir)/src/util.c test_util_CFLAGS = \ - -I$(top_srcdir)/src \ $(GIO2_CFLAGS) \ $(GLIB2_CFLAGS) \ $(LIBVIRT_CFLAGS) -- 2.17.1

There's nothing target-specific about either. This is going to be useful later on. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/Makefile.am | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 688dfb5..1b73c8d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,22 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -DVIRT_DBUS_INTERFACES_DIR=\"$(DBUS_INTERFACES_DIR)\" +AM_CFLAGS = \ + $(GIO2_CFLAGS) \ + $(GLIB2_CFLAGS) \ + $(LIBVIRT_CFLAGS) \ + $(LIBVIRT_GLIB_CFLAGS) \ + $(WARN_CFLAGS) \ + $(PIE_CFLAGS) \ + $(NULL) +AM_LDFLAGS = \ + $(GIO2_LDFLAGS) \ + $(GLIB2_LDFLAGS) \ + $(LIBVIRT_LDFLAGS) \ + $(LIBVIRT_GLIB_LDFLAGS) \ + $(RELRO_LDFLAGS) \ + $(PID_LDFLAGS) \ + $(NULL) bin_PROGRAMS = libvirt-dbus @@ -18,25 +34,6 @@ libvirt_dbus_SOURCES = \ storagepool.c storagepool.h \ storagevol.c storagevol.h \ $(NULL) - -libvirt_dbus_CFLAGS = \ - $(GIO2_CFLAGS) \ - $(GLIB2_CFLAGS) \ - $(LIBVIRT_CFLAGS) \ - $(LIBVIRT_GLIB_CFLAGS) \ - $(WARN_CFLAGS) \ - $(PIE_CFLAGS) \ - $(NULL) - -libvirt_dbus_LDFLAGS = \ - $(GIO2_LDFLAGS) \ - $(GLIB2_LDFLAGS) \ - $(LIBVIRT_LDFLAGS) \ - $(LIBVIRT_GLIB_LDFLAGS) \ - $(RELRO_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(NULL) - libvirt_dbus_LDADD = \ $(GIO2_LIBS) \ $(GLIB2_LIBS) \ -- 2.17.1

On Fri, Jun 29, 2018 at 06:01:15PM +0200, Andrea Bolognani wrote:
There's nothing target-specific about either. This is going to be useful later on.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/Makefile.am | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 688dfb5..1b73c8d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,22 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -DVIRT_DBUS_INTERFACES_DIR=\"$(DBUS_INTERFACES_DIR)\" +AM_CFLAGS = \ + $(GIO2_CFLAGS) \ + $(GLIB2_CFLAGS) \ + $(LIBVIRT_CFLAGS) \ + $(LIBVIRT_GLIB_CFLAGS) \ + $(WARN_CFLAGS) \ + $(PIE_CFLAGS) \ + $(NULL) +AM_LDFLAGS = \ + $(GIO2_LDFLAGS) \ + $(GLIB2_LDFLAGS) \ + $(LIBVIRT_LDFLAGS) \ + $(LIBVIRT_GLIB_LDFLAGS) \ + $(RELRO_LDFLAGS) \ + $(PID_LDFLAGS) \
s/PID/PIE/ Pavel

On Fri, 2018-06-29 at 19:02 +0200, Pavel Hrdina wrote:
On Fri, Jun 29, 2018 at 06:01:15PM +0200, Andrea Bolognani wrote:
+AM_LDFLAGS = \ + $(GIO2_LDFLAGS) \ + $(GLIB2_LDFLAGS) \ + $(LIBVIRT_LDFLAGS) \ + $(LIBVIRT_GLIB_LDFLAGS) \ + $(RELRO_LDFLAGS) \ + $(PID_LDFLAGS) \
s/PID/PIE/
Good catch, must have gotten lost in the rebases O:-) -- Andrea Bolognani / Red Hat / Virtualization

We're going to start using libtool convenience libraries in a second. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .gitignore | 9 +++++++++ configure.ac | 1 + 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index b792bac..48e0411 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.la +*.lo *.log *.o *.pyc @@ -6,6 +8,7 @@ *Makefile.in *~ .deps +.libs __pycache__ vgcore.* @@ -19,9 +22,15 @@ vgcore.* /config.log /config.status /configure +/libtool /libvirt-dbus-*.tar.gz /libvirt-dbus.spec /m4/aclocal.m4 +/m4/libtool.m4 +/m4/ltoptions.m4 +/m4/ltsugar.m4 +/m4/ltversion.m4 +/m4/lt~obsolete.m4 /run /stamp-h1 diff --git a/configure.ac b/configure.ac index d7820dd..eef0834 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,7 @@ AC_PROG_CC AC_PROG_MKDIR_P AM_PROG_CC_C_O AC_PROG_CC_STDC +AC_PROG_LIBTOOL PKG_CHECK_MODULES(GIO2, gio-unix-2.0 >= GLIB2_REQUIRED) PKG_CHECK_MODULES(GLIB2, glib-2.0 >= GLIB2_REQUIRED) -- 2.17.1

On Fri, Jun 29, 2018 at 06:01:16PM +0200, Andrea Bolognani wrote:
We're going to start using libtool convenience libraries in a second.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .gitignore | 9 +++++++++ configure.ac | 1 + 2 files changed, 10 insertions(+)
We should also update spec file to include: BuildRequires: libtool Pavel

On Fri, 2018-06-29 at 20:15 +0200, Pavel Hrdina wrote:
On Fri, Jun 29, 2018 at 06:01:16PM +0200, Andrea Bolognani wrote:
We're going to start using libtool convenience libraries in a second.
We should also update spec file to include:
BuildRequires: libtool
Fair enough :) I'll squash that in. -- Andrea Bolognani / Red Hat / Virtualization

We use these utility functions both in the daemon and for test programs, so create a new convenience library that we can compile once and include in both places. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/Makefile.am | 11 ++++++++++- tests/Makefile.am | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 1b73c8d..493cf81 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,12 +18,20 @@ AM_LDFLAGS = \ $(PID_LDFLAGS) \ $(NULL) +noinst_LTLIBRARIES = \ + libutil.la \ + $(NULL) + +libutil_la_SOURCES = \ + util.c \ + util.h \ + $(NULL) + bin_PROGRAMS = libvirt-dbus libvirt_dbus_SOURCES = \ main.c \ connect.c connect.h \ - util.c util.h \ domain.c domain.h \ events.c events.h \ gdbus.c gdbus.h \ @@ -35,6 +43,7 @@ libvirt_dbus_SOURCES = \ storagevol.c storagevol.h \ $(NULL) libvirt_dbus_LDADD = \ + libutil.la \ $(GIO2_LIBS) \ $(GLIB2_LIBS) \ $(LIBVIRT_LIBS) \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 03d51aa..2991689 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -18,7 +18,8 @@ check_PROGRAMS = \ test_util test_util_SOURCES = \ - test_util.c $(top_srcdir)/src/util.c + test_util.c \ + $(NULL) test_util_CFLAGS = \ $(GIO2_CFLAGS) \ $(GLIB2_CFLAGS) \ @@ -28,6 +29,7 @@ test_util_LDFLAGS = \ $(GLIB2_LDFLAGS) \ $(LIBVIRT_LDFLAGS) test_util_LDADD = \ + $(top_builddir)/src/libutil.la \ $(GIO2_LIBS) \ $(GLIB2_LIBS) \ $(LIBVIRT_LIBS) -- 2.17.1

This is the recommended mode of operation. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index eef0834..b6261a0 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([foreign -Wno-portability]) +AM_INIT_AUTOMAKE([foreign -Wno-portability subdir-objects]) AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS -- 2.17.1

libvirt already use both options and libvirt-dbus only targets a subset of the platforms, so we can safely enable them. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b6261a0..fff237a 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([foreign -Wno-portability subdir-objects]) +AM_INIT_AUTOMAKE([foreign -Wno-portability -Wno-obsolete subdir-objects tar-pax]) AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS -- 2.17.1

libvirt already uses xz compression, so we can safely follow suit. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .gitignore | 2 +- configure.ac | 2 +- libvirt-dbus.spec.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 48e0411..052b1ff 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ vgcore.* /config.status /configure /libtool -/libvirt-dbus-*.tar.gz +/libvirt-dbus-*.tar.* /libvirt-dbus.spec /m4/aclocal.m4 /m4/libtool.m4 diff --git a/configure.ac b/configure.ac index fff237a..493cd11 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([foreign -Wno-portability -Wno-obsolete subdir-objects tar-pax]) +AM_INIT_AUTOMAKE([foreign -Wno-portability -Wno-obsolete subdir-objects tar-pax no-dist-gzip dist-xz]) AC_CANONICAL_HOST AC_USE_SYSTEM_EXTENSIONS diff --git a/libvirt-dbus.spec.in b/libvirt-dbus.spec.in index 319fd59..285eec0 100644 --- a/libvirt-dbus.spec.in +++ b/libvirt-dbus.spec.in @@ -11,7 +11,7 @@ Release: 1%{?dist} Summary: libvirt D-Bus API binding License: LGPLv2+ URL: https://libvirt.org/ -Source0: https://libvirt.org/sources/dbus/%{name}-%{version}.tar.gz +Source0: https://libvirt.org/sources/dbus/%{name}-%{version}.tar.xz BuildRequires: gcc BuildRequires: glib2-devel >= %{glib2_version} -- 2.17.1

Some of the variables that contain lists of files that will undergo pre-processing follow the *_in_files naming convention to highlight the fact; let's be consistent about it. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- data/Makefile.am | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/Makefile.am b/data/Makefile.am index 8c5a8d2..f1e9dfd 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -8,15 +8,15 @@ system_service_in_files = \ system_servicedir = $(DBUS_SYSTEM_SERVICES_DIR) system_service_DATA = $(system_service_in_files:.service.in=.service) -system_policy_files = \ +system_policy_in_files = \ system/org.libvirt.conf.in system_policydir = $(DBUS_SYSTEM_POLICIES_DIR) -system_policy_DATA = $(system_policy_files:.conf.in=.conf) +system_policy_DATA = $(system_policy_in_files:.conf.in=.conf) -polkit_files = \ +polkit_in_files = \ system/libvirt-dbus.rules.in polkitdir = $(POLKIT_RULES_DIR) -polkit_DATA = $(polkit_files:.rules.in=.rules) +polkit_DATA = $(polkit_in_files:.rules.in=.rules) interfaces_files = \ org.libvirt.Connect.xml \ @@ -34,8 +34,8 @@ interfaces_DATA = $(interfaces_files) EXTRA_DIST = \ $(service_in_files) \ $(system_service_in_files) \ - $(system_policy_files) \ - $(polkit_files) \ + $(system_policy_in_files) \ + $(polkit_in_files) \ $(interfaces_files) \ $(NULL) -- 2.17.1

Sticking to one item per line will ensure future diffs are minimal and easily understandable. More in general, being consistent is good :) Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Makefile.am | 12 +++++++++--- data/Makefile.am | 32 +++++++++++++++++++++++--------- docs/Makefile.am | 16 ++++++++++++---- src/Makefile.am | 40 +++++++++++++++++++++++++++------------- tests/Makefile.am | 21 ++++++++++++++------- 5 files changed, 85 insertions(+), 36 deletions(-) diff --git a/Makefile.am b/Makefile.am index bb5ff5c..93941c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,9 @@ - -SUBDIRS = data docs src tests +SUBDIRS = \ + data \ + docs \ + src \ + tests \ + $(NULL) ACLOCAL_AMFLAGS = -I m4 @@ -11,7 +15,9 @@ EXTRA_DIST = \ README.md \ $(NULL) -DISTCLEAN_FILES = $(PACKAGE).spec +DISTCLEAN_FILES = \ + $(PACKAGE).spec \ + $(NULL) rpm: clean @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) diff --git a/data/Makefile.am b/data/Makefile.am index f1e9dfd..7b523da 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,22 +1,34 @@ service_in_files = \ - session/org.libvirt.service.in + session/org.libvirt.service.in \ + $(NULL) servicedir = $(DBUS_SERVICES_DIR) -service_DATA = $(service_in_files:.service.in=.service) +service_DATA = \ + $(service_in_files:.service.in=.service) \ + $(NULL) system_service_in_files = \ - system/org.libvirt.service.in + system/org.libvirt.service.in \ + $(NULL) system_servicedir = $(DBUS_SYSTEM_SERVICES_DIR) -system_service_DATA = $(system_service_in_files:.service.in=.service) +system_service_DATA = \ + $(system_service_in_files:.service.in=.service) \ + $(NULL) system_policy_in_files = \ - system/org.libvirt.conf.in + system/org.libvirt.conf.in \ + $(NULL) system_policydir = $(DBUS_SYSTEM_POLICIES_DIR) -system_policy_DATA = $(system_policy_in_files:.conf.in=.conf) +system_policy_DATA = \ + $(system_policy_in_files:.conf.in=.conf) \ + $(NULL) polkit_in_files = \ - system/libvirt-dbus.rules.in + system/libvirt-dbus.rules.in \ + $(NULL) polkitdir = $(POLKIT_RULES_DIR) -polkit_DATA = $(polkit_in_files:.rules.in=.rules) +polkit_DATA = \ + $(polkit_in_files:.rules.in=.rules) \ + $(NULL) interfaces_files = \ org.libvirt.Connect.xml \ @@ -29,7 +41,9 @@ interfaces_files = \ org.libvirt.StorageVol.xml \ $(NULL) interfacesdir = $(DBUS_INTERFACES_DIR) -interfaces_DATA = $(interfaces_files) +interfaces_DATA = \ + $(interfaces_files) \ + $(NULL) EXTRA_DIST = \ $(service_in_files) \ diff --git a/docs/Makefile.am b/docs/Makefile.am index c41ffae..fe8ca1c 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,13 +1,21 @@ POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)" -PODFILES = libvirt-dbus.pod +PODFILES = \ + libvirt-dbus.pod \ + $(NULL) %.8: %.pod $(AM_V_GEN)$(POD2MAN) -s 8 $< $@ \ && if grep 'POD ERROR' $@; then rm $@; exit 1; fi -man8_MANS = libvirt-dbus.8 +man8_MANS = \ + libvirt-dbus.8 \ + $(NULL) -EXTRA_DIST = $(PODFILES) +EXTRA_DIST = \ + $(PODFILES) \ + $(NULL) -CLEANFILES = $(man8_MANS) +CLEANFILES = \ + $(man8_MANS) \ + $(NULL) diff --git a/src/Makefile.am b/src/Makefile.am index 493cf81..2fb1820 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ - -DVIRT_DBUS_INTERFACES_DIR=\"$(DBUS_INTERFACES_DIR)\" + -DVIRT_DBUS_INTERFACES_DIR=\"$(DBUS_INTERFACES_DIR)\" \ + $(NULL) AM_CFLAGS = \ $(GIO2_CFLAGS) \ $(GLIB2_CFLAGS) \ @@ -27,24 +28,37 @@ libutil_la_SOURCES = \ util.h \ $(NULL) -bin_PROGRAMS = libvirt-dbus +bin_PROGRAMS = \ + libvirt-dbus \ + $(NULL) libvirt_dbus_SOURCES = \ + connect.c \ + connect.h \ + domain.c \ + domain.h \ + events.c \ + events.h \ + gdbus.c \ + gdbus.h \ main.c \ - connect.c connect.h \ - domain.c domain.h \ - events.c events.h \ - gdbus.c gdbus.h \ - network.c network.h \ - nodedev.c nodedev.h \ - nwfilter.c nwfilter.h \ - secret.c secret.h \ - storagepool.c storagepool.h \ - storagevol.c storagevol.h \ + network.c \ + network.h \ + nodedev.c \ + nodedev.h \ + nwfilter.c \ + nwfilter.h \ + secret.c \ + secret.h \ + storagepool.c \ + storagepool.h \ + storagevol.c \ + storagevol.h \ $(NULL) libvirt_dbus_LDADD = \ libutil.la \ $(GIO2_LIBS) \ $(GLIB2_LIBS) \ $(LIBVIRT_LIBS) \ - $(LIBVIRT_GLIB_LIBS) + $(LIBVIRT_GLIB_LIBS) \ + $(NULL) diff --git a/tests/Makefile.am b/tests/Makefile.am index 2991689..09c3e2e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -5,17 +5,20 @@ AM_CPPFLAGS = \ test_helpers = \ xmldata.py \ libvirttest.py \ - conftest.py + conftest.py \ + $(NULL) test_programs = \ test_connect.py \ test_domain.py \ test_network.py \ test_nodedev.py \ - test_storage.py + test_storage.py \ + $(NULL) check_PROGRAMS = \ - test_util + test_util \ + $(NULL) test_util_SOURCES = \ test_util.c \ @@ -23,21 +26,25 @@ test_util_SOURCES = \ test_util_CFLAGS = \ $(GIO2_CFLAGS) \ $(GLIB2_CFLAGS) \ - $(LIBVIRT_CFLAGS) + $(LIBVIRT_CFLAGS) \ + $(NULL) test_util_LDFLAGS = \ $(GIO2_LDFLAGS) \ $(GLIB2_LDFLAGS) \ - $(LIBVIRT_LDFLAGS) + $(LIBVIRT_LDFLAGS) \ + $(NULL) test_util_LDADD = \ $(top_builddir)/src/libutil.la \ $(GIO2_LIBS) \ $(GLIB2_LIBS) \ - $(LIBVIRT_LIBS) + $(LIBVIRT_LIBS) \ + $(NULL) EXTRA_DIST = \ $(test_helpers) \ $(test_programs) \ - travis-run + travis-run \ + $(NULL) TESTS = \ $(check_PROGRAMS) \ -- 2.17.1

On Fri, Jun 29, 2018 at 06:01:07PM +0200, Andrea Bolognani wrote:
It all started when I got
tests/Makefile.am:17: warning: source file '$(top_srcdir)/src/util.c' is in a subdirectory, tests/Makefile.am:17: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities.
when running autogen.sh and decided to investigate; before I realized it, I was already deep down the rabbit hole and falling towards Wonderland at an increasingly concerning speed.
Andrea Bolognani (15): gitignore: Fix man page pattern gitignore: Fix aclocal.m4 pattern tests: Don't distribute compiled binaries src: Fix typo in PIE_LDFLAGS src: Remove empty CLEANFILES src: Don't list source files in EXTRA_DIST tests: Move includes to AM_CPPFLAGS src: Make CFLAGS and LDFLAGS global configure: Enable libtool src: Build libutil.la separately configure: Enable subdir-objects configure: Enable -Wno-obsolete and tar-pax configure: Use xz for release archives data: Rename some variables to *_in_files autotools: Use consistent style
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Andrea Bolognani
-
Pavel Hrdina