]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Fix link errors with a particular set of modules on mingw.
authorBruno Haible <bruno@clisp.org>
Sat, 30 May 2020 01:17:19 +0000 (03:17 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 30 May 2020 01:23:56 +0000 (03:23 +0200)
* gnulib-tool (func_emit_tests_Makefile_am): Add ../lib/libgnu.a to
LDADD a second time, after the second occurrence of libtests.a.
* pygnulib/GLEmiter.py (tests_Makefile_am): Likewise.

ChangeLog
gnulib-tool
pygnulib/GLEmiter.py

index d43fa874d42ef8efeb95fdffcf1cc369576fdde3..13673e472f79629040da2369871d1d856d9f7bbd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-05-29  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: Fix link errors with a particular set of modules on mingw.
+       * gnulib-tool (func_emit_tests_Makefile_am): Add ../lib/libgnu.a to
+       LDADD a second time, after the second occurrence of libtests.a.
+       * pygnulib/GLEmiter.py (tests_Makefile_am): Likewise.
+
 2020-05-29  Bruno Haible  <bruno@clisp.org>
 
        fnmatch: Rely on more gnulib modules.
index 01c6745ad84979a115d5ccbdd848b0893451c636..20a2a3e2a7b0bdea690deb88ba61f72e167bc48a 100755 (executable)
@@ -4165,8 +4165,6 @@ func_emit_tests_Makefile_am ()
   echo "  -I${testsbase_inverse} -I\$(srcdir)/${testsbase_inverse} \\"
   echo "  -I${testsbase_inverse}/${sourcebase-lib} -I\$(srcdir)/${testsbase_inverse}/${sourcebase-lib}"
   echo
-  local_ldadd_before=''
-  local_ldadd_after=''
   if $use_libtests; then
     # All test programs need to be linked with libtests.a.
     # It needs to be passed to the linker before ${libname}.${libext}, since
@@ -4176,10 +4174,10 @@ func_emit_tests_Makefile_am ()
     # module whose dependency to 'progname' is voluntarily omitted).
     # The LIBTESTS_LIBDEPS can be passed to the linker once or twice, it does
     # not matter.
-    local_ldadd_before=' libtests.a'
-    local_ldadd_after=' libtests.a $(LIBTESTS_LIBDEPS)'
+    echo "LDADD = libtests.a ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext} libtests.a ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext} \$(LIBTESTS_LIBDEPS)"
+  else
+    echo "LDADD = ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext}"
   fi
-  echo "LDADD =${local_ldadd_before} ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext}${local_ldadd_after}"
   echo
   if $use_libtests; then
     echo "libtests_a_SOURCES ="
index f0746f8278015f634a715975588cb012519ddd96..441d2956d8beb1e511ad4f447639ec869c5ead33 100644 (file)
@@ -1123,8 +1123,6 @@ AC_DEFUN([%V1%_LIBSOURCES], [
             (testsbase_inverse, sourcebase, testsbase_inverse, sourcebase)
         emit += '\n'
 
-        local_ldadd_before = string()
-        local_ldadd_after = string()
         if libtests:
             # All test programs need to be linked with libtests.a.
             # It needs to be passed to the linker before ${libname}.${libext}, since
@@ -1134,11 +1132,12 @@ AC_DEFUN([%V1%_LIBSOURCES], [
             # 'error' module whose dependency to 'progname' is voluntarily omitted).
             # The LIBTESTS_LIBDEPS can be passed to the linker once or twice, it does
             # not matter.
-            local_ldadd_before = ' libtests.a'
-            local_ldadd_after = ' libtests.a $(LIBTESTS_LIBDEPS)'
-        emit += 'LDADD =%s %s/%s/%s.%s%s\n\n' % \
-            (local_ldadd_before, testsbase_inverse, sourcebase, libname, libext,
-             local_ldadd_after)
+            emit += 'LDADD = libtests.a %s/%s/%s.%s libtests.a %s/%s/%s.%s $(LIBTESTS_LIBDEPS)\n\n' % \
+                (testsbase_inverse, sourcebase, libname, libext,
+                 testsbase_inverse, sourcebase, libname, libext)
+        else:
+            emit += 'LDADD = %s/%s/%s.%s\n\n' % \
+                (testsbase_inverse, sourcebase, libname, libext)
         if libtests:
             emit += 'libtests_a_SOURCES =\n'
             # Here we use $(LIBOBJS), not @LIBOBJS@. The value is the same. However,