Re: spaces (was: Provide a means to activate dynamically the debug traces)

2009-01-19 Thread Akim Demaille


Le 10 janv. 09 à 22:25, Ralf Wildenhues a écrit :


BTW, your editor seems to both reformat existing code, and use
different indenting strategy for new code.  Hmm.


Yeah, I know.  But fixing the indentation issues progressively does  
not

seem bad to me.  I certainly don't want these useless differences to
creep into my new code.


This implies that there is a single, well-defined ideal state.  Your
editor does not collapse 8 spaces to a TAB, mine (and some others)  
does.

This causes whitespace-only changes.  Very very minor, I agree, but
still a small irritation when reviewing.


I agree.


Maybe we should update HACKING
about the style we decide about?
(note this is really just bike shedding, and babbling)


I definitely think this would be a good idea.

I have worked for years with the same set up as you, using an much TAB  
as is possible.  But I read someday something that Jim wrote about  
this topic, in which he was advocating the no-tab approach, and I was  
convinced.  What changed my viewpoint was that (i) Jim is in favor of  
it, so it's good :)  and (ii) because he did point out that it makes  
it really easier to discuss about code in emails.  It is true that I  
have been disturbed and even annoyed by tab vs. space in some patches  
that gave the impression of improper indentation.


Therefore, for a year or so, I am now using spaces only.

Just to give my 0.02€ about this.

The following patch addresses space issues in libtoolize.  Some are  
benign, some are really dangerous because they invite some editors to  
break the code.  I speak from experience: I once broke Autoconf  
because of  ->  cleanup from my editor :(  I really  
recommend that this patch (or a variation thereof, maybe based on  
$lt_sp and $lt_tab) be applied, independently from whether the Libtool  
republic votes for tab or space for presidency, as tracking these  
issues is uneasy.


From 425171194b41e6627aae75f18dfa5620e8a8c34d Mon Sep 17 00:00:00 2001
From: Akim Demaille 
Date: Mon, 19 Jan 2009 09:05:31 +0100
Subject: [PATCH] Clean space uses.

* libtoolize.m4sh: Remove trailing spaces.
Use , as some editors remove "useless" spaces in
.
---
 libtoolize.m4sh |   32 
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 0eefa98..a3aa74d 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -182,7 +182,7 @@ all_pkgltdl_files="COPYING.LIB Makefile Makefile.in 
Makefile.inc Makefile.am REA
   --install|-i)opt_install=: ;;
 
   --ltdl)  opt_ltdl=:
-   if test "$#" -gt 0; then
+   if test "$#" -gt 0; then
  case $1 in
-*) ;;
*)  ltdldir=`$ECHO "$1" | $SED 's,/*$,,'`
@@ -195,7 +195,7 @@ all_pkgltdl_files="COPYING.LIB Makefile Makefile.in 
Makefile.inc Makefile.am REA
   --no-warn)   opt_warning=false ;;
 
   --nonrecursive|--non-recursive)
-   ltdl_mode=nonrecursive
+   ltdl_mode=nonrecursive
;;
 
   --quiet|--automake|-q) # --automake is for 1.5 compatibility
@@ -311,7 +311,7 @@ func_copy_cb ()
 copy_return_status=1
 
 # Libtool is probably misinstalled if this happens:
-test -f "$my_srcdir/$my_file" || 
+test -f "$my_srcdir/$my_file" ||
 func_fatal_error "\`$my_file' not found in \`$my_srcdir'"
 
 case $opt_verbose in
@@ -375,7 +375,7 @@ func_copy_some_files ()
 if test "X$my_copy_cb" = Xfunc_copy_cb; then
  $opt_force || if test -f "$my_destdir/$my_filename"; then
$opt_quiet || func_echo_once "$my_msg_var"
-   $opt_quiet \
+   $opt_quiet \
  || func_error "\`$my_destdir/$my_filename' exists: use \`--force' 
to overwrite"
continue
  fi
