From 7688d80fdcf83763450d2c41acdc5b5c8fbf67c0 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Mon, 19 Sep 2011 18:43:34 -0400 Subject: [PATCH] Handle gl_LIBOBJS/gl_LTLIBOBJS correctly. These AC_SUBSTed variables reference objects whose sources are located in lib, thus they need to be rewritten like other AC_SUBSTed variables. These objects also need the header dependencies like other objects. --- scripts/fix-gnulib.pl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/fix-gnulib.pl b/scripts/fix-gnulib.pl index b93cf22..1f50d49 100755 --- a/scripts/fix-gnulib.pl +++ b/scripts/fix-gnulib.pl @@ -145,7 +145,10 @@ EOF s:\$\(builddir\):\$\(top_builddir\)/lib:g; } continue { print }; -print "\$(libgnu_la_OBJECTS): \$(gnulib_headers)\n"; +print <<'EOF'; +gnulib_lt_objects = $(libgnu_la_OBJECTS) $(gl_LTLIBOBJS) +$(gnulib_lt_objects): $(gnulib_headers) +EOF # Some filenames are AC_SUBSTed by the Gnulib macros, and thus we need to # prepend lib/ if and only if they're not empty. Unfortunately, make is not @@ -159,6 +162,16 @@ if (defined $m4output) { print M4OUT "dnl This file was generated by fix-gnulib.pl\n"; print M4OUT "AC_DEFUN([$m4macro], [dnl\n"; + print M4OUT <<'EOF'; +m4_foreach([gl_objvar], [[gl_LIBOBJS], [gl_LTLIBOBJS]], [dnl +set x $gl_objvar; shift +gl_objvar= +while test ${#} -gt 0; do + gl_objvar="$gl_objvar lib/${1}"; shift +done +]) +EOF + foreach (@vars) { print M4OUT "$_=\${$_:+lib/\$$_}\n"; } -- 2.43.0