Re: Rebase of the pr-msvc-support branch?

2009-01-13 Thread Peter Rosin

Den 2009-01-09 14:23 skrev Eric Blake:

According to Peter Rosin on 1/9/2009 3:11 AM:

I don't have gnulib-tool, which is mentioned in that file, how do I get
hold of that tool (for cygwin)?


Here's how to get a shallow gnulib clone, then build git-merge-changelog:


*snip*

Great, thanks, works like a charm!


Hmm, is it allowed for ChangeLog entries to not be in chronological
order? Or should I redate them when I rebase?


That point is a bit fuzzy; personally, I'm okay with preserving the date
that a patch was written, but ordering the changelog in the order patches
were applied (so dates are out of order), but rewriting the entries to
have the date of the merge is also probably acceptable.


Ok, went with keeping the dates the patches were applied to the old
branch.

I'm doing the rebase now, thanks for the help.

Cheers,
Peter




Re: [SCM] GNU Libtool branch, pr-msvc-support, created. v2.2.6-79-g951d283

2009-01-13 Thread Peter Rosin

Den 2009-01-13 10:12 skrev Peter Rosin:

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, pr-msvc-support has been created
at  951d28316f365a0e17ae44dc076877da620f3ce8 (commit)


I will reply to this message with four rebased patches that are pending.

skip-on-no-reload.patch
http://lists.gnu.org/archive/html/libtool-patches/2008-09/msg1.html
msvc-documentation.patch
http://lists.gnu.org/archive/html/libtool-patches/2008-08/msg00136.html
embed-manifest-exeext.patch
http://lists.gnu.org/archive/html/libtool-patches/2008-09/msg0.html
libtool-ar.patch
http://lists.gnu.org/archive/html/libtool-patches/2008-09/msg3.html

Cheers,
Peter




Documentation for new variables in MSVC port.

2009-01-13 Thread Peter Rosin

Den 2009-01-13 10:39 skrev Peter Rosin:

msvc-documentation.patch
http://lists.gnu.org/archive/html/libtool-patches/2008-08/msg00136.html


2008-08-31  Peter Rosin  

* doc/libtool.texi (libtool script contents): Document
new variables introduced by the MSVC port.

diff --git a/doc/libtool.texi b/doc/libtool.texi
index 1782811..5c46ece 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -5530,6 +5530,23 @@ are used within @code{ltmain.sh} (@pxref{Configuring}):
 The name of the system library archiver.
 @end defvar
 
+...@defvar AR_FLAGS
+Flags to create an archive.
+...@end defvar
+
+...@defvar AR_TFLAGS
+Flags to list archive content.
+...@end defvar
+
+...@defvar AR_XFLAGS
+Flags to extract files (or a single file, see @var{ar_extract_one_by_one})
+from an archive.
+...@end defvar
+
+...@defvar AR_SEP
+Separator between @var{AR} flags (e.g. @var{AR_TFLAGS}) and @var{AR} files.
+...@end defvar
+
 @defvar CC
 The name of the compiler used to configure libtool.  This will always
 contain the compiler for the current language (@pxref{Tags}).
@@ -5595,6 +5612,13 @@ using @var{export_symbols_cmds} before linking an 
archive.
 Set to @samp{yes} or @samp{no}.  Default is @samp{no}.
 @end defvar
 
+...@defvar ar_extract_one_by_one
+Extract archive members one by one as listed by @var{AR} using the
+option @var{AR_TFLAGS} in case the archiver does not support
+extracting all archive members with the @var{AR_XFLAGS} option.
+Normally @samp{no}, enable with @samp{yes}.
+...@end defvar
+
 @defvar archive_cmds
 @defvarx archive_expsym_cmds
 @defvarx old_archive_cmds
@@ -5620,6 +5644,10 @@ these commands, libtool will proceed to link against 
@var{$objdir/$newlib}
 instead of @var{soname}.
 @end defvar
 
+...@defvar archiver_list_spec
+How to feed a file listing to the archiver.
+...@end defvar
+
 @defvar build
 @defvarx build_alias
 @defvarx build_os
@@ -5637,6 +5665,11 @@ Whether libtool should build static libraries on this 
system.  Set to
 @samp{yes} or @samp{no}.
 @end defvar
 