@@ -483,12 +483,12 @@ func_scan_files ()
 s,^.*AC_REQUIRE(.*$,,; s,^.*m4@&t...@_require(.*$,,;
s,^.*m4@&t...@_define(.*$,,
s,^.*A[CU]_DEFUN(.*$,,; s,^.*m4@&t...@_defun(.*$,,
-   /AC_CONFIG_AUX_DIR(/ {
-   s,^.*AC_CONFIG_AUX_DIR([[   ]*\([^])]*\).*$,ac_auxdir=\1,
+   /AC_CONFIG_AUX_DIR(/ {
+   s,^.*AC_CONFIG_AUX_DIR([[]*\([^])]*\).*$,ac_auxdir=\1,
p
 }
-   /AC_CONFIG_MACRO_DIR(/ {
-   s,^.*AC_CONFIG_MACRO_DIR([[ ]*\([^])]*\).*$,ac_macrodir=\1,
+   /AC_CONFIG_MACRO_DIR(/ {
+   s,^.*AC_CONFIG_MACRO_DIR([[  ]*\([^])]*\).*$,ac_macrodir=\1,
p
 }
/_LT_CONFIG_LTDL_DIR(/d
@@ -503,14 +503,14 @@ func_scan_files ()
}
/the.*option into.*LT_INIT.*parameter/d
/\@<:@LT_INIT/d
-   /LT_INIT/{
+   /LT_INIT/{
s,^.*$,seen_libtool=:,
p
}
/\@<:@LTDL_INIT/d
/LTDL_INIT/  {
-   s,^.*LTDL_INIT([[   ]*\([^])]*\).*$,ltdl_options="\1",
-

Re: Provide a means to activate dynamically the debug traces

2009-01-19 Thread Akim Demaille


Le 14 janv. 09 à 11:16, Akim Demaille a écrit :


Le 10 janv. 09 à 22:25, Ralf Wildenhues a écrit :

So what do you recommend to store persistent information?  A  
function

that returns some static variable (sort of a singleton)?  Or an
additional argument everywhere (gee...).  Maybe I can do it using
advices to hand over the verbosity flags, but that does sound like a
nuisance for the API.


A lt_dlget* and a lt_dlset* function, if the user needs to be able to
provide a type.  Don't provide the user with a direct pointer if you
don't have to.

Note that I didn't say global variables are bad, although they are
obviously bad, too, for two reasons: slow access, and, well,  
globality.

Assume that you write a library that uses ltdl internally, and I use
your library in a program that also links against a completely  
different
library that also uses ltdl.  You'll most likely not want  
interference.

Well, in your case I'm not so sure.  But if not, then adding a module
loading advisor to change verbosity would seem appropriate.


I thought about this, and I think that the best option would be to  
have a callback function with  a signature more or less like:


void log(void* user_data, level_type level, const char* format, ...);


Here is my proposal.

There are a few issues on which I'd be happy to have feedback:

- I discovered slist only afterwards, and I did not convert
  my code to use it.  I believe it would bring nothing useful,
  because we really need no specific features here.  Using
  slist would probably require more auxiliary structures and
  routines.  But I can understand the advantages of reusing
  slist.

- This interface is not convenient for messages that are forged
  in several pieces (first "%s", and then "%s\n").  syslog does
  not support them, so maybe I should just always require the log
  message to be a \n-ending line?  It is annoying for
  lt_dlloader_dump.  Maybe in this case I should forge a dynamic
  string first, and log it afterwards, instead of logging several
  lines.

- I have not decided what LEVELs should be.  We could use
  syslog's values.  No strong opinion here.  Or a bitfield?

- I have to address stdarg portability, doc, tests, NEWS etc.

From 031d93cd5e851668bbb8a005273abad32903b88e Mon Sep 17 00:00:00 2001
From: Akim Demaille 
Date: Fri, 9 Jan 2009 14:38:13 +0100
Subject: [PATCH] Provide support for user logging functions.

* libltdl/libltdl/lt__debug.h, libltdl/lt__debug.c: New.
* libltdl/Makefile.inc, libtoolize.m4sh: Compile/ship/install them.
* libltdl/libltdl/lt__private.h: Include lt__debug.h.
(lt__log_list): New.
* libltdl/libltdl/lt_system.h: Include stdarg.h.
* libltdl/ltdl.h (LT_LOG, LT_LOG0, LT_LOG1, LT_LOG2)
(LT_NONNULL, LT_NAME): New.
* libltdl/ltdl.c, libltdl/lt_dlloader.c: Use them.
* libltdl/lt_dlloader.c (loader_dump_callback): Issue a full
line.
(lt_dlloader_dump): Issue full lines.
* tests/libtoolize.at: Adjust expected libtoolize output.
---
 libltdl/Makefile.inc  |4 +-
 libltdl/libltdl/lt__debug.h   |   63 
 libltdl/libltdl/lt__private.h |   13 +-
 libltdl/libltdl/lt_system.h   |3 +-
 libltdl/lt__debug.c   |  105 +
 libltdl/lt_dlloader.c |   15 ++
 libltdl/ltdl.c|   59 ++-
 libltdl/ltdl.h|   23 -
 libtoolize.m4sh   |5 +-
 tests/libtoolize.at   |   12 -
 10 files changed, 260 insertions(+), 42 deletions(-)
 create mode 100644 libltdl/libltdl/lt__debug.h
 create mode 100644 libltdl/lt__debug.c

diff --git a/libltdl/Makefile.inc b/libltdl/Makefile.inc
index 0cd982d..7ace644 100644
--- a/libltdl/Makefile.inc
+++ b/libltdl/Makefile.inc
@@ -1,6 +1,6 @@
 ## Makefile.inc -- includable Makefile.am snippet
 ##
-##   Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+##   Copyright (C) 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
 ##   Written by Gary V. Vaughan, 2003
 ##
 ##   NOTE: The canonical source of this file is maintained with the
@@ -54,6 +54,7 @@ noinst_LTLIBRARIES += libltdl/libltdlc.la
 endif
 
 libltdl_libltdl_la_SOURCES = libltdl/libltdl/lt__alloc.h \
+ libltdl/libltdl/lt__debug.h \
  libltdl/libltdl/lt__dirent.h \
  libltdl/libltdl/lt__glibc.h \
  libltdl/libltdl/lt__private.h \
@@ -64,6 +65,7 @@ libltdl_libltdl_la_SOURCES = libltdl/libltdl/lt__alloc.h \
  libltdl/libltdl/slist.h \
  libltdl/loaders/preopen.c \
  libltdl/lt__alloc.c \
+ libltdl/lt__debug.c \
  libltdl/lt_dlloader.c \
  libltdl/lt_error.c \
  libltdl/ltdl.c \
diff --git a/libltdl/libltdl/lt_

Re: [PATCH] GNU/kOpenSolaris port

2009-01-19 Thread Robert Millan

Hi,

"kopensolaris-gnu" was accepted in GNU config.  I adjusted my patch to use
that, see attachment.

Can it be included now?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
2009-01-19  Robert Millan  

	* libltdl/m4/libtool.m4: Recognize GNU/kOpenSolaris
	(kopensolaris*-gnu).
	* libltdl/m4/ltdl.m4: Likewise.

index b7b566d..c8dfa77 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2380,7 +2380,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -3014,7 +3014,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3635,7 +3635,7 @@ m4_if([$1], [CXX], [
 	;;
 	esac
 	;;
-  linux* | k*bsd*-gnu)
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
 	case $cc_basename in
 	  KCC*)
 	# KAI C++ Compiler
@@ -3919,7 +3919,7 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
   ;;
 
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   case $cc_basename in
   # old Intel for x86_64 which still supported -KPIC.
   ecc*)
@@ -4300,7 +4300,7 @@ _LT_EOF
   _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
   ;;
 
-gnu* | linux* | tpf* | k*bsd*-gnu)
+gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
   tmp_diet=no
   if test "$host_os" = linux-dietlibc; then
 	case $cc_basename in
@@ -5792,7 +5792,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 _LT_TAGVAR(inherit_rpath, $1)=yes
 ;;
 
-  linux* | k*bsd*-gnu)
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
 case $cc_basename in
   KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
index a2b1a4e..2dbefed 100644
--- a/libltdl/m4/ltdl.m4
+++ b/libltdl/m4/ltdl.m4
@@ -468,7 +468,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
   freebsd* | dragonfly*)
 lt_cv_sys_dlopen_deplibs=yes
 ;;
-  gnu* | linux* | k*bsd*-gnu)
+  gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
 # GNU and its variants, using gnu ld.so (Glibc)
 lt_cv_sys_dlopen_deplibs=yes
 ;;


Re: spaces (was: Provide a means to activate dynamically the debug traces)

2009-01-19 Thread Bob Friesenhahn

On Mon, 19 Jan 2009, Akim Demaille wrote:

I have worked for years with the same set up as you, using an much TAB as is 
possible.  But I read someday something that Jim wrote about this topic, in 
which he was advocating the no-tab approach, and I was convinced.  What 
changed my viewpoint was that (i) Jim is in favor of it, so it's good :)  and 
(ii) because he did point out that it makes it really easier to discuss about 
code in emails.  It is true that I have been disturbed and even annoyed by 
tab vs. space in some patches that gave the impression of improper 
indentation.


Therefore, for a year or so, I am now using spaces only.


It is not necessary to use hard tabs.  They are a form of text 
compression which originated with anchient character terminals and 
typewriters.  Since many/most people have a habit of changing the 
meaning of TAB to something other than the standard 8 spaces, TAB 
causes a lot of formatting problems if TAB is used in conjunction with 
spaces.  Text editors have a very hard time agreeing on how to treat 
TAB and so when TAB is used, the text only appears correct for the 
person who wrote it.  For many years I have had my editor configured 
to always use spaces.  This ensures WYSIWYG for everyone involved.


Bob
==
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/





Re: Unify line endings in localization test

2009-01-19 Thread Ralf Wildenhues
Hi Peter,

* Peter Rosin wrote on Sat, Jan 17, 2009 at 12:42:34AM CET:
> In the localization test, the output of the compiler is compared
> with the grepped output of the compiler when run through libtool.
>
> MSVC outputs its messages with \r\n, but the grep in the above
> strips that down to just \n on MSYS. So, when the output is
> diffed, there is a test failure.

Ah.

> Ok to push? Or should I just push it to the pr-msvc-support branch
> for now?

I think we shouldn't be constantly rebasing pr-msvc-support.  I think
instead when we can't decide soonish whether to merge it into master or
to redo it (because it would need largish redoing), then you should just
merge from master into the branch in order to keep it up to date.

> 2009-01-17  Peter Rosin  
>
>   Unify line endings in localization test.
>   * tests/localization.at: Process both the expected output and
>   the libtool output in the same manner in order to eliminate
>   line ending differences. Fixes the test on MSYS/MSVC.

This looks a bit hackish.  We already have a handful of places which we
fixed up in order to avoid line ending issues.  This one looks hackish
enough to deserve being wrapped in a macro (in testsuite.at, below
LT_AT_HOST_DATA?), so that future instances of this issue can easily be
handled likewise.

> --- a/tests/localization.at
> +++ b/tests/localization.at
> @@ -43,7 +43,7 @@ AT_CHECK([$CC $CPPFLAGS $CFLAGS -c b.c || exit 77], [], 
> [stdout], [stderr])
>  
>  # Find out about expected output.
>  AT_CHECK([$CC $CPPFLAGS $CFLAGS -c a.c || exit 1], [1], [stdout], [stderr])
> -mv -f stdout expected-stdout
> +grep -v thisisprobablynotmatching stdout > expected-stdout
>  mv -f stderr expected-stderr

Why only stdout and not stderr?

>  AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c a.c || 
> exit 1],
>[1], [stdout], [stderr])

Thanks,
Ralf




happy late new year

2009-01-19 Thread Ralf Wildenhues
Pushed to master, sorry for the long delay.

The long line in ltmain.m4sh is actually necessary in order for
  libtool --version

to work correctly.  Will address in a followup patch.

Cheers,
Ralf

Bump copyright years.

* ChangeLog.2008: New, rotated from ...
* ChangeLog: ... here.
* Makefile.am (EXTRA_DIST): Add ChangeLog.2008.
* NEWS, libltdl/config/ltmain.m4sh: Bump copyright years.
* libltdl/m4/libtool.m4 (_LT_COPYING, LT_OUTPUT): Likewise.
* libtoolize.m4sh: Likewise.

diff --git a/Makefile.am b/Makefile.am
index 86224e1..790 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 ## Makefile.am -- Process this file with automake to produce Makefile.in
 ##
-##   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008  Free Software
-##   Foundation, Inc.
+##   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free
+##   Software Foundation, Inc.
 ##   Written by Gary V. Vaughan, 2003
 ##
 ##   This file is part of GNU Libtool.
@@ -145,7 +145,8 @@ EXTRA_DIST += bootstrap $(srcdir)/libtoolize.in 
$(auxdir)/ltmain.m4sh \
  ChangeLog.1996 ChangeLog.1997 ChangeLog.1998 \
  ChangeLog.1999 ChangeLog.2000 ChangeLog.2001 \
  ChangeLog.2002 ChangeLog.2003 ChangeLog.2004 \
- ChangeLog.2005 ChangeLog.2006 ChangeLog.2007
+ ChangeLog.2005 ChangeLog.2006 ChangeLog.2007 \
+ ChangeLog.2008
 CLEANFILES += libtool libtoolize libtoolize.tmp \
  $(auxdir)/ltmain.tmp $(m4dir)/ltversion.tmp
 
diff --git a/NEWS b/NEWS
index 9550e5b..00bd1bb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 NEWS - list of user-visible changes between releases of GNU Libtool
 
-New in 2.2.8 2008-??-??: git version 2.2.7a, Libtool team:
+New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
 
 * New features:
 
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 20ca07b..6be529a 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -4,8 +4,7 @@ m4_divert_push([SCRIPT])# @configure_input@
 # libtool (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
 # Written by Gordon Matzigkeit , 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 
2007, 2008, 2009 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index b7b566d..def0bba 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1,7 +1,7 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -10,7 +10,7 @@
 
 m4_define([_LT_COPYING], [dnl
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -632,7 +632,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME 
])config.lt[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
 configured by $[0], generated by m4_PACKAGE_STRING.
 
-Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2009 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 941ad85..8096440 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -5,7 +5,7 @@ AS_INIT[]m4_divert_push([HEADER-COPYRIGHT])dnl
 # libtoolize (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
 # Written by Gary V. Vaughan , 2003
 
-# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, 
Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software 
Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 




[PATCH] func_version copes with multi-line copyright headers.

2009-01-19 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Mon, Jan 19, 2009 at 09:40:20PM CET:
> The long line in ltmain.m4sh is actually necessary in order for
>   libtool --version
> 
> to work correctly.  Will address in a followup patch.

OK to push?

Thanks,
Ralf

func_version copes with multi-line copyright headers.

* libltdl/config/getopt.m4sh (func_version): Slurp in copyright
lines until a period is found.
* libltdl/config/ltmain.m4sh: Multi-line copyright is ok to use
now.
* tests/help.at (standard command line options): New file, new
tests.  Make this test group the first one for libtool tests,
moving the banner ...
* tests/duplicate_members.at: ... from here.
* Makefile.am (TESTSUITE_AT): Add tests/help.at.

diff --git a/Makefile.am b/Makefile.am
index 73135f5..f9c4f92 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -451,6 +451,7 @@ dist-hook:
 TESTSUITE  = tests/testsuite
 TESTSUITE_AT   = tests/testsuite.at \
  tests/libtoolize.at \
+ tests/help.at \
  tests/duplicate_members.at \
  tests/duplicate_conv.at \
  tests/duplicate_deps.at \
diff --git a/libltdl/config/getopt.m4sh b/libltdl/config/getopt.m4sh
index 8cf99de..5f20320 100644
--- a/libltdl/config/getopt.m4sh
+++ b/libltdl/config/getopt.m4sh
@@ -1,6 +1,7 @@
 m4_if([getopt.m4sh -- getopt helper functions   -*- Autoconf -*-
 
-   Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+   Foundation, Inc.
Written by Gary V. Vaughan, 2004
 
This file is part of GNU Cvs-utils.
@@ -35,7 +36,15 @@ M4SH_VERBATIM([[
 # Echo version message to standard output and exit.
 func_version ()
 {
-$SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+$SED -n '/(C)/!b go
+   :more
+   /\./! {
+ N
+ s/\n# //
+ b more
+   }
+   :go
+   /^# '$PROGRAM' (GNU /,/# warranty; / {
 s/^# //
s/^# *$//
 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index a45d755..7e59338 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -4,7 +4,8 @@ m4_divert_push([SCRIPT])# @configure_input@
 # libtool (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
 # Written by Gordon Matzigkeit , 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 
2007, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
diff --git a/tests/duplicate_members.at b/tests/duplicate_members.at
index afa9d20..657e307 100755
--- a/tests/duplicate_members.at
+++ b/tests/duplicate_members.at
@@ -1,6 +1,6 @@
 # duplicate_members.at -- duplicate members in archive tests  -*- Autotest -*-
 
-#   Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
 #   Written by Alexandre Oliva & Peter O'Gorman, 2005
 #
 #   This file is part of GNU Libtool.
@@ -22,7 +22,6 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 
-AT_BANNER([Testing libtool functions.])
 AT_SETUP([duplicate members in archive tests])
 AT_KEYWORDS([libtool])
 
diff --git a/tests/help.at b/tests/help.at
new file mode 100644
index 000..f0e7e94
--- /dev/null
+++ b/tests/help.at
@@ -0,0 +1,38 @@
+# help.at -- standard command line options  -*- Autotest -*-
+#
+#   Copyright (C) 2009 Free Software Foundation, Inc.
+#
+#   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_BANNER([Testing libtool functions.])
+
+AT_SETUP([standard command line options])
+AT_KEYWORDS([libtool])
+AT_KEYWORDS([libtoolize])
+
+AT_CHECK([$LIBTOOLIZE --help], [], [ignore])
+AT_CHECK([$LIBTOOLIZE --version], [], [stdout])
+AT_CHECK([grep 'Copyright.*Free Software Foundation' stdout], [], [ignore])
+AT_CHECK([$LIBTOOL --he

Re: use $EXEEXT consistently in new testsuite

2009-01-19 Thread Ralf Wildenhues
Hi Roumen,

* Roumen Petrov wrote on Sun, Jan 04, 2009 at 02:56:54PM CET:
> --- a/tests/convenience.at
> +++ b/tests/convenience.at
> @@ -263,7 +263,7 @@ EOF
># libgcj.spec or unable to find it.  Skip this test for them.
>if test $i -eq 1; then
>  AT_CHECK([$GCJ $GCJFLAGS -c foo1.java || exit 77], [], [ignore], 
> [ignore])
> -AT_CHECK([$GCJ $GCJFLAGS --main=foo1 -o foo1 foo1.java A1.java || exit 
> 77],[],[ignore],[ignore])
> +AT_CHECK([$GCJ $GCJFLAGS --main=foo1 -o foo1$EXEEXT foo1.java A1.java || 
> exit 77],[],[ignore],[ignore])
>  AT_CHECK([./foo1$EXEEXT || exit 77],[],[ignore],[ignore])
>  rm -f foo1.o foo1.obj foo1$EXEEXT
>fi

Thanks for the patch, and sorry for the delay.  Pushed.

Cheers,
Ralf

2009-01-19  Roumen Petrov(tiny change)

Add missing $EXEEXT to java test.
* tests/convenience.at (Java convenience archives): Add $EXEEXT.

diff --git a/tests/convenience.at b/tests/convenience.at
index 995c8ff..339c59a 100644
--- a/tests/convenience.at
+++ b/tests/convenience.at
@@ -1,6 +1,6 @@
 # convenience.at -- testing C convenience archives-*- Autotest -*-
 
-#   Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
 #   Written by Ralf Wildenhues, 2005
 #
 #   This file is part of GNU Libtool.
@@ -263,7 +263,7 @@ EOF
   # libgcj.spec or unable to find it.  Skip this test for them.
   if test $i -eq 1; then
 AT_CHECK([$GCJ $GCJFLAGS -c foo1.java || exit 77], [], [ignore], [ignore])
-AT_CHECK([$GCJ $GCJFLAGS --main=foo1 -o foo1 foo1.java A1.java || exit 
77],[],[ignore],[ignore])
+AT_CHECK([$GCJ $GCJFLAGS --main=foo1 -o foo1$EXEEXT foo1.java A1.java || 
exit 77],[],[ignore],[ignore])
 AT_CHECK([./foo1$EXEEXT || exit 77],[],[ignore],[ignore])
 rm -f foo1.o foo1.obj foo1$EXEEXT
   fi




Re: Unify line endings in localization test

2009-01-19 Thread Peter Rosin

Hi Ralf,

Den 2009-01-19 21:35 skrev Ralf Wildenhues:

Ok to push? Or should I just push it to the pr-msvc-support branch
for now?


I think we shouldn't be constantly rebasing pr-msvc-support.  I think
instead when we can't decide soonish whether to merge it into master or
to redo it (because it would need largish redoing), then you should just
merge from master into the branch in order to keep it up to date.


I had no plan to rebase anything, what I was suggesting was to maybe
push it to the branch now (if it wasn't clear that it was safe for
master), then when someone said "ok", I could cherry-pick it into
master.

(But the last four patches on the branch are not very pretty, dates
are all messed up, no Changelog entries, crappy commit msgs etc etc.
Those should be merged with care.)


2009-01-17  Peter Rosin  

Unify line endings in localization test.
* tests/localization.at: Process both the expected output and
the libtool output in the same manner in order to eliminate
line ending differences. Fixes the test on MSYS/MSVC.


This looks a bit hackish.  We already have a handful of places which we
fixed up in order to avoid line ending issues.  This one looks hackish
enough to deserve being wrapped in a macro (in testsuite.at, below
LT_AT_HOST_DATA?), so that future instances of this issue can easily be
handled likewise.


Ok, I'll have a look writing some output unification macro.


--- a/tests/localization.at
+++ b/tests/localization.at
@@ -43,7 +43,7 @@ AT_CHECK([$CC $CPPFLAGS $CFLAGS -c b.c || exit 77], [], 
[stdout], [stderr])
 
 # Find out about expected output.

 AT_CHECK([$CC $CPPFLAGS $CFLAGS -c a.c || exit 1], [1], [stdout], [stderr])
-mv -f stdout expected-stdout
+grep -v thisisprobablynotmatching stdout > expected-stdout
 mv -f stderr expected-stderr


Why only stdout and not stderr?


Because it's the grep that warps stdout of the libtool run. By also
running grep on the expected output the two files get the exact same
treatment. But since stderr isn't piped through grep, they compare
ok w/o unifying.


 AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c a.c || 
exit 1],
 [1], [stdout], [stderr])






Another LT_AT_EXEC_CHECK fixup.

2009-01-19 Thread Ralf Wildenhues
Hello,

I've had this really small patch to fix a couple of omissions.
Seems obvious, pushed.

Cheers,
Ralf

Another LT_AT_EXEC_CHECK fixup.

* tests/shlibpath.at (shlibpath_overrides_runpath): Use
LT_AT_EXEC_CHECK instead of AT_CHECK.

diff --git a/tests/shlibpath.at b/tests/shlibpath.at
index 658bfd8..eea059b 100644
--- a/tests/shlibpath.at
+++ b/tests/shlibpath.at
@@ -51,7 +51,7 @@ $LIBTOOL --mode=clean rm -f liba.la
 eval `$LIBTOOL --config | $EGREP 
'^(shlibpath_var|shlibpath_overrides_runpath)='`
 
 # No point checking a system with static libraries:
-AT_CHECK([{ ./m || exit 1; } && exit 77], [1], [ignore], [ignore])
+LT_AT_EXEC_CHECK([./m], [1], [ignore], [ignore], [|| exit 1 && exit 77])
 
 if test "$shlibpath_var" = PATH; then
   addpath=`pwd`/moved/bin
@@ -65,7 +65,7 @@ export $shlibpath_var
 if test "$shlibpath_overrides_runpath" != no; then
   LT_AT_EXEC_CHECK([./m], [0], [ignore], [ignore])
 else
-  AT_CHECK([./m || exit 1], [1], [ignore], [ignore])
+  LT_AT_EXEC_CHECK([./m], [1], [ignore], [ignore], [|| exit 1])
 fi
 # Test that shlibpath_var is effective in adding paths at all:
 LT_AT_EXEC_CHECK([./m2], [0], [ignore], [ignore])




Re: plugins on the command line are renamed

2009-01-19 Thread Ralf Wildenhues
Hello Paul,

* Paul Biggar wrote on Sun, Jan 11, 2009 at 11:04:05PM CET:
> I hope its not too soon to ping on this?

No, pinging is certainly ok, and, sigh, unfortunately necessary.  :-/

> On Wed, Dec 31, 2008 at 1:22 PM, Paul Biggar  wrote:
> > On Wed, Dec 31, 2008 at 8:43 AM, Ralf Wildenhues  
> > wrote:
> >>> The point of interest is that both the executable name "src/phc" and
> >>> the .la file "plugins/tests/raise_globals.la" have both been renamed
> >>> to "/home/pbiggar/phc_work/svn/branches/dataflow/src/.libs/lt-phc".,
> >>> which is correct for the former but not the latter.

Please try the patch below.

Others, ok to commit (and Paul, OK to put you in THANKS)?  I thought of
somehow changing the func_ltwrapper_script_p set of functions to only
match for wrappers for programs and not for objects or libraries, but am
currently reluctant to go this way.  Point here is that handling of *.lo
and *.la files is only special for arguments of -dlopen.

Thanks,
Ralf

execute mode: do not transform *.lo or *.la arguments.

* libltdl/config/ltmain.m4sh (func_mode_execute): Do not check
arguments matching *.lo or *.la for script wrappers.
* tests/execute-mode.at (execute mode): Add tests.
* NEWS, THANKS: Update.
Report by Paul Biggar.

diff --git a/NEWS b/NEWS
index 759b7d2..2d713e7 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,7 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
 only the default informational output. See New Features, --no-silent.
   - Link tests are guarded by cache variables so they can be avoided for
 bootstrapping purposes (e.g., when link tests are not possible).
+  - Argument mangling of execute mode has been improved (i.e., lessened).
 
 * Miscellaneous changes:
 
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 7e59338..608dcff 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -1319,7 +1319,7 @@ func_mode_execute ()
 for file
 do
   case $file in
-  -*) ;;
+  -* | *.la | *.lo ) ;;
   *)
# Do a test to see if this is really a libtool program.
if func_ltwrapper_script_p "$file"; then
diff --git a/tests/execute-mode.at b/tests/execute-mode.at
index a019e8e..ef0ac07 100644
--- a/tests/execute-mode.at
+++ b/tests/execute-mode.at
@@ -210,4 +210,11 @@ do
   arg1=
 done
 
+# Check that .la files are not transformed by the wrapper searching loop.
+AT_CHECK([$LIBTOOL --mode=execute echo ./main liba.lo libfakelib.la], [], 
[stdout])
+# This could be .libs/lt-main or similar (or just plain `main').
+AT_CHECK([grep main stdout], [], [ignore])
+AT_CHECK([grep liba.lo stdout], [], [ignore])
+AT_CHECK([grep libfakelib.la stdout], [], [ignore])
+
 AT_CLEANUP




Re: [PATCH] GNU/kOpenSolaris port

2009-01-19 Thread Ralf Wildenhues
* Robert Millan wrote on Mon, Jan 19, 2009 at 11:45:24AM CET:
> 
> "kopensolaris-gnu" was accepted in GNU config.  I adjusted my patch to use
> that, see attachment.

Thanks for carrying this through, pushed as below.  I've added you to
THANKS.

Cheers,
Ralf

2009-01-19  Robert Millan  

Support GNU/kOpenSolaris.
* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER)
(_LT_CHECK_MAGIC_METHOD, _LT_COMPILER_PIC, _LT_LINKER_SHLIBS)
(_LT_LANG_CXX_CONFIG) [kopensolaris*-gnu]: Recognize
GNU/kOpenSolaris.
* libltdl/m4/ltdl.m4 (LT_SYS_DLOPEN_DEPLIBS): Likewise.
* NEWS, THANKS: Update.

 2009-01-19  Ralf Wildenhues  
 
Another LT_AT_EXEC_CHECK fixup.
diff --git a/NEWS b/NEWS
index 00bd1bb..5116598 100644
--- a/NEWS
+++ b/NEWS
@@ -12,8 +12,12 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
   - New libtool command line flag --no-verbose, which disables only
 the extra "verbose" output messages and has no effect on the
 default informational messages.
+
+* Changes in supported systems or compilers:
+
   - Improved support for 64bit Windows (mingw64).
   - Improved support for cegcc (Windows CE/PocketPC).
+  - Support for GNU/kOpenSolaris (kopensolaris*-gnu).
 
 * Bug fixes:
 
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index def0bba..20bf078 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2380,7 +2380,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -3014,7 +3014,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3635,7 +3635,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
-  linux* | k*bsd*-gnu)
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
  KCC*)
# KAI C++ Compiler
@@ -3919,7 +3919,7 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
   ;;
 
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
   case $cc_basename in
   # old Intel for x86_64 which still supported -KPIC.
   ecc*)
@@ -4300,7 +4300,7 @@ _LT_EOF
   _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols 
>$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs 
$compiler_flags ${wl}-h,$soname 
${wl}--retain-symbols-file,$output_objdir/$soname.expsym 
${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
   ;;
 
-gnu* | linux* | tpf* | k*bsd*-gnu)
+gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
   tmp_diet=no
   if test "$host_os" = linux-dietlibc; then
case $cc_basename in
@@ -5792,7 +5792,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 _LT_TAGVAR(inherit_rpath, $1)=yes
 ;;
 
-  linux* | k*bsd*-gnu)
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
 case $cc_basename in
   KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
diff --git a/libltdl/m4/ltdl.m4 b/libltdl/m4/ltdl.m4
index a2b1a4e..111fac1 100644
--- a/libltdl/m4/ltdl.m4
+++ b/libltdl/m4/ltdl.m4
@@ -468,7 +468,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
   freebsd* | dragonfly*)
 lt_cv_sys_dlopen_deplibs=yes
 ;;
-  gnu* | linux* | k*bsd*-gnu)
+  gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
 # GNU and its variants, using gnu ld.so (Glibc)
 lt_cv_sys_dlopen_deplibs=yes
 ;;




Re: spaces

2009-01-19 Thread Ralf Wildenhues
Hi Akim,

* Akim Demaille wrote on Mon, Jan 19, 2009 at 09:44:37AM CET:
> Le 10 janv. 09 à 22:25, Ralf Wildenhues a écrit :
>
>> Maybe we should update HACKING about the style we decide about?
>> (note this is really just bike shedding, and babbling)
>
> I definitely think this would be a good idea.
>
> I have worked for years with the same set up as you, using an much TAB  
> as is possible.  But I read someday something that Jim wrote about this 
> topic, in which he was advocating the no-tab approach, and I was  
> convinced.  What changed my viewpoint was that (i) Jim is in favor of  
> it, so it's good :)

Nice reasoning.  ;-)

> and (ii) because he did point out that it makes it 
> really easier to discuss about code in emails.

Good point.

> It is true that I have been disturbed and even annoyed by tab vs.
> space in some patches that gave the impression of improper
> indentation.
>
> Therefore, for a year or so, I am now using spaces only.

But it is not sufficient for Libtool if you are the only one who uses
spaces.  And it is probably not helpful for email readability if new
lines are spaces and old lines are tabs for indentation.

I see Bob also prefers spaces.

Well, changing Libtool over to use spaces only is quite a diff, and not
a trivial one to check, either.  Let alone that it increases ltmain.sh
by more than 10% in size, which will probably even have an impact on
runtime performance.

I don't know what way is best here.  We can draw a poll or so.

> The following patch addresses space issues in libtoolize.  Some are  
> benign, some are really dangerous because they invite some editors to  
> break the code.  I speak from experience: I once broke Autoconf because 
> of  ->  cleanup from my editor :(

I remember such incidents (not sure whether this particular one).

> I really recommend that 
> this patch (or a variation thereof, maybe based on $lt_sp and $lt_tab) be 
> applied, independently from whether the Libtool republic votes for tab or 
> space for presidency, as tracking these issues is uneasy.

Indeed.

> From 425171194b41e6627aae75f18dfa5620e8a8c34d Mon Sep 17 00:00:00 2001
> From: Akim Demaille 
> Date: Mon, 19 Jan 2009 09:05:31 +0100
> Subject: [PATCH] Clean space uses.
> 
>   * libtoolize.m4sh: Remove trailing spaces.
>   Use , as some editors remove "useless" spaces in
>   .

This patch is ok, feel free to push.

Thanks,
Ralf




Re: set_program_name behavior

2009-01-19 Thread Ralf Wildenhues
Hello Bruno,

* Bruno Haible wrote on Wed, Jan 14, 2009 at 10:51:46PM CET:
> 
> The removal of */.libs/lt- prefixes is done so that "make check" produces
> reliable results, and because the precise location of the executable used
> under the hood by libtool is a detail that the user should not know about.
> (Remember the need to use "./libtool --mode=execute gdb cp". Btw, I find
> the need to mention --mode=execute explicitly really painful. As if the
> command 'gdb' was not well known...)

Well,
  alias lgdb='libtool --mode=execute gdb'

is still shorter than what you suggest, but for reference, here's a
patch that does what you want.

What do the others think, should libtool be lenient here?  I don't have
a strong preference (sure don't mind), the requirement for a mode seems
to have been present for at least 10 years.

Aside, I am not quite sure whether it is portable (to other systems or
debugger versions) to assume that gdb will not be interactive when
started with stdin redirected to /dev/null.

Thanks,
Ralf

Execute mode works without --mode arg for `gdb'.

* libltdl/config/ltmain.m4sh (main): If the first
nonoption argument is `gdb', assume execute mode.
* tests/execute-mode.at (execute mode): Test it.
* doc/libtool.texi (Execute mode): Document it.
* NEWS: Update.
Suggestion from Bruno Haible.

diff --git a/NEWS b/NEWS
index 29a4d99..84bcfdd 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
 avoid multiple finish mode commands stemming from multiple installs into
 the same library directory.  To avoid surprises, the old --finish option
 is deprecated now.
+  - `libtool --mode=execute gdb ...' works without the --mode argument, if
+the program to be run is exactly `gdb'.
 
 * Changes in supported systems or compilers:
 
diff --git a/doc/libtool.texi b/doc/libtool.texi
index d6d95f2..9c62d86 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -1571,6 +1571,9 @@ If any of the @var{args} are libtool executable wrappers, 
then they are
 translated into the name of their corresponding uninstalled binary, and
 any of their required library directories are added to the library path.
 
+If the program to be run is @samp{gdb}, then the @option{--mode=execute}
+may be omitted.
+
 @node Install mode
 @section Install mode
 @cindex install mode
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 608dcff..298d7a4 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -436,8 +436,14 @@ $opt_help || {
 func_fatal_configuration "not configured to build any kind of library"
   fi
 
-  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
-
+  if test -z "$mode"; then
+case $nonopt in
+  gdb) mode=execute ;;
+esac
+if test -z "$mode"; then
+  func_fatal_error "error: you must specify a MODE."
+fi
+  fi
 
   # Darwin sucks
   eval std_shrext=\"$shrext_cmds\"
diff --git a/tests/execute-mode.at b/tests/execute-mode.at
index ef0ac07..c3370da 100644
--- a/tests/execute-mode.at
+++ b/tests/execute-mode.at
@@ -217,4 +217,8 @@ AT_CHECK([grep main stdout], [], [ignore])
 AT_CHECK([grep liba.lo stdout], [], [ignore])
 AT_CHECK([grep libfakelib.la stdout], [], [ignore])
 
+# Accept `gdb' also without --mode argument.
+AT_CHECK([$LIBTOOL --mode=execute gdb /bin/ls 

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

2009-01-19 Thread Ralf Wildenhues
Hi Charles,

* Charles Wilson wrote on Fri, Jan 16, 2009 at 02:51:21PM CET:
> The "unexpected" failure was
>  36: execute mode FAILED (execute-mode.at:193)
> but it is unrelated; it's a problem in cygwin-1.7's "dos-style path
> detection"...That's not a path!
> 
> --- /dev/null   2006-11-30 19:00:00.0 -0500
> +++
> /usr/src/packages/libtool/git/build-cygwin-dlpreopen-fix-take2/tests/testsui
> te.dir/at-groups/36/stderr  2009-01-15 23:50:30.98180 -0500
> @@ -0,0 +1,6 @@
> +cygwin warning:
> +  MS-DOS style path detected: d\"e
> +  Preferred POSIX equivalent is: d/"e
> +  CYGWIN environment variable option "nodosfilewarning" turns off this
> warning.
> +  Consult the user's guide for more details about POSIX paths:
> +http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> stdout:
> abc
> d\"e
> f\"g
> xyz
> 36. execute-mode.at:25: 36. execute mode (execute-mode.at:25): FAILED 
> (execute-mode.at:193)

Thanks.  Applying this to avoid this failure.

Cheers,
Ralf

Avoid failure due to Cygwin path detection bug.
* tests/execute-mode.at (execute mode): Ignore noise on stderr;
Cygwin might consider `d\"e' to be a DOS-style path and warn.
Report by Charles Wilson.

diff --git a/tests/execute-mode.at b/tests/execute-mode.at
index c3370da..a73cada 100644
--- a/tests/execute-mode.at
+++ b/tests/execute-mode.at
@@ -1,6 +1,6 @@
 # execute-mode.at -- libtool --mode=execute -*- Autotest -*-
 #
-#   Copyright (C) 2008 Free Software Foundation, Inc.
+#   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 #   Written by Ralf Wildenhues, 2008
 #
 #   This file is part of GNU Libtool.
@@ -190,7 +190,7 @@ do
   if test -z "$arg1"; then
 arg1=$arg2; continue
   fi
-  AT_CHECK([$LIBTOOL --mode=execute ./foo abc "$arg1" "$arg2" xyz], [], 
[stdout])
+  AT_CHECK([$LIBTOOL --mode=execute ./foo abc "$arg1" "$arg2" xyz], [], 
[stdout], [ignore])
   AT_CHECK([$FGREP "$arg1" stdout], [], [ignore])
   AT_CHECK([$FGREP "$arg2" stdout], [], [ignore])
   AT_CHECK([test `sed -n '/^abc$/,/^xyz$/p' stdout | wc -l` -eq 4])




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

2009-01-19 Thread Ralf Wildenhues
Hello Charles,

I haven't looked at your patches in detail yet, but a couple of things
caught my eye:

* Charles Wilson wrote on Sat, Jan 03, 2009 at 02:39:15AM CET:
> diff --git a/libltdl/config/general.m4sh b/libltdl/config/general.m4sh
> index 4bc304c..c4de91a 100644
> --- a/libltdl/config/general.m4sh
> +++ b/libltdl/config/general.m4sh
[...]
> +# func_tr_sh
> +# turn $1 into a string suitable for a shell variable name
> +# result is stored in $func_tr_sh_result
> +func_tr_sh ()
> +{
> +  func_tr_sh_result=`echo "$1" | $SED -e 's/[^A-Za-z0-9_]/_/g'`
> +  # ensure result begins with non-digit
> +  case "$func_tr_sh_result" in
> +[A-Za-z_][A-Za-z0-9_] ) ;;
> +* ) func_tr_sh_result=_$func_tr_sh_result ;;
> +  esac
> +}
>  ]])

Let's not waste processes when we don't have to, with something like
this untested bit:

func_tr_sh ()
{
  case $1 in
[!a-zA-Z_]* | *[!a-zA-Z_0-9]*)
  func_tr_sh_result=`$ECHO "$1" | $SED 's/^[^a-zA-Z]/_/; 
s/[^a-zA-Z0-9]/_/g'`
  ;;
*)
  func_tr_sh_result=$1
  ;;
  esac
}

> --- a/libltdl/config/ltmain.m4sh
> +++ b/libltdl/config/ltmain.m4sh

> @@ -1988,7 +1988,7 @@ extern \"C\" {
> eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > 
> "$nlist"T'
> eval '$MV "$nlist"T "$nlist"'
> case $host in
> - *cygwin | *mingw* | *cegcc* )
> + *cygwin* | *mingw* | *cegcc* )
> eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
> eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
> ;;

Is this fixing a bug?  If yes, then it should be a separate patch,
documented in the ChangeLog entry, done likely in all other such
instances of missing '*' (I haven't found any), and would be obviously
correct and ok to push.  Please, please don't mix heavy patches with
such cleanups.  It only leads to cleanups being delayed.


In your "take 3" of this patch series, you have this hunk:

| @@ -2217,7 +2217,7 @@ func_win32_libid ()
|  ;;
|*ar\ archive*) # could be an import, or static
|  if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
| -   $EGREP 'file format (pe-i386(.*architecture: 
i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
| +   $EGREP 'file format (pei?-i386(.*architecture: 
i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
|win32_nmres=`eval $NM -f posix -A $1 |
| $SED -n -e '
| 1,100{

Now, my memory is really bad about win32 semantics, but wasn't it
exactly pei-i386 libraries that we wanted to not match here?

More generally, I have a feeling that this function is badly
conditioned: it needs adjustment fairly often, it is unclear to me which
cases exactly it tries to exclude (for starters: why is the file format
test needed at all?), and when things fail here, they do so very
unobviously for the libtool user.  These issues could IMVHO be
ameliorated by having some test cases that show the fine line between
import libraries that are acceptable, and static ones that are not.
So that when we port this to the next w32 system, we just have to run
the test suite and fix it until it passes.  What do you think?

Thanks,
Ralf




Re: Unify line endings in localization test

2009-01-19 Thread Peter Rosin

Den 2009-01-19 21:35 skrev Ralf Wildenhues:

This looks a bit hackish.  We already have a handful of places which we
fixed up in order to avoid line ending issues.  This one looks hackish
enough to deserve being wrapped in a macro (in testsuite.at, below
LT_AT_HOST_DATA?), so that future instances of this issue can easily be
handled likewise.


Something like the attached?

Cheers,
Peter

2009-01-20  Peter Rosin  

Unify line endings in localization test.
* tests/testsuite.at (LT_AT_UNIFY_NL): Add macro that unifies
line endings on platforms that suffer from such confusion.
* tests/localization.at: Use it. Fixes the test on MSYS/MSVC.
diff --git a/tests/localization.at b/tests/localization.at
index d489fef..1a5c774 100644
--- a/tests/localization.at
+++ b/tests/localization.at
@@ -43,13 +43,16 @@ AT_CHECK([$CC $CPPFLAGS $CFLAGS -c b.c || exit 77], [], 
[stdout], [stderr])
 
 # Find out about expected output.
 AT_CHECK([$CC $CPPFLAGS $CFLAGS -c a.c || exit 1], [1], [stdout], [stderr])
-mv -f stdout expected-stdout
-mv -f stderr expected-stderr
+LT_AT_UNIFY_NL([stdout], [expected-stdout])
+LT_AT_UNIFY_NL([stderr], [expected-stderr])
 AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c a.c || 
exit 1],
 [1], [stdout], [stderr])
+LT_AT_UNIFY_NL([stderr])
 AT_CHECK([diff expected-stderr stderr])
 LTBASE=`$ECHO "$LIBTOOL" | sed 's,^.*/,,'`
-AT_CHECK([grep -v "^$LTBASE: compile" stdout | diff expected-stdout -])
+grep -v "^$LTBASE: compile" stdout > libtool-stdout
+LT_AT_UNIFY_NL([libtool-stdout])
+AT_CHECK([diff expected-stdout libtool-stdout])
 
 # check that we get our quoting right.
 LANGUAGE='a; nosuchprogram " '\''  & $x /#+*(){}|,:`\ !%'
diff --git a/tests/testsuite.at b/tests/testsuite.at
index f116a1f..1d7b3ef 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -204,6 +204,19 @@ case $host_os in mingw*)
 esac])
 
 
