[PATCH 1/2] tests: __declspec (dll{ex, im}port) in tests/exceptions.at

2010-09-20 Thread Peter Rosin
Hi!

I have tested this patch on MinGW/gcc and Cygwin/gcc and they are both
ok with the __declspec() notation.  On MSVC, the test goes from skip
to fail, as it needs 2/2.

Cheers,
Peter

>From 52972128c5952da628e033e4509208711906c3a2 Mon Sep 17 00:00:00 2001
From: Peter Rosin 
Date: Mon, 20 Sep 2010 09:07:25 +0200
Subject: [PATCH 1/2] tests: __declspec (dll{ex,im}port) in tests/exceptions.at

* tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use
__declspec (dllimport) and __declspec (dllexport) instead of
the less portable __attribute__ ((dllimport)) and
__attribute__ ((dllexport)).  Makes the test compile on MSVC.

Signed-off-by: Peter Rosin 
---
 ChangeLog   |8 
 tests/exceptions.at |   17 -
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 78d3e48..3c72890 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-20  Peter Rosin  
+
+   tests: __declspec (dll{ex,im}port) in tests/exceptions.at
+   * tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use
+   __declspec (dllimport) and __declspec (dllexport) instead of
+   the less portable __attribute__ ((dllimport)) and
+   __attribute__ ((dllexport)).  Makes the test compile on MSVC.
+
 2010-09-19  Peter Rosin  
 
tests: Import items from liba1 for MSVC.
diff --git a/tests/exceptions.at b/tests/exceptions.at
index 235597c..286b2ac 100644
--- a/tests/exceptions.at
+++ b/tests/exceptions.at
@@ -66,9 +66,8 @@ CPPFLAGS="$LTDLINCL $CPPFLAGS"
 # the regex).  However, in this test, none of these situations apply,
 # so we don't directly address it.  Otherwise, the correct mechanism
 # would be to avoid all of those flags, and instead explicitly decorate
-# all symbols with appropriate __attribute__ ((dllexport)) or
-# __attribute__ ((dllimport)) flags when building the DLLs and the
-# clients.
+# all symbols with appropriate __declspec (dllexport) or
+# __declspec (dllimport) flags when building the DLLs and the clients.
 #
 # For more information, see these two threads:
 #   http://lists.gnu.org/archive/html/bug-libtool/2010-06/msg00069.html
