[PATCH v2] configure.ac: add subdir-objects

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Jul 11 14:52:10 UTC 2016


This allows to avoid the following warning when re-generating the
configure script:

  auparse/Makefile.am:95: warning: source file '../lib/gen_tables.c' is in a subdirectory,
  auparse/Makefile.am:95: but option 'subdir-objects' is disabled

To make this possible and avoid a bug in automake < 1.16, we have to
adjust two Makefile.am, to use a relative path rather in _SOURCES rather
than a path that uses $(top_srcdir). Indeed, $(top_srcdir) was not
properly expanded when used in _SOURCES in automake versions < 1.16.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
---
 bindings/python/python2/Makefile.am | 2 +-
 bindings/python/python3/Makefile.am | 2 +-
 configure.ac                        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bindings/python/python2/Makefile.am b/bindings/python/python2/Makefile.am
index 1dcb5bc..208ae66 100644
--- a/bindings/python/python2/Makefile.am
+++ b/bindings/python/python2/Makefile.am
@@ -27,7 +27,7 @@ AM_CPPFLAGS = -I$(top_builddir) -I at PYINCLUDEDIR@
 
 pyexec_LTLIBRARIES = auparse.la
 
-auparse_la_SOURCES = $(top_srcdir)/bindings/python/auparse_python.c
+auparse_la_SOURCES = ../auparse_python.c
 auparse_la_CPPFLAGS = -I$(top_srcdir)/auparse $(AM_CPPFLAGS)
 auparse_la_LDFLAGS = -module -avoid-version -Wl,-z,relro
 auparse_la_LIBADD = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la
diff --git a/bindings/python/python3/Makefile.am b/bindings/python/python3/Makefile.am
index edd38e9..93495da 100644
--- a/bindings/python/python3/Makefile.am
+++ b/bindings/python/python3/Makefile.am
@@ -26,7 +26,7 @@ AM_CPPFLAGS = -I$(top_builddir) $(PYTHON3_INCLUDES)
 
 py3exec_LTLIBRARIES = auparse.la
 
-auparse_la_SOURCES = $(top_srcdir)/bindings/python/auparse_python.c
+auparse_la_SOURCES = ../auparse_python.c
 auparse_la_CPPFLAGS = -I$(top_srcdir)/auparse $(AM_CPPFLAGS)
 auparse_la_LDFLAGS = -module -avoid-version -Wl,-z,relro
 auparse_la_LIBADD = ${top_builddir}/auparse/libauparse.la ${top_builddir}/lib/libaudit.la
diff --git a/configure.ac b/configure.ac
index c5e87e7..1118f15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ echo Configuring auditd $VERSION
 
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
 AM_PROG_LIBTOOL
 AC_SUBST(LIBTOOL_DEPS)
 OLDLIBS="$LIBS"
-- 
2.7.4




More information about the Linux-audit mailing list