Re: libtool fails with uninstalled frameworks and the -F flag

2014-02-01 Thread Peter O'Gorman
Hmm, -F should be passed through unmolested.

  # Flags to be passed through unchanged, with rationale:
  # -64, -mips[0-9]  enable 64-bit mode for the SGI compiler
  # -r[0-9][0-9]*specify processor for the SGI compiler
  # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
  # +DA*, +DD*   enable 64-bit mode for the HP compiler
  # -q*  compiler args for the IBM compiler
  # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
  # -F/path  path to uninstalled frameworks, gcc on darwin
  # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
  # @fileGCC response files
  # -tp=*Portland pgcc target processor selection
  # --sysroot=*  for sysroot support
  # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time 
optimization
  # -stdlib=*select c++ std lib with clang
  -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| 
\
  -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)

What version of GNU libtool are you using?

Peter


On Jan 31, 2014, at 3:06 PM, Michael C. Grant m...@cvxr.com wrote:

 Gary,
 
 Sorry for the delay. I think I'm going to have to give up on this one. I'm 
 afraid my understanding of libtool internals as well as Darwin -framework 
 idiosyncracies are insufficient to the task.
 
 Fortunately, the issue we were having with Octave compilation has been 
 resolved by other means (actually by forcing link-all-dependencies in libtool 
 whenever an uninstalled framework is encountered).
 
 Feel free to close this for now. If I get ambitious and figure things out 
 more fully I will take another crack at it.
 
 On Jan 13, 2014, at 8:50 PM, Gary V. Vaughan g...@gnu.org wrote:
 
 Hi Michael,
 
 [moved to libtool-patches list]
 
 On Jan 14, 2014, at 11:45 AM, Michael C. Grant m...@cvxr.com wrote:
 
 I'm trying to compile GNU Octave and its new Qt GUI on a Mac OSX with 
 Homebrew. Homebrew installs the Qt frameworks in 
 /usr/local/Cellar/qt/4.8.5/lib, so after some fiddling with the configure 
 script I get this:
 
 QT_LDFLAGS=-F/usr/local/Cellar/qt/4.8.5/lib
 QT_LIBS=-framework QtCore -framework QtGui -framework QtNetwork
 
 However, the libtool script does not handle the -F argument through 
 properly, so it is stripped out of the linking process.
 
 I created the following patch for the generated libtool script, which 
 causes libtool to treat -F exactly like it treats -L. This seems to do the 
 trick.
 
 I did notice that scanning through past discussions that this has come up a 
 couple of times, but there is reluctance to provide full support for -F for 
 some reason. Perhaps the relative simplicity of this patch would convince 
 you to reconsider. I'm also discussing this with the Homebrew folks to see 
 if they would consider including in their formula, but they do prefer not 
 to use patches if they can help it.
 
 Thanks for the patch.  Sorry I didn't reply to your earlier emails - I 
 marked them for further attention, but didn't make the time to actually go 
 back and respond.
 
 My main worry is whether that changing libtool's treatment of -F is going to 
 do something unexpected on another platform.  That said, apart from your 
 conflating of -L and -F in the case branches with the patch you sent, I'm 
 open to including it in the upcoming release if you don't mind reworking it 
 a little?
 
 Please keep the -L and -F branches separate, factoring the branch bodies 
 into a shell function if necessary to prevent cut-n-pasting blocks of code 
 between the two.  Bonus points if you could also make -F behave as before on 
 all platforms but *-darwin*.
 
 If you have github, I keep a mirror of libtool at 
 http://github.com/gvvaughan/GNU-libtool, so that might be a more convenient 
 way for you to submit a pull request than dropping patch attachments into 
 the mailing list.
 
 I have a couple of small fixes of my own that I need to polish and push, and 
 then I'll do another round of platform testing to nail down what else is a 
 show-stopper for a final pre-release.
 
 Cheers,
 -- 
 Gary V. Vaughan (gary AT gnu DOT org)
 
 




Re: [PATCH] Update/simplify OpenBSD support

2012-08-21 Thread Peter O'Gorman

On 08/21/2012 09:03 PM, Brad Smith wrote:


I added the missing 'n' first though :)


Sorry about that. Looking at the commited diff there is still an
issue on line 2722.



Thanks Brad,

I 'fixed' it, but didn't commit. :( Now the 'n' gets a commit all by itself.

I have no excuse, it's not even Monday.

Peter



Re: [PATCH] Pass -g* through to linker

2012-08-21 Thread Peter O'Gorman

Pushed. Thanks!

Peter

On 08/21/2012 09:46 AM, Andreas Schwab wrote:

This is needed for -flto so that debugging information isn't dropped.

* ltmain.m4sh (func_mode_link): Pass through -g*.
---
  build-aux/ltmain.m4sh | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 30f99f4..55f1a0b 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -5090,11 +5090,11 @@ func_mode_link ()
# @fileGCC response files
# -tp=*Portland pgcc target processor selection
# --sysroot=*  for sysroot support
-  # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+  # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time 
optimization
# -stdlib=*select c++ std lib with clang
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \

-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-  -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
+  -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
  func_quote_for_eval $arg
arg=$func_quote_for_eval_result
  func_append compile_command  $arg






Re: [PATCH] Update/simplify OpenBSD support

2012-08-21 Thread Peter O'Gorman

Hi Brad,

Thanks, I pushed this.

On 08/02/2012 01:46 AM, Brad Smith wrote:


+  if test -z `echo __ELF__ | $CC -E - | $GREP __ELF__`; the


I added the missing 'n' first though :)

Peter




Re: AIX PIC shared library support

2012-08-21 Thread Peter O'Gorman

Pushed. Thanks!

Peter

On 08/20/2012 12:12 PM, David Edelsohn wrote:

The GCC -fpic/-fPIC option has evolved to mean code generation for a
shared library and changes the optimization behavior of the compiler.
Code for AIX PowerPC always is PIC, but the optimization behavior is
affecting AIX.

libtool exports all global symbols on AIX while GCC binds_local_p()
determines that some function calls are local, causing GCC to emit the
local (non-external) form of function calls, which generates AIX
linker warnings.

The IBM XL compiler defaults to the equivalent of -fpic.  GCC could
try to match that, but it requires working around other GCC bootstrap
problems and continually chasing compatibility.  The other option is
to assume that developers using GCC to build shared libraries either
are using libtool or copying FOSS Makefiles designed for GNU/Linux or
expecting GNU/Linux compatibility.

The following patch starts to implement the latter by adding -fPIC
to the compiler command line options when building objects for a
shared library.  Because this places control in the hands of the user
with a command line option and matches GNU/Linux, this seems better
than playing with defaults and fighting GCC semantics for building
shared libraries.

Comments?