@@ -84,9 +83,9 @@ AT_DATA([common.h],
 #if defined(__CYGWIN__) || defined(_WIN32)
 # if defined(DLL_EXPORT) || defined(USING_COMMON_DLL)
 #  if defined(LIBTOOL_TEST_IN_COMMON)
-#   define COMMON_IMPEXP __attribute__ ((dllexport))
+#   define COMMON_IMPEXP __declspec (dllexport)
 #  else
-#   define COMMON_IMPEXP __attribute__ ((dllimport))
+#   define COMMON_IMPEXP __declspec (dllimport)
 #  endif
 # else
 #  define COMMON_IMPEXP
@@ -128,9 +127,9 @@ AT_DATA([module.h],
 #if defined(__CYGWIN__) || defined(_WIN32)
 # if defined(DLL_EXPORT) || defined(USING_MODULE_DLL)
 #  if defined(LIBTOOL_TEST_IN_MODULE)
-#   define MODULE_IMPEXP __attribute__ ((dllexport))
+#   define MODULE_IMPEXP __declspec (dllexport)
 #  else
-#   define MODULE_IMPEXP __attribute__ ((dllimport))
+#   define MODULE_IMPEXP __declspec (dllimport)
 #  endif
 # else
 #  define MODULE_IMPEXP
@@ -174,9 +173,9 @@ AT_DATA([lib.h],
 #if defined(__CYGWIN__) || defined(_WIN32)
 # if defined(DLL_EXPORT) || defined(USING_LIB_DLL)
 #  if defined(LIBTOOL_TEST_IN_LIB)
-#   define LIB_IMPEXP __attribute__ ((dllexport))
+#   define LIB_IMPEXP __declspec (dllexport)
 #  else
-#   define LIB_IMPEXP __attribute__ ((dllimport))
+#   define LIB_IMPEXP __declspec (dllimport)
 #  endif
 # else
 #  define LIB_IMPEXP
-- 
1.7.1





[PATCH 2/2] libltdl: Make sure preloaded symbols are declared extern "C".

2010-09-20 Thread Peter Rosin
>From 48c28ce65b53af7ad6c1cb84026e47be9ce2d68b Mon Sep 17 00:00:00 2001
From: Peter Rosin 
Date: Mon, 20 Sep 2010 09:11:43 +0200
Subject: [PATCH 2/2] libltdl: Make sure preloaded symbols are declared extern 
"C".

* libltdl/ltdl.h (LTDL_SET_PRELOADED_SYMBOLS): Move the
declaration of lt__PROGRAM__LTX_preloaded_symbols to global
scope and make sure it has "C" linkage.  Makes exceptions.at
succeed on MSVC.

Signed-off-by: Peter Rosin 
---
 ChangeLog  |9 +
 libltdl/ltdl.h |9 +
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3c72890..8ed47f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,13 @@
 2010-09-20  Peter Rosin  
+   Ralf Wildenhues  
+
+   libltdl: Make sure preloaded symbols are declared extern "C".
+   * libltdl/ltdl.h (LTDL_SET_PRELOADED_SYMBOLS): Move the
+   declaration of lt__PROGRAM__LTX_preloaded_symbols to global
+   scope and make sure it has "C" linkage.  Makes exceptions.at
+   succeed on MSVC.
+
+2010-09-20  Peter Rosin  
 
tests: __declspec (dll{ex,im}port) in tests/exceptions.at
* tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use
diff --git a/libltdl/ltdl.h b/libltdl/ltdl.h
index 5154da1..749a54d 100644
--- a/libltdl/ltdl.h
+++ b/libltdl/ltdl.h
@@ -102,10 +102,11 @@ LT_SCOPE int  lt_dlpreload_open(const char 
*originator,
  lt_dlpreload_callback_func *func);
 
 #define lt_preloaded_symbols   lt__PROGRAM__LTX_preloaded_symbols
-#define LTDL_SET_PRELOADED_SYMBOLS()   LT_STMT_START{  \
-   extern LT_DLSYM_CONST lt_dlsymlist lt_preloaded_symbols[];  \
-   lt_dlpreload_default(lt_preloaded_symbols); \
-   }LT_STMT_END
+/* Ensure C linkage.  */
+extern LT_DLSYM_CONST lt_dlsymlist lt__PROGRAM__LTX_preloaded_symbols[];
+
+#define LTDL_SET_PRELOADED_SYMBOLS() \
+   lt_dlpreload_default(lt_preloaded_symbols)
 
 
 
-- 
1.7.1





Re: [PATCH 1/2] tests: __declspec (dll{ex, im}port) in tests/exceptions.at

2010-09-20 Thread Bob Friesenhahn

On Mon, 20 Sep 2010, Peter Rosin wrote:


Hi!

I have tested this patch on MinGW/gcc and Cygwin/gcc and they are both
ok with the __declspec() notation.  On MSVC, the test goes from skip
to fail, as it needs 2/2.


This patch looks good to apply, as does the 2/2 patch to make sure 
that lt__PROGRAM__LTX_preloaded_symbols is globally scoped and "extern 
C".


Bob



Cheers,
Peter


From 52972128c5952da628e033e4509208711906c3a2 Mon Sep 17 00:00:00 2001

From: Peter Rosin 
Date: Mon, 20 Sep 2010 09:07:25 +0200
Subject: [PATCH 1/2] tests: __declspec (dll{ex,im}port) in tests/exceptions.at

* tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use
__declspec (dllimport) and __declspec (dllexport) instead of
the less portable __attribute__ ((dllimport)) and
__attribute__ ((dllexport)).  Makes the test compile on MSVC.

Signed-off-by: Peter Rosin 
---
ChangeLog   |8 
tests/exceptions.at |   17 -
2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 78d3e48..3c72890 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-20  Peter Rosin  
+
+   tests: __declspec (dll{ex,im}port) in tests/exceptions.at
+   * tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use
+   __declspec (dllimport) and __declspec (dllexport) instead of
+   the less portable __attribute__ ((dllimport)) and
+   __attribute__ ((dllexport)).  Makes the test compile on MSVC.
+
2010-09-19  Peter Rosin  

tests: Import items from liba1 for MSVC.
diff --git a/tests/exceptions.at b/tests/exceptions.at
index 235597c..286b2ac 100644
--- a/tests/exceptions.at
+++ b/tests/exceptions.at
@@ -66,9 +66,8 @@ CPPFLAGS="$LTDLINCL $CPPFLAGS"
# the regex).  However, in this test, none of these situations apply,
# so we don't directly address it.  Otherwise, the correct mechanism
# would be to avoid all of those flags, and instead explicitly decorate
-# all symbols with appropriate __attribute__ ((dllexport)) or
-# __attribute__ ((dllimport)) flags when building the DLLs and the
-# clients.
+# all symbols with appropriate __declspec (dllexport) or
+# __declspec (dllimport) flags when building the DLLs and the clients.
#
# For more information, see these two threads:
#   http://lists.gnu.org/archive/html/bug-libtool/2010-06/msg00069.html
@@ -84,9 +83,9 @@ AT_DATA([common.h],
#if defined(__CYGWIN__) || defined(_WIN32)
# if defined(DLL_EXPORT) || defined(USING_COMMON_DLL)
#  if defined(LIBTOOL_TEST_IN_COMMON)
-#   define COMMON_IMPEXP __attribute__ ((dllexport))
+#   define COMMON_IMPEXP __declspec (dllexport)
#  else
-#   define COMMON_IMPEXP __attribute__ ((dllimport))
+#   define COMMON_IMPEXP __declspec (dllimport)
#  endif
# else
#  define COMMON_IMPEXP
@@ -128,9 +127,9 @@ AT_DATA([module.h],
#if defined(__CYGWIN__) || defined(_WIN32)
# if defined(DLL_EXPORT) || defined(USING_MODULE_DLL)
#  if defined(LIBTOOL_TEST_IN_MODULE)
-#   define MODULE_IMPEXP __attribute__ ((dllexport))
+#   define MODULE_IMPEXP __declspec (dllexport)
#  else
-#   define MODULE_IMPEXP __attribute__ ((dllimport))
+#   define MODULE_IMPEXP __declspec (dllimport)
#  endif
# else
#  define MODULE_IMPEXP
@@ -174,9 +173,9 @@ AT_DATA([lib.h],
#if defined(__CYGWIN__) || defined(_WIN32)
# if defined(DLL_EXPORT) || defined(USING_LIB_DLL)
#  if defined(LIBTOOL_TEST_IN_LIB)
-#   define LIB_IMPEXP __attribute__ ((dllexport))
+#   define LIB_IMPEXP __declspec (dllexport)
#  else
-#   define LIB_IMPEXP __attribute__ ((dllimport))
+#   define LIB_IMPEXP __declspec (dllimport)
#  endif
# else
#  define LIB_IMPEXP



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



Re: [PATCH 1/2] tests: __declspec (dll{ex, im}port) in tests/exceptions.at

2010-09-20 Thread Peter Rosin
Hi Bob,

Den 2010-09-20 17:57 skrev Bob Friesenhahn:
> On Mon, 20 Sep 2010, Peter Rosin wrote:
>> I have tested this patch on MinGW/gcc and Cygwin/gcc and they are both
>> ok with the __declspec() notation.  On MSVC, the test goes from skip
>> to fail, as it needs 2/2.
> 
> This patch looks good to apply, as does the 2/2 patch to make sure that
> lt__PROGRAM__LTX_preloaded_symbols is globally scoped and "extern C".

Both pushed, thanks for looking them over!

Cheers,
Peter



Re: [PATCH 6/6] maint: use sed instead of maintaining 2 README files.

2010-09-20 Thread Ralf Wildenhues
Hello Gary,

* Gary V. Vaughan wrote on Sun, Sep 19, 2010 at 05:46:25AM CEST:
> On 18 Sep 2010, at 13:40, Ralf Wildenhues wrote:
> > * Gary V. Vaughan wrote on Sat, Sep 18, 2010 at 07:20:18AM CEST:
> >> +  sed -e '/^This is GNU Libtool,/,/^interface.$/c\
> >> +This is an alpha testing release of GNU Libtool, a generic library\
> >> +support script.  Libtool hides the complexity of using shared libraries\
> >> +behind a consistent, portable interface.' $file > $file.T \
> > 
> > this script will wrongly exit with status 0 if the stdout redirection
> > fails at this point.
> 
> Ah, true.  I was trying to keep the script simple, and overdid it a bit.  In
> light of that, and my having noticed that the script also didn't complain if
> sed was unable to match any text to edit, I've now improved the script thus:

Well, your improvements:

> >   # Make sure the paragraph we are matching has not been edited since
> >   # this script was written.
> >   matched=`sed -n -e '/^This is GNU Libtool,/,/^interface.$/p' $file \
> >   |wc -l |sed 's|^ *||'`
> >   test 3 = "$matched" \
> >   || func_fatal_error "$file format has changed, please fix \`$0'"

actually caused a regression: this code will cause 'make distcheck' to
fail, because at 'make dist' time the file will be rewritten before
being added to the tarball (if the version doesn't indicate a stable
release), then when distcheck tries to create yet another tarball, the
above check will catch:

| case 2.2.11a in \
|   *[a-z]) /bin/sh ../libltdl/config/edit-readme-alpha libtool-2.2.11a/README 
;; \
| esac
| edit-readme-alpha: libtool-2.2.11a/README format has changed, please fix 
`../libltdl/config/edit-readme-alpha'
| make[3]: *** [dist-hook] Error 1
| make[3]: *** Waiting for unfinished jobs

Cheers,
Ralf



[PATCH] build: ship autobuild.m4, to reduce bootstrap requirement

2010-09-20 Thread Eric Blake
Shipping a copy of autobuild.m4 makes it so that users need not
pre-install autobuild just for aclocal to find the macro AB_INIT.

* libltdl/m4/.gitignore: Drop autobuild.m4.
* libltdl/m4/autobuild.m4: New file, copied from autobuild.
* configure.ac (AB_INIT): Unconditionally call it.

Signed-off-by: Eric Blake 
---

> Be sure to *not* list autobuild.m4 anywhere else, e.g., in Makefile.am.
> It is picked up automatically.  You can make the AB_INIT call in
> configure.ac unconditional, but then again, no loss in leaving it as it
> is.

I've tested that 'make dist' does include autobuild.m4.

 ChangeLog   |7 +++
 configure.ac|3 +--
 libltdl/m4/.gitignore   |1 -
 libltdl/m4/autobuild.m4 |   40 
 4 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 libltdl/m4/autobuild.m4

diff --git a/ChangeLog b/ChangeLog
index 8ed47f7..d468552 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-20  Eric Blake  
+
+   build: ship autobuild.m4, to reduce bootstrap requirement
+   * libltdl/m4/.gitignore: Drop autobuild.m4.
+   * libltdl/m4/autobuild.m4: New file, copied from autobuild.
+   * configure.ac (AB_INIT): Unconditionally call it.
+
 2010-09-20  Peter Rosin  
Ralf Wildenhues  

diff --git a/configure.ac b/configure.ac
index 0fcf109..131cd3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,8 +138,7 @@ AM_INIT_AUTOMAKE([1.11.1 gnu subdir-objects dist-xz 
color-tests parallel-tests])
 # string for this build.
 : ${autobuild_mode=default}
 AB_VERSION="AC_PACKAGE_VERSION ($TIMESTAMP)"
-m4_ifdef([AB_INIT],
-[AB_INIT([$autobuild_mode])])
+AB_INIT([$autobuild_mode])


 dnl We use m4sh to generate libtool's portable shell scripts
diff --git a/libltdl/m4/.gitignore b/libltdl/m4/.gitignore
index 81a1059..0b52c5c 100644
--- a/libltdl/m4/.gitignore
+++ b/libltdl/m4/.gitignore
@@ -1,2 +1 @@
 ltversion.m4
-autobuild.m4
diff --git a/libltdl/m4/autobuild.m4 b/libltdl/m4/autobuild.m4
new file mode 100644
index 000..93ccb54
--- /dev/null
+++ b/libltdl/m4/autobuild.m4
@@ -0,0 +1,40 @@
+# autobuild.m4 serial 7
+dnl Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# Usage: AB_INIT([MODE]).
+AC_DEFUN([AB_INIT],
+[
+  AC_REQUIRE([AC_CANONICAL_BUILD])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
+  if test -z "$AB_PACKAGE"; then
+AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE}
+  fi
+  AC_MSG_NOTICE([autobuild project... $AB_PACKAGE])
+
+  if test -z "$AB_VERSION"; then
+AB_VERSION=${PACKAGE_VERSION:-$VERSION}
+  fi
+  AC_MSG_NOTICE([autobuild revision... $AB_VERSION])
+
+  hostname=`hostname`
+  if test "$hostname"; then
+AC_MSG_NOTICE([autobuild hostname... $hostname])
+  fi
+
+  ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
+
+  date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ`
+  if test "$?" != 0; then
+date=`date`
+  fi
+  if test "$date"; then
+AC_MSG_NOTICE([autobuild timestamp... $date])
+  fi
+])
-- 
1.7.2.3




Re: [PATCH] build: ship autobuild.m4, to reduce bootstrap requirement

2010-09-20 Thread Ralf Wildenhues
* Eric Blake wrote on Mon, Sep 20, 2010 at 08:13:25PM CEST:
> Shipping a copy of autobuild.m4 makes it so that users need not
> pre-install autobuild just for aclocal to find the macro AB_INIT.
> 
> * libltdl/m4/.gitignore: Drop autobuild.m4.
> * libltdl/m4/autobuild.m4: New file, copied from autobuild.
> * configure.ac (AB_INIT): Unconditionally call it.

OK thanks!

Cheers,
Ralf



Re: [PATCH] build: ship autobuild.m4, to reduce bootstrap requirement

2010-09-20 Thread Eric Blake

On 09/20/2010 12:44 PM, Ralf Wildenhues wrote:

* Eric Blake wrote on Mon, Sep 20, 2010 at 08:13:25PM CEST:

Shipping a copy of autobuild.m4 makes it so that users need not
pre-install autobuild just for aclocal to find the macro AB_INIT.

* libltdl/m4/.gitignore: Drop autobuild.m4.
* libltdl/m4/autobuild.m4: New file, copied from autobuild.
* configure.ac (AB_INIT): Unconditionally call it.


OK thanks!


Pushed.

--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



Re: libtool does not recognize lib64 -- Update to Olly Betts' patch

2010-09-20 Thread Toshio Kuratomi
On Sat, Sep 11, 2010 at 04:04:04PM -0400, Toshio Kuratomi wrote:
> Greetings.  I package software for Fedora and frequently get hit with
> /usr/lib64 being added as an rpath in builds.  I found what I think is the
> last thread on this subject here:
>   http://lists.gnu.org/archive/html/libtool-patches/2010-06/msg00141.html
> 
> In the second message, Olly Betts links to a message from 2007 where he
> proposed a patch that would solve this by parsing the output of
> /sbin/ldconfig rather than trying to parse /etc/ld.so.conf.  The thread
> ended with a positive view of the patch and a request to update the patch
> for current libtool.  This last step doesn't appear to have happened.
> 
> Since I care about this issue, I've gone ahead and ported the patch to
> current git master.  I'm attaching it here.
> 
Anything I need to do to get this looked at?

Thanks,
-Toshio


pgpbSNk4aRWEo.pgp
Description: PGP signature


Re: libtool does not recognize lib64 -- Update to Olly Betts' patch

2010-09-20 Thread Ralf Wildenhues
* Toshio Kuratomi wrote on Mon, Sep 20, 2010 at 10:20:09PM CEST:
> On Sat, Sep 11, 2010 at 04:04:04PM -0400, Toshio Kuratomi wrote:
> > Greetings.  I package software for Fedora and frequently get hit with
> > /usr/lib64 being added as an rpath in builds.  I found what I think is the
> > last thread on this subject here:
> >   http://lists.gnu.org/archive/html/libtool-patches/2010-06/msg00141.html
> > 
> > In the second message, Olly Betts links to a message from 2007 where he
> > proposed a patch that would solve this by parsing the output of
> > /sbin/ldconfig rather than trying to parse /etc/ld.so.conf.  The thread
> > ended with a positive view of the patch and a request to update the patch
> > for current libtool.  This last step doesn't appear to have happened.
> > 
> > Since I care about this issue, I've gone ahead and ported the patch to
> > current git master.  I'm attaching it here.
> > 
> Anything I need to do to get this looked at?

I'm looking at it.  The patch has issues, the approach itself has issues
too, and is definitely not ready for the upcoming release.

Details when I have them sorted out.

Thanks,
Ralf



Re: libtool-2.2.11a on AIX 5.3 current git master 2010-08-25 /status

2010-09-20 Thread Ralf Wildenhues
[ adding libtool-patches ]

Hello Rainer, all,

* Rainer Tammer wrote on Sun, Sep 19, 2010 at 12:55:59PM CEST:
> here is the result of the bisect. I had to slightly change your
> suggested bisect script:
> 
> if grep 'FAIL: f[c7]*demo-exec' checklog; then
> ->
> if grep '^FAIL: ' checklog; then
> 
> Result:

> 2fc264a8e2f7224627bb7c191a38a2dc9e7b5bcb is first bad commit
> commit 2fc264a8e2f7224627bb7c191a38a2dc9e7b5bcb
> Author: Ralf Wildenhues 
> Date:   Fri Aug 6 22:03:19 2010 +0200
> 
> Fix AC_NO_EXECUTABLES test failure on AIX.
> 
> * libltdl/m4/libtool.m4 (_LT_SYS_MODULE_PATH_AIX): Wrap link
> test in AC_CACHE_VAL, using cache variable $lt_cv_aix_libpath.
> * tests/no-executables.at (AC_NO_EXECUTABLES): Preset it, to
> avoid link test.
> Bug report by Rainer Tammer.

Thank You! for carrying this through until the end!  The timing is
really at the last minute, before this becomes a regression in a
released version.

As far as I can see it, the semantic change of the above patch is that,
before the patch, _LT_SYS_MODULE_PATH_AIX computed the libpath value for
each compiler separately, while now it is done only once, by the C
compiler, and that result reused for the others.  A quick test reveals
that the different compilers add different directories to their path.

Now, The Right Thing[tm] would probably be to somehow merge these paths
intelligently, so that when we link C, C++, and Fortran code together,
all directories are available.  However, at this point I'm *only*
interested in avoiding *regressions* and still keeping the
no-executables issue fixed.

Thus, the attached patch uses, in addition to a global cache variable
(that the user may specify), a set of per-language cache variables.
(The trailing space in the tagvar name is because the CC tagvar has no
_CC suffix, but should not overlap with the global name.)

I'm running it on the AIX systems I have access to now.

Rainer, can you please try it on your problematic system, too, ASAP?

OK to commit?

Thanks,
Ralf
>From c723aee17f21478894ba038711afde125daa1f70 Mon Sep 17 00:00:00 2001
From: Ralf Wildenhues 
Date: Mon, 20 Sep 2010 21:51:55 +0200
Subject: [PATCH] Revert to per-language libpath computation on AIX.

* libltdl/m4/libtool.m4 (_LT_SYS_MODULE_PATH_AIX): Accept
tagname argument.  Use global cache variable lt_cv_aix_libpath
to override per-language tag variables for the libpath value.
Fix the sed script to remove trailing space.
(_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Pass tag argument to
_LT_SYS_MODULE_PATH_AIX.
Tracked down and reported by Rainer Tammer.

Signed-off-by: Ralf Wildenhues 
---
 ChangeLog |   11 ++
 libltdl/m4/libtool.m4 |   54 
 2 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8ed47f7..3a87052 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-20  Ralf Wildenhues  
+
+   Revert to per-language libpath computation on AIX.
+   * libltdl/m4/libtool.m4 (_LT_SYS_MODULE_PATH_AIX): Accept
+   tagname argument.  Use global cache variable lt_cv_aix_libpath
+   to override per-language tag variables for the libpath value.
+   Fix the sed script to remove trailing space.
+   (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Pass tag argument to
+   _LT_SYS_MODULE_PATH_AIX.
+   Tracked down and reported by Rainer Tammer.
+
 2010-09-20  Peter Rosin  
Ralf Wildenhues  
 
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index a8b07bf..2aee398 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1073,33 +1073,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   fi
 ])
 
-# _LT_SYS_MODULE_PATH_AIX
-# ---
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# --
 # Links a minimal program and checks the executable
 # for the system default hardcoded library path. In most cases,
 # this is /usr/lib:/lib, but when the MPI compilers are used
 # the location of the communication and MPI libs are included too.
 # If we don't find anything, use the default library path according
 # to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-AC_CACHE_VAL([lt_cv_aix_libpath],
-[AC_LINK_IFELSE([AC_LANG_PROGRAM],[
-lt_aix_libpath_sed='
-/Import File Strings/,/^$/ {
-   /^0/ {
-   s/^0  *\(.*\)$/\1/
-   p
-   }
-}'
-lt_cv_aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e 
"$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$lt_cv_aix_libpath"; then
-  lt_cv_aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e 
"$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$lt_cv_aix_libpath"; then lt_cv_aix_libpath="/usr/lib:/lib"; fi
-])
-aix_libpath=$lt_cv_aix_libp

[PATCH] maint: drop autobuild requirement

2010-09-20 Thread Eric Blake
* HACKING: Update.

Signed-off-by: Eric Blake 
---

I'm pushing this under the obvious rule, given that the whole point
of my previous patch was to remove this dependency, and since this
is a docs-only patch.

 ChangeLog |3 +++
 HACKING   |4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d468552..ceb193c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-09-20  Eric Blake  

+   maint: drop autobuild requirement
+   * HACKING: Update.
+
build: ship autobuild.m4, to reduce bootstrap requirement
* libltdl/m4/.gitignore: Drop autobuild.m4.
* libltdl/m4/autobuild.m4: New file, copied from autobuild.
diff --git a/HACKING b/HACKING
index d36b7f0..977be10 100644
--- a/HACKING
+++ b/HACKING
@@ -602,9 +602,7 @@ or obtained by writing to the Free Software Foundation, 
Inc.,
   (esp. bug-libtool) for outstanding bug reports also in the list of
   pending moderation requests.

-* Make sure you have wget, xz, and autobuild installed.  aclocal should be
-  able to find autobuild.m4; or you can install it into the tree with
- aclocal -I libltdl/m4 --install
+* Make sure you have wget and xz installed.

 * Make sure your locale is sane, e.g. by exporting LC_ALL=C.

-- 
1.7.2.3




Re: libtool does not recognize lib64 -- Update to Olly Betts' patch

2010-09-20 Thread Toshio Kuratomi
On Mon, Sep 20, 2010 at 10:25:06PM +0200, Ralf Wildenhues wrote:
> * Toshio Kuratomi wrote on Mon, Sep 20, 2010 at 10:20:09PM CEST:
> > On Sat, Sep 11, 2010 at 04:04:04PM -0400, Toshio Kuratomi wrote:
> > > Greetings.  I package software for Fedora and frequently get hit with
> > > /usr/lib64 being added as an rpath in builds.  I found what I think is the
> > > last thread on this subject here:
> > >   http://lists.gnu.org/archive/html/libtool-patches/2010-06/msg00141.html
> > > 
> > > In the second message, Olly Betts links to a message from 2007 where he
> > > proposed a patch that would solve this by parsing the output of
> > > /sbin/ldconfig rather than trying to parse /etc/ld.so.conf.  The thread
> > > ended with a positive view of the patch and a request to update the patch
> > > for current libtool.  This last step doesn't appear to have happened.
> > > 
> > > Since I care about this issue, I've gone ahead and ported the patch to
> > > current git master.  I'm attaching it here.
> > > 
> > Anything I need to do to get this looked at?
> 
> I'm looking at it.  The patch has issues, the approach itself has issues
> too, and is definitely not ready for the upcoming release.
> 
> Details when I have them sorted out.
> 
No problem, thsanks for looking.

/me Awaits list of things to work on :-)
-Toshio


pgpkEjZo5lfik.pgp
Description: PGP signature


Re: [PATCH] Skip need_lib_prefix.at on systems without lib prefix on libraries.

2010-09-20 Thread Roumen Petrov

Peter Rosin wrote:

Den 2010-09-18 00:04 skrev Roumen Petrov:

Hi Peter,

Peter Rosin wrote:

Hi!

need_lib_prefix.at currently fails with MSVC.


Hmm probably test fail as shared library is build without -no-undefined  flag.

Did libtool MSC allow creation of shared libraries without -no-undefined ?

On windows platforms (msc, gcc(mingw*)) may be the test require some PATH 
magics.
(as example like func_fix_path from static.at test)


You are barking up the wrong tree, since:

1. The test passes on MinGW and Cygwin with gcc, if wouldn't do that if
-no-undefined was the cause of the fail.




2. The patch in the old quoted message makes the test pass on MSVC, which
it wouldn't do if -no-undefined was the cause of the fail.

"PATH magic" is not relevant if -no-undefined is not passed, since everything
should be static in that case (no dlls created).


But the libtool command contain -rpath so the test build shared and 
static libraries .



1) linux native build:
$ cd .../testsuite.dir/086
$ strace -f ./main 2>&1 | grep foo
open("/.libs/tls/i686/libfoo1.so", O_RDONLY) = -1 ENOENT (No such 
file or directory)
open("/.libs/tls/libfoo1.so", O_RDONLY) = -1 ENOENT (No such file or 
directory)
open("/.libs/i686/libfoo1.so", O_RDONLY) = -1 ENOENT (No such file 
or directory)

open("/.libs/libfoo1.so", O_RDONLY) = 3
open("/.libs/libfoo2.so", O_RDONLY) = 3
write(1, "libfoo1: 2\nlibfoo2: 3\n", 22libfoo1: 2
libfoo2: 3

$ ls .../testsuite.dir/086/.libs/
foo1.la@  foo1.lai  foo1.o  foo2.o  libfoo1.a  libfoo1.so*  libfoo2.a 
libfoo2.la@  libfoo2.lai  libfoo2.so*  lt-main*  main*  mainS.o


Result test pass. Both static and shared libraries are created. The 
executable load shared.



2) In cross-build env. verbose more:

libtool: link: ( cd ".libs" && rm -f "foo1.la" && ln -s "../foo1.la" 
"foo1.la" )
/X/need_lib_prefix.at:165: $LIBTOOL --mode=link $CC -module 
-avoid-version $CFLAGS $LDFLAGS -o libfoo2.la foo2.lo -rpath $instdir/lib

stderr:
libtool: link: warning: undefined symbols not allowed in 
i386-pc-mingw32msvc shared libraries



$ ls .libs/
foo1.la@  foo1.lai  foo1.o  foo2.o  libfoo1.a  libfoo2.a  libfoo2.la@ 
libfoo2.lai  lt-main.c  main.exe*  main.exeS.o  main_ltshwrapper


Result the test pass. Shared libraries are not created.


I'm not convinced that test is correct for windows platforms.


3)  In cross-build env. and test patched with -no-undefined :
$ ls .libs/
foo1.la@  foo1.o  libfoo1.a libfoo1.dll.a  libfoo2.dll* 
libfoo2.la@  lt-main.c  main.exeS.o
foo1.lai  foo2.o  libfoo1.dll*  libfoo2.a  libfoo2.dll.a 
libfoo2.lai  main.exe*  main_ltshwrapper


