[PATCH] ar-lib: Fix for MSVC 14.

Bruno Haible <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <6938708.iGJUXoy3Be@omega>
Hi,

When building GNU gettext HEAD (0.20.1+) with MSVC 14, the creation of
libtextstyle.la fails, because it can't extract the members of several
sub-libraries (*.lib files). The reason is that the
  lib -NOLOGO -LIST some.lib
lists the members, one per line, with a CR/LF as line terminator.
The file names given in subsequent commands to
  lib -NOLOGO -EXTRACT...
thus end in a CR, and 'lib' does not unpack these members, complaining:
  LINK : warning LNK4014: cannot find member object libxml/.libs/rpl_la_tree.obj^M

The fix is simple: Remove the CRs in the pipe.
0001-ar-lib-Fix-for-MSVC-14.patch (text/x-patch, 1.3 KB)
From 20f739e6f739f67bb8afafffaaa68b388769b100 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Thu, 4 Jul 2019 03:43:54 +0200
Subject: [PATCH] ar-lib: Fix for MSVC 14.

* lib/ar-lib (extract): Convert CRLFs in 'lib -NOLOGO -LIST' output to LFs.
---
 lib/ar-lib | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/ar-lib b/lib/ar-lib
index 0baa4f6..f64465e 100755
--- a/lib/ar-lib
+++ b/lib/ar-lib
@@ -2,9 +2,9 @@
 # Wrapper for Microsoft lib.exe
 
 me=ar-lib
-scriptversion=2012-03-01.08; # UTC
+scriptversion=2019-07-04.01; # UTC
 
-# Copyright (C) 2010-2018 Free Software Foundation, Inc.
+# Copyright (C) 2010-2019 Free Software Foundation, Inc.
 # Written by Peter Rosin <[email protected]>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -224,10 +224,11 @@ elif test -n "$extract"; then
       esac
     done
   else
-    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
-    do
-      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
-    done
+    $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \
+      | while read member
+        do
+          $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+        done
   fi
 
 elif test -n "$quick$replace"; then
-- 
2.7.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.