+...@defvar compile_tag
+Add tag specific option for the compiler. Normally disabled (i.e.
+...@var{compile_tag} is empty).
+...@end defvar
+
 @defvar compiler_c_o
 Whether the compiler supports the @option{-c} and @option{-o} options
 simultaneously.  Set to @samp{yes} or @samp{no}.
@@ -5649,6 +5682,26 @@ convenience archives or a set of object file names can 
be passed via
 linker-specific options or linker scripts.
 @end defvar
 
+...@defvar dashL_envvar
+When linking, move all paths specified with @option{-L} options to
+this variable, for toolchains where it makes sense to pass the library
+search paths in an environment variable. Normally disabled (i.e.
+...@var{dashl_envvar} empty).
+...@end defvar
+
+...@defvar dashL_envvar_spec
+When moving library search paths with @var{dashL_envvar}, prepend this
+to each @option{-L} path that is added to @var{dashL_envvar}. Unused
+if @var{dashL_envvar} is empty.
+...@end defvar
+
+...@defvar dashl_xform
+...@code{sed} expression for transforming -l options for the linker. The
+input to the @code{sed} instance is the original argument to the
+...@option{-l} option, the output is fed as an arguments to the linker.
+Normally disabled (i.e. @var{dashl_xform} empty).
+...@end defvar
+
 @defvar dlopen_support
 Whether @code{dlopen} is supported on the platform.
 Set to @samp{yes} or @samp{no}.
@@ -5708,6 +5761,16 @@ and relinking at install time is triggered.  This also 
means that @var{DESTDIR}
 installation does not work as expected.
 @end defvar
 
+...@defvar file_magic_glob
+How to find potential files when @var{deplibs_check_method} is
+...@samp{file_magic}. @var{file_magic_glob} is a @code{sed} expression,
+and the @code{sed} instance is fed potential files, that is
+transformed by the @var{file_magic_glob} expression. Useful when the
+shell does not support the shell option @code{nocaseglob}, making
+...@var{want_nocaseglob} inappropriate. Normally disabled (i.e.
+...@var{file_magic_glob} empty).
+...@end defvar
+
 @defvar finish_cmds
 Commands to tell the dynamic linker how to find shared libraries in a
 specific directory.
@@ -5874,6 +5937,10 @@ Whether files must be locked to prevent conflicts when 
compiling
 simultaneously.  Set to @samp{yes} or @samp{no}.
 @end defvar
 
+...@defvar nm_file_list_spec
+Specify filename containing input files for @var{NM}.
+...@end defvar
+
 @defvar no_builtin_flag
 Compiler flag to disable builtin functions that conflict with declaring
 external global symbols as @code{char}.
@@ -5907,6 +5974,15 @@ Commands run after installing a shared or static 
library, respectively.
 Commands run after uninstalling a shared or static library, respectively.
 @end defvar
 
+...@defvar postlink_cmds
+Commands necessary for finishing linking programs. @var{postlink_cmds}
+are executed immediately after the program is linked. Any occurance of
+the string @code{@@OUTPUT@@} in @var{postlink_cmds} is replaced by the
+name of the created executable (i.e. 

Handle -o w/ and w/o $EXEEXT during manifest embedding

2009-01-13 Thread Peter Rosin

Den 2009-01-13 10:39 skrev Peter Rosin:

embed-manifest-exeext.patch
http://lists.gnu.org/archive/html/libtool-patches/2008-09/msg0.html


2008-09-01  Peter Rosin  

* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS)
[ cygwin, mingw, cegcc ] : @OUTPUT@ may or may not
include a trailing $EXEEXT. If mt fails, make sure libtool
exits with an error.
(_LT_LANG_CXX_CONFIG): Likewise.
* tests/exeext.at: New. Make sure linking with both -o prog
and -o prog$EXEEXT works.
* Makefile.am: Add previous test to testsuite.

>From c1bf926bf5a79b77328f82bb2d88c964f609a6f7 Mon Sep 17 00:00:00 2001
From: Peter Rosin 
Date: Mon, 3 Apr 1995 04:10:00 +0200
Subject: [PATCH] patch embed-manifest-exeext.patch

---
 Makefile.am   |1 +
 libltdl/m4/libtool.m4 |   22 ++-
 tests/exeext.at   |   53 +
 3 files changed, 70 insertions(+), 6 deletions(-)
 create mode 100644 tests/exeext.at