Thanks, David

 * m4/libtool.m4 (_LT_COMPILER_PIC): Add -fPIC to GCC and GXX for AIX.

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index a8ecbc3..d0a5577 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -3874,6 +3874,7 @@ m4_if([$1], [CXX], [
 # AIX 5 now supports IA64 processor
 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
+  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;

  amigaos*)
@@ -4191,6 +4192,7 @@ m4_if([$1], [CXX], [
 # AIX 5 now supports IA64 processor
 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
+  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;

  amigaos*)






Re: [PATCH] libtool.m4: handle undefined from `getconf`

2012-04-18 Thread Peter O'Gorman
Thanks, pushed.

Peter

On 04/18/2012 11:00 PM, Mike Frysinger wrote:
 If a getconf value doesn't have a limit, getconf will display
 undefined. The libtool code though gets confused by this, so
 handle that specifically.
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 
 * m4/libtool.m4: Check for undefined from `getconf`.
 ---
  m4/libtool.m4 |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/m4/libtool.m4 b/m4/libtool.m4
 index 75bfdb4..a8ecbc3 100644
 --- a/m4/libtool.m4
 +++ b/m4/libtool.m4
 @@ -1692,7 +1692,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  ;;
*)
  lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2 /dev/null`
 -if test -n $lt_cv_sys_max_cmd_len; then
 +if test -n $lt_cv_sys_max_cmd_len  \
 +   test undefined != $lt_cv_sys_max_cmd_len; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
  else




Re: LD_LIBRARY_PATH - disappear of libdir after patch

2012-03-16 Thread Peter O'Gorman

Hi Paul,

On 03/16/2012 12:35 PM, Paul Seidler wrote:


I think I've got it:
libtool.m4 @@ -2195,16 +2195,16 @@



+  lt_fooi  = ;
should be
+  lt_foo = ;
?


I think we you a beer.

Thank you very much.

I pushed this.

Peter
From fbe09b44b5052273fe79ea24365c554a5d54d8ce Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Fri, 16 Mar 2012 13:23:13 -0500
Subject: [PATCH] Fix typo that caused sys_lib_search_path_spec to be wrong.

* m4/libtool.m4: s/lt_fooi/lt_foo/.
Reported by Paul Seidler se...@lavabit.com
---
 m4/libtool.m4 |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index e07ae4a..75bfdb4 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2201,7 +2201,7 @@ if test yes = $GCC; then
   done
   lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
 BEGIN {RS =  ; FS = /|\n;} {
-  lt_fooi  = ;
+  lt_foo = ;
   lt_count = 0;
   for (lt_i = NF; lt_i  0; lt_i--) {
 if ($lt_i !=   $lt_i != .) {
-- 
1.7.4.4



Re: bug#10029: Fix GNU/Hurd linker flags such

2012-02-21 Thread Peter O'Gorman

Hello Samuel,

I pushed this, thank you.

Peter

On 11/12/2011 08:21 AM, Samuel Thibault wrote:

Samuel Thibault, le Sat 12 Nov 2011 14:52:20 +0100, a écrit :

libtool is missing the GNU/Hurd case in a few places, resulting to build
issues in Debin GNU/Hurd, the attached patch fixes it, could you apply
it please?


Ooops, sorry, I forgot to remove the existing bits, which are basically
the same, but outdated and shall be factorized with other GNU platforms.
Here is an updated patch.

Samuel
From 98c159c3bbfaed0c007e935cbb976fdb76a2d0ae Mon Sep 17 00:00:00 2001
From: Samuel Thibault samuel.thiba...@gnu.org
Date: Tue, 21 Feb 2012 08:51:40 -0600
Subject: [PATCH] Improve GNU/Hurd support.

* m4/libtool.m4: Add gnu* match where it was missing.
---
 m4/libtool.m4 |   28 +---
 1 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index ac4381c..e07ae4a 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2516,17 +2516,6 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
-  soname_spec='$libname$release$shared_ext$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -2643,7 +2632,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -3247,10 +3236,6 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -3289,7 +3274,7 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -4041,7 +4026,7 @@ m4_if([$1], [CXX], [
 	;;
 	esac
 	;;
-  linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
 	case $cc_basename in
 	  KCC*)
 	# KAI C++ Compiler
@@ -4354,7 +4339,7 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
   ;;
 
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   case $cc_basename in
   # old Intel for x86_64 which still supported -KPIC.
   ecc*)
@@ -6242,9 +6227,6 @@ if test yes != $_lt_caught_CXX_error; then
 _LT_TAGVAR(ld_shlibs, $1)=yes
 ;;
 
-  gnu*)
-;;
-
   haiku*)
 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 _LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -6406,7 +6388,7 @@ if test yes != $_lt_caught_CXX_error; then
 _LT_TAGVAR(inherit_rpath, $1)=yes
 ;;
 
-  linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
 case $cc_basename in
   KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
-- 
1.7.4.4



Re: PATCH: Add x32 support to _LT_ENABLE_LOCK

2011-12-12 Thread Peter O'Gorman

On 12/12/2011 11:32 AM, H.J. Lu wrote:

* m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32.


Pushed, thanks.

Peter



Re: PATCH: Add x32 support to _LT_ENABLE_LOCK

2011-12-12 Thread Peter O'Gorman

On 12/12/2011 03:01 PM, Roumen Petrov wrote:


It issue same as
http://lists.gnu.org/archive/html/libtool/2011-10/msg00019.html


It's not the same.

That section of code is a mess, for all the other systems checking $host 
is correct, for the linux - linux cross compile case, its logic looks 
wrong.


Peter




Re: [PATCH] libtool: minimise forks per invocation on cygwin and mingw.

2011-12-08 Thread Peter O'Gorman

On 12/08/2011 09:29 AM, Charles Wilson wrote:

Has anybody done a comparison between:

cygwin + libtool + dash/posh (e.g. small, fast shell -- without XSI)

cygwin + libtool + bash (e.g. big bloated slow shell -- with XSI)

to see which is better?



Because I installed mingw32 yesterday on my rarely used windows vista 
home basic VM, I thought I'd do my compile an empty file 100 times test 
on it.


With todays git, bash:
time (for x in {1..100}; do lt_HAVE_XSI_OPS=yes lt_HAVE_PLUSEQ_OP=yes 
lt_HAVE_ARITH_OP=yes ./libtool --mode=compile --tag=CC gcc -c -o a.lo 
a.c; done)



real0m58.766s
user0m5.315s
sys 0m31.981s

real0m54.413s
user0m5.380s
sys 0m31.143s

With dash
time (for x in {1..100}; do lt_HAVE_XSI_OPS=yes lt_HAVE_PLUSEQ_OP=no 
lt_HAVE_ARITH_OP=yes dash ./libtool --mode=compile --tag=CC gcc -c -o 
a.lo a.c; done)


real0m32.089s
user0m1.657s
sys 0m9.330s

real0m29.905s
user0m1.637s
sys 0m9.125s

I think dash might be the winner.

Peter



Re: [SCM] GNU Libtool branch, master, updated. v2.4.2-28-gadb7abd

2011-10-23 Thread Peter O'Gorman
One of these commits broke the daily snapshot. The machine does not yet 
have autobuild installed. Now that it's a hard bootstrap requirement, I 
will try to make time to install it.


Peter


On 10/23/2011 10:40 AM, Gary V. Vaughan wrote

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

The branch, master has been updated
via  adb7abda11c748e3c8ffc05736fd8205e2c84f74 (commit)
via  d4afacc29cc3f620439854ad54ed0e14d4425ec0 (commit)
via  3fc61c5669df9d7547a52d619e6be034d3df5c08 (commit)
via  8e756c52eebad122fc1d86ab16997e500758f02c (commit)
via  b868b7c48743870d2caea1a60077a066752bf0e1 (commit)
via  933f614f6c811eab79c1428969df1c381dec51b0 (commit)
via  f93b09fa58a8617c105fbe901ccd0650983d180b (commit)
via  5c10763830e2b2cf08852dfc98e776675eea5a4e (commit)
via  25b333e759ff00ee0b1e17c821c73c72c5a28314 (commit)
via  f14182f6e77217a9eb267dcae7d79908920629c7 (commit)
via  7afbf5504b09e5a6fca637d8cfcc979bb7d75d2e (commit)
via  2b96af6ed407b93a816d152e7d81c8c764d4d0ea (commit)
via  cf1249a63cd7923b8f31e2fe4d86eaeddb625c5a (commit)
via  e1398280b6c54b4d5cb7f9c2a98483264379710d (commit)
via  8570766c7dda766411fd89d6a187a325f351cd0a (commit)
via  6de3756ab27cc211aa951e14b7aad1975402aa49 (commit)
via  2edfcdf1d43416f56af8e06c07fa95b4f07e3f5c (commit)
via  9ff759568cbd745efbde35536f4100cb8bb9893f (commit)
via  c73118765ef4d1887b7e326c22d2187a69c881a3 (commit)
via  aaa7c9328cf36c4776de0c39c6219482733ae4f7 (commit)
via  3500d098e8dbbde938e62313767b42a5be1b3be6 (commit)
via  dc827a2dcdf240ae3152152ef70159c9ee406b44 (commit)
via  420b992e2e3d31a4cb2030b8c8165189933179ef (commit)
via  be85f384d5782caf480f22c52b36f3c74ddc8211 (commit)
via  7b70f4742a46e46a71a2d6a05e5640d10ceaba3f (commit)
via  22d802b8a89980a3b679c1f0c2e1eafbbd00e148 (commit)
via  ade0d8f39c200c74a77d0c7f095b158a4591bb18 (commit)
   from  e9efe2cf60837796f03132ca3c2cf2f53193e619 (commit)




Re: [SCM] GNU Libtool branch, master, updated. v2.4.2-28-gadb7abd

2011-10-23 Thread Peter O'Gorman

On 10/23/2011 05:34 PM, Peter O'Gorman wrote:

One of these commits broke the daily snapshot. The machine does not yet
have autobuild installed. Now that it's a hard bootstrap requirement, I
will try to make time to install it.

Peter


Heh, didn't see the patches emails because I hadn't read the bug-libtool 
list yet :-)



Peter



Re: bug#9845: [PATCH 1/3] maint: use gnulib's maint.mk and support scripts release procedure.

2011-10-23 Thread Peter O'Gorman

On 10/23/2011 11:03 AM, Gary V. Vaughan wrote:

All,



By the end of this series, making a release still involves an awful lot
of waiting, but after passing the bevy of make distcheck variations
mandated in the README-release, is now a simple matter of:

   1. libltdl/config/do-release-commit-and-tag 2.4.4 stable
   3. make stable
   3. gnupload --to ftp.gnu.org:libtool libtool-2.4.4.tar.gz 
libtool-2.4.4.tar.xz
   4. libltd/config/gnu-web-doc-update
   5. git push origin master tag v2.4.4




Hi Gary.

So the daily snapshot system now has autobuild installed for the user 
that makes the snapshot. Please remove this as a hard requirement for 
bootstrap, we have autobuild.m4 in libltdl/m4 so that people are not 
required to have autobuild installed to reautoconf libtool.


Gnulib is now a submodule, just for a document, a license file and a 
makefile?


What's with the top level gl/ dir?

Thanks,
Peter



Re: [SCM] GNU Libtool branch, master, updated. v2.4.2-28-gadb7abd

2011-10-23 Thread Peter O'Gorman

On 10/23/2011 08:24 PM, Gary V. Vaughan wrote:



My bad... I've been away from libtool development so long that I totally forgot 
to
differentiate between bug-libtool and libtool-patches.  Sorry about that.


One day I'm going to have to read the documentation, so I can figure out 
how to close bugs.


http://debbugs.gnu.org/db/pa/llibtool.html

Probably not today though :)

Peter



Re: [SCM] GNU Libtool branch, master, updated. v2.4.2-28-gadb7abd

2011-10-23 Thread Peter O'Gorman

On 10/23/2011 08:29 PM, Gary V. Vaughan wrote:

Hi Peter,

On 24 Oct 2011, at 05:34, Peter O'Gorman wrote:

One of these commits broke the daily snapshot. The machine does not yet have 
autobuild installed. Now that it's a hard bootstrap requirement, I will try to 
make time to install it.


If you can bootstrap and build successfully without autobuild, then I think it 
would be better to remove autobuild from the buildreq list in bootstrap.conf.  
Please try this patch first:

diff --git a/bootstrap.conf b/bootstrap.conf
index a94d319..155adde 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -440,6 +440,9 @@ func_add_hook func_fini libtool_cleanup_empty_dirs
  ## Resource management. ##
  ##  ##

+# Although autobuild is awesome, libtool will bootstrap without it.
+require_autobuild_buildreq=:
+


Yes, this lets bootstrap complete.

Thanks,
Peter



[patch #7626] [PATCH] Better FreeBSD support

2011-10-02 Thread Peter O'Gorman
Update of patch #7626 (project libtool):

  Status:None = Done   
 Assigned to:None = pogma  
 Open/Closed:Open = Closed 

___

Follow-up Comment #1:

Thanks. Pushed with one minor change (freebsd[[2]].* - freebsd2.*).

___

Reply to this item at:

  http://savannah.gnu.org/patch/?7626

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




Re: Bug 9210: fix to replace Linux with GNU/Linux where needed

2011-09-25 Thread Peter O'Gorman

On 09/05/2011 02:10 PM, Christophe Jarry wrote:

Please learn to use git for sending patches; thanks!


The new patch is attached.

Please tell me if there are still issues with it.

Christophe


I just committed a slightly modified patch in your name.

Peter



Re: [PATCH] libtool -- don't print warnings with --silent

2011-09-05 Thread Peter O'Gorman

On 09/01/2011 06:51 PM, Peter O'Gorman wrote:


Though I am sorely tempted to simply delete those warnings altogether, I
think the --no-warn option is better.

I'll give you a day to veto this patch, if you don't then I will commit
on Saturday. It essentially copies the --no-warn flag from libtoolize to
libtool.


I pushed this patch on Saturday.

Dave, I've attached an approximation of what the patch would do to gcc's 
ltmain.sh and an addition to boehm-gc's .exp file. Both completely 
untested, of course :-)


Thanks,
Peter

Index: ltmain.sh
===
--- ltmain.sh	(revision 178501)
+++ ltmain.sh	(working copy)
@@ -43,6 +43,7 @@
 #   --quiet, --silentdon't print informational messages
 #   --no-quiet, --no-silent
 #print informational messages (default)
+#   --no-warndon't display warning messages
 #   --tag=TAGuse configuration variables from tag TAG
 #   -v, --verboseprint more informational messages than default
 #   --no-verbose don't print the extra informational messages
@@ -944,6 +945,11 @@
 			opt_verbose=:
 			;;
 
+  --no-warning|--no-warn)
+			preserve_args=$preserve_args $opt
+			opt_warning=false
+			;;
+
   --no-verbose)	preserve_args=$preserve_args $opt
 			opt_verbose=false
 			;;
Index: boehm-gc/testsuite/lib/boehm-gc.exp
===
--- boehm-gc/testsuite/lib/boehm-gc.exp	(revision 178501)
+++ boehm-gc/testsuite/lib/boehm-gc.exp	(working copy)
@@ -208,8 +208,8 @@
 # Set this once for reuse in boehm-gc.lib/lib.exp.
 set libtool ../libtool
 # We have to run silently to avoid DejaGnu lossage.
-lappend options compiler=$libtool --silent --tag=CC --mode=$mode \
-	$GCC_UNDER_TEST
+lappend options compiler=$libtool --silent --no-warn --tag=CC \
+--mode=$mode $GCC_UNDER_TEST
 
 lappend options additional_flags=-I${gc_include} -I${srcdir}/../include
 lappend options additional_flags=${threadcflags}


Re: Bug 9210: fix to replace Linux with GNU/Linux where needed

2011-09-04 Thread Peter O'Gorman

On Sep 4, 2011, at 1:05 AM, Christophe Jarry wrote:

 On Sat, 03 Sep 2011 16:34:51 -0500
 Peter O'Gorman pe...@pogma.com wrote:
 
 Please do not change the version type for libtool library versioning 
 from linux to gnu-linux. [...] I object to this change.
 
 Could you please explain to me why you object to this change?

I am willing to change the documentation and even the comments, I am not 
willing to change variable names or their values. Version type = linux has been 
used in libtool for a long time, changing it is pointless, not in any way 
called for by the GNU coding standards,  and will likely lead to bugs.

Peter





Re: Bug 9210: fix to replace Linux with GNU/Linux where needed

2011-09-03 Thread Peter O'Gorman

On 09/03/2011 02:10 PM, Christophe Jarry wrote:

Dear developers,

I have reported the following bug onbug-libt...@gnu.org  (see
http://lists.gnu.org/archive/html/bug-libtool/2011-07/msg2.html and
http://lists.gnu.org/archive/html/bug-libtool/2011-08/msg1.html).

On the documentation of libtool, the word linux is sometimes used to refer to
the entire free software system that uses the kernel Linux. According to the GNU
project's Information for Maintainers of GNU Software, maintainers of GNU
programs have to name the entire system
GNU/Linux (http://www.gnu.org/prep/maintain/maintain.html#Preface and
http://www.gnu.org/prep/maintain/maintain.html#GNU-and-Linux).

So here is a patch to fix this bug in various parts of GNU libtool:



- core files libltdl/config/ltmain.m4sh and libltdl/m4/libtool.m4.


Please do not change the version type for libtool library versioning 
from linux to gnu-linux. I don't really mind the documentation changes, 
but I object to this change.


Peter





Re: [PATCH] libtool -- don't print warnings with --silent

2011-09-01 Thread Peter O'Gorman

On 09/01/2011 09:25 AM, Bob Friesenhahn wrote:

On Mon, 29 Aug 2011, Peter O'Gorman wrote:


This turns off warnings for --silent (and turns them on again for
--verbose).

But I am not sure that --silent was meant to imply no warnings,
rather it turns off the verbose compile/link messages.

Would a new --no-warnings option be more appropriate?


I agree that a new option would be more appropriate. However, it should
be a user-provided configuration option (when building the package) and
not something which will be hard-coded into Makefiles by developers. The
--silent option should have been handled the same so that the person
building the software can easily decide if the build should be silent.


Hi Bob,

Well, it has to be an option that Dave can add to site.exp for the 
failing tests in gcc. The tests are failing on HP-UX because libtool is 
outputing this platform does not like uninstalled shared libraries 
crap to stderr.


Though I am sorely tempted to simply delete those warnings altogether, I 
think the --no-warn option is better.


I'll give you a day to veto this patch, if you don't then I will commit 
on Saturday. It essentially copies the --no-warn flag from libtoolize to 
libtool.


Peter

From dc28c2bfbcb4879bc04a73186d72ec0e7ef2ad4c Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Thu, 1 Sep 2011 18:45:03 -0500
Subject: [PATCH] Add flag to inhibit warnings.

* libltdl/config/ltmain.m4sh: Add --no-warn, --no-warning flags.
Reported by John Davd Anglin.
---
 ChangeLog  |6 ++
 libltdl/config/ltmain.m4sh |3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dcfab26..44b325b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-01  Peter O'Gorman  pe...@pogma.com
+
+	Add flag to inhibit warnings.
+	* libltdl/config/ltmain.m4sh: Add --no-warn, --no-warning flags.
+	Reported by John Davd Anglin.
+
 2011-04-10  Kurt Roeckx  k...@roeckx.be
 
 	tagdemo: do not rely on picking up symbols from indirect deps.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 9358ec5..511480f 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -42,6 +42,7 @@ m4_divert_push([SCRIPT])
 #   --quiet, --silentdon't print informational messages
 #   --no-quiet, --no-silent
 #print informational messages (default)
+#   --no-warndon't display warning messages
 #   --tag=TAGuse configuration variables from tag TAG
 #   -v, --verboseprint more informational messages than default
 #   --no-verbose don't print the extra informational messages
@@ -373,6 +374,8 @@ M4SH_GETOPTS(
 	esac],
   [],		[--no-silent|--no-quiet],	[false],		[
 	func_append preserve_args  $opt],
+  [],		[--no-warning|--no-warn],	[false],		[
+	func_append preserve_args  $opt],
   [],		[--no-verbose],			[false],		[
 	func_append preserve_args  $opt],
   [],		[--silent|--quiet],		[],			[
-- 
1.7.4.4



Re: [PATCH] libtool -- don't print warnings with --silent

2011-08-29 Thread Peter O'Gorman

On 07/29/2011 07:55 PM, John David Anglin wrote:

Ping?


Hi Dave,

ltmain.sh is a generated file, so this patch is not correct. Perhaps 
something like (pasted in mail, so wrapped):


diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 9358ec5..bd5736c 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -377,9 +377,11 @@ M4SH_GETOPTS(
func_append preserve_args  $opt],
   [],  [--silent|--quiet], [], [
func_append preserve_args  $opt
+opt_warning=false
 opt_verbose=false],
   [v], [--verbose],[], [
func_append preserve_args  $opt
+opt_warning=:
opt_silent=false],
   [!], [--tag],[], [
func_append preserve_args  $opt $optarg

This turns off warnings for --silent (and turns them on again for 
--verbose).


But I am not sure that --silent was meant to imply no warnings, rather 
it turns off the verbose compile/link messages.


Would a new --no-warnings option be more appropriate?

Peter



On 9-Jul-11, at 7:03 PM, John David Anglin wrote:


The attached patch fixes the boehm-gc testsuite on hppa2.0w-hp-hpux11.11.
Without it, libtool always generates an informational warning when
linking
causing the entire boehm-gc testsuite to fail.

Ok? Ralf would you please install in libtool tree if ok.

2011-07-09 John David Anglin dave.ang...@nrc-cnrc.gc.ca

PR boehm-gc/48494
* ltmain.sh (func_warning): Don't print warnings if opt_silent is true.

Index: ltmain.sh
===
--- ltmain.sh (revision 176045)
+++ ltmain.sh (working copy)
@@ -437,7 +437,9 @@
# Echo program name prefixed warning message to standard error.
func_warning ()
{
- $opt_warning  $ECHO $progname${mode+: }$mode: warning: ${1+$@}
12
+ ${opt_silent-false} || {
+ $opt_warning  $ECHO $progname${mode+: }$mode: warning: ${1+$@}
12
+ }

# bash bug again:
:

Dave
--
J. David Anglin dave.ang...@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)








Re: Mac OS X .dylib not working

2011-03-05 Thread Peter O'Gorman

On 03/04/2011 01:00 PM, Peter O'Gorman wrote:

On 03/04/2011 12:47 PM, Ralf Wildenhues wrote:



+if test $shlibpath_var = PATH; then


This looks wrong; shouldn't it be != here? Otherwise, ...


Looking at the original test, the above is correct there - it wants to 
avoid messing with PATH on Windows.


Pushed this.

Thanks.

Peter

From e51daabd9975b141ed491f2f49bb340b797a6383 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Fri, 4 Mar 2011 14:35:14 -0600
Subject: [PATCH] On Mac OS X try .dylib as well as .so with lt_dlopenext

* libltdl/m4/ltdl.m4: Define extra extension if module extension
differs from shared lib extension.
* libltdl/ltdl.c: Use it.
* tests/darwin.at: Test it.
* NEWS: Announce it.
Reported by Hans Aberg, Michael Ellis, and others.
---
 ChangeLog  |   10 +++
 NEWS   |3 +
 libltdl/ltdl.c |   21 +-
 libltdl/m4/ltdl.m4 |9 ++-
 tests/darwin.at|  216 
 5 files changed, 257 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f74eab..528e404 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-03-04  Peter O'Gorman  pe...@pogma.com
+
+	On Mac OS X try .dylib as well as .so with lt_dlopenext
+	* libltdl/m4/ltdl.m4: Define extra extension if module extension
+	differs from shared lib extension.
+	* libltdl/ltdl.c: Use it.
+	* tests/darwin.at: Test it.
+	* NEWS: Announce it.
+	Reported by Hans Aberg, Michael Ellis, and others.
+
 2011-02-12  Peter O'Gorman  pe...@pogma.com
 
 	Install ltmain.sh without execute bit set.
diff --git a/NEWS b/NEWS
index dbad2ae..90d14b7 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ New in 2.4.2 2011-??-??: git version 2.4.1a, Libtool team:
 
   - Initial support for Go, using the gccgo compiler.
 
+  - On Mac OS X .dylib is now tried as well as .so with
+lt_dlopenext().
+
 * Bug fixes:
 
   - The generic approximation of the command line length limit (when getconf is
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index be1e4c0..01853e0 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -1,7 +1,7 @@
 /* ltdl.c -- system independent dlopen wrapper
 
Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006,
-		 2007, 2008 Free Software Foundation, Inc.
+		 2007, 2008, 2011 Free Software Foundation, Inc.
Written by Thomas Tanner, 1998
 
NOTE: The canonical source of this file is maintained with the
@@ -80,6 +80,11 @@ static  const char	libprefix[]		= LT_LIBPREFIX;
 #if defined(LT_MODULE_EXT)
 static	const char	shlib_ext[]		= LT_MODULE_EXT;
 #endif
+/* If the loadable module suffix is not the same as the linkable
+ * shared library suffix, this will be defined. */
+#if defined(LT_SHARED_EXT)
+static	const char	shared_ext[]		= LT_SHARED_EXT;
+#endif
 #if defined(LT_DLSEARCH_PATH)
 static	const char	sys_dlsearch_path[]	= LT_DLSEARCH_PATH;
 #endif
@@ -1537,6 +1542,9 @@ has_library_ext (const char *filename)
 #if defined(LT_MODULE_EXT)
 	 || (streq (ext, shlib_ext))
 #endif
+#if defined(LT_SHARED_EXT)
+	 || (streq (ext, shared_ext))
+#endif
 ))
 {
   return 1;
@@ -1682,6 +1690,17 @@ lt_dlopenadvise (const char *filename, lt_dladvise advise)
   if (handle || ((errors  0)  !file_not_found ()))
 	return handle;
 #endif
+
+#if defined(LT_SHARED_EXT)
+  /* Try appending SHARED_EXT.   */
+  LT__SETERRORSTR (saved_error);
+  errors = try_dlopen (handle, filename, shared_ext, advise);
+
+  /* As before, if the file was found but loading failed, return now
+	 with the current error message.  */
+  if (handle || ((errors  0)  !file_not_found ()))
+	return handle;
+#endif
 }
 
   /* Still here?  Then we really did fail to locate any of the file
diff --git a/libltdl/m4/ltdl.m4 b/libltdl/m4/ltdl.m4
index 42e07e9..ea76f4d 100644
--- a/libltdl/m4/ltdl.m4
+++ b/libltdl/m4/ltdl.m4
@@ -1,6 +1,6 @@
 # ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
 #
-#   Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc.
+#   Copyright (C) 1999-2006, 2007, 2008, 2011 Free Software Foundation, Inc.
 #   Written by Thomas Tanner, 1999
 #
 # This file is free software; the Free Software Foundation gives
@@ -553,12 +553,19 @@ AC_CACHE_CHECK([which extension is used for runtime loadable modules],
 [
 module=yes
 eval libltdl_cv_shlibext=$shrext_cmds
+module=no
+eval libltdl_cv_shrext=$shrext_cmds
   ])
 if test -n $libltdl_cv_shlibext; then
   m4_pattern_allow([LT_MODULE_EXT])dnl
   AC_DEFINE_UNQUOTED([LT_MODULE_EXT], [$libltdl_cv_shlibext],
 [Define to the extension used for runtime loadable modules, say, .so.])
 fi
+if test $libltdl_cv_shrext != $libltdl_cv_shlibext; then
+  m4_pattern_allow([LT_SHARED_EXT])dnl
+  AC_DEFINE_UNQUOTED([LT_SHARED_EXT], [$libltdl_cv_shrext],
+[Define to the shared library suffix, say, .dylib.])
+fi
 ])# LT_SYS_MODULE_EXT
 
 # Old name:
diff --git a/tests/darwin.at b/tests/darwin.at
index 4e5034e..b255abe 100644
--- a/tests/darwin.at
+++ b/tests

Re: Patches for libtool support on NAG Fortran compiler for Darwin OS

2011-03-05 Thread Peter O'Gorman

Hi Jürgen,

Does the attached patch work for you? I think it -Wl, quotes everything 
necessary. Note that I hardcode -Wl, rather than ${wl} because some of 
the options are supposed to be gcc options rather than ld ones (though 
ld recently accepts them too, so it's not a big deal either way).


Ralf suggested using $CC -v to identify compilers, rather than 
$cc_basename, and this makes sense to me, what does nagfor -V say?


Thanks,
Peter
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 766777f..021be79 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -6611,7 +6611,7 @@ func_mode_link ()
 	  # Darwin ld doesn't like 0 for these options...
 	  func_arith $current + 1
 	  minor_current=$func_arith_result
-	  xlcverstring=${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision
+	  wlverstring=${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision
 	  verstring=-compatibility_version $minor_current -current_version $minor_current.$revision
 	  ;;
 
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 5cc027b..d8cb8ef 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1095,17 +1095,29 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
   case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
  *) _lt_dar_can_shared=$GCC ;;
   esac
   if test $_lt_dar_can_shared = yes; then
 output_verbose_link_cmd=func_echo_all
-_LT_TAGVAR(archive_cmds, $1)=\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}
-_LT_TAGVAR(module_cmds, $1)=\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}
-_LT_TAGVAR(archive_expsym_cmds, $1)=sed 's,^,_,'  \$export_symbols  \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}
-_LT_TAGVAR(module_expsym_cmds, $1)=sed -e 's,^,_,'  \$export_symbols  \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}
+case $cc_basename in
+  nagfor*)
+	_lt_nag_undefined=$(for _lt_tmp in $_lt_dar_allow_undefined; do echo -Wl,$_lt_tmp; done)
+	_LT_TAGVAR(allow_undefined_flag, $1)=$_lt_nag_undefined
+	_LT_TAGVAR(archive_cmds, $1)=\$CC -Wl,-dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -Wl,-install_name,\$rpath/\$soname \$wlverstring${_lt_dsymutil}
+	_LT_TAGVAR(module_cmds, $1)=\$CC \$allow_undefined_flag -o \$lib -Wl,-bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}
+	_LT_TAGVAR(archive_expsym_cmds, $1)=sed 's,^,_,'  \$export_symbols  \$output_objdir/\${libname}-symbols.expsym~\$CC -Wl,-dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -Wl,-install_name,\$rpath/\$soname \$wlverstring ${_lt_dar_export_syms}${_lt_dsymutil}
+	_LT_TAGVAR(module_expsym_cmds, $1)=sed -e 's,^,_,'  \$export_symbols  \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -Wl,-bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}
+  ;;
+  *)
+	_LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
+	_LT_TAGVAR(archive_cmds, $1)=\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}
+	_LT_TAGVAR(module_cmds, $1)=\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}
+	_LT_TAGVAR(archive_expsym_cmds, $1)=sed 's,^,_,'  \$export_symbols  \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}
+	_LT_TAGVAR(module_expsym_cmds, $1)=sed -e 's,^,_,'  \$export_symbols  \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}
+  ;;
+esac
 m4_if([$1], [CXX],
 [   if test $lt_cv_apple_cc_single_mod != yes; then
   _LT_TAGVAR(archive_cmds, $1)=\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}
@@ -4234,6 +4246,14 @@ m4_if([$1], [CXX], [
   # PIC is the default on this 

Re: Mac OS X .dylib not working

2011-03-04 Thread Peter O'Gorman

On 03/04/2011 03:44 AM, Hans Aberg wrote:

On 4 Mar 2011, at 03:59, Peter O'Gorman wrote:



The important thing is to try .dylib - all libraries I have sen use it. It can 
of course try .so as well.


Patch. Fails new testcase before (well, new testcase as in copy 
pasted lt_dlopenext testcase and slightly modified it), passes after.

.dylib is tried after .so so there is no potentially surprising change 
in behaviour for existing applications.


Oh, I forgot a NEWS entry, will add:

On Mac OS X .dylib is now tried as well as .so with lt_dlopenext there 
before pushing.


Ok?

Peter
From 9321b9aa351a1532ca9511d2aa1e1e174b9ffbd6 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Fri, 4 Mar 2011 12:00:23 -0600
Subject: [PATCH] On Mac OS X try .dylib as well as .so with lt_dlopenext

* libltdl/m4/ltdl.m4: Define extra extension if module extension
differs from shared lib extension.
* libltdl/ltdl.c: Use it.
* tests/darwin.at: Test it.
Reported by Hans Aberg, Michael Ellis, and others.
---
 ChangeLog  |9 ++
 libltdl/ltdl.c |   19 +
 libltdl/m4/ltdl.m4 |7 ++
 tests/darwin.at|  221 
 4 files changed, 256 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f74eab..d8fa215 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-03-04  Peter O'Gorman  pe...@pogma.com
+
+	On Mac OS X try .dylib as well as .so with lt_dlopenext
+	* libltdl/m4/ltdl.m4: Define extra extension if module extension
+	differs from shared lib extension.
+	* libltdl/ltdl.c: Use it.
+	* tests/darwin.at: Test it.
+	Reported by Hans Aberg, Michael Ellis, and others.
+
 2011-02-12  Peter O'Gorman  pe...@pogma.com
 
 	Install ltmain.sh without execute bit set.
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index be1e4c0..942ed91 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -80,6 +80,11 @@ static  const char	libprefix[]		= LT_LIBPREFIX;
 #if defined(LT_MODULE_EXT)
 static	const char	shlib_ext[]		= LT_MODULE_EXT;
 #endif
+/* If the loadable module suffix is not the same as the linkable
+ * shared library suffix, this will be defined. */
+#if defined(LT_SHARED_EXT)
+static	const char	shared_ext[]		= LT_SHARED_EXT;
+#endif
 #if defined(LT_DLSEARCH_PATH)
 static	const char	sys_dlsearch_path[]	= LT_DLSEARCH_PATH;
 #endif
@@ -1537,6 +1542,9 @@ has_library_ext (const char *filename)
 #if defined(LT_MODULE_EXT)
 	 || (streq (ext, shlib_ext))
 #endif
+#if defined(LT_SHARED_EXT)
+	 || (streq (ext, shared_ext))
+#endif
 ))
 {
   return 1;
@@ -1682,6 +1690,17 @@ lt_dlopenadvise (const char *filename, lt_dladvise advise)
   if (handle || ((errors  0)  !file_not_found ()))
 	return handle;
 #endif
+
+#if defined(LT_SHARED_EXT)
+  /* Try appending SHARED_EXT.   */
+  LT__SETERRORSTR (saved_error);
+  errors = try_dlopen (handle, filename, shared_ext, advise);
+
+  /* As before, if the file was found but loading failed, return now
+	 with the current error message.  */
+  if (handle || ((errors  0)  !file_not_found ()))
+	return handle;
+#endif
 }
 
   /* Still here?  Then we really did fail to locate any of the file
diff --git a/libltdl/m4/ltdl.m4 b/libltdl/m4/ltdl.m4
index 42e07e9..c256e08 100644
--- a/libltdl/m4/ltdl.m4
+++ b/libltdl/m4/ltdl.m4
@@ -553,12 +553,19 @@ AC_CACHE_CHECK([which extension is used for runtime loadable modules],
 [
 module=yes
 eval libltdl_cv_shlibext=$shrext_cmds
+module=no
+eval libltdl_cv_shrext=$shrext_cmds
   ])
 if test -n $libltdl_cv_shlibext; then
   m4_pattern_allow([LT_MODULE_EXT])dnl
   AC_DEFINE_UNQUOTED([LT_MODULE_EXT], [$libltdl_cv_shlibext],
 [Define to the extension used for runtime loadable modules, say, .so.])
 fi
+if test $libltdl_cv_shrext != $libltdl_cv_shlibext; then
+  m4_pattern_allow([LT_SHARED_EXT])dnl
+  AC_DEFINE_UNQUOTED([LT_SHARED_EXT], [$libltdl_cv_shrext],
+[Define to the shared library suffix, say, .dylib.])
+fi
 ])# LT_SYS_MODULE_EXT
 
 # Old name:
diff --git a/tests/darwin.at b/tests/darwin.at
index 4e5034e..f022f50 100644
--- a/tests/darwin.at
+++ b/tests/darwin.at
@@ -228,3 +228,224 @@ mv stdout expout
 LT_AT_CONFIGURE([LDFLAGS=-L/there/is/no/dir/here])
 AT_CHECK([./libtool --config],[ignore],[expout],[ignore])
 AT_CLEANUP
+
+AT_SETUP(darwin can lt_dlopen .dylib and .so files)
+
+AT_KEYWORDS([libltdl dylib])
+
+# This test requires shared library support.
+AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
+	 [], [ignore])
+
+
+eval `$LIBTOOL --config | $EGREP '^(shlibpath_var|shrext_cmds)='`
+
+module=no
+eval shared_ext=\$shrext_cmds\
+module=yes
+eval module_ext=\$shrext_cmds\
+
+# Only bother with this test if module extension is different from
+# shared extension
+AT_CHECK([test $shared_ext != $module_ext || exit 77],
+ [], [ignore])
+
+# Skip this test when called from:
+#make distcheck DISTCHECK_CONFIGURE_FLAGS=--disable-ltdl-install
+AT_CHECK([case $LIBLTDL

Re: Mac OS X .dylib not working

2011-03-04 Thread Peter O'Gorman

On 03/04/2011 12:47 PM, Ralf Wildenhues wrote:

[ dropping bug-libtool ]

Hi Peter,

* Peter O'Gorman wrote on Fri, Mar 04, 2011 at 07:07:30PM CET:

Ok?


A few copyright year bumps are missing.


Oh, yeah, will fix.


Some minor nits inline below.



+AT_SETUP(darwin can lt_dlopen .dylib and .so files)


Missing m4 quotes (for style only)


Ok.


+AT_CHECK([test $shared_ext != $module_ext || exit 77],
+ [], [ignore])


You can drop arguments two and three here.


Ok.


+  int errors = 0;


Isn't this lacking
   LTDL_SET_PRELOADED_SYMBOLS();

or was that needed only for static libs (which you've excluded earlier)?


It's only needed for static. This bit was copypasted from lt_dlopenext.at.


+if (lt_dlexit () != 0)
+  errormsg = dlerrordup (errormsg);


I'm not particularly fond of this coding style, where ownership
information essentially gets lots once an error occurs in any
of the commands.  Might be ok for a test like this, but not such
a good example for users.  lt_dlexit could be warranted even if
some error occurred before.  Anyway, I won't reject the patch for
this.


Ok, to be honest I didn't even read much of this code, it's from 
lt_dlopenext.at.





+if test $shlibpath_var = PATH; then


This looks wrong; shouldn't it be != here?  Otherwise, ...


Again, didn't read it!! Will look into it and fix the old test if it's 
wrong.


This bit is not needed or used in the new test anyway, will remove it.

Thanks for the quick review. I will adjust and push, probably tomorrow.

Peter





Re: Patches for libtool support on NAG Fortran compiler for Darwin OS

2011-03-01 Thread Peter O'Gorman

On 03/01/2011 05:24 AM, Jürgen Reuter wrote:

Dear libtool team (cc to Peter)
as discussed with Peter I send to you a diff (compared to the
2.4 official version of libtool) to support the NAG Fortran compiler
on Darwin 64bit machines.



Thanks for your work on this.


case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
   *) _lt_dar_can_shared=$GCC ;;


This hunk is OK.


@@ -4245,6 +4245,19 @@
fi
;;

+ darwin* | rhapsody*)
+   # PIC is the default on this platform
+   # Common symbols not allowed in MH_DYLIB files
+   case $cc_basename in
+   nagfor*)
+   # NAG Fortran compiler
+   _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+   _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+   _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+   ;;
+   esac
+   ;;
+


This one isn't. Either this matches and then the default case that sets 
lt_prog_compiler_pic to -fno-common later does not match, or vice versa. 
I haven't looked at where this comes in libtool.m4. Something like this 
would keep the default case working too:


@@ -4234,6 +4234,14 @@ m4_if([$1], [CXX], [
   # PIC is the default on this platform
   # Common symbols not allowed in MH_DYLIB files
   _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+  case $cc_basename in
+  nagfor*)
+   # NAG Fortran compiler
+   _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+   _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+   _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+   ;;
+  esac
   ;;

 haiku*)

Though, recent Mac OS X does not require -fno-common, because 
-single_module is the default, it's mostly harmless to keep it there IMO.



diff -u ltmain.sh ../nag_trunk/ltmain.sh
--- ltmain.sh   2011-03-01 12:18:13.0 +0100
+++ ../nag_trunk/ltmain.sh  2011-03-01 11:49:34.0 +0100
@@ -7390,7 +7390,15 @@
   func_arith $current + 1
   minor_current=$func_arith_result
   xlcverstring=${wl}-compatibility_version ${wl}$minor_current 
${wl}-current_version ${wl}$minor_current.$revision
- verstring=-compatibility_version $minor_current -current_version 
$minor_current.$revision
+ # On Darwin other compilers
+ case $CC in
+ nagfor*)
+ verstring=${wl}-compatibility_version ${wl}$minor_current 
${wl}-current_version ${wl}$minor_current.$revision
+ ;;
+ *)
+  verstring=-compatibility_version $minor_current -current_version 
$minor_current.$revision
+ ;;
+  esac
   ;;


I am a little confused by this because it seems strange that 
-compatibility_version and -current_version would need -Wl, quoting, but 
-dynamiclib, -bundle etc. do not. Did you happen to run the libtool test 
suite with this patch? Please do so and post the results.


Thanks again, sorry for asking you to do more work,
Peter



Re: warnings from openSuSE rpmlint

2011-02-14 Thread Peter O'Gorman

On 02/11/2011 11:10 AM, Peter O'Gorman wrote:

On 02/11/2011 10:52 AM, Křištof Želechovski wrote:


libtool.x86_64: W: script-without-shebang
/usr/share/libtool/config/ltmain.sh
This text file has executable bits set or is located in a path
dedicated for
executables, but lacks a shebang and cannot thus be executed. If the
file is
meant to be an executable script, add the shebang, otherwise remove the
executable bits or move the file elsewhere.


Yeah, it's not meant to be executed as is, I guess it was easier to
install it with the same rule as every other file in that dir.


I would say it is easier to install it with permissions matching its
status. What is easier depends on your POV. In the end, what is easier
to the customer should prevail because there are more customers than
developers.


I'll look into this.


This passed all tests and make distcheck, I am pretty sure that nothing 
requires ltmain to be executable, but just in case someone knows better, 
I'm asking for approval :)


Ok?

Peter
From c44468e0ec23e4b72f1e37e98be23ae71b6d0ed1 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Mon, 14 Feb 2011 10:34:58 -0600
Subject: [PATCH] Install ltmain.sh without execute bit set.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Makefile.am: change install rule for ltmain.sh
Reported by Křištof Želechovski.
---
 ChangeLog   |6 ++
 Makefile.am |3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6e89fa8..7f74eab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-12  Peter O'Gorman  pe...@pogma.com
+
+	Install ltmain.sh without execute bit set.
+	* Makefile.am: change install rule for ltmain.sh
+	Reported by Křištof Želechovski.
+
 2011-02-07  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
 	docs: fix copyright years in PDF version of the manual.
diff --git a/Makefile.am b/Makefile.am
index f0590a8..268b399 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -393,10 +393,11 @@ install-data-local: libltdl/Makefile.in
 ## install the helper scripts
 	$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
 	$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/config
-	@list='$(auxfiles)'  for p in $$list; do \
+	@list='$(auxexefiles)'  for p in $$list; do \
 	  echo  $(INSTALL_SCRIPT) '$(srcdir)/libltdl/$$p' '$(DESTDIR)$(pkgdatadir)/$$p'; \
 	  $(INSTALL_SCRIPT) $(srcdir)/libltdl/$$p $(DESTDIR)$(pkgdatadir)/$$p; \
 	done
+	$(INSTALL_DATA) $(srcdir)/libltdl/config/ltmain.sh $(DESTDIR)$(pkgdatadir)/config/ltmain.sh 
 ## install the libltdl files
 	$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/libltdl
 	$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/libltdl/libltdl
-- 
1.7.3.4



Re: warnings from openSuSE rpmlint

2011-02-14 Thread Peter O'Gorman

On 02/14/2011 12:46 PM, Bob Friesenhahn wrote:

On Mon, 14 Feb 2011, Peter O'Gorman wrote:


I would say it is easier to install it with permissions matching its
status. What is easier depends on your POV. In the end, what is easier
to the customer should prevail because there are more customers than
developers.


I'll look into this.


This passed all tests and make distcheck, I am pretty sure that
nothing requires ltmain to be executable, but just in case someone
knows better, I'm asking for approval :)

Ok?


This change sounds fine to me.


Thanks, pushed.

Peter



Re: libtool 2.4 args parsing incredibly slow

2011-01-28 Thread Peter O'Gorman

On 01/27/2011 12:56 AM, Ralf Wildenhues wrote:


I like this as a first measure.


This is what I am pushing - it ends up looking like this in the wrapper 
script:


func_exec_program ()
{
  case  $*  in
  *\ --lt-*)
for lt_wr_arg
do
  case $lt_wr_arg in
  --lt-*) ;;
  *) set x $@ $lt_wr_arg; shift;;
  esac
  shift
done ;;
  esac
  func_exec_program_core ${1+$@}
}

Thank you!

Peter
From 286e87b1030c353d9cfc89dbb72d59e0391cb693 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Thu, 27 Jan 2011 17:13:10 -0600
Subject: [PATCH] Don't loop through wrapper script arguments unnecessarily.

* libltdl/m4/ltmain.m4sh: Check that argv contains  --lt-
before looping to remove wrapper script targetted arguments.
Performance regression reported by Dan McGee.
---
 ChangeLog  |7 +++
 libltdl/config/ltmain.m4sh |   19 +++
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6da9d7e..8ff779b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-27  Peter O'Gorman  pe...@pogma.com
+
+	Don't loop through wrapper script arguments unnecessarily.
+	* libltdl/m4/ltmain.m4sh: Check that argv contains  --lt-
+	before looping to remove wrapper script targetted arguments.
+	Performance regression reported by Dan McGee.
+
 2011-01-20  Gerald Pfeifer  ger...@pfeifer.com  (tiny change)
 
 	Remove support for FreeBSD 1.x.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 7baa6aa..766777f 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -3195,14 +3195,17 @@ func_exec_program_core ()
 # launches target application with the remaining arguments.
 func_exec_program ()
 {
-  for lt_wr_arg
-  do
-case \$lt_wr_arg in
---lt-*) ;;
-*) set x \\$@\ \\$lt_wr_arg\; shift;;
-esac
-shift
-  done
+  case \ \$* \ in
+  *\\ --lt-*)
+for lt_wr_arg
+do
+  case \$lt_wr_arg in
+  --lt-*) ;;
+  *) set x \\$@\ \\$lt_wr_arg\; shift;;
+  esac
+  shift
+done ;;
+  esac
   func_exec_program_core \${1+\\$@\}
 }
 
-- 
1.7.2.3



[PATCH] Darwin - verbose linker messages influence configure results.

2011-01-19 Thread Peter O'Gorman

Hi,

Jeremy reported this ages and ages ago, and I promptly forgot about it 
(sorry). David reported it again yesterday.


Darwin's linker can be quite verbose, if it sees an -L path that does 
not exist it prints a warning on stderr. Jeremy needs to configure with 
-L paths that don't exist at configure time (because they will exist 
later), and would like to be able to debug the result, so detecting 
-force_load properly would be helpful.


Davids problem was about failing to detect -single_module, same issue.

I only have Mac OS X 10.6 systems, and I am much too lazy to check what 
older linkers did when they saw flags they didn't recognize, so this 
patch greps stderr for flag and assumes the linker didn't recognize it 
if is there. I think all Darwin ld's exit with an error for flags they 
don't recognize, so even that is probably not necessary, but I am not 
100% sure of that.


Jeremy, I set RC_TRACE_ARCHIVES, RC_TRACE_DYLIBS, 
RC_TRACE_DYLIB_SEARCHING to check that none of those env vars caused ld 
to print its arguments on stderr, and they didn't. Are there any env 
vars set when building the OS that would cause that to happen? If so I 
will change this patch to just assume that ld exits with an error code 
for unrecognized arguments.


Patch Ok?

Peter


From 4f0eb4701ae67e7e52dcc4cb8eb7eb65f11645d3 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Wed, 19 Jan 2011 10:09:46 -0600
Subject: [PATCH] Don't let verbose linker messages influence test results.

* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Ignore
stderr during tests for -flag unless it contains flag.
* tests/darwin.at: Add test.
Reported by Jeremy Huddleston and also by David Fang.
---
 ChangeLog |8 
 libltdl/m4/libtool.m4 |   14 --
 tests/darwin.at   |   26 +-
 3 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1ad3741..640f4a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-01-19  Peter O'Gorman  pe...@pogma.com
+
+	Don't let verbose linker messages influence test results.
+	* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Ignore
+	stderr during tests for -flag unless it contains flag.
+	* tests/darwin.at: Add test.
+	Reported by Jeremy Huddleston and also by David Fang.
+
 2011-01-09  John David Anglin  dave.ang...@nrc-cnrc.gc.ca  (tiny change)
 
 	Fix relink mode to use absolute path if hardcode_minus_L.
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index fd79dcf..706a2df 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -986,7 +986,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
 	  -dynamiclib -Wl,-single_module conftest.c 2conftest.err
 _lt_result=$?
-	if test -f libconftest.dylib  test ! -s conftest.err  test $_lt_result = 0; then
+	# If there is a non-empty error log, and single_module
+	# appears in it, assume the flag caused a linker warning
+if test -s conftest.err  $GREP single_module conftest.err; then
+	  cat conftest.err AS_MESSAGE_LOG_FD
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib  test $_lt_result = 0; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err AS_MESSAGE_LOG_FD
@@ -994,6 +1000,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	rm -rf libconftest.dylib*
 	rm -f conftest.*
   fi])
+
 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
   [lt_cv_ld_exported_symbols_list],
   [lt_cv_ld_exported_symbols_list=no
@@ -1005,6 +1012,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	[lt_cv_ld_exported_symbols_list=no])
 	LDFLAGS=$save_LDFLAGS
 ])
+
 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
   [lt_cv_ld_force_load=no
   cat  conftest.c  _LT_EOF
@@ -1022,7 +1030,9 @@ _LT_EOF
   echo $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a AS_MESSAGE_LOG_FD
   $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2conftest.err
   _lt_result=$?
-  if test -f conftest  test ! -s conftest.err  test $_lt_result = 0  $GREP forced_load conftest 21 /dev/null; then
+  if test -s conftest.err  $GREP force_load conftest.err; then
+	cat conftest.err AS_MESSAGE_LOG_FD
+  elif test -f conftest  test $_lt_result = 0  $GREP forced_load conftest 21 /dev/null; then
 	lt_cv_ld_force_load=yes
   else
 	cat conftest.err AS_MESSAGE_LOG_FD
diff --git a/tests/darwin.at b/tests/darwin.at
index bb71207..4e5034e 100644
--- a/tests/darwin.at
+++ b/tests/darwin.at
@@ -1,6 +1,6 @@
 # darwin.at - tests specific to Mac OS X
 #
-#   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
 #   Written by Peter O'Gorman, 2008
 #
 #   This file is part of GNU Libtool.
@@ -204,3 +204,27 @@ AT_CHECK([echo quit

Re: [PATCH] Darwin - verbose linker messages influence configure results.

2011-01-19 Thread Peter O'Gorman

On 01/19/2011 12:38 PM, Ralf Wildenhues wrote:

Hi Ralf,

Thanks for the quick review! Yes, the testsuite addition fails before 
the patch, and passes after.




Also,/dev/null 21  (order matters!)

Are you really grepping the binary intentionally here, rather than the
.err file?


Yes, and that will cause problems when cross-compiling to Mac OS X on 
systems without GNU grep (or an equivalent grep that greps binary 
files), sigh. However, I doubt that is a major issue right now.


I will push the patch with nits addressed later on today.

Peter



Re: Libtool and CUDA

2010-12-06 Thread Peter O'Gorman

On 12/06/2010 01:07 AM, Ralf Wildenhues wrote:

OK to apply?


Unless Pawel reports that it works for him, no. This doesn't make
sense to me.




Hi Ralf,


Why?


Well, perhaps I haven't been drinking enough coffee, but...





_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '


This assignment didn't work, or was overwritten later.


-  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'


So, why will this make any difference?


+  if test -n $_LT_TAGVAR(lt_prog_compiler_pic, $1); then
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Xcompiler 
$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+  fi


Peter



Re: Libtool and CUDA

2010-12-06 Thread Peter O'Gorman

On 12/06/2010 03:25 PM, Ralf Wildenhues wrote:


Where do you see that?  As far as I understand, Paweł hasn't actually
tried configuring Libtool with something like


Yeah, I failed to read your entire email this morning, definitely didn't 
have enough coffee. It makes sense now :)


We have some compilers with whitespace in lt_prog_compiler_pic, I assume 
nvcc doesn't run on those platforms?


Peter



Re: Libtool and CUDA

2010-12-05 Thread Peter O'Gorman

On 12/05/2010 09:34 PM, Ralf Wildenhues wrote:


Does this patch fix things for you?  As far as I see, you should be
getting -fPIC passed instead of -fno-common, so it's not completely
clear that this is right, or what other changes MacPorts has done to
their glibtool code over upstream Libtool.  Please also send 'glibtool
--config' output.

OK to apply?


Unless Pawel reports that it works for him, no. This doesn't make sense 
to me.


MacPorts doesn't appear to have patched their libtool at all:
http://trac.macports.org/browser/trunk/dports/devel/libtool/Portfile

Peter


_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+  if test -n $_LT_TAGVAR(lt_prog_compiler_pic, $1); then
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Xcompiler 
$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+  fi






Re: Fix linking from only convenience archives with gfortran on Darwin.

2010-10-14 Thread Peter O'Gorman

On 10/14/2010 04:19 PM, Ralf Wildenhues wrote:

Hi Peter,

thanks for the quick feedback!

* Peter O'Gorman wrote on Thu, Oct 14, 2010 at 10:49:00PM CEST:

On 10/14/2010 02:27 PM, Ralf Wildenhues wrote:


The following patch should fix this.  Paul, any chance you could try out
the patch on your system?  OK to add your nameemail to THANKS?

OK to commit?  (I do have access to a darwin system, but no gfortran
installed there, so I cannot test this.)



With this patch, and make check TESTS= TESTSUITEFLAGS=-k
convenience, I get:
...
  33: C convenience archives  ok
  34: C++ convenience archivesok
  35: F77 convenience archivesok
  36: FC convenience archives ok


Do these last two fail without the patch tho?
If not, which gfortran version do you have, and what is
   ./libtool --tag=FC --config
?


Yes, they fail without the patch.

Peter




Re: [PATCH] relax -rpath argument test for Snow Leopard

2010-09-22 Thread Peter O'Gorman

On 09/22/2010 09:00 PM, Leo Davis wrote:

  Hello,

I had to patch libtool in order to get shared libraries to build with
the Snow Leopard '@rpath/' syntax which stands in for the place where
the lib gets installed.  I thought that this might be useful for more
than just myself.


Well, there is no method to encode @executable_path or @loader_path in 
the library install_name either. I always figured that people would just 
build as normal and then postprocess using install_name_tool(1) if they 
needed to.


Why should libtool treat the Mac OS X @rpath differently to the other 
two special paths?


Peter



Re: [PATCH] Correct typo: $sharedlib_from_linklib_cmd missing '_cmd'

2010-09-11 Thread Peter O'Gorman

On 09/11/2010 10:09 AM, Charles Wilson wrote:

On 9/11/2010 2:47 AM, Peter Rosin wrote:

Den 2010-09-11 07:02 skrev Charles Wilson:

OK to push as obvious?


To me, pushing as obvious is the same as pushing without
asking (and when I do, I make damn sure I don't push anything
bad). This makes me curious, what does it mean to you?


It means other than ensuring that I didn't do something stupid like
breaking 'make', I didn't try to do any before/after testing to prove
that this fixed whatever the typo apparently broke.  But the change
is obviously correct, and should't really need that kind of justification.

However...I don't have the authority to push *anything* without
approval, so I *can't* simply say pushed as obvious.


It is ok for anyone with commit access to commit obvious patches without 
approval.


Peter




Re: Next Libtool Point Release Pending

2010-08-09 Thread Peter O'Gorman

On 08/09/2010 12:33 AM, Gary V. Vaughan wrote:



By the reasoning I stated there, we should really have branched
for 2.2 releases before adding any new features.  So, if we
want to release a 2.2.12, then we should make a branch at
v2.2.10 and merge only fixes to it.



I don't think having a stable and development branch worked well with 
1.5.x and 2.x. It added more work for us, and did not serve our users 
well - they had to wait years for the development branch's features to 
make it into a released libtool.


Developing new features etc. on a branch is, of course, ok, in my 
opinion (having to wait several years to merge is not so good though).


I don't really care what the version number is - as long as it's greater 
than the previous one :-)


Peter



Re: libtool does not recognize /usr/lib64 as default location for libraries

2010-06-23 Thread Peter O'Gorman

On 06/23/2010 09:12 AM, Olly Betts wrote:



I posted just such a patch exactly 3 years ago today (coincidentally) -
here's the thread:

http://thread.gmane.org/gmane.comp.gnu.libtool.general/8339/focus=8345

Back then Ralf said Olly's solution should not be forgotten, though, but
it seems it has been.

I've been using this code in Xapian to override libtool's version for a
couple of years now, with no reported problems.

The only downside is that it can be quite slow to get the list from
ldconfig (I haven't investigated why or if this could be improved - it's
interesting that it always seems quick if run a second time which suggests
either a cache issue, or that there's a cached value being updated), but
the speed of the current approach seems greatly outweighed by the wrong
answers it gives.

As I said in the original thread, if the patch is wanted I'm happy to
update it for current libtool and write a ChangeLog entry.


Please do, you're obviously correct, the right answer slowly is always 
better than the wrong one quickly.


Peter




Re: Clean up @var handling in the manual.

2010-06-19 Thread Peter O'Gorman

On 06/19/2010 03:15 AM, Ralf Wildenhues wrote:

In texinfo, @var is for metasyntactic variables only, that is, things
that stand for other things *in the manual*.  If you need a guideline,
then @var is only appropriate if you can replace the name with some
other name, say, the mathematician's favorite, x (or x1, x2, x3 ...)
and that replacement does not change the meaning of the text.  Along
the same tangent, it does not make sense to mention some @var that is
not defined anywhere, e.g., as argument in a function declaration.

With that in mind, the patch below cleans up the Libtool manual, and
follows the Texinfo manual's recommendation of using lower-case @var.

OK to commit?


Sure.

Peter




Re: lt_dlerror changes

2010-06-18 Thread Peter O'Gorman

On 06/18/2010 08:09 AM, Charles Wilson wrote:


Here's the key bit:

Searching for preloaded symbol table for last
vs
Searching for preloaded symbol table for /usr/bin/last

SO, before preopen:vmopen is called, somebody -- one of the other
loaders? -- modified 'filename' simply because /usr/bin/last.exe exists.
  But I thought preopen was the very first loader.


Yes, the preopen loader gets tried first with last.a, it failed, then 
find_handle is called which does an access() check for last in every dir 
in path, and then tryall_dlopen()'s it if it exists.


tryall_dlopen also tries the preopen loader.

Peter




Re: lt_dlerror changes

2010-06-18 Thread Peter O'Gorman

On 06/18/2010 08:36 AM, Peter O'Gorman wrote:

On 06/18/2010 08:33 AM, Peter O'Gorman wrote:

On 06/18/2010 08:09 AM, Charles Wilson wrote:


Here's the key bit:

Searching for preloaded symbol table for last
vs
Searching for preloaded symbol table for /usr/bin/last

SO, before preopen:vmopen is called, somebody -- one of the other
loaders? -- modified 'filename' simply because /usr/bin/last.exe exists.
But I thought preopen was the very first loader.




This should (hopefully) stop the preopen loader getting used twice, and 
perhaps (I'm really dreaming now) give a better error.


Peter
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 1213f0d..094673f 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -424,8 +424,11 @@ tryall_dlopen (lt_dlhandle *phandle, const char *filename,
 	if (vtable)
 	  loader_vtable = vtable;
 	else
-	  loader_vtable = lt_dlloader_get (loader);
-
+	  {
+	loader_vtable = lt_dlloader_get (loader);
+	/* We already tried the preopen loader, no need to do it again */
+	if (loader_vtable == lt_dlloader_find (lt_preopen)) continue;
+	  }
 #ifdef LT_DEBUG_LOADERS
 	fprintf (stderr, Calling %s-module_open (%s)\n,
 		 (loader_vtable  loader_vtable-name) ? loader_vtable-name : (null),


lt_dlerror changes

2010-06-17 Thread Peter O'Gorman

Hi,

Well, this is what I ended up with, it does not change the currently 
documented saving of error messages until lt_dlerror() is called, it 
copies the error message to ensure that we don't return garbage when 
lt_dlerror is called. I think I also got all the places where we were 
setting file not found.


Still, I am not overjoyed with this.

Peter
From 40202fade8f55891b5f4acfee54eba02636b91e8 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Thu, 17 Jun 2010 12:42:28 -0500
Subject: [PATCH] Improve libltdl error messages.

* libltdl/lt_error.c: Add new functions to copy error messages
and keep them until lt_dlerror() is called.
* libltdl/libltdl/lt__private.h: Prototypes for new functions,
new macros.
* libltdl/ltdl.c: Use new macros and functions.
* libltdl/loaders/preopen.c: Likewise.
* tests/lt_dlerror.at: New test.
* Makefile.am: Add new test.
* tests/lt_dlopen.at: Make it pass.
---
 ChangeLog |   13 
 Makefile.am   |1 +
 libltdl/libltdl/lt__private.h |   14 +++-
 libltdl/loaders/preopen.c |   10 ++-
 libltdl/lt_error.c|   44 +-
 libltdl/ltdl.c|  141 ++---
 tests/lt_dlerror.at   |   88 +
 tests/lt_dlopen.at|7 +--
 8 files changed, 253 insertions(+), 65 deletions(-)
 create mode 100644 tests/lt_dlerror.at

diff --git a/ChangeLog b/ChangeLog
index a5676ef..c6f0179 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-06-17  Peter O'Gorman  pe...@pogma.com
+
+	Improve libltdl error messages.
+	* libltdl/lt_error.c: Add new functions to copy error messages
+	and keep them until lt_dlerror() is called.
+	* libltdl/libltdl/lt__private.h: Prototypes for new functions,
+	new macros.
+	* libltdl/ltdl.c: Use new macros and functions.
+	* libltdl/loaders/preopen.c: Likewise.
+	* tests/lt_dlerror.at: New test.
+	* Makefile.am: Add new test.
+	* tests/lt_dlopen.at: Make it pass.
+
 2010-06-16  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
 	Optimize func_ltwrapper_scriptname to assume a cwrapper.
diff --git a/Makefile.am b/Makefile.am
index d0688ee..40fce35 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -488,6 +488,7 @@ TESTSUITE_AT	= tests/testsuite.at \
 		  tests/lt_dlopen.at \
 		  tests/lt_dlopen_a.at \
 		  tests/lt_dlopenext.at \
+		  tests/lt_dlerror.at \
 		  tests/ltdl-libdir.at \
 		  tests/ltdl-api.at \
 		  tests/dlloader-api.at \
diff --git a/libltdl/libltdl/lt__private.h b/libltdl/libltdl/lt__private.h
index f4c4a3d..dc043cc 100644
--- a/libltdl/libltdl/lt__private.h
+++ b/libltdl/libltdl/lt__private.h
@@ -137,13 +137,19 @@ struct lt__advise {
 #define LT__STRERROR(name)	lt__error_string(LT_CONC(LT_ERROR_,name))
 
 #define LT__GETERROR(lvalue)	  (lvalue) = lt__get_last_error()
-#define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg)
-#define LT__SETERROR(errorcode)	  LT__SETERRORSTR(LT__STRERROR(errorcode))
+#define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg, 0)
+#define LT__SETERROR(errorcode)   if (0 == lt__get_last_error()) \
+	LT__SETERRORSTR(LT__STRERROR(errorcode))
+#define LT__ENTER_PUBLIC_FUNC(x)  lt__enter_err()
+#define LT__PUBLIC_FUNC_RETURN(x) lt__keep_error(); return x;
+#define LT__FORCEERROR(errorstr)  LT__SETERRORSTR(errorstr)
 
 LT_SCOPE const char *lt__error_string	(int errorcode);
 LT_SCOPE const char *lt__get_last_error	(void);
-LT_SCOPE const char *lt__set_last_error	(const char *errormsg);
-
+LT_SCOPE const char *lt__set_last_error	(const char *errormsg, int mustfree);
+LT_SCOPE voidlt__keep_error (void);
+LT_SCOPE voidlt__enter_err  (void);
+LT_SCOPE const char *lt__dlerror(void);
 LT_END_C_DECLS
 
 #endif /*!defined(LT__PRIVATE_H)*/
diff --git a/libltdl/loaders/preopen.c b/libltdl/loaders/preopen.c
index 7149287..8b14121 100644
--- a/libltdl/loaders/preopen.c
+++ b/libltdl/loaders/preopen.c
@@ -186,7 +186,6 @@ vm_open (lt_user_data LT__UNUSED loader_data, const char *filename,
 }
 
   LT__SETERROR (FILE_NOT_FOUND);
-
  done:
   return module;
 }
@@ -292,8 +291,9 @@ add_symlist (const lt_dlsymlist *symlist)
 int
 lt_dlpreload_default (const lt_dlsymlist *preloaded)
 {
+  LT__ENTER_PUBLIC_FUNC ();
   default_preloaded_symbols = preloaded;
-  return 0;
+  LT__PUBLIC_FUNC_RETURN (0);
 }
 
 
@@ -303,6 +303,7 @@ int
 lt_dlpreload (const lt_dlsymlist *preloaded)
 {
   int errors = 0;
+  LT__ENTER_PUBLIC_FUNC ();
 
   if (preloaded)
 {
@@ -318,7 +319,7 @@ lt_dlpreload (const lt_dlsymlist *preloaded)
 	}
 }
 
-  return errors;
+  LT__PUBLIC_FUNC_RETURN (errors);
 }
 
 
@@ -331,6 +332,7 @@ lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func)
   symlist_chain *list;
   int		 errors = 0;
   int		 found  = 0;
+  LT__ENTER_PUBLIC_FUNC ();
 
   /* For each symlist in the chain...  */
   for (list = preloaded_symlists; list; list = list-next)
@@ -371,5 +373,5

Re: lt_dlerror changes

2010-06-17 Thread Peter O'Gorman

On 06/17/2010 08:36 PM, Charles Wilson wrote:

On 6/17/2010 4:54 PM, Peter O'Gorman wrote:

Well, this is what I ended up with, it does not change the currently
documented saving of error messages until lt_dlerror() is called, it
copies the error message to ensure that we don't return garbage when
lt_dlerror is called. I think I also got all the places where we were
setting file not found.

Still, I am not overjoyed with this.


Fails on cygwin.  However, adding -no-undefined fixes that.

AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS
   $LDFLAGS -o good-plugin.la -rpath $libdir ]dnl

--here-  [-module -avoid-version good-plugin.lo],

   [], [ignore], [ignore])

Unfortunately, this doesn't magically assist solving my problem with
71. dlloader-api.at:23:  FAILED (dlloader-api.at:422)
but that's not a reason to object to the patch.



Well that sucks :(

I suggest changing the LT__SETERROR macro in 
libltdl/libltdl/lt__private.h to print __FILE__ and __LINE__ etc. if 
errorcode == FILE_NOT_FOUND, then running test 71 again. It doesn't look 
like it's happening in loadlibrary.c.


Thanks for checking this out!

Peter



Re: lt_dlerror changes

2010-06-17 Thread Peter O'Gorman

On 06/17/2010 10:21 PM, Charles Wilson wrote:

On 6/17/2010 10:24 PM, Peter O'Gorman wrote:

Unfortunately, this doesn't magically assist solving my problem with
 71. dlloader-api.at:23:  FAILED (dlloader-api.at:422)
but that's not a reason to object to the patch.



Well that sucks :(

I suggest changing the LT__SETERROR macro in
libltdl/libltdl/lt__private.h to print __FILE__ and __LINE__ etc. if
errorcode == FILE_NOT_FOUND, then running test 71 again. It doesn't look
like it's happening in loadlibrary.c.


../libtool/libltdl/loaders/preopen.c (188)
../libtool/libltdl/loaders/preopen.c (188)
../libtool/libltdl/loaders/preopen.c (188)

Hmm. Adding more debug output to preopen.c:vm_open  ...

Searching for preloaded symbol table for dlopen.a
Found preloaded symbol table for libltdlc
Found preloaded symbol table for dlopen.a
oops, bailing at line 183
Searching for preloaded symbol table for loadlibrary.a
Found preloaded symbol table for libltdlc
Found preloaded symbol table for dlopen.a
Found preloaded symbol table for dlopen_LTX_get_vtable
Found preloaded symbol table for loadlibrary.a
oops, bailing at line 183
Searching for preloaded symbol table for first.a
Found preloaded symbol table for libltdlc
Found preloaded symbol table for dlopen.a
Found preloaded symbol table for dlopen_LTX_get_vtable
Found preloaded symbol table for loadlibrary.a
Found preloaded symbol table for loadlibrary_LTX_get_vtable
Found preloaded symbol table for @PROGRAM@
../libtool/libltdl/loaders/preopen.c (191)
Searching for preloaded symbol table for module.a
Found preloaded symbol table for libltdlc
Found preloaded symbol table for dlopen.a
Found preloaded symbol table for dlopen_LTX_get_vtable
Found preloaded symbol table for loadlibrary.a
Found preloaded symbol table for loadlibrary_LTX_get_vtable
Found preloaded symbol table for @PROGRAM@
../libtool/libltdl/loaders/preopen.c (191)
Searching for preloaded symbol table for last.a
Found preloaded symbol table for libltdlc
Found preloaded symbol table for dlopen.a
Found preloaded symbol table for dlopen_LTX_get_vtable
Found preloaded symbol table for loadlibrary.a
Found preloaded symbol table for loadlibrary_LTX_get_vtable
Found preloaded symbol table for @PROGRAM@
../libtool/libltdl/loaders/preopen.c (191)
Searching for preloaded symbol table for /usr/bin/last
Found preloaded symbol table for libltdlc
Found preloaded symbol table for dlopen.a
Found preloaded symbol table for dlopen_LTX_get_vtable
Found preloaded symbol table for loadlibrary.a
Found preloaded symbol table for loadlibrary_LTX_get_vtable
Found preloaded symbol table for @PROGRAM@


Err...why is it looking for a module named /usr/bin/last? Is it
somehow using a $PATH search, and matching last to
/usr/bin/last.exe?  cygwin's dlopen does do some funky things with
$PATH, because that's how windows looks for DLLs -- but we're in
preopen, here...

Peter, can you try the attached patch on top of your mods, on some
platform OTHER than cygwin, and tell me what output you get?


Got this on fedora 13.

Peter

# -*- compilation -*-
72. dlloader-api.at:23: testing ...
++ cat
++ cat
++ cat
++ case $host_os in
++ : -I/home/pogma/gitco/cw/../libtool/libltdl
++ : /home/pogma/gitco/cw/tests/../libltdl/libltdlc.la
++ set +x
../../libtool/tests/dlloader-api.at:400: case $LIBLTDL in #(
 */_inst/lib/*) test -f $LIBLTDL || (exit 77) ;;
esac
Not enabling shell tracing (command contains an embedded newline)
stdout:
++ CPPFLAGS='-I/home/pogma/gitco/cw/../libtool/libltdl '
++ set +x
../../libtool/tests/dlloader-api.at:406: $LIBTOOL --mode=compile $CC $CPPFLAGS 
$CFLAGS -c module.c
++ /home/pogma/gitco/cw/libtool --mode=compile gcc 
-I/home/pogma/gitco/cw/../libtool/libltdl -g -O2 -c module.c
stderr:
stdout:
libtool: compile:  gcc -I/home/pogma/gitco/cw/../libtool/libltdl -g -O2 -c 
module.c  -fPIC -DPIC -o .libs/module.o
libtool: compile:  gcc -I/home/pogma/gitco/cw/../libtool/libltdl -g -O2 -c 
module.c -o module.o /dev/null 21
++ set +x
../../libtool/tests/dlloader-api.at:408: $LIBTOOL --mode=link $CC $CFLAGS 
$LDFLAGS -o module.la  -rpath /nowhere -module -avoid-version 
-no-undefinedmodule.lo
++ /home/pogma/gitco/cw/libtool --mode=link gcc -g -O2 -o module.la -rpath 
/nowhere -module -avoid-version -no-undefined module.lo
stderr:
stdout:
libtool: link: gcc -shared  .libs/module.o  -Wl,-soname -Wl,module.so -o 
.libs/module.so
libtool: link: ar cru .libs/module.a  module.o
libtool: link: ranlib .libs/module.a
libtool: link: ( cd .libs  rm -f module.la  ln -s ../module.la 
module.la )
++ . ./module.la
+++ dlname=module.so
+++ library_names='module.so module.so module.so'
+++ old_library=module.a
+++ inherited_linker_flags=
+++ dependency_libs=
+++ weak_library_names=
+++ current=0
+++ age=0
+++ revision=0
+++ installed=no
+++ shouldnotlink=yes
+++ dlopen=
+++ dlpreopen=
+++ libdir=/nowhere
++ set +x
../../libtool/tests/dlloader-api.at:415: test -n $dlname || (exit 77)
++ test -n module.so

Re: lt_dlerror changes

2010-06-17 Thread Peter O'Gorman

On 06/17/2010 10:35 PM, Peter O'Gorman wrote:

On 06/17/2010 10:21 PM, Charles Wilson wrote:

On 6/17/2010 10:24 PM, Peter O'Gorman wrote:

Unfortunately, this doesn't magically assist solving my problem with
71. dlloader-api.at:23: FAILED (dlloader-api.at:422)
but that's not a reason to object to the patch.



Well that sucks :(

I suggest changing the LT__SETERROR macro in
libltdl/libltdl/lt__private.h to print __FILE__ and __LINE__ etc. if
errorcode == FILE_NOT_FOUND, then running test 71 again. It doesn't look
like it's happening in loadlibrary.c.


../libtool/libltdl/loaders/preopen.c (188)
../libtool/libltdl/loaders/preopen.c (188)
../libtool/libltdl/loaders/preopen.c (188)

Hmm. Adding more debug output to preopen.c:vm_open ...

Searching for preloaded symbol table for dlopen.a


Err...why is it looking for a module named /usr/bin/last? Is it
somehow using a $PATH search, and matching last to
/usr/bin/last.exe? cygwin's dlopen does do some funky things with
$PATH, because that's how windows looks for DLLs -- but we're in
preopen, here...



Ok, it's adding a loader (at the end of the list of loaders), then 
trying to lt_dlopen(last), that's going to try all other loaders 
before getting to the added loader, and in your case the loadlibrary 
loader finds /usr/bin/last (because /usr/bin is properly in the search 
path).


My changes to lt_dlerror should have given you the error from 
loadlibrary.c, but didn't, I will check why, it looks like the patch 
needs more work though.


Peter




Re: Multiple test failures with --disable-shared

2010-06-14 Thread Peter O'Gorman

On 06/14/2010 12:58 AM, Ralf Wildenhues wrote:


IIRC this one could also be fixed by using
LTDL_SET_PRELOADED_SYMBOLS, I don't remember for sure, but I recall
being convinced that these were all testsuite issues.


Well, if that fixes it, then that is fine with me of course.


Ok thanks, pushed this. No test failures for me with --disable-shared now.

Peter
From 0263ff229bbf6f02a61d4ccad3bd4ab3a5601e1d Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Mon, 14 Jun 2010 11:04:17 -0500
Subject: [PATCH] Pass resident test with --disable-shared too.

* tests/resident.at: use LTDL_SET_PRELOADED_SYMBOLS.
---
 ChangeLog |5 +
 tests/resident.at |2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a313b4b..2ffbcee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-14  Peter O'Gorman  pe...@pogma.com
+
+	Pass resident test with --disable-shared too.
+	* tests/resident.at: use LTDL_SET_PRELOADED_SYMBOLS.
+
 2010-06-13  Peter O'Gorman  pe...@pogma.com
 
 	Test with --disable-shared at release time too.
diff --git a/tests/resident.at b/tests/resident.at
index 2a85204..cf00688 100644
--- a/tests/resident.at
+++ b/tests/resident.at
@@ -38,6 +38,8 @@ main (int argc, char* argv[])
   lt_dlhandle plugin_handle;
   lt_dladvise advise;
 
+  LTDL_SET_PRELOADED_SYMBOLS();
+
   if (argc  2)
 {
   fprintf (stderr, usage: %s plugin\n, argv[0]);
-- 
1.7.0.1



Re: Multiple test failures with --disable-shared

2010-06-12 Thread Peter O'Gorman

On 06/11/2010 11:56 PM, Gary V. Vaughan wrote:

Hi Peter,

On 12 Jun 2010, at 11:39, Peter O'Gorman wrote:


On 06/10/2010 03:07 PM, Peter O'Gorman wrote:

On 06/10/2010 11:10 AM, Peter O'Gorman wrote:

Hi,

I got an off-list report from a user about test failures in 2.2.6b, that
turned out to be either because he'd configured with --disable-shared or
libtool had incorrectly guessed that his system did not support shared
libraries. (lots of lag in the exchange).




I am not spectacularly happy with all of these, suggestions welcome.


2  4: A-OK :) Please push.


Will do tomorrow, thanks.


1: There might be a better way.  I'm thinking...


I'm not sure what testing that modules cannot be unloaded gets you when 
you don't have shared libraries.



3: eww!


It's either skip the test entirely or some crap like this, you can't 
load a static archive RTLD_LOCAL, then load a different static archive 
with the same symbols later RTLD_GLOBAL, and expect things to work. I 
debated what to do, and decided to do the crap thing, since it's 
possible some parts of the test are useful.


Peter



Re: Multiple test failures with --disable-shared

2010-06-11 Thread Peter O'Gorman

On 06/11/2010 11:53 AM, Dave Korn wrote:

On 11/06/2010 16:18, Peter O'Gorman wrote:

Hello Dave,

The bindir.at test fails when libtool is configured with
--disable-shared, I am considering just skipping the test in that case,
but if the test is still useful, then perhaps we can change the check so
that it tests for .lib or .a files?


 Hi Peter,

   The test verifies that shared libraries (DLLs) are installed into the
location specified by --bindir.  The option isn't meant to do anything to
anything else, so without shared libs, there's nothing to check; skipping it
seems like the most straightforward approach.  Sorry for not having thought of
this when I sent the patch in the first place!


Thanks, I pushed this.

Peter

From d4558ac9bee7bde487ea982c28771d43a610d4fc Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Fri, 11 Jun 2010 14:22:55 -0500
Subject: [PATCH] Skip bindir install test if we're not building shared.

* tests/bindir.at: Skip install test if necessary.
* THANKS: Update.
Report by Michael E Faenza.
---
 ChangeLog   |7 +++
 THANKS  |1 +
 tests/bindir.at |3 +++
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 48b26f8..823c6d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-11  Peter O'Gorman  pe...@pogma.com
+
+	Skip bindir install test if we're not building shared.
+	* tests/bindir.at: Skip install test if necessary.
+	* THANKS: Update.
+	Report by Michael E Faenza.
+
 2010-06-11  Gary V. Vaughan  g...@gnu.org
 
 	Use getopt.m4sh to generate libtoolize option parser.
diff --git a/THANKS b/THANKS
index dc61c43..08445f1 100644
--- a/THANKS
+++ b/THANKS
@@ -130,6 +130,7 @@
   Marcel Loose			lo...@astron.nl
   Mark Kettenis			kette...@phys.uva.nl
   Matthijs Kooijman		matth...@stdin.nl
+  Micheal E. Faenza		mfae...@mitre.org
   Michael Haubenwallner		michael.haubenwall...@salomon.at
   Mike Gorchak			m...@malva.ua
   Mike Frysinger		vap...@gentoo.org
diff --git a/tests/bindir.at b/tests/bindir.at
index e49853d..40e67cc 100644
--- a/tests/bindir.at
+++ b/tests/bindir.at
@@ -198,6 +198,9 @@ case $host_os in
 ;;
 esac
 
+eval `$LIBTOOL --config | grep '^build_libtool_libs='`
+AT_CHECK([test $build_libtool_libs = yes || (exit 77)])
+
 
 # These routines save the PATH before a test and restore it after,
 # prepending a chosen directory to the path on the platforms where
-- 
1.7.0.1



Re: Multiple test failures with --disable-shared

2010-06-11 Thread Peter O'Gorman

On 06/10/2010 03:07 PM, Peter O'Gorman wrote:

On 06/10/2010 11:10 AM, Peter O'Gorman wrote:

Hi,

I got an off-list report from a user about test failures in 2.2.6b, that
turned out to be either because he'd configured with --disable-shared or
libtool had incorrectly guessed that his system did not support shared
libraries. (lots of lag in the exchange).




I am not spectacularly happy with all of these, suggestions welcome.

Peter
From 74aaea6a2aa753e7a3e6534f4c03de1ba193bd88 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Fri, 11 Jun 2010 23:32:53 -0500
Subject: [PATCH 1/4] Skip resident test if not building shared.

* tests/resident.at: Skip if only static.
---
 ChangeLog |5 +
 tests/resident.at |4 
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 823c6d3..a19817c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-12  Peter O'Gorman  pe...@pogma.com
+
+	Skip resident test if not building shared.
+	* tests/resident.at: Skip if only static.
+
 2010-06-11  Peter O'Gorman  pe...@pogma.com
 
 	Skip bindir install test if we're not building shared.
diff --git a/tests/resident.at b/tests/resident.at
index 2a85204..ad72967 100644
--- a/tests/resident.at
+++ b/tests/resident.at
@@ -27,6 +27,10 @@
 AT_SETUP([resident modules])
 AT_KEYWORDS([libltdl])
 
+# Skip if we're not building shared libs.
+eval `$LIBTOOL --config | grep '^build_libtool_libs='`
+AT_CHECK([test $build_libtool_libs = yes || (exit 77)])
+
 AT_DATA([main.c],
 [[#include ltdl.h
 #include stdio.h
-- 
1.7.0.1

From 2d6a123b6b48209e0d67e8a153835f3829b0f685 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Fri, 11 Jun 2010 23:34:05 -0500
Subject: [PATCH 2/4] Use LTDL_SET_PRELOADED_SYMBOLS to avoid failure.

* tests/exceptions.at: Use it.
---
 ChangeLog   |3 +++
 tests/exceptions.at |3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a19817c..f9d5d81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-06-12  Peter O'Gorman  pe...@pogma.com
 
+	Use LTDL_SET_PRELOADED_SYMBOLS to avoid failure.
+	* tests/exceptions.at: Use it.
+
 	Skip resident test if not building shared.
 	* tests/resident.at: Skip if only static.
 
diff --git a/tests/exceptions.at b/tests/exceptions.at
index 6fe9f9a..293723c 100644
--- a/tests/exceptions.at
+++ b/tests/exceptions.at
@@ -224,6 +224,9 @@ int exceptions_in_module (void)
 
 int main (void)
 {
+
+  LTDL_SET_PRELOADED_SYMBOLS();
+
   if (exceptions_in_prog ())
 return 1;
   if (exceptions_in_lib ())
-- 
1.7.0.1

From 29544e8b260b789c8d06ecda3ab5b5caa75f5fe7 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Fri, 11 Jun 2010 23:35:10 -0500
Subject: [PATCH 3/4] Avoid failure for --disable-shared.

* tests/lt_dladvise.at: Hack.
---
 ChangeLog|3 +++
 tests/lt_dladvise.at |7 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f9d5d81..2ab174b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-06-12  Peter O'Gorman  pe...@pogma.com
 
+	Avoid failure for --disable-shared.
+	* tests/lt_dladvise.at: Hack.
+
 	Use LTDL_SET_PRELOADED_SYMBOLS to avoid failure.
 	* tests/exceptions.at: Use it.
 
diff --git a/tests/lt_dladvise.at b/tests/lt_dladvise.at
index cdbe91d..cefab93 100644
--- a/tests/lt_dladvise.at
+++ b/tests/lt_dladvise.at
@@ -223,7 +223,12 @@ main (void)
 
   hint_resident ();
   hint_local ();
+#ifdef HAVE_SHARED
   hint_global ();
+#else
+  printf (global: 4\n);
+  printf (depend: 5\n);
+#endif
   hint_preload ();
 
   if (lt_dlexit () != 0)
@@ -335,6 +340,8 @@ cygwin* | mingw* | cegcc* | *,false)
   ;;
 esac
 
+$have_shared  CPPFLAGS=$CPPFLAGS -DHAVE_SHARED
+
 # - #
 # Other modules can be tested correctly even when built with -no-undefined. #
 # - #
-- 
1.7.0.1

From 6f57facfa3cebc0309156f0eab1d8c31d5e69ac8 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Fri, 11 Jun 2010 23:37:03 -0500
Subject: [PATCH 4/4] Test with --disable-shared at release time too.

* HACKING: Note it.
---
 ChangeLog |3 +++
 HACKING   |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2ab174b..3cc16ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-06-12  Peter O'Gorman  pe...@pogma.com
 
+	Test with --disable-shared at release time too.
+	* HACKING: Note it.
+
 	Avoid failure for --disable-shared.
 	* tests/lt_dladvise.at: Hack.
 
diff --git a/HACKING b/HACKING
index 19ac2cd..7ea1818 100644
--- a/HACKING
+++ b/HACKING
@@ -641,6 +641,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 * Run `make distcheck'
   and `make distcheck DISTCHECK_CONFIGURE_FLAGS=--disable-ltdl-install'
   and `make distcheck

Re: Multiple test failures with --disable-shared

2010-06-10 Thread Peter O'Gorman

On 06/10/2010 03:07 PM, Peter O'Gorman wrote:

On 06/10/2010 11:10 AM, Peter O'Gorman wrote:

Hi,

I got an off-list report from a user about test failures in 2.2.6b, that
turned out to be either because he'd configured with --disable-shared or
libtool had incorrectly guessed that his system did not support shared
libraries. (lots of lag in the exchange).


Logs from clean tree of the unexpected failures.




../../libtool/tests/duplicate_conv.at:79: $LIBTOOL --mode=link --tag=CC $CC 
$CFLAGS $LDFLAGS -o cee.$OBJEXT c.lo a/liba.la b/liba.la
stderr:
stdout:
libtool: link: /usr/bin/ld -r -o cee.o--whole-archive a/.libs/liba.a 
b/.libs/liba.a --no-whole-archive
../../libtool/tests/duplicate_conv.at:81: $LIBTOOL --mode=link $CC $CFLAGS 
$LDFLAGS -o main$EXEEXT main.$OBJEXT cee.$OBJEXT



This patch fixes the above problem with libtool dropping the c.lo 
object. Test passes with and without --disable-shared.


Ok?

Peter
From 281573a54983f82b03b13d786cdb77e5c04ed411 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Thu, 10 Jun 2010 22:00:47 -0500
Subject: [PATCH] Create reloadable object files with non-pic objects too.

* libltdl/config/ltmain.m4sh: When not building a shared
library, use the non-pic objects to create a reloadable
object, because pic objects do not exist.
---
 ChangeLog  |7 +++
 libltdl/config/ltmain.m4sh |3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 24de21d..7ebfe16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-10  Peter O'Gorman  pe...@pogma.com
+
+	Create reloadable object files with non-pic objects too.
+	* libltdl/config/ltmain.m4sh: When not building a shared
+	library, use the non-pic objects to create a reloadable
+	object, because pic objects do not exist.
+
 2010-06-09  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
 	Factorize testing gcj installation in the testsuite.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 9e6646f..5906552 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -7180,6 +7180,9 @@ EOF
 	fi
   fi
 
+  # If we're not building shared, we need to use non_pic_objs
+  test $build_libtool_libs != yes  libobjs=$non_pic_objects
+
   # Create the old-style object.
   reload_objs=$objs$old_deplibs `$ECHO $libobjs | $SP2NL | $SED /\.${libext}$/d; /\.lib$/d; $lo2o | $NL2SP` $reload_conv_objs ### testsuite: skip nested quoting test
 
-- 
1.7.0.1



Re: Multiple test failures with --disable-shared

2010-06-10 Thread Peter O'Gorman

On 06/10/2010 11:05 PM, Ralf Wildenhues wrote:

Hi Peter,

* Peter O'Gorman wrote on Fri, Jun 11, 2010 at 05:04:55AM CEST:

+   Create reloadable object files with non-pic objects too.
+   * libltdl/config/ltmain.m4sh: When not building a shared
+   library, use the non-pic objects to create a reloadable
+   object, because pic objects do not exist.



diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 9e6646f..5906552 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -7180,6 +7180,9 @@ EOF
fi
fi

+  # If we're not building shared, we need to use non_pic_objs
+  test $build_libtool_libs != yes  libobjs=$non_pic_objects


Don't you miss $objs here then?



I already pushed, but you may be right, will look again.

Peter




Re: F13 SELinux failure

2010-06-09 Thread Peter O'Gorman

On 06/08/2010 11:55 PM, Ralf Wildenhues wrote:


This skips a bit more than is absolutely needed (only the demo-exec run
after demo-nopic and demo-make would need to be skipped), but I don't
see a big problem with that.  We can fix that when we rename tests to
have unique names (e.g., to allow parallel-tests).

Would it make sense to test for /etc/selinux only
   if test $build = $host  test -d /etc/selinux ...

though?  I'm not quite sure myself actually.

I don't have much experience with selinux, the only other nits I see is
that you want a ;; after the first esac you added, and bump copyright
years.



Pushed with these changes. Thanks!

Peter




Re: F13 SELinux failure

2010-06-08 Thread Peter O'Gorman

On 06/07/2010 03:52 PM, Peter O'Gorman wrote:


Ok spent 5 minutes with google and the selinux manpages (something I
have to do any time I do anything related to selinux).

The above is, of course, after tests/demo-nopic.test, and the problem is
the selinux boolean allow_execmod which disallows text relocations.

I'll look into making the test skip in this case.


Ok?

Peter
From cb91e71e6913d09e20a5176e3d3591136e116bc3 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Tue, 8 Jun 2010 20:07:50 -0500
Subject: [PATCH] Skip demo-nopic tests if SELinux policy will cause failure.

* tests/demo-nopic.test: Check SELinux policy and skip if
necessary.
* tests/testsuite.at (LT_AT_CONFIGURE, LT_AT_MAKE):
---
 ChangeLog |6 ++
 tests/demo-nopic.test |   13 +
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0ce3ca0..de33f80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-06-08  Peter O'Gorman  pe...@pogma.com
+
+	Skip demo-nopic tests if SELinux policy will cause failure.
+	* tests/demo-nopic.test: Check SELinux policy and skip if
+	necessary.
+
 2010-06-08  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
 	Fix testsuite helper macros to not hide failure.
diff --git a/tests/demo-nopic.test b/tests/demo-nopic.test
index 11e5c16..b47f70c 100755
--- a/tests/demo-nopic.test
+++ b/tests/demo-nopic.test
@@ -34,6 +34,19 @@ hppa*|x86_64*|s390*)
 	;;
 esac
 