Result test skipped = failed.

3.1)
$ cd .../testsuite.dir/086/.libs/
$ ./main.exe
libfoo2: 3
function `f' not found: Procedure not found
error during preloading.

$ strace -f ./main.exe 2>&1 | grep foo
[pid   353] stat64("/086/.libs/libfoo1.dll", {st_mode=S_IFREG|0755, 
st_size=809650, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo1.dll", {st_mode=S_IFREG|0755, 
st_size=809650, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo1.dll", {st_mode=S_IFREG|0755, 
st_size=809650, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo1.dll", {st_mode=S_IFREG|0755, 
st_size=809650, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo1.dll", {st_mode=S_IFREG|0755, 
st_size=809650, ...}) = 0
[pid   338] open("/086/.libs/libfoo1.dll", 
O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 78
[pid   353] stat64("/086/.libs/libfoo1.dll", {st_mode=S_IFREG|0755, 
st_size=809650, ...}) = 0

[pid   353] open("/086/.libs/libfoo1.dll", O_RDONLY) = 9
[pid   353] open("/opt/wine/1.3.1/lib/wine/libfoo1.dll.so", O_RDONLY) = 
-1 ENOENT (No such file or directory)
[pid   353] open("/opt/wine/1.3.1/lib/wine/libfoo1.dll.so", 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid   353] stat64("/086/.libs/libfoo2.dll", {st_mode=S_IFREG|0755, 
st_size=809656, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo2.dll", {st_mode=S_IFREG|0755, 
st_size=809656, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo2.dll", {st_mode=S_IFREG|0755, 
st_size=809656, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo2.dll", {st_mode=S_IFREG|0755, 
st_size=809656, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo2.dll", {st_mode=S_IFREG|0755, 
st_size=809656, ...}) = 0
[pid   338] open("/086/.libs/libfoo2.dll", 
O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 79
[pid   353] stat64("/086/.libs/libfoo2.dll", {st_mode=S_IFREG|0755, 
st_size=809656, ...}) = 0

[pid   353] open("/086/.libs/libfoo2.dll", O_RDONLY) = 9
[pid   353] open("/opt/wine/1.3.1/lib/wine/libfoo2.dll.so", O_RDONLY) = 
-1 ENOENT (No such file or directory)
[pid   353] open("/opt/wine/1.3.1/lib/wine/libfoo2.dll.so", 
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid   353] stat64("/086/.libs/libfoo1.dll", {st_mode=S_IFREG|0755, 
st_size=809650, ...}) = 0
[pid   353] stat64("/086/.libs/libfoo1.dll", {st_mode=S_IFREG|0755, 
st_size=809650, ...}) =

[PATCH] maint: edit-readme-alpha shouldn't try to re-edit during dist.

2010-09-20 Thread Gary V. Vaughan
Hallo Ralf,

On 21 Sep 2010, at 00:34, Ralf Wildenhues wrote:
> a regression: this code will cause 'make distcheck' to
> fail, because at 'make dist' time the file will be rewritten before
> being added to the tarball (if the version doesn't indicate a stable
> release), then when distcheck tries to create yet another tarball, the
> above check will catch:
> 
> | case 2.2.11a in \
> |   *[a-z]) /bin/sh ../libltdl/config/edit-readme-alpha 
> libtool-2.2.11a/README ;; \
> | esac
> | edit-readme-alpha: libtool-2.2.11a/README format has changed, please fix 
> `../libltdl/config/edit-readme-alpha'
> | make[3]: *** [dist-hook] Error 1
> | make[3]: *** Waiting for unfinished jobs