diff --git a/Makefile.am b/Makefile.am
index e70cd38..1049289 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -465,6 +465,7 @@ TESTSUITE_AT= tests/testsuite.at \
  tests/search-path.at \
  tests/indirect_deps.at \
  tests/archive-in-archive.at \
+ tests/exeext.at \
  tests/execute-mode.at \
  tests/infer-tag.at \
  tests/localization.at \
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index a8f20f0..a9f9035 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -4824,9 +4824,14 @@ _LT_EOF
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
_LT_TAGVAR(compile_tag, $1)=-TC
_LT_TAGVAR(dashl_xform, $1)='s/\(.*\)/\1.lib/'
-   _LT_TAGVAR(postlink_cmds, $1)='if test -e "@out...@.exe.manifest"; then
-   mt -manifest "@out...@.exe.manifest" -outputresource:"@out...@.exe";
-   $RM "@out...@.exe.manifest";
+   _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ case "$lt_outputfile" in
+   *.[[eE][xX][eE]]) ;;
+   *) lt_outputfile="$lt_outputfile.exe" ;;
+ esac~
+ if test -e "$lt_outputfile.manifest"; then
+   mt -manifest "$lt_outputfile.manifest" 
-outputresource:"$lt_outputfile" || exit 1;
+   $RM "$lt_outputfile.manifest";
  fi'
;;
   *)
@@ -5821,9 +5826,14 @@ if test "$_lt_caught_CXX_error" != yes; then
  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
  _LT_TAGVAR(compile_tag, $1)=-TP
  _LT_TAGVAR(dashl_xform, $1)='s/\(.*\)/\1.lib/'
- _LT_TAGVAR(postlink_cmds, $1)='if test -e "@out...@.exe.manifest"; 
then
- mt -manifest "@out...@.exe.manifest" 
-outputresource:"@out...@.exe";
- $RM "@out...@.exe.manifest";
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+   case "$lt_outputfile" in
+ *.[[eE][xX][eE]]) ;;
+ *) lt_outputfile="$lt_outputfile.exe" ;;
+   esac~
+   if test -e "$lt_outputfile.manifest"; then
+ mt -manifest "$lt_outputfile.manifest" 
-outputresource:"$lt_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
fi'
  ;;
