Re: preparing for 1.5.24

2007-04-25 Thread Ralf Wildenhues
Hi Charles,

* Charles Wilson wrote on Wed, Apr 25, 2007 at 05:38:49AM CEST:
 Ralf Wildenhues wrote:

 Thanks also for the documentation suggestion.  Slightly rewritten
 suggestion to come up.

 Ping? [antecedent reposted below]

Sigh.  I had hoped to have enough time to work on this.  Alas, I better
just post my thoughts.  Apologies for being the eye of the needle here
(can you use the phrase this way in English?).

First, I think this is a bit ad hoc here: the dllexport/dllimport issue,
or more generally, w32-specific issues (although as I understand it's
not /strictly/ w32-specific), don't start with using libltdl.  As such,
I think they deserves its own chapter in the manual, and then the
libltdl handling can refer to it, in shortened form.  Ideally, all the
gory details of how you can have several deplibs, some static some
shared, and currently need to define a macro for each based on that (but
maybe libtool can help there in the future to automatize that?).
AC_LIBTOOL_WIN32_DLL could refer to this section then.

I think some of this stuff has been discussed at length on the libtool
lists; I assume you were one of the people involved.

Even cooler would be to take into account the differences for when we
add support for MSVC, wgcc, ...

 Around line 3546 [probably 4476, now] in libtool.texi, something like:

 --%
 @emph{Win32 specific}

FWIW, I don't like this way of putting keywords much.  It should be a
heading, or part of the surrounding sentence.

 When building a DLL on windows (MinGW,Cygwin) that 

Let's not speak of a library as a DLL, except where we explain what a
DLL is, and except the strictly w32-specific parts of the manual.  We
should strive to use coherent names for things, here: shared library.
Just like you use convenience archive within the same sentence.

 uses @code{libltdl} as a convenience archive, there are some issues with 
 symbol decoration that must be carefully managed.  You must do one of the 
 following, within the code and/or build machinery of your library:

 @enumerate 1
 @item explicitly mark as @code{declspec(dllexport)} all symbols in your 
 library that should be exported when building your library's source code.  
 However, these symbols should @emph{not} be marked 
 @code{declspec(dllexport)} when building @emph{clients} of your library -- 
 instead, the symbols should be marked @code{declspec(dllimport)}. This 
 procedure will require careful macro design within your library's public 
 header files.  An example of this may be found in @file{zlib.h} from the 
 zlib distribution @url{http://www.zlib.net/}.

Let's rather not refer to an external source here: they could change,
the link is more than two links away from what the user really needs to
see when doing this, and zlib isn't GNU software (it's free, so there's
no real issue here).

Rather, a small, self-contained example would be great.  Ideally, that
example would be identical to a test in the new testsuite, so that we're
kept honest in that it actually works as expected.

 @item use the (win32-specific) linker option @code{-Xlinker 
 --export-all-symbols}.  This will restore the expected auto-export 
 behavior of the GNU linker on windows.  However, the 
 @code{--export-all-symbols} option is specific to the GNU linker's i386 PE 
 target -- @code{ld} for other targets will not recognize the option.  
 Therefore, using this option will require careful coding in your library's 
 @file{Makefile.am} and @file{configure.ac}.  For example:

 configure.ac:
 @example
 ...
 case $host_os in
 cygwin* | mingw* | pw32*)

This doesn't account for specifity to GNU binutils ld.  $with_gnu_ld
should help here, bugs in its setting notwithstanding.

   RESTORE_AUTOEXPORT=-Xlinker --export-all-symbols
[...]

Cheers, and thanks for all your work,
Ralf




Re: Bug#419228: unnecessary linkage when libtool convenience libraries (noinst_LTLIBRARIES) are used

2007-04-25 Thread Ralf Wildenhues
* Eric Blake wrote on Wed, Apr 25, 2007 at 02:08:38AM CEST:
 According to Ralf Wildenhues on 4/24/2007 3:05 PM:
  Let's document a useful variant of it then.  Is this wording OK?

  * README, README.alpha: Document how to test an arbitrary
  installed libtool script.
 
 Looks great to me!  Go ahead and install these hints.

Done, thanks!

Cheers,
Ralf




Re: mdemo ltdl failure

