From: Nick Bowler Date: Sat, 19 Feb 2022 03:09:15 +0000 (-0500) Subject: Fix DX_GNULIB_SYMFILES usage in VPATH builds. X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/commitdiff_plain/8399cb7be4ef4ad57f6a4ef507e8c0fab4c9a78a Fix DX_GNULIB_SYMFILES usage in VPATH builds. A typo in the configure commands prevented VPATH builds from working as expected. Fix that and add a small test case to verify such builds. --- diff --git a/m4/gnulib-shared.m4 b/m4/gnulib-shared.m4 index 21b7cbb..6747bb9 100644 --- a/m4/gnulib-shared.m4 +++ b/m4/gnulib-shared.m4 @@ -37,7 +37,7 @@ do IFS=:; set x $gl_f gl_of=$[2]; gl_am=$gl_of.am # TODO fully handle user-specified input files IFS=$gl_save_IFS - test -f "$gl_am" || test -f "$srcdir/gl_am" || continue + test -f "$gl_am" || test -f "$srcdir/$gl_am" || continue $MAKE -f - glconfig-objects GLCONFIG_OBJECTS="$ac_tmp/gl_objs.lst" \ <"$gl_of" >/dev/null 2>&1 && test -f "$ac_tmp/gl_objs.lst" || continue sed 's|[[.][^/.]*$]| &|' "$ac_tmp/gl_objs.lst" | LC_ALL=C sort -u \ diff --git a/tests/macros.at b/tests/macros.at index 5202790..e5eb8ff 100644 --- a/tests/macros.at +++ b/tests/macros.at @@ -340,10 +340,8 @@ exit 1]) AT_CLEANUP -AT_SETUP([DX_GNULIB_SYMFILES]) -AT_KEYWORDS([DX_GNULIB_SYMFILES macro]) - -echo : >compile +m4_define([TEST_SYMFILES_INIT], +[echo : >compile TEST_CONFIGURE_AC([[AM_INIT_AUTOMAKE([foreign]) AM_PROG_CC_C_O AC_SUBST([GLSRC], [.]) @@ -352,11 +350,6 @@ DX_GNULIB_SYMFILES([symfiles.lst]) AC_CONFIG_FILES([Makefile]) ]]) -AT_DATA([symfiles.lst], -[[b.foo -d.bar -]]) - cp "$srcdir/snippet/glconfig.mk" . AT_DATA([Makefile.am], [[CLEANFILES = @@ -377,6 +370,15 @@ do_test: .PHONY: do_test include $(top_srcdir)/glconfig.mk +]])]) + +AT_SETUP([DX_GNULIB_SYMFILES]) +AT_KEYWORDS([DX_GNULIB_SYMFILES macro]) + +TEST_SYMFILES_INIT +AT_DATA([symfiles.lst], +[[b.foo +d.bar ]]) TEST_AUTORECONF @@ -406,6 +408,27 @@ e.o AT_CLEANUP +AT_SETUP([DX_GNULIB_SYMFILES separate srcdir]) +AT_KEYWORDS([DX_GNULIB_SYMFILES macro vpath]) + +TEST_SYMFILES_INIT +AT_DATA([symfiles.lst]) +TEST_AUTORECONF + +mkdir build && cd build +TEST_CONFIGURE([], [../configure]) +AT_CHECK([make -s do_test], [0], [[ +/// +a.o +b.o +c.o +d.o +e.o +]]) +cd .. + +AT_CLEANUP + AT_SETUP([DX_GNULIB_SYMFILES distribution]) AT_KEYWORDS([DX_GNULIB_SYMFILES macro]) diff --git a/testsuite.at b/testsuite.at index 998fa5c..2879f38 100644 --- a/testsuite.at +++ b/testsuite.at @@ -43,7 +43,8 @@ AT_CHECK([autoreconf -I "$srcdir/m4"], [0], [], [stderr])]) m4_define([TEST_CONFIGURE], [AT_KEYWORDS([configure])dnl AT_CHECK([export CC -CONFIG_SHELL=$TEST_SHELL $TEST_SHELL ./configure --quiet CONFIG_SHELL=$TEST_SHELL $1])]) +CONFIG_SHELL=$TEST_SHELL $TEST_SHELL m4_default([$2], +[./configure]) --quiet CONFIG_SHELL=$TEST_SHELL $1])]) m4_include([tests/macros.at]) m4_include([tests/snippets.at])