Ah.  D'oh.

Well, it does at least show that the script interacts correctly with
an error for make to help catch the case where someone commits a change
to the first paragraph of README without a matching edit to the sed
expressions in edit-readme-alpha.

Here is (an overkill) patch to not exit with an error, so that `make
distcheck' can complete.

Okay to push?

* libltdl/config/edit-readme-alpha: If README is non-writable
assume that it is being run from distcheck, and bail out with
a warning (to help diagnose cases where the heuristic is not
correct).  However, if README has already been edited to the
alpha text, quietly skip without an error message.
---
 ChangeLog|9 +
 libltdl/config/edit-readme-alpha |   15 ++-
 2 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ceb193c..342c2ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-21  Gary V. Vaughan  
+
+   maint: edit-readme-alpha shouldn't try to re-edit during dist.
+   * libltdl/config/edit-readme-alpha: If README is non-writable
+   assume that it is being run from distcheck, and bail out with
+   a warning (to help diagnose cases where the heuristic is not
+   correct).  However, if README has already been edited to the
+   alpha text, quietly skip without an error message.
+
 2010-09-20  Eric Blake  
 
maint: drop autobuild requirement
diff --git a/libltdl/config/edit-readme-alpha b/libltdl/config/edit-readme-alpha
index 6070a31..c60fbc0 100755
--- a/libltdl/config/edit-readme-alpha
+++ b/libltdl/config/edit-readme-alpha
@@ -55,10 +55,23 @@ func_fatal_error ()
 
 
 for file in "$@"; do
+  # Assume that read-only README indicates that we are running inside
+  # the latter part of a `make distcheck'.
+  test -w $file || {
+echo "$progname: not editing non-writeable \`$file' (distcheck?)"
+continue
+  }
+
   # Make sure the paragraph we are matching has not been edited since
   # this script was written.