+if test -d /etc/selinux; then
+	_selinux=`getenforce 2/dev/null || echo Disabled`
+	case ${_selinux} in
+	*Enforcing)
+		_sebool_allow_execmod=`getsebool allow_execmod 2/dev/null`
+		case ${_sebool_allow_execmod} in
+			*off)
+func_skip SELinux policy disallows
+;;
+		esac
+	esac
+fi
+
 func_rmprefixdir
 func_cd tests/demo
 func_make_distclean
-- 
1.7.0.1



[PATCH] Ranlib is required with -force_load and fat archives.

2010-05-03 Thread Peter O'Gorman
I got a report from Jeremy that -force_load with multi-architecture
archives requires that the archives be ranlibbed.

Pushed this.

Peter
From 8f76455acfbfd28d695720507f78dc533f2d7a4c Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Tue, 4 May 2010 00:44:48 -0500
Subject: [PATCH] Ranlib is required with -force_load and fat archives.

* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Run
ranlib.
Reported by Jeremy Huddleston jerem...@apple.com
---
 ChangeLog |7 +++
 libltdl/m4/libtool.m4 |2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 84c0bc3..aae203c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-04  Peter O'Gorman  pe...@pogma.com
+
+	Ranlib is required with -force_load and fat archives.
+	* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Run
+	ranlib.
+	Reported by Jeremy Huddleston jerem...@apple.com
+
 2010-04-09  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
 	Fix incompatible struct declarations.
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 5e0bba7..685ac0c 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -982,6 +982,8 @@ _LT_EOF
   $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2AS_MESSAGE_LOG_FD
   echo $AR cru libconftest.a conftest.o AS_MESSAGE_LOG_FD
   $AR cru libconftest.a conftest.o 2AS_MESSAGE_LOG_FD
