These are two buildsystem tweaks, in the same vein as the ones I posted recently for libosmocore, plus a gitignore update thrown in for good measure.
From: Andreas Rottmann a.rottmann@gmx.at
Having subdir-objects enabled is recommended by automake 1.14, to avoid future incompatibilities.
However, adding that option breaks out-of-tree builds, and also seems to break "make distclean" for in-tree builds. The reason is that apparently, automake with subdir-objects enabled cannot cope with source files in a different, non-child directory. To avoid that, instead of referencing the source files, we (just) link against that library. --- configure.ac | 2 +- tests/sccp/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac index 49c5f7e..2b4062b 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_INIT([libosmo-sccp], m4_esyscmd([./git-version-gen .tarball-version]), [openbsc@lists.osmocom.org])
-AM_INIT_AUTOMAKE([dist-bzip2]) +AM_INIT_AUTOMAKE([subdir-objects dist-bzip2]) AC_CONFIG_TESTDIR(tests)
dnl kernel style compile messages diff --git a/tests/sccp/Makefile.am b/tests/sccp/Makefile.am index 8cce20c..c22801a 100644 --- a/tests/sccp/Makefile.am +++ b/tests/sccp/Makefile.am @@ -5,6 +5,6 @@ EXTRA_DIST = sccp_test.ok
noinst_PROGRAMS = sccp_test
-sccp_test_SOURCES = sccp_test.c $(top_srcdir)/src/sccp.c -sccp_test_LDADD = $(LIBOSMOCORE_LIBS) +sccp_test_SOURCES = sccp_test.c +sccp_test_LDADD = $(top_builddir)/src/libsccp.a $(LIBOSMOCORE_LIBS)
From: Andreas Rottmann a.rottmann@gmx.at
This file is dropped into the top-level source directory by "autoreconf -i". --- .gitignore | 1 + 1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore index 65fb1ef..48b2e76 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ bsc_mgcp #configure aclocal.m4 autom4te.cache/ +compile config.log config.status configure
From: Andreas Rottmann a.rottmann@gmx.at
Running "make distcheck" failed trying to generate ".version" into the read-only unpacked source directory. Actually shipping ".version" in the tarball fixes that.
The error manifested as:
make[1]: Entering directory '/tmp/build/libosmo-sccp-0.0.6.3.24-758d/_build' echo 0.0.6.3.24-758d > ../.version-t && mv ../.version-t ../.version /bin/bash: ../.version-t: Permission denied Makefile:807: recipe for target '../.version' failed --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/Makefile.am b/Makefile.am index e300b31..534fdc2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,8 @@ SUBDIRS = include src tests pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc
+EXTRA_DIST = .version + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@