GNOME Bugzilla – Bug 751137
tests: out-of-source, parallel build failure due to $(top_builddir) / $(top_srcdir) and LDFLAGS / LDADD mixups
Last modified: 2015-06-19 01:18:24 UTC
top_builddir is for files generated at build time: config.h, *.la, *.o, *.so etc. top_srcdir is for disted sources: the *.h and *.c files that are in the source tarball. foo_LDFLAGS is for random flags that automake should directly pass to the linker, for example -Wl,--as-needed. If you abuse LDFLAGS for libtool dependencies, for example by adding bar.la to foo_LDFLAGS, there is no telling whether bar.la will be scheduled for building before foo in the case of parallel make. foo_LDADD is for libool linking dependencies. Stick your -lwhatever and whatever.la things here. The new at-spi2-at tests/Makefile confuses all these concepts, and as a result, when performing an out-of-source, parallel build (e.g. make -j8 in a temp subdirectory of source checkout), errors like the following happen: Making all in tests make[2]: Entering directory '/home/tetromino/scm/at-spi2-atk/build/tests' Making all in dummyatk make[3]: Entering directory '/home/tetromino/scm/at-spi2-atk/build/tests/dummyatk' CC libdummyatk_la-my-atk-action.lo CC libdummyatk_la-my-atk-component.lo CC libdummyatk_la-my-atk-object.lo CCLD libdummyatk.la make[3]: Leaving directory '/home/tetromino/scm/at-spi2-atk/build/tests/dummyatk' make[3]: Entering directory '/home/tetromino/scm/at-spi2-atk/build/tests' CC libxmlloader_la-atk-object-xml-loader.lo make[3]: *** No rule to make target '../../tests/dummyatk/libdummyatk.la', needed by 'libxmlloader.la'. Stop. make[3]: Leaving directory '/home/tetromino/scm/at-spi2-atk/build/tests' Makefile:889: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/home/tetromino/scm/at-spi2-atk/build/tests' Makefile:506: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/tetromino/scm/at-spi2-atk/build' Makefile:394: recipe for target 'all' failed make: *** [all] Error 2 (reported downstream at https://bugs.gentoo.org/show_bug.cgi?id=552346)
Created attachment 305514 [details] [review] proposed patch
Comment on attachment 305514 [details] [review] proposed patch Okay; looks fine. Thanks for the report and patch.