[PATCH libinput] Split libinput-util into a noinst helper library

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 4 19:54:56 PST 2014


Fixes distcheck (broken with automake 1.14.1 and 1.13.4)

make[2]: Entering directory '....../libinput-0.7.0/_build/test'
Makefile:926: ../src/.deps/libinput-util.Plo: No such file or directory
make[2]: *** No rule to make target '../src/.deps/libinput-util.Plo'.  Stop.
make[2]: Leaving directory '....../libinput/libinput-0.7.0/_build/test'
Makefile:412: recipe for target 'distclean-recursive' failed

That was the only place we used subdir objects, so we can drop it from
configure now.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 configure.ac     |  2 +-
 src/Makefile.am  | 16 +++++++++++++---
 test/Makefile.am |  5 ++---
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8aa2a55..eb75a4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ AC_SUBST([LIBINPUT_VERSION], [libinput_version])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 
-AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])
+AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
 
 # Before making a release, the LIBINPUT_LT_VERSION string should be
 # modified.
diff --git a/src/Makefile.am b/src/Makefile.am
index 027e08c..0968459 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,5 @@
 lib_LTLIBRARIES = libinput.la
+noinst_LTLIBRARIES = libinput-util.la
 
 include_HEADERS =			\
 	libinput.h
@@ -7,8 +8,6 @@ libinput_la_SOURCES =			\
 	libinput.c			\
 	libinput.h			\
 	libinput-private.h		\
-	libinput-util.c			\
-	libinput-util.h			\
 	evdev.c				\
 	evdev.h				\
 	evdev-mt-touchpad.c		\
@@ -29,13 +28,24 @@ libinput_la_SOURCES =			\
 
 libinput_la_LIBADD = $(MTDEV_LIBS) \
 		     $(LIBUDEV_LIBS) \
-		     $(LIBEVDEV_LIBS)
+		     $(LIBEVDEV_LIBS) \
+		     libinput-util.la
+
 libinput_la_CFLAGS = -I$(top_srcdir)/include \
 		     $(MTDEV_CFLAGS)	\
 		     $(LIBUDEV_CFLAGS)	\
 		     $(LIBEVDEV_CFLAGS)	\
 		     $(GCC_CFLAGS)
 
+libinput_util_la_SOURCES = \
+	libinput-util.c		\
+	libinput-util.h
+
+libinput_util_la_LIBADD =
+libinput_util_la_CFLAGS = -I$(top_srcdir)/include \
+			  $(LIBUDEV_CFLAGS) \
+			  $(GCC_CFLAGS)
+
 libinput_la_LDFLAGS = -version-info $(LIBINPUT_LT_VERSION) -shared
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/test/Makefile.am b/test/Makefile.am
index 0abd695..2c36e3f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -11,8 +11,6 @@ AM_CXXFLAGS = $(GCC_CXXFLAGS)
 TEST_LIBS = liblitest.la $(CHECK_LIBS) $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS) $(top_builddir)/src/libinput.la
 noinst_LTLIBRARIES = liblitest.la
 liblitest_la_SOURCES = \
-	../src/libinput-util.h \
-	../src/libinput-util.c \
 	litest.h \
 	litest-int.h \
 	litest-alps-semi-mt.c \
@@ -30,6 +28,7 @@ liblitest_la_SOURCES = \
 	litest-xen-virtual-pointer.c \
 	litest-vmware-virtual-usb-mouse.c \
 	litest.c
+liblitest_la_LIBADD = $(top_builddir)/src/libinput-util.la
 
 run_tests = \
 	test-udev \
@@ -103,7 +102,7 @@ test_build_std_gnuc90_CFLAGS = -std=gnu90 -Werror
 # test for linking with the minimal linker flags
 test_build_linker_SOURCES = build-pedantic.c
 test_build_linker_CFLAGS = -I$(top_srcdir)/src
-test_build_linker_LDADD = $(top_builddir)/src/libinput.la
+test_build_linker_LDADD = $(top_builddir)/src/libinput.la $(top_builddir)/src/libinput-util.la
 
 # test including from C++
 test_build_cxx_SOURCES = build-cxx.cc
-- 
2.1.0



More information about the wayland-devel mailing list