Skip to content

qt: Makefile.am: use recursive Makefile to solve argument list limit

The project started to move away from recursive Makefile a while ago for performance reasons. Unfortunately, even though tools like libtool can handle an arbitrary number of files by using @filelists, automake is subject12 to max argument limitation in its distdir-am target, which will try to expand $(DISTFILES) in the bash command line.

This is workarounded in this commit by moving all the files from Qt in a separate Makefile that will be recursively called by automake, reducing the size of $(DISTFILES). Hopefully, Make/Automake would have fixed this or we would have moved completely to Meson when we reach the limit again.

The second patch also refactors the way tests are run for QML.

I've also printed the difference between master with:

sed -i s,gui/qt/,,g modules/gui/qt/Makefile.am
git commit -a -m"WIP"
git diff HEAD..qt-fix-limits/1 -- modules/gui/qt/Makefile.am

so as to triple-check that I don't remove a fil, which resulted in:


diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 96ee79c4ec7..e8745f9e704 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -11,7 +11,12 @@
 # For each qml and js resource
 #   - Add it to ..._QML
 
+include ../../common.am
+guidir = $(pluginsdir)/gui
+gui_LTLIBRARIES =
 SUFFIXES += .ui .h .hpp .moc.cpp .qml
+TEST_EXTENSIONS = .qml
+EXTRA_DIST =
 
 vlc_qt_libs = $(QT5_PLUGINS_LIBS) $(QT5_PLATFORM_PLUGINS_LIBS) $(QT5_XCB_PLUGINS_LIBS) $(QT5_WAYLAND_PLUGINS_LIBS) $(QT_LIBS) $(LIBS_qt)
 
@@ -1144,12 +1149,13 @@ gui_LTLIBRARIES += libqt_plugin.la
 BUILT_SOURCES += $(nodist_libqt_plugin_la_SOURCES)
 if !HAVE_WIN32
 if !HAVE_OS2
-pkglibexec_PROGRAMS += vlc-qt-check
+pkglibexec_PROGRAMS = vlc-qt-check
 endif
 endif
 
-if HAVE_QT5_QUICK_TEST
+QML_LOG_COMPILER = $(builddir)/qml_test -input
 
+if HAVE_QT5_QUICK_TEST
 qml_test_SOURCES = tests/qml_test.cpp
 nodist_qml_test_SOURCES = resources.cpp
 if HAVE_QMLCACHE
@@ -1157,11 +1163,8 @@ nodist_qml_test_SOURCES += qmlcache_loader.cpp $(libqt_plugin_la_QML)
 endif
 qml_test_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) -fPIC $(CXXFLAGS_qt) ${QT5_QUICK_TEST_CFLAGS} -DQUICK_TEST_SOURCE_DIR="\"${srcdir}/tests\""
 qml_test_LDADD = $(QT5_PLUGINS_LIBS) ${QT5_QUICK_TEST_LIBS} $(QT_LIBS) $(LIBS_qt)
-check_PROGRAMS += qml_test
+check_PROGRAMS = qml_test
 EXTRA_DIST += tests/tst_FSM.qml
-
-TESTS += qml_test
-
+TESTS = tests/tst_FSM.qml
 endif
-
 endif

I'd encourage reviewers to do the same, especially right before merging, to ensure I don't break anything.

  1. https://lists.gnu.org/archive/html/bug-automake/2009-07/msg00008.html

  2. https://lists.gnu.org/archive/html/automake/2014-05/msg00015.html

Merge request reports