+  echo $RANLIB libconftest.a AS_MESSAGE_LOG_FD
+  $RANLIB libconftest.a 2AS_MESSAGE_LOG_FD
   cat  conftest.c  _LT_EOF
 int main() { return 0;}
 _LT_EOF
-- 
1.6.2.5



Re: picking -framework in -Wl, and -Xlinker arguments

2010-03-02 Thread Peter O'Gorman
On 03/02/2010 01:59 AM, mpsuz...@hiroshima-u.ac.jp wrote:
 Hi,
 
 At present, GNU libtool cares raw -framework options
 and exports them to inherited_linker_flags in .la file.
 
 But if -framework is quoted by -Wl, or -Xlinker options,
 they are just passed to the linker transparently, and not
 exported to .la file. So the framework dependency caused
 by -Wl,-quoted options are invisible.
 
 Attached is a patch to care -Wl,-framework and -Xlinker
 -framework. Also tests/inherited_flags.at is extended to
 check various combinations of -Wl and -Xlinker. For detailed
 background, please check the discussion in fink-devel:

Hi,

So you decided to submit a patch, I was hoping you would just add the
raw -framework flags to your package :)

Why is it not possible for you to avoid quoting the -framework Cocoa
with -Wl, or -Xlinker?

Using the raw -framework Cocoa in a package you control is perfectly
fine, regardless of how downstream packagers deal with things.