+# LT_AT_UNIFY_NL(FILE, [RESULT-FILE])
+# 
+# Ensure (text) file has predicable line endings.
+m4_define([LT_AT_UNIFY_NL],
+[case $host_os in
+ mingw*)
+  tr -d '\015' < $1 > m4_ifval([$2], [$2], [$1.t
+  mv -f $1.t $1]) ;; m4_ifval([$2], [
+ *)
+  mv -f $1 $2 ;;])
+esac])
+
+
 # LT_AT_EXEC_CHECK(EXECUTABLE, [STATUS = 0], [STDOUT], [STDERR],
 # [ARGS-OR-STATUS-ADJUST])
 # --


Re: set_program_name behavior

2009-01-19 Thread Bob Friesenhahn

On Mon, 19 Jan 2009, Ralf Wildenhues wrote:


Well,
 alias lgdb='libtool --mode=execute gdb'

is still shorter than what you suggest, but for reference, here's a
patch that does what you want.

What do the others think, should libtool be lenient here?  I don't have
a strong preference (sure don't mind), the requirement for a mode seems
to have been present for at least 10 years.


10 years already?  the only concern I can think of is if this blocks 
building the program called 'gdb', but hopefully it's build is already 
using --mode given the 10 years..



Aside, I am not quite sure whether it is portable (to other systems or
debugger versions) to assume that gdb will not be interactive when
started with stdin redirected to /dev/null.


This may be a valid concern for systems which do not support POSIX 
pty's or /dev/null (primarily Windows).


Bob
==
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/





Re: Unify line endings in localization test

2009-01-19 Thread Ralf Wildenhues
Hi Peter,

* Peter Rosin wrote on Mon, Jan 19, 2009 at 09:52:50PM CET:
> Den 2009-01-19 21:35 skrev Ralf Wildenhues:
>>
>> I think we shouldn't be constantly rebasing pr-msvc-support.  I think
>> instead when we can't decide soonish whether to merge it into master or
>> to redo it (because it would need largish redoing), then you should just
>> merge from master into the branch in order to keep it up to date.
>
> I had no plan to rebase anything, what I was suggesting was to maybe
> push it to the branch now (if it wasn't clear that it was safe for
> master), then when someone said "ok", I could cherry-pick it into
> master.

With respect to being smart about merges, and knowing what's already
been added to master, cherry-picking isn't any better than rebasing.
Only merging is.  And currently we are not using that to our advantage.

> (But the last four patches on the branch are not very pretty, dates
> are all messed up, no Changelog entries, crappy commit msgs etc etc.
> Those should be merged with care.)

Sure.

Cheers,
Ralf




Re: plugins on the command line are renamed

2009-01-19 Thread Ralf Wildenhues
Hello Paul,

let's drop the libtool list.

* Paul Biggar wrote on Tue, Jan 20, 2009 at 03:11:25AM CET:
> On Mon, Jan 19, 2009 at 10:15 PM, Ralf Wildenhues wrote:
> > Please try the patch below.
> 
> I had trouble applying this with git apply. Is it against git trunk?

git master, yes.  It was updated yesterday, though.

> However, I'm now getting so many problems that I suspect something is
> seriously wrong. Before I list them, is there a document describing
> what I should be doing after I checkout. I suspect I should run either
> bootstrap, configure, or aclocal && autoconf && automake, but I had
> problems with all three.

  ./bootstrap

should suffice; please post its output if there are problems.

Thanks,
Ralf




Re: plugins on the command line are renamed

2009-01-19 Thread Paul Biggar
Hi Ralf,

Thanks for getting back to me.

On Mon, Jan 19, 2009 at 10:15 PM, Ralf Wildenhues
 wrote:
> Please try the patch below.

I had trouble applying this with git apply. Is it against git trunk? I
merged it manually however.

 $ git apply a
error: patch failed: NEWS:30
error: NEWS: patch does not apply
error: patch failed: libltdl/config/ltmain.m4sh:1319
error: libltdl/config/ltmain.m4sh: patch does not apply
error: patch failed: tests/execute-mode.at:210
error: tests/execute-mode.at: patch does not apply

However, I'm now getting so many problems that I suspect something is
seriously wrong. Before I list them, is there a document describing
what I should be doing after I checkout. I suspect I should run either
bootstrap, configure, or aclocal && autoconf && automake, but I had
problems with all three.

Thanks,
Paul




> Others, ok to commit (and Paul, OK to put you in THANKS)?  I thought of

Yes, no objection to the THANKS :)