*)
diff --git a/tests/exeext.at b/tests/exeext.at
new file mode 100644
index 000..30a9e4f
--- /dev/null
+++ b/tests/exeext.at
@@ -0,0 +1,53 @@
+# exeext.at -- ensure that exeext handling works  -*- Autotest -*-
+#
+#   Copyright (C) 2008 Free Software Foundation, Inc.
+#   Written by Peter Rosin, 2008
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+
+AT_SETUP([both of -o prog and -o prog$EXEEXT work])
+AT_KEYWORDS([libtool])
+
+AT_CHECK([test -n "$EXEEXT" || exit 77])
+
+bin=`pwd`/bin
+binext=`pwd`/binext
+mkdir src $bin srcext $binext
+
+AT_DATA(src/prog.c,
+[[
+int main(void) { return 0; }
+]])
+
+$CC $CPPFLAGS $CFLAGS -c src/prog.c -o src/prog.$OBJEXT
+
+AT_CHECK($LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o src/prog 
src/prog.$OBJEXT,
+[0], [ignore], [ignore])
+AT_CHECK($LIBTOOL --mode=link $CC $CFLAGS $LDFLA

Archiver handling

2009-01-13 Thread Peter Rosin

Den 2009-01-13 10:39 skrev Peter Rosin:

libtool-ar.patch
http://lists.gnu.org/archive/html/libtool-patches/2008-09/msg3.html


No ChangeLog entry written yet.

Sorry 'bout that...

Cheers,
Peter
>From e71c3c45eccb25dd2601dfc51b2b86c24bc03cd6 Mon Sep 17 00:00:00 2001
From: Peter Rosin 
Date: Thu, 8 Nov 1984 10:20:00 +0200
Subject: [PATCH] patch libtool-ar.patch

---
 Makefile.am |3 +-
 doc/libtool.texi|   73 ++-
 libltdl/config/ltmain.m4sh  |   69 
 libltdl/m4/libtool.m4   |   16 -
 tests/archive-in-archive.at |5 +--
 5 files changed, 159 insertions(+), 7 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1049289..334bc97 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -476,7 +476,8 @@ EXTRA_DIST += $(srcdir)/$(TESTSUITE) $(TESTSUITE_AT) 
$(srcdir)/tests/package
 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
-   AR="$(AR)" AR_FLAGS="${AR_FLAGS}" AR_SEP="${AR_SEP}" \
+   AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
+   LT_AR="$(LT_AR)" LT_ARFLAGS="$(LT_ARFLAGS)" \
STRIP="$(STRIP)" INSTALL="$(INSTALL)" \
OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 5c46ece..344e37a 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -127,6 +127,7 @@ Invoking @code{libtool}
 * Finish mode:: Completing a library installation.
 * Uninstall mode::  Removing installed executables and libraries.
 * Clean mode::  Removing uninstalled executables and libraries.
+* Archive mode::Portably handle archives.
 
 Integrating libtool with your package
 
@@ -1217,6 +1218,7 @@ by programs libtool invokes, rather than libtool itself.
 * Finish mode:: Completing a library installation.
 * Uninstall mode::  Removing installed executables and libraries.
 * Clean mode::  Removing uninstalled executables and libraries.
+* Archive mode::Portably handle archives.
 @end menu
 
 @node Compile mode
@@ -1620,6 +1622,64 @@ files (typically @command{/bin/rm}).
 The remaining @var{mode-args} are either flags for the deletion program
 (beginning with a @samp{-}), or the names of files to delete.
 
+...@node Archive mode
+...@section Archive mode
+...@cindex archive mode
+...@cindex mode, archive
+
+...@dfn{archive} mode lets you handle archives portably on systems where
+the archiver is weird. As an example, the Microsoft LIB.EXE archiver
+expects @command{lib -OUT:example.lib some.obj objects.obj}, which is
+impossible to fit into the variables @var{AR} and @var{AR_FLAGS} (note
+that there is no space between @samp{-OUT:} and @file{example.lib}).
+Also, many expect to be able to extract archives with @command{$AR x}
+and list archive content with @command{$AR t}. Again using Microsoft
+LIB.EXE as an example, archive extraction and listing do not always
+work like that (@command{lib -EXTRACT:example.lib} and
+...@command{lib -LIST example.lib} respectively, note the absent colon
+in the listing command).
+
+Libtool presents the archiver with a limited but common interface
+
+...@var{mode-args} consist of an archiver command, an archive to operate
+on and possibly a set of object files.
+
+The possible archiver command are
+
+...@table @option
+...@item cru @file{archive-file} @file{object-fi...@dots{}
+Creates an archive.
+
+...@example
+ms$ @kbd{libtool --mode=ar cru example.lib some.obj objects.obj}
+libtool: ar: lib -NOLOGO -OUT:example.lib  some.obj objects.obj
+ms$
+...@end example
+
+...@item x @file{archive-file}
+Extracts an archive.
+
+...@example
+ms$ @kbd{libtool --mode=ar x example.lib}
+libtool: ar: (cd . && lib -NOLOGO -EXTRACT:some.obj "example.lib")
+libtool: ar: (cd . && lib -NOLOGO -EXTRACT:objects.obj "example.lib")
+ms$
+...@end example
+
+...@item t @file{archive-file}
+Lists the contents of an archive. The libtool option @option{--quiet} is
+useful here, to avoid the first disgnostic line.
+
+...@example
+ms$ @kbd{libtool --mode=ar x example.lib}
+libtool: ar: lib -NOLOGO -LIST example.lib
+some.obj
+objects.obj
+ms$
+...@end example
+
+...@end table
+
 @node Integrating libtool
 @chapter Integrating libtool with your package
 
@@ -5487,7 +5547,7 @@ in cases where it is necessary.
 @node Archivers
 @subsection Archivers
 
-On all known systems, building a static library can be accomplished by
+On all sane systems, building a static library can be accomplished by
 running @kbd{ar cru l...@var{name}.a @var{obj1}.o @var{obj2}.o @dots{}},
 where the @samp{.a} file is the output library, and each @samp{.o} file is an
 object file.
@@ -5497,6 +5557,17 @@ must be used to ``bless'' the created libra

Reloadable objects do not work on MSVC, SKIP test.

2009-01-13 Thread Peter Rosin

Den 2009-01-13 10:39 skrev Peter Rosin:

skip-on-no-reload.patch
http://lists.gnu.org/archive/html/libtool-patches/2008-09/msg1.html


2008-08-31  Peter Rosin  

* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS)
[cygwin, mingw, pw32, cegcc] : Indicate that reloadable
objects does not work.
* tests/duplicate_conv.at: Skip last test if reloadable
objects does not work.
* doc/libtool.texi (libtool script contents): Document how to
indicate that reloadable objects do not work.


diff --git a/doc/libtool.texi b/doc/libtool.texi
index 7b6b3f5..1782811 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -5909,7 +5909,8 @@ Commands run after uninstalling a shared or static 
library, respectively.
 
 @defvar reload_cmds
 @defvarx reload_flag
-Commands to create a reloadable object.
+Commands to create a reloadable object. Set @var{reload_cmds} to
+...@samp{false} on systems that cannot create reloadable objects.
 @end defvar
 
 @defvar runpath_var
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index c32f099..a8f20f0 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3024,6 +3024,11 @@ case $reload_flag in
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+if test "$GCC" != yes; then
+  reload_cmds=false
+fi
+;;
   darwin*)
 if test "$GCC" = yes; then
   reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