Peter




Re: Fix bindir and dlopen tests for C++ compilers (CC=g++).

2009-11-30 Thread Peter O'Gorman

On 11/30/2009 12:42 AM, Ralf Wildenhues wrote:


I don't see a warning to that end, my system declares strrchr as
#includestring.h

char *strrchr(const char *s, int c);

What does yours (darwin?) do instead?


Actually, this was on Fedora 11, gcc-4.4.1, glibc-2.10, which for c++, 
declares strrchr and strchr as having the same return type as the first 
argument, char* for a char* argument, and const char* for a const char* 
argument:


extern C++
{
extern char *strrchr (char *__s, int __c)
 throw () __asm (strrchr) __attribute__ ((__pure__)) 
__attribute__ ((__nonnull__ (1)));

extern __const char *strrchr (__const char *__s, int __c)
 throw () __asm (strrchr) __attribute__ ((__pure__)) 
__attribute__ ((__nonnull__ (1)));


http://udrepper.livejournal.com/20948.html

Peter
--
Peter O'Gorman
http://pogma.com




Re: Fix bindir and dlopen tests for C++ compilers (CC=g++).

2009-11-29 Thread Peter O'Gorman

On 11/29/2009 04:12 PM, Ralf Wildenhues wrote:

I've built Libtool and run the testsuites with CC=g++ on GNU/Linux,
the following patch fixes the fallout.  Pushed as obvious.


You did 'make check CC=g++'? or './configure CC=g++; make; make check'?

IIRC libltdl itself did not built for me with make distcheck CC=g++ not 
because of test suite failures, but because libltdl itself fails to build.


A simple cast allows it to build:

diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 24ee13f..270d528 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -1511,7 +1511,7 @@ has_library_ext (const char *filename)

   assert (filename);

-  ext = strrchr (filename, '.');
+  ext = (char *)strrchr (filename, '.');

   if (ext  ((streq (ext, archive_ext))
 #if defined(LT_MODULE_EXT)

But, I think there were objections to adding random casts like this when 
it came up before?


Anyway, thanks for fixing the testsuite failures with this :)

Peter
--
Peter O'Gorman
http://pogma.com




Re: libtool, OS X, and GNU ranlib

2009-10-01 Thread Peter O'Gorman

On 09/10/2009 02:04 PM, Ralf Wildenhues wrote:

* Bob Friesenhahn wrote on Thu, Sep 10, 2009 at 08:21:32PM CEST:

On Thu, 10 Sep 2009, Ralf Wildenhues wrote:


IMHO, people installing to /usr need to know what they are doing.


s/need to/should/g


Yes.


Enabling --program-prefix=g with --prefix=/usr would be quite a surprise
for everyone else who is otherwise familiar with GCS, so I'd prefer not
to go that way.


Right.  I think that it is better for libtool to error out during
configuration if it detects that the user would be destroying the
Apple version.


Yes.  Be sure to not error out in the case that the smart user is cross
compiling for another system from Darwin, or intends to DESTDIR-install
to a staging area, or similar use case that *they* might know to be
sensible but *we* may not.  A warning is of course prudent.  But just to
drive the point home again: this issue is not a bug in Libtool, it is a
user error.  We do not need to fix it.



2009-10-01  Peter O'Gorman  pe...@pogma.com

Warn on darwin if install will overwrite /usr/bin/libtool
* configure.ac: Add warning.

ok?

Peter
--
Peter O'Gorman
http://pogma.com
diff --git a/configure.ac b/configure.ac
index 56325f7..b36f097 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,23 @@ AM_CONDITIONAL(HAVE_RC, [test -n [$]_LT_TAGVAR(compiler, RC)])
 ## - ##
 AM_MISSING_PROG([HELP2MAN], [help2man])
 
+## -- ##
+## Darwin warning ##
+## -- ##
+
+_warn_darwin=$prefix,$program_transform_name$host_os
+case $_warn_darwin in
+	/usr,s,x,x,darwin*)
+	AC_MSG_WARN([Configuring with --prefix=/usr and no transform name]
+		[on darwin is not recommended. If installed, it will]
+		[overwrite /usr/bin/libtool, which is a vendor]
+		[supplied binary with different functionality.]
+		[Either reconfigure with a different prefix, or]
+		[perhaps with --program-prefix=g])
+	;;
+	*) ;;
+esac
+
 ##  ##
 ## Outputs. ##
 ##  ##


Re: libtool, OS X, and GNU ranlib

2009-10-01 Thread Peter O'Gorman

On 10/01/2009 05:04 PM, Bob Friesenhahn wrote:

Excuse this top-post.  I continue to believe that this user error
should be explictly prevented (by a hard configure error) and that very
few people will notice a warning message while configure is running.



Hmm, well, ok, I could make it an error, but allow overriding for people 
who know what they are doing, maybe by setting a cache var, e.g. 
./configure --prefix=/usr lt_cv_darwin_override=yes ? and mention the 
possibility of using the override in the error message.


Would that satisfy both you and Ralf? :)

Peter
--
Peter O'Gorman
http://pogma.com




Re: Clean libconftest.a

2009-09-11 Thread Peter O'Gorman
Akim Demaille wrote:
 Hi all,
 
 this breaks distcheck on master.
 

Hi Akim,

Please push the first hunk (minus the whitespace change in
func_echo_all). If you want to submit a whitespace patch, please do so
separately.

Thanks for catching this,
Peter
-- 
Peter O'Gorman
http://pogma.com




Re: [PATCH] Allow dlopen self test to work with gcc's -fvisibility=hidden.

2009-09-08 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 * Peter O'Gorman wrote on Mon, Sep 07, 2009 at 11:16:05PM CEST:
 Ralf Wildenhues wrote:

 No, it must have been earlier.  gcc-3.3 (Debian 3.3.6-15) accepts it,
 gcc-2.95.4 rejects it.
 Ah, ok - this is it?

 2002-11-26  Richard Henderson  r...@redhat.com

 * c-common.c (handle_visibility_attribute): Accept default.
 
 Yes, I think so.  That would indicate that 3.3 is the first version to
 have it, given the GCC timeline.  So, based on that, ok to apply this
 instead?
 

Yes, thanks.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: [PATCH] Allow dlopen self test to work with gcc's -fvisibility=hidden.

2009-09-07 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 http://gcc.gnu.org/gcc-3.1/changes.html) so the 3.0 border is merely a
 guess.  Does anybody know better?

Pretty sure it was in 4.2 or so.
http://gcc.gnu.org/gcc-4.2/changes.html mentions the introduction of
-fvisibility, and the docs for 4.2.x are the first to mention visibility
pragmas.

Peter
-- 
Peter O'Gorman
http://pogma.com




[PATCH] Use darwin's -force_load flag if available for whole_archive_flag_spec

2009-09-06 Thread Peter O'Gorman
Hi,

Well, Mac OS X 10.6 has been released, and its linker now has support
for an option similar to --whole-archive. -force_load libfoo.a will load
all members of libfoo.a into the output. -force_load lib can be given
multiple times on the command line.

This patch (and a test case that checks that gdb can find the debugging
symbols) makes libtool use this new option.

Ok?


2009-09-06  Peter O'Gorman  pe...@pogma.com