-  matched=`sed -n -e '/^This is GNU Libtool,/,/^interface.$/p' $file \
+  matched=`sed -n -e '/^This is GNU Libtool,/,/^interface\.$/p' $file \
   |wc -l |sed 's|^ *||'`
+
+  # Unless, of course, it was edited by this script already.
+  test 3 = "$matched" \
+  || matched=`sed -n -e '/^This is an alpha testing release/,/behind a 
consistent, portable interface\.$/p' $file \
+  |wc -l |sed 's|^ *||'`
+
   test 3 = "$matched" \
   || func_fatal_error "$file format has changed, please fix \`$0'"
 
-- 
1.7.2.2




Re: [PATCH] maint: edit-readme-alpha shouldn't try to re-edit during dist.

2010-09-20 Thread Ralf Wildenhues
Hi Gary,

* Gary V. Vaughan wrote on Tue, Sep 21, 2010 at 03:05:46AM CEST:
> Well, it does at least show that the script interacts correctly with
> an error for make to help catch the case where someone commits a change
> to the first paragraph of README without a matching edit to the sed
> expressions in edit-readme-alpha.
> 
> Here is (an overkill) patch to not exit with an error, so that `make
> distcheck' can complete.
> 
> Okay to push?

Well, I don't want to appear overly nitpicky for this issue,
but if you don't absolutely need to check and skip non-writable files,
I wouldn't do it, and rather error out in that case.

> * libltdl/config/edit-readme-alpha: If README is non-writable
> assume that it is being run from distcheck, and bail out with
> a warning

FWIW, exiting 0 is not what I'd call "bail out".

> (to help diagnose cases where the heuristic is not
> correct).  However, if README has already been edited to the
> alpha text, quietly skip without an error message.

> --- a/libltdl/config/edit-readme-alpha
> +++ b/libltdl/config/edit-readme-alpha
> @@ -55,10 +55,23 @@ func_fatal_error ()
>  
>  
>  for file in "$@"; do
> +  # Assume that read-only README indicates that we are running inside
> +  # the latter part of a `make distcheck'.
> +  test -w $file || {
> +echo "$progname: not editing non-writeable \`$file' (distcheck?)"

If you prefer to, or need to keep the warning+skip, I suggest to
print warnings on stderr.

> +continue
> +  }
> +
># Make sure the paragraph we are matching has not been edited since
># this script was written.
> -  matched=`sed -n -e '/^This is GNU Libtool,/,/^interface.$/p' $file \
> +  matched=`sed -n -e '/^This is GNU Libtool,/,/^interface\.$/p' $file \
>|wc -l |sed 's|^ *||'`
> +
> +  # Unless, of course, it was edited by this script already.
> +  test 3 = "$matched" \
> +  || matched=`sed -n -e '/^This is an alpha testing release/,/behind a 
> consistent, portable interface\.$/p' $file \
> +  |wc -l |sed 's|^ *||'`