Thanks, Paul



> diff --git a/NEWS b/NEWS
> index 759b7d2..2d713e7 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -30,6 +30,7 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
> only the default informational output. See New Features, --no-silent.
>   - Link tests are guarded by cache variables so they can be avoided for
> bootstrapping purposes (e.g., when link tests are not possible).
> +  - Argument mangling of execute mode has been improved (i.e., lessened).
>
>  * Miscellaneous changes:
>
> diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
> index 7e59338..608dcff 100644
> --- a/libltdl/config/ltmain.m4sh
> +++ b/libltdl/config/ltmain.m4sh
> @@ -1319,7 +1319,7 @@ func_mode_execute ()
> for file
> do
>   case $file in
> -  -*) ;;
> +  -* | *.la | *.lo ) ;;
>   *)
># Do a test to see if this is really a libtool program.
>if func_ltwrapper_script_p "$file"; then
> diff --git a/tests/execute-mode.at b/tests/execute-mode.at
> index a019e8e..ef0ac07 100644
> --- a/tests/execute-mode.at
> +++ b/tests/execute-mode.at
> @@ -210,4 +210,11 @@ do
>   arg1=
>  done
>
> +# Check that .la files are not transformed by the wrapper searching loop.
> +AT_CHECK([$LIBTOOL --mode=execute echo ./main liba.lo libfakelib.la], [], 
> [stdout])
> +# This could be .libs/lt-main or similar (or just plain `main').
> +AT_CHECK([grep main stdout], [], [ignore])
> +AT_CHECK([grep liba.lo stdout], [], [ignore])
> +AT_CHECK([grep libfakelib.la stdout], [], [ignore])
> +
>  AT_CLEANUP
>



-- 
Paul Biggar
paul.big...@gmail.com