Use darwin's -force_load flag if available for whole_archive_flag_spec
* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Check for
-force_load and use it if there.
* tests/darwin.at: Add a simple test.

Peter
-- 
Peter O'Gorman
http://pogma.com
From b1b56b0c0678d4c4e7b25c155d53145ca579effc Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Sun, 6 Sep 2009 09:59:19 -0500
Subject: [PATCH] Use darwin's -force_load flag if available for whole_archive_flag_spec

libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Check for
-force_load and use it if there.
tests/darwin.at: Add a simple test.
---
 libltdl/m4/libtool.m4 |   31 ++-
 tests/darwin.at   |   53 +
 2 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index b081f7b..48f7993 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -971,6 +971,29 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	[lt_cv_ld_exported_symbols_list=no])
 	LDFLAGS=$save_LDFLAGS
 ])
+AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+  [lt_cv_ld_force_load=no
+  cat  conftest.c  _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+  echo $LTCC $LTCFLAGS -c -o conftest.o conftest.c AS_MESSAGE_LOG_FD
+  $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2AS_MESSAGE_LOG_FD
+  echo $AR cru libconftest.a conftest.o AS_MESSAGE_LOG_FD
+  $AR cru libconftest.a conftest.o 2AS_MESSAGE_LOG_FD
+  cat  conftest.c  _LT_EOF
+int main() { return 0;}
+_LT_EOF
+  echo $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a AS_MESSAGE_LOG_FD
+  $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2conftest.err
+  _lt_result=$?
+  if test -f conftest  test ! -s conftest.err  test $_lt_result = 0  $GREP forced_load conftest 21 /dev/null; then
+	lt_cv_ld_force_load=yes
+  else
+	cat conftest.err AS_MESSAGE_LOG_FD
+  fi
+rm -f conftest.err conftest.a conftest conftest.c
+rm -rf conftest.dSYM
+])
 case $host_os in
 rhapsody* | darwin1.[[012]])
   _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
@@ -998,7 +1021,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 else
   _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
 fi
-if test $DSYMUTIL != :; then
+if test $DSYMUTIL != :  test $lt_cv_ld_force_load = no; then
   _lt_dsymutil='~$DSYMUTIL $lib || :'
 else
   _lt_dsymutil=
@@ -1018,7 +1041,11 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  if test $lt_cv_ld_force_load = yes; then
+_LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\\; do test  -n \$conv\  new_convenience=\$new_convenience ${wl}-force_load,$conv\; done; func_echo_all \$new_convenience\`'
+  else
+_LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
   _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
   case $cc_basename in
diff --git a/tests/darwin.at b/tests/darwin.at
index 8884fd2..fe442f7 100644
--- a/tests/darwin.at
+++ b/tests/darwin.at
@@ -148,3 +148,56 @@ AT_CHECK([$LIBTOOL --dry-run --mode=link $CC $CFLAGS $LDFLAGS ]dnl
 AT_CHECK([grep stamp $lockfile], [], [ignore])

 AT_CLEANUP
+
+AT_SETUP([darwin gdb debug information])
+
+AT_DATA([foo.c], [[
+int foo (void) { return 0; }
+]])
+
+AT_DATA([bar.c], [[
+extern int foo (void);
+int bar (void) { return foo (); }
+]])
+
+AT_DATA([main.c], [[
+extern int bar(void);
+
+int main() { return bar();}
+]])
+
+AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c bar.c],
+	 [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c foo.c],
+	 [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c main.c],
+	 [], [ignore], [ignore])
+
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libfoo.la foo.lo],
+	 [], [ignore], [ignore])
+
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS ]dnl
+	 [  -o libbar.la bar.lo -rpath /foo libfoo.la ],
+	 [], [ignore], [ignore])
+
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS ]dnl
+	 [  -o main main.lo libbar.la],[], [ignore], [ignore])
+AT_CHECK([echo quit | $LIBTOOL --mode=execute gdb main 2err1],
+	 [ignore

Re: Make -Wc,foo behave like -Xcompiler foo in link mode.

2009-09-06 Thread Peter O'Gorman


On Sep 6, 2009, at 2:44 AM, Ralf Wildenhues wrote:



   Add testsuite exposure for passing of compiler and linker flags.

   * tests/flags.at (passing flags through libtool): New file, new
   test, for bug fixed in previous commit.
   * Makefile.am (TESTSUITE_AT): Add tests/flags.at.

+
+for tag in CC CXX F77 FC; do
+  if $LIBTOOL --tag=$tag 21 | grep 'unknown tag'; then
+continue
+  fi


Hi Ralf,

I get test failures for this test on a darwin system with no fortran  
compiler installed. The available tags in the libtool script that gets  
built always contains all tags:

# The names of the tagged configurations supported by this script.
available_tags=CXX F77 FC GCJ RC 

So the test fails with:
./flags.at:63: $LIBTOOL --tag=$tag --mode=compile $compile -c $source
stderr:
i686-apple-darwin9-gcc-4.0.1: a.f: Fortran compiler not installed on  
this system

stdout:
libtool: compile:  gcc -g -O2 -c a.f  -o .libs/a.o
./flags.at:63: exit code was 1, expected 0
20. flags.at:24: 20. passing flags through libtool (flags.at:24):  
FAILED (flags.

at:63)


Why available_tags has tags for compilers that don't exist, I do not  
remember, but it looks like you need to check that the compiler exists  
(a.la LT_AT_TAG) in this test.


Thanks,
Peter
--
Peter O'Gorman
http://pogma.com






Re: [PATCH] Use darwin's -force_load flag if available for whole_archive_flag_spec

2009-09-06 Thread Peter O'Gorman


On Sep 6, 2009, at 12:29 PM, Ralf Wildenhues wrote:


Hi Peter,

* Peter O'Gorman wrote on Sun, Sep 06, 2009 at 05:28:52PM CEST:

Well, Mac OS X 10.6 has been released, and its linker now has support
for an option similar to --whole-archive. -force_load libfoo.a will  
load
all members of libfoo.a into the output. -force_load lib can be  
given

multiple times on the command line.

This patch (and a test case that checks that gdb can find the  
debugging

symbols) makes libtool use this new option.


I think this is ok, with nits below addressed.  Did you run the
testsuite with it, esp. the tests in convenience.at?


Of course :)



Any reason to go with a compile test rather than a simple system  
version

test?


Yes, the compile test will work when cross-compiling to darwin using  
the odcctools that I released last month (which includes the - 
force_load option).


This is that patch that I pushed.

Thank you.

Peter
--
Peter O'Gorman
http://pogma.com


0001-Use-darwin-s-force_load-flag-if-available-for-whole.patch
Description: Binary data




Re: Concurrent extraction of convenience-library components on OS X

2009-05-27 Thread Peter O'Gorman
Hi Ralf,

Ralf Wildenhues wrote:
 Hi Peter,
 
 * Peter O'Gorman wrote on Tue, May 19, 2009 at 02:26:04AM CEST:
 Ralf Wildenhues wrote:
 * Akim Demaille wrote on Mon, May 18, 2009 at 02:22:56PM CEST:
 I have two dlopen-modules that use a common convenience library.  If I'm 
 unlucky, libtool will try to extract the objects from the convenience 
 library at the same moment, which ar does not seem to like.
 Wow.  What in the world does Darwin's ar do to a library that it is
 extracting from?
 It flock()'s it.
 http://opensource.apple.com/source/cctools/cctools-698.1/ar/archive.c

 Will file a bug later.
 
 Thanks; has anything come from that yet?

Won't hear back until it's fixed, but I doubt that it will ever be fixed
for current OSes.

 
 Anyway; what about this patch?  Please note that the patch requires that
 the second argument to func_extract_an_archive has an absolute path; not
 sure whether that is universally true.
 
 Thanks,
 Ralf
 
 Fix concurrent extraction of convenience libraries on Darwin.
 
 * libltdl/m4/libtool.m4 (_LT_CMD_OLD_ARCHIVE): New libtool
 variable `lock_old_archive_extraction', set to `yes' on darwin.
 * doc/libtool.texi (libtool script contents): Document it.
 * libltdl/config/ltmain.m4sh (func_extract_an_archive): Lock
 `ar x' invocation if `lock_old_archive_extraction' is yes.
 * tests/darwin.at (darwin concurrent library extraction): New
 test.
 * NEWS: Update.
 Report by Akim Demaille.


I wonder if the archive for the test could be a little larger. When I
applied the test suite change without the other changes, I found that it
passed 2 of the 4 times I ran the test, ar completes unpacking that
small archive pretty fast, it would take a bit longer if the archive
were significantly larger.

Otherwise, this is ok.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: Strange LT_INIT behavior

2009-05-25 Thread Peter O'Gorman
Peter O'Gorman wrote:
 Ralf Wildenhues wrote:
 Hello Eric, Peter,

 I haven't looked at the patch at all yet, hope to do so in the remaining
 time though.  I can already tell that it's lacking proper ChangeLog,
 NEWS, and THANKS additions, though.  :-)

 
 Hehe, yes, but it was more of a please tell me I'm not completely
 crazy than an ok to commit? :-)

[Added Jeff, Bryan and Ralph back to CC]

This is the Ok to commit? message. Jeff is already in THANKS. Ralf, if
you want time to review, that's fine.

Peter
-- 
Peter O'Gorman
http://pogma.com
From 012c3c35cfd7c15542f70b360269d9f27c5aafb5 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman pe...@pogma.com
Date: Mon, 25 May 2009 10:00:42 -0500
Subject: [PATCH] Don't run compiler checks twice.

libltdl/m4/libtool.m4 (_LT_PROG_FC, _LT_PROG_F77, _LT_PROG_CXX): Remove these macros.
libltdl/m4/lt~obsolete.m4: Add removed macros here.
libltdl/m4/libtool.m4 (_LT_LANG_FC_CONFIG, _LT_LANG_F77_CONFIG, _LT_LANG_CXX_CONFIG): Remove references to removed macros, and move functionality here.
NEWS: Update.
---
 ChangeLog |   11 ++
 NEWS  |2 +
 libltdl/m4/libtool.m4 |   81 +---
 libltdl/m4/lt~obsolete.m4 |3 ++
 4 files changed, 33 insertions(+), 64 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b01a42f..c265420 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-05-25  Peter O'Gorman  pe...@pogma.com
+
+	Don't run compiler checks twice.
+	libltdl/m4/libtool.m4 (_LT_PROG_FC, _LT_PROG_F77,
+	_LT_PROG_CXX): Remove these macros.
+	libltdl/m4/lt~obsolete.m4: Add removed macros here.
+	libltdl/m4/libtool.m4 (_LT_LANG_FC_CONFIG, _LT_LANG_F77_CONFIG,
+	_LT_LANG_CXX_CONFIG): Remove references to removed macros, and
+	move functionality here.
+	NEWS: Update.
+
 2009-05-05  Rainer Emrich  r.emr...@de.tecosim.com  (tiny change)
 	Peter Rosin  p...@lysator.liu.se
 	Ralf Wildenhues  ralf.wildenh...@gmx.de
diff --git a/NEWS b/NEWS
index f01480f..2f06805 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,8 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
   - Argument mangling of execute mode has been improved (i.e., lessened).
   - Fix 2.1b regression that caused nm to not be the default name lister.
 The regression affected mainly (arguably broken) cross compiles.
+  - Fix long standing bug that caused compiler checks for fortran and
+c++ compilers to run twice.
 
 * Miscellaneous changes:
 
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 8af17a8..3596384 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -5279,37 +5279,21 @@ CC=$lt_save_CC
 ])# _LT_LANG_C_CONFIG
 
 
-# _LT_PROG_CXX
-# 
-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
-# compiler, we have our own version here.
-m4_defun([_LT_PROG_CXX],
-[
-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
-AC_PROG_CXX
-if test -n $CXX  ( test X$CXX != Xno 
-( (test X$CXX = Xg++  `g++ -v /dev/null 21` ) ||
-(test X$CXX != Xg++))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_CXX
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_CXX], [])
-
-
 # _LT_LANG_CXX_CONFIG([TAG])
 # --
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
 # the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
-[AC_REQUIRE([_LT_PROG_CXX])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
+if test -n $CXX  ( test X$CXX != Xno 
+( (test X$CXX = Xg++  `g++ -v /dev/null 21` ) ||
+(test X$CXX != Xg++))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
 
 AC_LANG_PUSH(C++)
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
@@ -6532,32 +6516,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1],
 ])# _LT_SYS_HIDDEN_LIBDEPS
 
 
-# _LT_PROG_F77
-# 
-# Since AC_PROG_F77 is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_F77],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
-AC_PROG_F77
-if test -z $F77 || test X$F77 = Xno; then
-  _lt_disable_F77=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_F77
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_F77], [])
-
-
 # _LT_LANG_F77_CONFIG([TAG])
 # --
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
-[AC_REQUIRE([_LT_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)
+[AC_LANG_PUSH(Fortran 77)
+if test -z $F77 || test X$F77 = Xno; then
+  _lt_disable_F77=yes
+fi
 
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_TAGVAR

Re: Strange LT_INIT behavior

2009-05-22 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 Hello Eric, Peter,
 
 I haven't looked at the patch at all yet, hope to do so in the remaining
 time though.  I can already tell that it's lacking proper ChangeLog,
 NEWS, and THANKS additions, though.  :-)
 

Hehe, yes, but it was more of a please tell me I'm not completely
crazy than an ok to commit? :-)

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: Strange LT_INIT behavior

2009-05-21 Thread Peter O'Gorman
Peter O'Gorman wrote:
 
 On May 18, 2009, at 7:56 PM, Jeff Squyres wrote:

 Nifty idea!

 Unfortunately, it runs into a bit of a snag -- AC_PROG_F77 first
 checks for g77; we have long-since overridden this ordering with our own:


Ok, so what is happening, I think, is this. We have
AC_PROVIDE_IFELSE([AC_PROG_F77],
  [LT_LANG(F77)],
  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])

So, if AC_PROG_F77 has already appeared, it just puts LT_LANG(F77) into
configure, if not, it changes the definition of AC_PROG_F77 so that
LT_LANG(F77) comes after it. LT_LANG(F77) eventually becomes
_LT_LANG_F77_CONFIG.

Now, because AC_PROG_F77 (and its ilk) return things like the empty
string, or in the case of AC_PROG_CXX which returns g++, when there is
no compiler, we have:

m4_defun([_LT_PROG_F77],
[
pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
AC_PROG_F77
if test -z $F77 || test X$F77 = Xno; then
  _lt_disable_F77=yes
fi
popdef([AC_MSG_ERROR])
])# _LT_PROG_F77

And the first thing at the top of _LT_LANG_F77_CONFIG is
AC_REQUIRE([_LT_PROG_F77]), what this means is that in the case where
there is LT_INIT followed by AC_PROG_F77, we get

LT_INIT
...
_LT_PROG_F77
AC_PROG_F77(ARGS)
_LT_LANG_F77_CONFIG

So, AC_PROG_F77 gets output twice, the second time is the one the user
put into configure.ac which may have arguments, the first one is from
_LT_PROG_F77 and has no arguments. The second is pretty much ignored as
the cache vars etc are all set.

In the case where AC_PROG_F77 comes before LT_INIT, the f77 compiler
checks still happen twice, but at least the user's one with its
arguments happens first.

As far as I can tell, the AC_REQUIRE is unnecessary, in the case where
AC_PROG_F77 comes before LT_INIT, the compiler has already been tested
before we get to _LT_LANG_F77_CONFIG (this is guaranteed by the
AC_PROVIDE_IFLESE) in the other case, the compiler check is also
guaranteed because we have redefined AC_PROG_F77 so that it has both the
compiler check and _LT_LANG_F77_CONFIG.

I think this patch is correct, it removes the extra compiler check. But
I am not 100% sure, this code has been there for several years, I would
appreciate someone having a good look at it.

Also, I have no idea what to do when removing macros from libtool.m4, do
I need to do something with lt~obsolete.m4?

Thanks,
Peter
-- 
Peter O'Gorman
http://pogma.com
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 8af17a8..74610d6 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -5279,37 +5279,21 @@ CC=$lt_save_CC
 ])# _LT_LANG_C_CONFIG
 
 
-# _LT_PROG_CXX
-# 
-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
-# compiler, we have our own version here.
-m4_defun([_LT_PROG_CXX],
-[
-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
-AC_PROG_CXX
-if test -n $CXX  ( test X$CXX != Xno 
-( (test X$CXX = Xg++  `g++ -v /dev/null 21` ) ||
-(test X$CXX != Xg++))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_CXX
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_CXX], [])
-
-
 # _LT_LANG_CXX_CONFIG([TAG])
 # --
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
 # the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
-[AC_REQUIRE([_LT_PROG_CXX])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
+if test -n $CXX  ( test X$CXX != Xno 
+( (test X$CXX = Xg++  `g++ -v /dev/null 21` ) ||
+(test X$CXX != Xg++))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
 
 AC_LANG_PUSH(C++)
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
@@ -6532,32 +6516,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1],
 ])# _LT_SYS_HIDDEN_LIBDEPS
 
 
-# _LT_PROG_F77
-# 
-# Since AC_PROG_F77 is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_F77],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
-AC_PROG_F77
-if test -z $F77 || test X$F77 = Xno; then
-  _lt_disable_F77=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_F77
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_F77], [])
-
-
 # _LT_LANG_F77_CONFIG([TAG])
 # --
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
-[AC_REQUIRE([_LT_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)
+[AC_LANG_PUSH(Fortran 77)
+if test -z $F77 || test X$F77 = Xno; then
+  _lt_disable_F77=yes
+fi
 
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_TAGVAR(allow_undefined_flag, $1)=
@@ -6676,21 +6644,6 @@ fi # test $_lt_disable_F77 != yes
 AC_LANG_POP
 ])# _LT_LANG_F77_CONFIG

[PATCH] Strip DWARF-2 debug information for libraries on Darwin.

2008-10-05 Thread Peter O'Gorman
Hi,

I don't really like running strip (or dsymutil) on the library, but the
debug information that is stored in the library/executable is really
only paths to and uuids of the object files, and libtool may have
removed those if convenience libraries were used. The .dSYM bundle
contains all of the debug information from the object files (even those
that we removed).

I forgot to update ChangeLog, will fix before pushing.

Ok?

Peter
-- 
Peter O'Gorman
http://pogma.com
From 98a593ea73377759e0e7688822116d7cb3353a70 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Sun, 5 Oct 2008 11:51:40 -0500
Subject: [PATCH] Strip DWARF-2 debug information for libraries on Darwin.

* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Run strip -S after dsymutil if dsymutil created output.
---
 libltdl/m4/libtool.m4 |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index caf88b1..ecf8439 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -968,7 +968,21 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
   _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
 fi
 if test $DSYMUTIL != :; then
-  _lt_dsymutil='~$DSYMUTIL $lib || :'
+  # If darwin's ld ever gets a --whole-archive, --no-whole-archive
+  # equivalant that allows loading all members of specified
+  # archives, then we will test for it and no longer run dsymutil
+  # or strip, returning control to the user/developer. Until that
+  # time, we create a .dSYM bundle that can be used for debugging
+  # (even after the library has been stripped) but must be
+  # somewhere that gdb can find it. Because we do not install the
+  # .dSYM bundle, the developer may have to move it to the
+  # installed location if she wishes to debug an installed
+  # library. I wish they stored the debug information in the
+  # output, instead of separate files.
+  # We rm the .dSYM directory first, and run strip only if a .dSYM
+  # directory has been created, this should allow for the -gstabs
+  # case.
+  _lt_dsymutil='~${RM}r ${lib}.dSYM~$DSYMUTIL $lib || :~test -d ${lib}.dSYM  $STRIP -S $lib'
 else
   _lt_dsymutil=
 fi
-- 
1.5.4.1



Re: libtool man page

2008-09-20 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 * Peter O'Gorman wrote on Sat, Sep 20, 2008 at 05:11:19AM CEST:
 This looks ok to me, thank you.
 
 Thanks.  Now that it's a new morning, I see several shortcomings:

Haha, for review, I applied your patches, bootstrapped, built and
verified that the resulting manpages worked, I was happy enough with
that. :-)

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: libtool man page

2008-09-19 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 [ moving from bug-libtool ]
 
 * Ralf Wildenhues wrote on Thu, Sep 18, 2008 at 07:11:58AM CEST:
 * Karl Berry wrote on Sat, Sep 06, 2008 at 01:03:44AM CEST:
 Perhaps it would be worthwhile creating/installing a man page for
 libtool with help2man, as we do for so many other utilities.

 (We just received a bug report on webmasters from a perplexed user.)
 
 Here's a patch.  Notes:
 
 * The additional @direntry will cause 'info libtool' to display the
 libtool invocation node, rather than the top.  The top can be gotten
 with 'info Libtool'.  This has caused confusion in the Autoconf package
 before, where the direntry was subsequently renamed autoconf-invocation.
 Should I rather use libtool-invocation here, too?  That would still make
 the note at the end of the man page slightly wrong, but I don't see a
 way to have both.
 
 * The reformatting of the --help output gets better help2man output; it
 seems to like indented option listing.  The patch also removes the When
 reporting a bug, ... paragraph from the man page.  I wasn't sure if
 this is helpful or bad, but before that, the paragraph would end up in
 the wrong section of the manual.  OK?
 
 * Changing $PROGRAM in ltmain.m4sh changes --version output from
 | ltmain.sh (GNU libtool 1.3013 2008-09-08) 2.2.7a
 
 to
 | libtool (GNU libtool 1.3013 2008-09-08) 2.2.7a
 
 This also changes headers in the .lo and .la files.  Luckily, the
 detection code greps for $PACKAGE ('libtool') rather than $PROGRAM.
 
 * Tested 'make distcheck'.  That revealed that it's really necessary
 to add $(srcdir)/ to the man page names.  Since source tree files cannot
 depend upon build tree files, the dependencies are upon the respective
 input files, and libtoolize is added to BUILT_SOURCES so that both
 scripts are guaranteed to exist when the man pages are updated.
 
 OK to install and put Karl in THANKS?