Indentation is a bit weird here, I'd have expected the | to align one
after the ` in the line above.

> +
>test 3 = "$matched" \
>|| func_fatal_error "$file format has changed, please fix \`$0'"

Thanks,
Ralf



Re: [PATCH] maint: edit-readme-alpha shouldn't try to re-edit during dist.

2010-09-20 Thread Ralf Wildenhues
* Gary V. Vaughan wrote on Tue, Sep 21, 2010 at 08:44:41AM CEST:
> With those addressed, and another successful distcheck, okay to push?

Sure.

Thanks,
Ralf



Re: [PATCH] maint: edit-readme-alpha shouldn't try to re-edit during dist.

2010-09-20 Thread Gary V. Vaughan
On 21 Sep 2010, at 12:07, Ralf Wildenhues wrote:
> Hi Gary,

Hallo Ralf,

Thanks again for the review.

> * Gary V. Vaughan wrote on Tue, Sep 21, 2010 at 03:05:46AM CEST:
>> Well, it does at least show that the script interacts correctly with
>> an error for make to help catch the case where someone commits a change
>> to the first paragraph of README without a matching edit to the sed
>> expressions in edit-readme-alpha.
>> 
>> Here is (an overkill) patch to not exit with an error, so that `make
>> distcheck' can complete.
>> 
>> Okay to push?
> 
> Well, I don't want to appear overly nitpicky for this issue,
> but if you don't absolutely need to check and skip non-writable files,
> I wouldn't do it, and rather error out in that case.