diff --git a/tests/duplicate_conv.at b/tests/duplicate_conv.at
index ac5643b..be04005 100644
--- a/tests/duplicate_conv.at
+++ b/tests/duplicate_conv.at
@@ -25,6 +25,8 @@
 AT_SETUP([duplicate convenience archive names])
 AT_KEYWORDS([libtool])
 
+eval `$LIBTOOL --config | sed -n '/^reload_cmds=/,/^$/p'`
+
 # We create two convenience archives with the same name, and _also_
 # containing an object with the same name.  This is necessary to detect
 # the failure with both 1.5.22 and HEAD, since the latter does not (did
@@ -75,6 +77,8 @@ AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main 
main.$OBJEXT ./libce
 LT_AT_EXEC_CHECK([./main],[0],[ignore],[ignore])
 $LIBTOOL --mode=clean rm -f libcee.la
 
+AT_CHECK([test "x$reload_cmds" = xfalse && exit 77], [1])
+
 # Test whether this works with reloadable objects as well.
 AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o cee.$OBJEXT 
c.lo a/liba.la b/liba.la],
 [0], [ignore], [ignore])


Re: [PATCH] [cygwin|mingw] fix dlpreopen with --disable-static take 2

2009-01-13 Thread Charles Wilson
Peter Rosin wrote:
> Den 2009-01-06 02:06 skrev Charles Wilson:
>> Maybe under that name. But a libbfd-ified version of impgen (as a
>> replacement for the IMO totally broken -- but part of mingw-utils-0.3 --
>> reimp program), that happens to also supply an --identify 
>> --identify-ms functionality? Not so far-fetched.
> 
> Right, but it still seems as if this new fixed impgen tool is closer
> to MinGW than to MSYS proper. However, as you say, better ask on a better
> list...

After playing with this idea for a while, it made more sense actually to
separate the impgen2 functionality from the dllname stuff. It's not yet
ready for prime time (and I'm trying to keep it in sync with on-going
changes to dlltool in binutils HEAD), but I'll send my latest version of
 these new tools to you offlist.  They compile with both cygwin-gcc
(using libiberty and libbfd from 20080624), and with mingw-gcc-3.4.5
(not sure what binutils version I have; one of the more recent releases
from mingw/sourceforge I'm sure).

> Also, it will not fail for Vfw32.Lib, it will instead list the three
> dlls it imports (AVICAP32.dll, AVIFIL32.dll, MSVFW32.dll).
 Well, we probably want it to fail. 
> 
>>> So, for the sake of argument, I agree that it should fail. But then I
>>> think it should fail in libtool, not in the tool that digs out the
>>> dll name(s) from the import library. But that's a minor point...
>>
>> Well, see this and the following thread:
>> http://sourceware.org/ml/binutils/2008-11/msg00078.html
> 
> I'm only saying that from the "binutils p.o.v." it makes at least some
> sence to report all imported dlls. At least optionally, but again, this
> was just a minor point...

A new patch to binutils' dlltool was accepted that makes the following
changes to --identify:
  1) automatically determines -- and operates with -- MS-style or
binutils-style implibs
  2) by default, lists all imported DLLs
  3) new --identify-strict flag causes multiple imported DLLs to be
reported as an error
http://sourceware.org/ml/binutils/2009-01/msg00152.html

--
Chuck