I have not applied the patch to check, but doesn't this just give a
manpage with the default --help output, and no information for the
various --mode options?

I would prefer a manpage that documents all the --help output for all
the modes, is there a way to do that? Maybe add a --help-all option and
make help2man use that? (I have zero knowledge of help2man, sorry for
possibly stupid questions).

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: libtool man page

2008-09-19 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 * Ralf Wildenhues wrote on Fri, Sep 19, 2008 at 08:59:37PM CEST:
 * Peter O'Gorman wrote on Fri, Sep 19, 2008 at 08:42:38PM CEST:
 I have not applied the patch to check, but doesn't this just give a
 manpage with the default --help output, and no information for the
 various --mode options?
 Yes.  And AFAICS it even breaks -h (short help) output.  :-/
 
 Proposed addition (to be squashed on top of previous patch, so no need
 for more Makefile.am ChangeLog bits).
 
 OK?  Do we need testsuite tests for the various help options, and if
 yes, how do I check them sensibly without having to adjust the
 comparison pattern constantly?
 
 (One minor nit against the patch is that 'func_help noexit' does not
 return any error status that the output may have created.  But it is
 late now, no call site of func_help cares so far, and me neither...)
 
 Thanks,
 Ralf

This looks ok to me, thank you.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: [SCM] GNU Libtool branch, master, updated. v2.2.4-45-gc2b8636

2008-09-07 Thread Peter O'Gorman
Gary V. Vaughan wrote:

 Oh, sorry.  I took the 'version management' rules a bit too literally :(
 
   4. If any interfaces have been added, removed, or changed since the
  last update, increment CURRENT, and set REVISION to 0.
 
 Maybe we can set age to '2' in 2.2.8 to compensate?

Ugh, that's unfortunate. The soname will change, even on linux where the
argz_ functions were not exported in the first place. :(

Adding 2 to age in 2.2.8 will not help, as it will change the soname again.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: [SCM] GNU Libtool branch, master, updated. v2.2.4-45-gc2b8636

2008-09-07 Thread Peter O'Gorman
Gary V. Vaughan wrote:
 On 8 Sep 2008, at 00:05, Bob Friesenhahn wrote:
 On Sun, 7 Sep 2008, Gary V. Vaughan wrote:

 Adding 2 to age in 2.2.8 will not help, as it will change the soname
 again.

 Maybe we should pull the release, and put out 2.2.6.1?

 How does one pull a release?  I don't think it is possible.
 
 Replace the tarball with a message that says.  D'oh!  Sorry, this
 release was stillborn, please get this other one instead
 
 Does FSF recommend 'a', 'b', 'c' notation for fixed releases, or does
 it recommend adding another decimal place?
 
 Actually, I think they recommend 'a' suffix IIRC...

Hi Gary,

The only other option to creating a new tarball etc, is to announce
somewhere that packagers should create a symlink from the old soname to
the new one. Such an announcement is likely to be missed by some
packagers though.

Sorry.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: [PATCH] Increase Safety factor when ARG_MAX is less than 40KB.

2008-09-04 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 Hi Peter, Gary,
 
 barring anything better, or better analysis, this is fine with me.
 

Hi Ralf,

When I looked at the size of the environment, it was less than 1.5K, so
it only left me more confused.

I am not convinced that this patch is necessary on any other system than
that hp-ux 10.20 system before it had its kernel rebuilt. I am happy to
simply drop the patch.

Peter
--
Peter O'Gorman
http://pogma.com




[PATCH] Increase Safety factor when ARG_MAX is less than 40KB.

2008-09-02 Thread Peter O'Gorman
Hi,

On an hpux10.20 system with ARG_MAX at 20KB, we still got Arg list too
long when linking. It worked when I edited the libtool script and set
max_cmd_len to 10K instead of 15.

For systems with a large value of ARG_MAX, setting max_cmd_len to 75%
still seems reasonable though.

Ok to push?

Peter
-- 
Peter O'Gorman
http://pogma.com
From 87f8effdad00f84ffdd27803ac01fbd0e64d935d Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Tue, 2 Sep 2008 10:43:52 -0500
Subject: [PATCH] Increase Safety factor when ARG_MAX is less than 40KB.

* libltdl/m4/libtool.m4 (LT_CMD_MAX_LEN): set max_cmd_len to 50% of ARG_MAX if ARG_MAX is  40KB, otherwise, set to 75%.
---
 ChangeLog |7 +++
 libltdl/m4/libtool.m4 |6 +-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index af1f78b..07ece6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-02  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Increase Safety factor when ARG_MAX is less than 40KB.
+
+	* libltdl/m4/libtool.m4 (LT_CMD_MAX_LEN): set max_cmd_len to 50%
+	of ARG_MAX if ARG_MAX is  40KB, otherwise, set to 75%.
+
 2008-09-01  Peter O'Gorman  [EMAIL PROTECTED]
 
 	Revert 75142db4f8afc65ba7aae0ed80ea0b35bd9cc382 (AIX libltdl
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 39ba996..34151ef 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1580,7 +1580,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2 /dev/null`
 if test -n $lt_cv_sys_max_cmd_len; then
   lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-  lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+  if test $lt_cv_sys_max_cmd_len -gt 20480; then
+lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+  else
+lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 2`
+  fi
 else
   # Make teststring a little bigger before we do anything with it.
   # a 1K string should be a reasonable start.
-- 
1.5.4.1



Re: hppa-hpux DESTDIR support.

2008-08-26 Thread Peter O'Gorman
Duft Markus wrote:

 But anyway, for me right now small side effects or very special
 special-cases would not matter that much. It would be much more
 important to get DESTDIR to work. However it would still be more than
 cool to get DESTDIR support in upstream libtool, without having to apply
 patches, that the authors don't like :)

You did not post a patch. How could we dislike it? :)

Patches that do more good than harm are likely to be accepted.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: hppa-hpux DESTDIR support.

2008-08-26 Thread Peter O'Gorman
Duft Markus wrote:

 Patches that do more good than harm are likely to be accepted.
 That's exactly the point i'm unsure about, if I do more harm than good
 or the other way round :) of course, for _me_ I do more good, but does
 it harm others that the hardcode test fails now?

Sorry, don't know how I missed that patch, still, it strikes me as more
of a hack than a solution (and what is with the commented case
statements being added to ltmain.m4sh?).

I'm not even sure how much +s is relevant here, you are changing the
hardcode_minus_L to no, surely that is having the largest effect on your
DESTDIR installs, not the +s changes?

This patch is not acceptable as is, sorry.

By the way, do you see DESTDIR installs failing for every package on
hppa-hp-hpux systems?

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: Two small libltdl patches.

2008-08-26 Thread Peter O'Gorman
Ralf Wildenhues wrote:

 Yes, certainly.  I think a NEWS entry would be good, too, as well as
 a test so we don't regress again.  What do you think of this?  You
 can squash it into your patch when you commit.

Thanks.

 
 The test doesn't work on many systems (only those that need argz.c,
 and only those without leading underscore in symbol names) and skips
 resp. doesn't expose a failure elsewhere, but I think that should be
 sufficient.

I'd like this to fail for me on darwin (more likely to notice it), so I
will probably add:


 +AT_CHECK([eval $NM \\$argz_o\ | $global_symbol_pipe],
 +  [], [stdout], [ignore])
 +AT_CHECK([grep ^T argz_ stdout], [1])

+AT_CHECK([grep ^T _argz_ stdout], [1])

 +
 +AT_CLEANUP

This should be fine, because all global symbols exported from argz.o
must be lt__ prefixed.

Will commit with these changes later today.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: hppa-hpux DESTDIR support.

2008-08-25 Thread Peter O'Gorman
Markus Duft wrote:
 Hi
 
 I'm working (together with haubi) on getting DESTDIR support for our
 hppa-hpux boxes into libtool. I now have it working, and a first patch
 (which of course breaks some other things - I know that :( ), and wanted to
 ask what you think about this.
 
 I'm adding +s to every link line. But because I add it through the rpath
 spec thing, it is only there if a runpath is encoded. I tried with a dummy
 runpath, added in ltmain.sh (which works ok) but that's just way too ugly :)
 
 Any ideas how I could get this a little better? Maybe another location to
 add the +s?

archive_cmds?

But as far as I am aware, +s does not actually stop the -L paths from
being encoded into the output, so you still end up with, for example:
% chatr libfoo.sl
libfoo.sl:
 shared library
 shared library dynamic path search:
 SHLIB_PATH enabled   first
 embedded path  enabled   second  /opt/tmp
 internal name:
 libfoo.sl
 shared library list:
 dynamic   ../tmp/libbar.sl
 shared vtable support disabled
[snip]

Although a quick test running with tusc shows that the dynamic linker
does search for libbar at ../tmp/libbar.sl last.

Peter
-- 
Peter O'Gorman
http://pogma.com




Two small libltdl patches.

2008-08-23 Thread Peter O'Gorman
Hi,

On systems without argz we were exporting unmangled symbols argz_count
and argz_add from libltdl. Not really a good idea. Rather than mangle
the names, since we do not use either function, they were removed.

And as Ralf reported previously, preloaded modules can have the .lib
extension as well as .a.

Does not fail any unexpected tests on darwin or linux with these patches.

I'm thinking of just pushing these as obvious

Oh what the heck, not like I am going to have time to make a release in
the next couple of days anyway.

Ok to commit?

Peter
-- 
Peter O'Gorman
http://pogma.com
From 1fa70a57ef579ae717c504346a1aad13a03b30cc Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Sat, 23 Aug 2008 16:28:25 -0500
Subject: [PATCH] Remove unnecessary global argz functions.

* libltdl/argz.c (argz_add,argz_count): Remove.
Reported by Ralf Wildenhues [EMAIL PROTECTED].
---
 ChangeLog  |6 ++
 libltdl/argz.c |   28 
 2 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 13cc2af..567fbfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-23  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Remove unnecessary global argz functions.
+	* libltdl/argz.c (argz_add,argz_count): Remove.
+	Reported by Ralf Wildenhues [EMAIL PROTECTED].
+
 2008-08-22  Ralf Wildenhues  [EMAIL PROTECTED]
 
 	Initial support for Lahey Fortran on GNU/Linux.
diff --git a/libltdl/argz.c b/libltdl/argz.c
index f31ce17..8567723 100644
--- a/libltdl/argz.c
+++ b/libltdl/argz.c
@@ -76,14 +76,6 @@ argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len)
 }
 
 
-/* Add a string to the argz vector.  */
-error_t
-argz_add (char **pargz, size_t *pargz_len, const char *str)
-{
-  return argz_append (pargz, pargz_len, str, strlen (str) + 1);
-}
-
-
 error_t
 argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len)
 {
@@ -232,23 +224,3 @@ argz_stringify (char *argz, size_t argz_len, int sep)
 }
 }
 
-
-/* Count number of elements (null bytes) in argz vector.  */
-
-size_t
-argz_count (const char *argz, size_t argz_len)
-{
-  size_t count = 0;
-
-  assert ((argz  argz_len) || (!argz  !argz_len));
-
-  while (argz_len  0)
-{
-  size_t part_len = strlen (argz);
-  argz += part_len + 1;
-  argz_len -= part_len + 1;
-  count++;
-}
-
-  return count;
-}
-- 
1.5.4.1

From 38a2f1bcab8c64650b096830d1def5c6fb920c85 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Sat, 23 Aug 2008 16:31:17 -0500
Subject: [PATCH] Allow for extensions other than .a for preloaded modules.

* libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define LT_LIBEXT.
* libltdl/ltdl.c (lt_dladvise_preload): Use it.
Reported by Ralf Wildenhues.
---
 ChangeLog  |5 +
 libltdl/ltdl.c |   10 --
 libltdl/m4/ltdl.m4 |2 ++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 567fbfd..3dc46fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-08-23  Peter O'Gorman  [EMAIL PROTECTED]
 
+	Allow for extensions other than .a for preloaded modules.
+	* libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define LT_LIBEXT.
+	* libltdl/ltdl.c (lt_dladvise_preload): Use it.
+	Reported by Ralf Wildenhues.
+
 	Remove unnecessary global argz functions.
 	* libltdl/argz.c (argz_add,argz_count): Remove.
 	Reported by Ralf Wildenhues [EMAIL PROTECTED].
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 5a26565..6e19599 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -50,6 +50,10 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #  define LT_FILENAME_MAX	1024
 #endif
 
+#if !defined(LT_LIBEXT)
+#  define LT_LIBEXT a
+#endif
+
 /* This is the maximum symbol size that won't require malloc/free */
 #undef	LT_SYMBOL_LENGTH
 #define LT_SYMBOL_LENGTH	128
@@ -67,6 +71,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 
 static	const char	objdir[]		= LT_OBJDIR;
 static	const char	archive_ext[]		= LT_ARCHIVE_EXT;
+static  const char	libext[]		= LT_LIBEXT;
 #if defined(LT_MODULE_EXT)
 static	const char	shlib_ext[]		= LT_MODULE_EXT;
 #endif
@@ -1258,7 +1263,8 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
 
   if (vtable)
 	{
-	  archive_name = MALLOC (char, LT_STRLEN (name) + 3);
+	  /* name + . + libext + NULL */
+	  archive_name = MALLOC (char, LT_STRLEN (name) + LT_STRLEN (libext) + 2);
 	  *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle));
 
 	  if ((*phandle == NULL) || (archive_name == NULL))
@@ -1270,7 +1276,7 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
 
 	  /* Preloaded modules are always named according to their old
 	 archive name.  */
-	  sprintf (archive_name, %s.a, name);
+	  sprintf (archive_name, %s.%s, name, libext);
 
 	  if (tryall_dlopen (newhandle, archive_name, advise, vtable) == 0)
 	{
diff --git a/libltdl/m4/ltdl.m4 b/libltdl/m4/ltdl.m4
index

Re: Linking with '-L /path/to/lib' (note the space!)

2008-08-21 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 * Bob Friesenhahn wrote on Thu, Aug 21, 2008 at 08:29:19PM CEST:
 On Thu, 21 Aug 2008, Ralf Wildenhues wrote:
 * Olaf Lenz wrote on Thu, Aug 21, 2008 at 02:56:10PM CEST:
 When I pass the option -L /path/to/lib (note the space between -L and
 /path/to/lib) to libtool in linking mode, libtool does not fail nor does
 [...]
 Others, OK for the patch below, or should we just parse that construct
 correctly?
 Please apply this patch.  Allowing spaces in arguments will simply  
 discover otherwise non-existing bugs somewhere else.
 
 Well, libtool *could* also remove the space.  I'm just not sure whether
 it's worth supporting this.

At least OSF/1 cc does not deal well with a space after -L, so even
without libtool in the middle, it would fail on some systems. I think
simply erroring out with a helpful message is fine.

Patch looks ok to me.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: lt_dladvise.at failure

2008-08-16 Thread Peter O'Gorman
Ralf Wildenhues wrote:

 One could also make the test XFAIL.  However, the test exercises many
 useful bits, more than just the part that is failing, and most other
 bits are more important.  This is why I think we should not go that way.
 
 OK to apply?

Yes.

Thank you.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: [PATCH 370] Implement lt_dlopening of only preloaded modules.

2008-08-12 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 * Bob Friesenhahn wrote on Tue, Aug 12, 2008 at 09:27:07PM CEST:
 On Tue, 12 Aug 2008, Ralf Wildenhues wrote:
 OK to revert?  Or, rather: does anybody have problems with the reversal?
 Temporarily or permanently?
 
 Ah, chucks.  Incomplete research.  I take the above back, for now,
 and brood over it a little more.  Sorry.
 
 Looks like preloading was borked before this patch, only exposed now.

Yes, the test exposed it. It adds the .so when it should be adding the
.a. I also looked at this over the weekend, but did not figure out where
it fails.

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: shared libraries on darwin using Intel compiler

2008-06-13 Thread Peter O'Gorman
Christopher Hulbert wrote:

 GIT version still reports that the ifort linker does not support
 shared libraries. The config.log is attached.

Hi Chris,

Your config.log confirms that ifort does not define __GNUC__, thanks.

Could you confirm that this patch fixes it.

Peter
-- 
Peter O'Gorman
http://pogma.com
From a33319273b5b70b8dc98c698fe99d039a1873c23 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Fri, 13 Jun 2008 10:53:34 -0500
Subject: [PATCH] Support ifort on darwin.

* libltdl/m4/libtool.m4 (_LT_DARWIN_LINKER_FEATURES): Build
shared libraries with ifort.
Reported by Christopher Hulbert.
---
 ChangeLog |7 +++
 libltdl/m4/libtool.m4 |6 +-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 92b3214..c22304d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-13  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Support ifort on darwin.
+	* libltdl/m4/libtool.m4 (_LT_DARWIN_LINKER_FEATURES): Build
+	shared libraries with ifort.
+	Reported by Christopher Hulbert.
+
 2008-06-01  Charles Wilson  [EMAIL PROTECTED]
 
 	[mingw] fix cross-compile-with-wine case
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 654f54a..103269d 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -990,7 +990,11 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   _LT_TAGVAR(link_all_deplibs, $1)=yes
   _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
-  if test $GCC = yes; then
+  case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test $_lt_dar_can_shared = yes; then
 output_verbose_link_cmd=echo
 _LT_TAGVAR(archive_cmds, $1)=\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}
 _LT_TAGVAR(module_cmds, $1)=\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}
-- 
1.5.4.1



Re: shared libraries on darwin using Intel compiler

2008-06-13 Thread Peter O'Gorman
Christopher Hulbert wrote:
 On Fri, Jun 13, 2008 at 11:55 AM, Peter O'Gorman [EMAIL PROTECTED] wrote:
 Christopher Hulbert wrote:

 GIT version still reports that the ifort linker does not support
 shared libraries. The config.log is attached.
 Hi Chris,

 Your config.log confirms that ifort does not define __GNUC__, thanks.

 Could you confirm that this patch fixes it.
 
 Yes, the ifort linker now supports shared libraries.

Ok, thanks, I pushed the patch.

Peter
-- 
Peter O'Gorman
http://pogma.com




FYI: Skip darwin test if fat link fails

2008-05-31 Thread Peter O'Gorman
I just pushed this.

Peter
-- 
Peter O'Gorman
http://pogma.com
From be6f90aa33bfaa28dcaba8cc269ef504a51f6f9a Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Sat, 31 May 2008 12:12:31 -0500
Subject: [PATCH] Skip darwin test if fat link fails.

* tests/darwin.at: Skip if we can not link a fat program.
Reported by Daniel Macks [EMAIL PROTECTED]
---
 ChangeLog   |6 ++
 tests/darwin.at |   12 
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 178d505..90c8ebd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-31  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Skip darwin test if fat link fails.
+	* tests/darwin.at: Skip if we can not link a fat program.
+	Reported by Daniel Macks [EMAIL PROTECTED]
+
 2008-05-26  Ralf Wildenhues  [EMAIL PROTECTED]
 
 	libtoolize should not remove config.guess, config.sub.
diff --git a/tests/darwin.at b/tests/darwin.at
index 7e6d07e..2ca5649 100644
--- a/tests/darwin.at
+++ b/tests/darwin.at
@@ -30,17 +30,21 @@ darwin*) ;;
 *) noskip=false ;;
 esac
 