2007-04-25 Thread Ralf Wildenhues
[ http://thread.gmane.org/gmane.comp.gnu.libtool.patches/7314/focus=7498 ]

Thanks Charles for all your work on this.  I installed this path into
Libtool HEAD, and pulled the changes over to gnulib.  Here's what the
gnulib patch looks like.

Cheers,
Ralf

2007-04-25  Charles Wilson  [EMAIL PROTECTED]
Ralf Wildenhues  [EMAIL PROTECTED]

* lib/argz_.h: ensure error_t definition is obtained in same
mechanism system argz.h would have.
* m4/argz.m4 (gl_FUNC_ARGZ): add new test to check if $host's
argz facilities are known bad.  Err on the side of caution if
cross-compiling.

Index: lib/argz_.h
===
RCS file: /cvsroot/gnulib/gnulib/lib/argz_.h,v
retrieving revision 1.5
diff -u -r1.5 argz_.h
--- lib/argz_.h 29 Mar 2007 15:02:55 -  1.5
+++ lib/argz_.h 25 Apr 2007 21:16:56 -
@@ -1,6 +1,6 @@
 /* lt__argz.h -- internal argz interface for non-glibc systems
 
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007 Free Software Foundation, Inc.
Written by Gary V. Vaughan, 2004
 
NOTE: The canonical source of this file is maintained with the
@@ -32,6 +32,8 @@
 #define LT__ARGZ_H 1
 
 #include stdlib.h
+#define __need_error_t
+#include errno.h
 #include sys/types.h
 
 #if defined(LTDL)
Index: m4/argz.m4
===
RCS file: /cvsroot/gnulib/gnulib/m4/argz.m4,v
retrieving revision 1.5
diff -u -r1.5 argz.m4
--- m4/argz.m4  29 Mar 2007 15:02:55 -  1.5
+++ m4/argz.m4  25 Apr 2007 21:16:57 -
@@ -1,13 +1,13 @@
 # Portability macros for glibc argz.-*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 #   Written by Gary V. Vaughan [EMAIL PROTECTED]
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 4 argz.m4
+# serial 5 argz.m4
 
 AC_DEFUN([gl_FUNC_ARGZ],
 [gl_PREREQ_ARGZ
@@ -27,6 +27,50 @@
 ARGZ_H=
 AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next \
argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])])
+
+dnl if have system argz functions, allow forced use of 
+dnl libltdl-supplied implementation (and default to do so
+dnl on known bad systems). Could use a runtime check, but
+dnl (a) detecting malloc issues is notoriously unreliable
+dnl (b) only known system that declares argz functions,
+dnl provides them, yet they are broken, is cygwin
+dnl releases prior to 16-Mar-2007 (1.5.24 and earlier)
+dnl So, it's more straightforward simply to special case 
+dnl this for known bad systems.
+AS_IF([test -z $ARGZ_H],
+[AC_CACHE_CHECK(
+[if argz actually works],
+[lt_cv_sys_argz_works],
+[case $host_os in #(
+*cygwin*)
+  lt_cv_sys_argz_works=no
+  if test $cross_compiling != no; then
+lt_cv_sys_argz_works=guessing no
+  else
+save_IFS=$IFS
+IFS=-.
+set x `uname -r | $SED -e 's/^\([[0-9\.]]*\).*/\1/'`
+IFS=$save_IFS
+lt_os_major=$[]{2-0}
+lt_os_minor=$[]{3-0}
+lt_os_micro=$[]{4-0}
+if test $lt_os_major -gt 1 ||
+   { test $lt_os_major -eq 1 
+ { test $lt_os_minor -gt 5 ||
+   { test $lt_os_minor -eq 5 
+ test $lt_os_micro -gt 24; }; }; }; then
+  lt_cv_sys_argz_works=yes
+fi
+  fi
+  ;; #(
+*) lt_cv_sys_argz_works=yes ;;
+esac])
+ AS_IF([test $lt_cv_sys_argz_works != yes],
+[AC_DEFINE([SYSTEM_ARGZ_IS_BROKEN], 1,
+   [This value is set to 1 to indicate that the system argz 
facility does not work])
+ARGZ_H=argz.h
+AC_LIBOBJ([argz])])])
+
 AC_SUBST([ARGZ_H])
 ])
 




Re: mdemo ltdl failure

2007-04-25 Thread Charles Wilson

Charles Wilson wrote:

I'll generate and
test an additional patch addressing Bruno's concerns.


Attached.  Re-ran *all* of the tests described here:
http://lists.gnu.org/archive/html/libtool-patches/2007-04/msg00073.html
with identical results.

I did not bump the argz.m4 serial again (I'm not sure what the rules 
are: bump on EVERY change, or only on big changes?).  So, Ralf, please 
do that manually if it is necessary.


--
Chuck

2007-04-26  Charles Wilson  [EMAIL PROTECTED]

* libltdl/libltdl/lt__glibc.h: use !HAVE_WORKING_ARGZ
instead of SYSTEM_ARGZ_IS_BROKEN
* libltdl/m4/argz.m4 (gl_FUNC_ARGZ): ditto.  Also, minor
stylistic improvements
Reported by: Bruno Haible [EMAIL PROTECTED]

Index: libltdl/libltdl/lt__glibc.h
===
RCS file: /cvsroot/libtool/libtool/libltdl/libltdl/lt__glibc.h,v
retrieving revision 1.9
diff -u -r1.9 lt__glibc.h
--- libltdl/libltdl/lt__glibc.h 25 Apr 2007 21:17:59 -  1.9
+++ libltdl/libltdl/lt__glibc.h 26 Apr 2007 00:33:34 -
@@ -37,7 +37,7 @@
 #  include config.h
 #endif
 
-#if !defined(HAVE_ARGZ_H) || defined(SYSTEM_ARGZ_IS_BROKEN)
+#if !defined(HAVE_ARGZ_H) || !defined(HAVE_WORKING_ARGZ)
 /* Redefine any glibc symbols we reimplement to import the
implementations into our lt__ namespace so we don't ever
clash with the system library if our clients use argz_*
Index: libltdl/m4/argz.m4
===
RCS file: /cvsroot/libtool/libtool/libltdl/m4/argz.m4,v
retrieving revision 1.5
diff -u -r1.5 argz.m4
--- libltdl/m4/argz.m4  25 Apr 2007 21:17:59 -  1.5
+++ libltdl/m4/argz.m4  26 Apr 2007 00:33:34 -
@@ -41,34 +41,35 @@
 [AC_CACHE_CHECK(
 [if argz actually works],
 [lt_cv_sys_argz_works],
-[case $host_os in #(
+[[case $host_os in #(
 *cygwin*)
   lt_cv_sys_argz_works=no
   if test $cross_compiling != no; then
 lt_cv_sys_argz_works=guessing no
   else
+lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/'
 save_IFS=$IFS
 IFS=-.
-set x `uname -r | $SED -e 's/^\([[0-9\.]]*\).*/\1/'`
+set x `uname -r | sed -e $lt_sed_extract_leading_digits`
 IFS=$save_IFS
-lt_os_major=$[]{2-0}
-lt_os_minor=$[]{3-0}
-lt_os_micro=$[]{4-0}
-if test $lt_os_major -gt 1 ||
-   { test $lt_os_major -eq 1 
- { test $lt_os_minor -gt 5 ||
-   { test $lt_os_minor -eq 5 
- test $lt_os_micro -gt 24; }; }; }; then
+lt_os_major=${2-0}
+lt_os_minor=${3-0}
+lt_os_micro=${4-0}
+if test $lt_os_major -gt 1 \
+   || { test $lt_os_major -eq 1 \
+  { test $lt_os_minor -gt 5 \
+   || { test $lt_os_minor -eq 5 \
+  test $lt_os_micro -gt 24; }; }; }; then
   lt_cv_sys_argz_works=yes
 fi
   fi
   ;; #(
 *) lt_cv_sys_argz_works=yes ;;
-esac])
- AS_IF([test $lt_cv_sys_argz_works != yes],
-[AC_DEFINE([SYSTEM_ARGZ_IS_BROKEN], 1,
-   [This value is set to 1 to indicate that the system argz 
facility does not work])
-ARGZ_H=argz.h
+esac]])
+ AS_IF([test $lt_cv_sys_argz_works = yes],
+[AC_DEFINE([HAVE_WORKING_ARGZ], 1,
+   [This value is set to 1 to indicate that the system argz 
facility works])],
+[ARGZ_H=argz.h
 AC_LIBOBJ([argz])])])
 
 AC_SUBST([ARGZ_H])