Well, the thing that is screwing up distcheck is when the distribution
tarball is unpacked into a read-only tree, and edit-readme-alpha wants
to rewrite the file again...

...although, the "don't re-edit when the alpha text is already there"
check later on should catch this already.  Although I feel happier with
both checks in place, I'll remove the writeable test if you'd prefer.

>> * libltdl/config/edit-readme-alpha: If README is non-writable
>> assume that it is being run from distcheck, and bail out with
>> a warning
> 
> FWIW, exiting 0 is not what I'd call "bail out".

I mean "bail out" as in: don't do the rest of the processing.

>> for file in "$@"; do
>> +  # Assume that read-only README indicates that we are running inside
>> +  # the latter part of a `make distcheck'.
>> +  test -w $file || {
>> +echo "$progname: not editing non-writeable \`$file' (distcheck?)"
> 
> If you prefer to, or need to keep the warning+skip, I suggest to
> print warnings on stderr.

Oops.  Well caught, thanks.

>> +continue
>> +  }
>> +
>>   # Make sure the paragraph we are matching has not been edited since
>>   # this script was written.
>> -  matched=`sed -n -e '/^This is GNU Libtool,/,/^interface.$/p' $file \
>> +  matched=`sed -n -e '/^This is GNU Libtool,/,/^interface\.$/p' $file \
>>   |wc -l |sed 's|^ *||'`
>> +
>> +  # Unless, of course, it was edited by this script already.
>> +  test 3 = "$matched" \
>> +  || matched=`sed -n -e '/^This is an alpha testing release/,/behind a 
>> consistent, portable interface\.$/p' $file \
>> +  |wc -l |sed 's|^ *||'`
> 
> Indentation is a bit weird here, I'd have expected the | to align one
> after the ` in the line above.

Okay.  I was lining it up with previous clause, but it is ugly.  I'll fix
that too.

With those addressed, and another successful distcheck, okay to push?

Cheers,
-- 
Gary V. Vaughan (g...@gnu.org)

PGP.sig
Description: This is a digitally signed message part