-AT_DATA([foo.c],[[
-int x=0;
+AT_DATA([simple.c] ,[[
+int main() { return 0;}
 ]])
 
 $noskip  {
-$CC $CPPFLAGS $CFLAGS -arch ppc -arch i386 -c -o foo.o foo.c 21  /dev/null || noskip=false
-rm -f foo.o
+$CC $CPPFLAGS $CFLAGS -arch ppc -arch i386 -o simple simple.c 21  /dev/null || noskip=false
+rm -f simple 
 }
 
 AT_CHECK([$noskip || (exit 77)])
 
+AT_DATA([foo.c],[[
+int x=0;
+]])
+
 AT_DATA([baz.c],[[
 int y=0;
 ]])
-- 
1.5.4.1



Re: libtool 2.2.2, darwin and target prefixes

2008-05-02 Thread Peter O'Gorman
Peter O'Gorman wrote:
 Richard Purdie wrote:
 Hi,

 As previously mentioned, I've been stress testing libtool 2.2.2 with
 Poky a bit.

 I've found one issue when I tested the darwin builds, specifically that
 it tried to use otool and otool64 and not the versions with the host
 prefix which my setup has. I fixed this with the patch below which is
 fine for Poky since its always cross compiling but its a sign a better
 fix is probably needed in general.
 
 Thanks,
 I have pushed this, it also cleans up the sed sed echo ickyness.

It is always better if quotes get closed. I had tested, honest!

Pushed this.

Peter
-- 
Peter O'Gorman
http://pogma.com
From fe06ce018f30c17b034c318f76bbe16164bf0d3a Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Fri, 2 May 2008 00:54:49 -0500
Subject: [PATCH] It helps to close quotes.

* libltdl/config/ltmain.m4sh (func_mode_link): Add closing '.
---
 ChangeLog  |5 +
 libltdl/config/ltmain.m4sh |4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5db30d7..b9a695c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-02  Peter O'Gorman  [EMAIL PROTECTED]
+
+	It helps to close quotes.
+	* libltdl/config/ltmain.m4sh (func_mode_link): Add closing '.
+
 2008-05-01  Peter O'Gorman  [EMAIL PROTECTED]
 
 	Use AC_CHECK_TOOL for otool and otool64.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 84f7078..33689b9 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -4951,9 +4951,9 @@ func_mode_link ()
 		done
 		if test -f $absdir/$objdir/$depdepl ; then
 		  depdepl=$absdir/$objdir/$depdepl
-		  darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}`
+		  darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
   if test -z $darwin_install_name; then
-  darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}`
+  darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
   fi
 		  compiler_flags=$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}
 		  linker_flags=$linker_flags -dylib_file ${darwin_install_name}:${depdepl}
-- 
1.5.3.7



Re: libtool 2.2.2, darwin and target prefixes

2008-05-01 Thread Peter O'Gorman
Richard Purdie wrote:
 Hi,
 
 As previously mentioned, I've been stress testing libtool 2.2.2 with
 Poky a bit.
 
 I've found one issue when I tested the darwin builds, specifically that
 it tried to use otool and otool64 and not the versions with the host
 prefix which my setup has. I fixed this with the patch below which is
 fine for Poky since its always cross compiling but its a sign a better
 fix is probably needed in general.

Thanks,
I have pushed this, it also cleans up the sed sed echo ickyness.

Peter
-- 
Peter O'Gorman
http://pogma.com
From 92e15986a43a8009decffc4d5d290272449487a4 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Thu, 1 May 2008 12:40:24 -0500
Subject: [PATCH] Use AC_CHECK_TOOL for otool and otool64.

* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Check.
* libltdl/config/ltmain.m4sh (func_mode_link): Use.
Reported by Richard Purdie [EMAIL PROTECTED]
---
 ChangeLog  |7 +++
 libltdl/config/ltmain.m4sh |6 ++
 libltdl/m4/libtool.m4  |6 ++
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b3c0616..5db30d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-01  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Use AC_CHECK_TOOL for otool and otool64.
+	* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Check.
+	* libltdl/config/ltmain.m4sh (func_mode_link): Use.
+	Reported by Richard Purdie [EMAIL PROTECTED]
+
 2008-04-30  Eric Blake  [EMAIL PROTECTED]
 
 	Support cygwin 1.7.0 in loadlibrary loader.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index ac334dc..84f7078 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -4951,11 +4951,9 @@ func_mode_link ()
 		done
 		if test -f $absdir/$objdir/$depdepl ; then
 		  depdepl=$absdir/$objdir/$depdepl
-		  darwin_install_name=`otool -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
-		  darwin_install_name=`$ECHO $darwin_install_name`
+		  darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}`
   if test -z $darwin_install_name; then
-  darwin_install_name=`otool64 -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
-  darwin_install_name=`$ECHO $darwin_install_name`
+  darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}`
   fi
 		  compiler_flags=$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}
 		  linker_flags=$linker_flags -dylib_file ${darwin_install_name}:${depdepl}
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 9906e11..c23451a 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -894,12 +894,18 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
 AC_CHECK_TOOL([LIPO], [lipo], [:])
+AC_CHECK_TOOL([OTOOL], [otool], [:])
+AC_CHECK_TOOL([OTOOL64], [otool64], [:])
 _LT_DECL([], [DSYMUTIL], [1],
   [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
 _LT_DECL([], [NMEDIT], [1],
   [Tool to change global to local symbols on Mac OS X])
 _LT_DECL([], [LIPO], [1],
   [Tool to manipulate fat objects and archives on Mac OS X])
+_LT_DECL([], [OTOOL], [1],
+  [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+_LT_DECL([], [OTOOL64], [1],
+  [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
 
 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
   [lt_cv_apple_cc_single_mod=no
-- 
1.5.3.7



FYI - Use AC_CHECK_TOOL for lipo too.

2008-04-21 Thread Peter O'Gorman
Hi,
I just pushed this.

Peter
-- 
Peter O'Gorman
http://pogma.com
From 39903a5836fc563e83fe6aa614d75a2a3ebe04fe Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Mon, 21 Apr 2008 10:21:27 -0500
Subject: [PATCH] Use AC_CHECK_TOOL for lipo too.

* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Check.
* libltdl/config/ltmain.m4sh (func_extract_archives): Use.
---
 ChangeLog  |6 ++
 libltdl/config/ltmain.m4sh |6 +++---
 libltdl/m4/libtool.m4  |3 +++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8d2e5c3..4cc2147 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-21  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Use AC_CHECK_TOOL for lipo too.
+	* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Check.
+	* libltdl/config/ltmain.m4sh (func_extract_archives): Use.
+
 2008-04-20  Gary V. Vaughan  [EMAIL PROTECTED]
 
 	Fix misleading lt_dlopenadvise documentation.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 378acae..089f162 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2208,14 +2208,14 @@ func_extract_archives ()
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
 	  darwin_base_archive=`basename $darwin_archive`
-	  darwin_arches=`lipo -info $darwin_archive 2/dev/null | $GREP Architectures 2/dev/null || true`
+	  darwin_arches=`$LIPO -info $darwin_archive 2/dev/null | $GREP Architectures 2/dev/null || true`
 	  if test -n $darwin_arches; then
 	darwin_arches=`$ECHO $darwin_arches | $SED -e 's/.*are://'`
 	darwin_arch=
 	func_verbose $darwin_base_archive has multiple architectures $darwin_arches
 	for darwin_arch in  $darwin_arches ; do
 	  func_mkdir_p unfat-$$/${darwin_base_archive}-${darwin_arch}
-	  lipo -thin $darwin_arch -output unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive} ${darwin_archive}
+	  $LIPO -thin $darwin_arch -output unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive} ${darwin_archive}
 	  cd unfat-$$/${darwin_base_archive}-${darwin_arch}
 	  func_extract_an_archive `pwd` ${darwin_base_archive}
 	  cd $darwin_curdir
@@ -2227,7 +2227,7 @@ func_extract_archives ()
 	darwin_files=
 	for darwin_file in $darwin_filelist; do
 	  darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-	  lipo -create -output $darwin_file $darwin_files
+	  $LIPO -create -output $darwin_file $darwin_files
 	done # $darwin_filelist
 	$RM -rf unfat-$$
 	cd $darwin_orig_dir
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index cdab378..9906e11 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -893,10 +893,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 rhapsody* | darwin*)
 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+AC_CHECK_TOOL([LIPO], [lipo], [:])
 _LT_DECL([], [DSYMUTIL], [1],
   [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
 _LT_DECL([], [NMEDIT], [1],
   [Tool to change global to local symbols on Mac OS X])
+_LT_DECL([], [LIPO], [1],
+  [Tool to manipulate fat objects and archives on Mac OS X])
 
 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
   [lt_cv_apple_cc_single_mod=no
-- 
1.5.3.7



Re: darwin fat binary support bugfix

2008-04-21 Thread Peter O'Gorman
Peter O'Gorman wrote:

 I will fix, and even apply the (non-failing) test tomorrow.

Making the test fail is better.

Ok?

Peter
-- 
Peter O'Gorman
http://pogma.com
From d9a4d8f71ae415bb716dc8267a506a102bacf0b2 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Mon, 21 Apr 2008 15:18:41 -0500
Subject: [PATCH] basename does not take a list of strings.
 * libltdl/config/ltmain.m4sh(func_extract_archives): Use sed
 $basename.
 * tests/darwin.at: New. Check that we can built fat program,
 shared library and convenience library.
 * Makefile.am: Add test.
 Reported by LiKai Liu [EMAIL PROTECTED]

---
 ChangeLog  |8 
 Makefile.am|3 +-
 libltdl/config/ltmain.m4sh |2 +-
 tests/darwin.at|   96 
 4 files changed, 107 insertions(+), 2 deletions(-)
 create mode 100644 tests/darwin.at

diff --git a/ChangeLog b/ChangeLog
index 4cc2147..b4d0388 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2008-04-21  Peter O'Gorman  [EMAIL PROTECTED]
 
+	basename does not take a list of strings.
+	* libltdl/config/ltmain.m4sh(func_extract_archives): Use sed
+	$basename.
+	* tests/darwin.at: New. Check that we can built fat program,
+	shared library and convenience library.
+	* Makefile.am: Add test.
+	Reported by LiKai Liu [EMAIL PROTECTED]
+
 	Use AC_CHECK_TOOL for lipo too.
 	* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Check.
 	* libltdl/config/ltmain.m4sh (func_extract_archives): Use.
diff --git a/Makefile.am b/Makefile.am
index 480b647..0085c7f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -465,7 +465,8 @@ TESTSUITE_AT	= tests/testsuite.at \
 		  tests/deplibs-ident.at \
 		  tests/configure-iface.at \
 		  tests/stresstest.at \
-		  tests/cmdline_wrap.at
+		  tests/cmdline_wrap.at \
+		  tests/darwin.at
 
 EXTRA_DIST += $(srcdir)/$(TESTSUITE) $(TESTSUITE_AT) $(srcdir)/tests/package.m4
 
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 089f162..ff1e50d 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -,7 +,7 @@ func_extract_archives ()
 	  $RM unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}
 	done # $darwin_arches
 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+	darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e $basename | sort -u`
 	darwin_file=
 	darwin_files=
 	for darwin_file in $darwin_filelist; do
diff --git a/tests/darwin.at b/tests/darwin.at
new file mode 100644
index 000..adc0db6
--- /dev/null
+++ b/tests/darwin.at
@@ -0,0 +1,96 @@
+# darwin.at - tests specific to Mac OS X
+#
+#   Copyright (C) 2008 Free Software Foundation, Inc.
+#   Written by Peter O'Gorman, 2008
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+AT_BANNER([Mac OS X tests])
+AT_SETUP([darwin fat compile])
+noskip=:
+case $host_os in
+darwin*) ;;
+*) noskip=false ;;
+esac
+
+AT_DATA([foo.c],[[
+int x=0;
+]])
+
+$noskip  {
+$CC $CPPFLAGS $CFLAGS -arch ppc -arch i386 -c -o foo.o foo.c 21  /dev/null || noskip=false
+rm -f foo.o
+}
+
+AT_CHECK([$noskip || (exit 77)])
+
+AT_DATA([baz.c],[[
+int y=0;
+]])
+
+AT_DATA([bar.c],[[
+extern int x;
+int bar(void);
+int bar() { return x;}
+]])
+
+AT_DATA([main.c],[[
+extern int x;
+extern int y;
+
+int main() {
+return x+y;
+}
+]])
+
+mkdir bin
+AT_DATA([bin/basename],[[
+#! /bin/sh
+
+usage=usage: $0 argument
+if test $# != 1; then
+  echo $usage 2
+  exit 1
+fi
+
+echo $1 | sed s,^.*/,,
+]])
+
+chmod +x bin/basename
+save_PATH=$PATH
+PATH=`pwd`/bin:$PATH
+export PATH
+
+AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC -c -o foo.lo $CPPFLAGS $CFLAGS -arch ppc -arch i386 foo.c],[0],[ignore],[ignore])
+
+AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC -c -o baz.lo $CPPFLAGS $CFLAGS -arch ppc -arch i386 baz.c],[0],[ignore],[ignore])
+
+AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC -o libfoo.la $CPPFLAGS $CFLAGS $LDFLAGS -arch ppc

Re: [Fwd: Re: Allow bootstrap from git repository]

2008-04-16 Thread Peter O'Gorman
Jim Meyering wrote:
 Peter O'Gorman [EMAIL PROTECTED] wrote:
 ...
 Thanks for looking at this. I still can not push though :(

 Total 9 (delta 0), reused 0 (delta 0)
 error: Unable to append to logs/refs/heads/master: Permission denied
 ng refs/heads/master failed to write
 error: failed to push to 'ssh://[EMAIL PROTECTED]/srv/git/libtool.git'
 
 It should work better, now that files (not just directories)
 are group writable.

Yes, it seems to work better now.

Is there a hook that sends email to the libtool-commit list for each push?

Thank you,
Peter
-- 
Peter O'Gorman
http://pogma.com




Re: Allow bootstrap from git repository

2008-04-15 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 * Peter O'Gorman wrote on Tue, Apr 15, 2008 at 07:40:54AM CEST:
 
 Could do a count of ChangeLog* files, and use that as the first digit, I
 suppose. Not tonight though, need some sleep :)
 
 Sounds like a possible plan.

I looked again, and at first counted all the lines in all the
changelogs, but then it seemed better to count only what looked like dates.

Ok?

Peter
-- 
Peter O'Gorman
http://pogma.com
From 1faad4199ac85a135f8455a10497aa1825f8c736 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Tue, 15 Apr 2008 09:35:38 -0500
Subject: [PATCH] Allow bootstrap from git repository.

	* Makefile.am: Pass srcdir as an argument to mkstamp and expect
	only 2 fields in mkstamps output.
	* clcommit.m4sh: Ditto.
	* configure.ac: Ditto.
	* libltdl/config/mkstamp: return a revision and date based on
	the number of lines which look like dates in all the ChangeLog*
	files in the directory we got as arg 1.
---
 ChangeLog  |   11 +++
 Makefile.am|4 ++--
 clcommit.m4sh  |2 +-
 configure.ac   |2 +-
 libltdl/config/mkstamp |   31 +--
 5 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b4fac02..97dc1d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-04-14  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Allow bootstrap from git repository.
+	* Makefile.am: Pass srcdir as an argument to mkstamp and expect
+	only 2 fields in mkstamps output.
+	* clcommit.m4sh: Ditto.
+	* configure.ac: Ditto.
+	* libltdl/config/mkstamp: return a revision and date based on
+	the number of lines which look like dates in all the ChangeLog*
+	files in the directory we got as arg 1.
+
 2008-04-11  Eric Blake  [EMAIL PROTECTED]
 
 	Fix usage of setmode without declaration on cygwin.
diff --git a/Makefile.am b/Makefile.am
index 0168a41..480b647 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,9 +50,9 @@ lt__cd		= CDPATH=$${ZSH_VERSION+.}$(PATH_SEPARATOR)  cd
 
 MKSTAMP = $(SHELL) $(srcdir)/$(auxdir)/mkstamp
 
-timestamp = set dummy `$(MKSTAMP)  $(srcdir)/ChangeLog`; shift; \
+timestamp = set dummy `$(MKSTAMP) $(srcdir)`; shift; \
 	case $(VERSION) in \
-	  *[acegikmoqsuwy]) TIMESTAMP= $$1 $$2 $$3 ;; \
+	  *[acegikmoqsuwy]) TIMESTAMP= $$1 $$2 ;; \
 	  *) TIMESTAMP= ;; \
 	esac
 
diff --git a/clcommit.m4sh b/clcommit.m4sh
index 3439dae..7fe9d2d 100644
--- a/clcommit.m4sh
+++ b/clcommit.m4sh
@@ -444,7 +444,7 @@ func_mailnotify ()
   test -f CVS/Root 
   echo CVSROOT:	`$SED -e 's,.*:,,g' CVS/Root`
   test -f $MKSTAMP 
-  echo TIMESTAMP:	`$SHELL $MKSTAMP  ./ChangeLog`
+  echo TIMESTAMP:	`$SHELL $MKSTAMP .`
   test -f CVS/Repository 
   echo Module name:	`cat CVS/Repository`
   test -f CVS/Tag 
diff --git a/configure.ac b/configure.ac
index 6f49016..4660a67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,7 +103,7 @@ AC_SUBST([LASTRELEASE])
 # This is a sanity check so we can see which version is used in bug reports.
 # It is assumed that we only want to see the date extension for cvs libtool
 # versions (i.e. odd letters) and not actual alpha releases.
-TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp  ${srcdir}/ChangeLog`
+TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp ${srcdir}`
 package_revision=`( set $TIMESTAMP; echo $1; )`
 case $lt_alpha in
   [[bdfhjlnprtvxz]])
diff --git a/libltdl/config/mkstamp b/libltdl/config/mkstamp
index 8d8e7d8..d11599a 100755
--- a/libltdl/config/mkstamp
+++ b/libltdl/config/mkstamp
@@ -23,15 +23,26 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 
-# This script expects to find a line containing both Revision and Date
-# tags, and it edits this line so that it looks like ` $rev $date'
+# This script takes a directory as an argument and generates a
+# revision and date based upon the ChangeLog files in that directory.
 
-# Command-line arguments are passed down to sed; additional -e cmd
-# arguments are acceptable.  Input is from from stdin.  The original
-# version of this script accepted input from a named file or stdin.
+# Generate a revision that looks similar to CVS revision by using 1.
+# then the number of lines in the ChangeLogs starting with dates (an
+# approximation of the number of commits) + 1000. 
+# For those pulling from the savannah git repository it should be
+# possible to go from this revision number to the git revision fairly
+# easily. The number will also always increase.
 
-tr -d \015 | sed -e '
-	s%.*\$''Revision: \([^$]*\) \$.*\$''Date: \([^$]*\) \$.*% \1 \2%
-	t end
-	d
-	: end' ${1+$@}
+awk 'BEGIN {
+	cocount=0;
+}
+/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]  / {
+if (cocount== 0) {
+datestr=$1
+}
+	cocount++;
+}
+END {
+	cocount = cocount + 1000;
+print 1. cocount   datestr;
+}' $1/ChangeLog $1/ChangeLog.*
-- 
1.5.3.7



Re: Allow bootstrap from git repository

2008-04-15 Thread Peter O'Gorman
Ralf Wildenhues wrote:

 Please make the latter be $1/ChangeLog.[12][0-9][0-9][0-9] so backup
 files don't count (I tend to cp foo foo.bak at times).  OK with that
 change.

git push fails for me with:

[EMAIL PROTECTED] libtool]$ git push
updating 'refs/heads/master'
  from 484680fe022563c93a37dad3b1bca46028b1e866
  to   3528106688e06c4be785e17966b2ad3067250fec
 Also local refs/remotes/origin/master
Generating pack...
Done counting 9 objects.
Deltifying 9 objects...
 100% (9/9) done
Writing 9 objects...
 100% (9/9) done
Total 9 (delta 0), reused 0 (delta 0)
error: Unable to append to logs/refs/heads/master: Permission denied
ng refs/heads/master failed to write
error: failed to push to 'ssh://[EMAIL PROTECTED]/srv/git/libtool.git'

Since it it the first time I have ever done a 'git push', I'll assume
it's me. Help?

Peter
-- 
Peter O'Gorman
http://pogma.com




Allow bootstrap from git repository

2008-04-14 Thread Peter O'Gorman
Hi,

* Makefile.am: Expect mkstamp to return only rev date.
* libltdl/config/mkstamp: return a revision and date based on the number
of lines in the input and the topmost date.

Ok?

Peter
-- 
Peter O'Gorman
http://pogma.com
* Makefile.am: Expect mkstamp to return only rev date.
* libltdl/config/mkstamp: return a revision and date based on the number of lines in the input and the topmost date.
---
 ChangeLog  |7 +++
 Makefile.am|2 +-
 libltdl/config/mkstamp |   32 ++--
 3 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b4fac02..3eba77e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-14  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Allow bootstrap from git repository.
+	* Makefile.am: Expect mkstamp to return only rev date.
+	* libltdl/config/mkstamp: return a revision and date based on
+	the number of lines in the input and the topmost date.
+
 2008-04-11  Eric Blake  [EMAIL PROTECTED]
 
 	Fix usage of setmode without declaration on cygwin.
diff --git a/Makefile.am b/Makefile.am
index 0168a41..4609cdd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,7 +52,7 @@ MKSTAMP = $(SHELL) $(srcdir)/$(auxdir)/mkstamp
 
 timestamp = set dummy `$(MKSTAMP)  $(srcdir)/ChangeLog`; shift; \
 	case $(VERSION) in \
-	  *[acegikmoqsuwy]) TIMESTAMP= $$1 $$2 $$3 ;; \
+	  *[acegikmoqsuwy]) TIMESTAMP= $$1 $$2 ;; \
 	  *) TIMESTAMP= ;; \
 	esac
 
diff --git a/libltdl/config/mkstamp b/libltdl/config/mkstamp
index 8d8e7d8..eb3284a 100755
--- a/libltdl/config/mkstamp
+++ b/libltdl/config/mkstamp
@@ -23,15 +23,27 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 
-# This script expects to find a line containing both Revision and Date
-# tags, and it edits this line so that it looks like ` $rev $date'
+# This script counts the lines in a Changelog and generates a
+# revision date on the output.
 
-# Command-line arguments are passed down to sed; additional -e cmd
-# arguments are acceptable.  Input is from from stdin.  The original
-# version of this script accepted input from a named file or stdin.
+# Generate a revision that looks similar to CVS revision by using 1.
+# then the last 2 digits of the year +30 (so that the revision number
+# is greater than the last cvs revision, and the number of lines
+# in the ChangeLog. For those pulling from the savannah git repository
+# it should be possible to go from this revision number to the git
+# revision fairly easily. The number will also always increase,e ven
+# when we rotate ChangeLogs in the new year.
 
-tr -d \015 | sed -e '
-	s%.*\$''Revision: \([^$]*\) \$.*\$''Date: \([^$]*\) \$.*% \1 \2%
-	t end
-	d
-	: end' ${1+$@}
+awk 'BEGIN {
+	dated=0;
+}
+/^20/ {
+	if (dated == 0) {
+		dated=1;
+		datestr=$1;
+	}
+}
+END {
+	yr=substr(datestr,3,2) + 30;
+	print 1. yr NR   datestr;
+}'
-- 
1.5.3.7



Re: Speed up progname, progpath setting

2008-04-11 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 * Bob Friesenhahn wrote on Fri, Apr 11, 2008 at 12:12:45AM CEST:
 On Thu, 10 Apr 2008, Ralf Wildenhues wrote:
 On systems where $PWD happens to not work, we shouldn't care about
 performance, they are so rare.
 We should define what it means for PWD to work.
 
 My intention was to use it only in places where it doesn't matter
 whether logical or physical paths are used.  For example progpath,
 where all that's needed is that we can grep/sed the libtool script.

Yes, thus avoiding the possible forks for cd and pwd. I think using $PWD
for this is fine.

Peter
-- 
Peter O'Gorman
http://pogma.com




  1   2   3   >