Re: [PATCH] GNU/kOpenSolaris port

2009-01-20 Thread Robert Millan
On Mon, Jan 19, 2009 at 11:24:07PM +0100, Ralf Wildenhues wrote:
 * Robert Millan wrote on Mon, Jan 19, 2009 at 11:45:24AM CET:
  
  kopensolaris-gnu was accepted in GNU config.  I adjusted my patch to use
  that, see attachment.
 
 Thanks for carrying this through, pushed as below.  I've added you to
 THANKS.

Thank you Ralf!

Btw, do you expect a new release soon?

-- 
Robert Millan

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




Re: spaces

2009-01-20 Thread Charles Wilson
Bob Friesenhahn wrote:
 For many years I have had my editor configured to always use
 spaces.  This ensures WYSIWYG for everyone involved.

Agree 100%. I try to manually match whatever sp/tab convention is in
place -- using vi if I have to -- but much prefer all spaces.

--
Chuck




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

2009-01-20 Thread Charles Wilson
Ralf Wildenhues wrote:
 +# func_tr_sh
 +# turn $1 into a string suitable for a shell variable name
 +# result is stored in $func_tr_sh_result
 +func_tr_sh ()
 +{
 +  func_tr_sh_result=`echo $1 | $SED -e 's/[^A-Za-z0-9_]/_/g'`
 +  # ensure result begins with non-digit
 +  case $func_tr_sh_result in
 +[A-Za-z_][A-Za-z0-9_] ) ;;
 +* ) func_tr_sh_result=_$func_tr_sh_result ;;
 +  esac
 +}
  ]])
 
 Let's not waste processes when we don't have to, with something like
 this untested bit:
 
 func_tr_sh ()
 {
   case $1 in
 [!a-zA-Z_]* | *[!a-zA-Z_0-9]*)
   func_tr_sh_result=`$ECHO $1 | $SED 's/^[^a-zA-Z]/_/; 
 s/[^a-zA-Z0-9]/_/g'`
   ;;
 *)
   func_tr_sh_result=$1
   ;;
   esac
 }

Your version will confuse '1dumblibraryname.a' and '2dumblibraryname.a'
by turning both into '_dumblibraryname_a'.  How about this:

# func_tr_sh
# turn $1 into a string suitable for a shell variable name
# result is stored in $func_tr_sh_result.  All characters
# not in the set a-zA-z0-9_ are replaced with '_'. Further,
# if $1 begins with a digit, a '_' is prepended as well.
func_tr_sh ()
{
  case $1 in
  [0-9]* | *[!a-zA-Z_0-9]*)
func_tr_sh_result=`$ECHO $1 | $SED 's/^\([0-9]\)/_\1/;
s/[^A-Za-z0-9]/_/g'`
;;
  * )
func_tr_sh_result=$1
;;
  esac
}
Which makes it clear exactly what we're trying to do:
  1) replace all bad chars with _
  2) prepend _ if $1 begins with a digit
There is still a slight inefficiency in the above: IF $1 has all valid
characters, but happens to begin with a digit, then we fork a sed simply
to prepend the '_'. I doubt this will occur much. or ever -- and if it
does, the penalty is an extra fork, not wrong behavior.

 --- a/libltdl/config/ltmain.m4sh
 +++ b/libltdl/config/ltmain.m4sh
 
 @@ -1988,7 +1988,7 @@ extern \C\ {
eval '$GREP -f $output_objdir/$outputname.exp  $nlist  
 $nlistT'
eval '$MV $nlistT $nlist'
case $host in
 -*cygwin | *mingw* | *cegcc* )
 +*cygwin* | *mingw* | *cegcc* )
eval echo EXPORTS ' $output_objdir/$outputname.def'
eval 'cat $nlist  $output_objdir/$outputname.def'
;;
 
 Is this fixing a bug?  If yes, then it should be a separate patch,
 documented in the ChangeLog entry, done likely in all other such
 instances of missing '*' (I haven't found any), and would be obviously
 correct and ok to push.  Please, please don't mix heavy patches with
 such cleanups.  It only leads to cleanups being delayed.

It is not a bug fix, exactly. I just noticed the lack of symmetry, AND
that '*cygwin' never appears anywhere else, and figured it was a typo.
The actual cygwin $host patterns we see AFAIK all match *cygwin -- but
by convention we (libtool) allow extensions on triples for variant
$hosts. This violated that convention, but wasn't /exactly/ a bug.

I can prepare a separate patch and push, if you prefer.

 In your take 3 of this patch series, you have this hunk:
 
 | @@ -2217,7 +2217,7 @@ func_win32_libid ()
 |  ;;
 |*ar\ archive*) # could be an import, or static
 |  if eval $OBJDUMP -f $1 | $SED -e '10q' 2/dev/null |
 | -   $EGREP 'file format (pe-i386(.*architecture: 
 i386)?|pe-arm-wince|pe-x86-64)' /dev/null; then
 | +   $EGREP 'file format (pei?-i386(.*architecture: 
 i386)?|pe-arm-wince|pe-x86-64)' /dev/null; then
 |win32_nmres=`eval $NM -f posix -A $1 |
 | $SED -n -e '
 | 1,100{
 
 Now, my memory is really bad about win32 semantics, but wasn't it
 exactly pei-i386 libraries that we wanted to not match here?

Originally (before the introduction of [func_]win32_libid()), we had
pei*-i386:

 cygwin* | mingw* | pw32*)
  lt_cv_deplibs_check_method='file_magic file format
pei*-i386(.*architecture: i386)?'

When win32_libid() was first introduced, we moved the pei*-i386
incantation as-is into win32_libid():
grep -E 'file format pei*-i386(.*architecture: i386)?' /dev/null ; then
in 6da15e03aa1127eb42652a1f7e15ee42633dbfdf Thu Oct 31 00:52:39 2002

This was changed to
grep -E 'file format pe-i386(.*architecture: i386)?' /dev/null ; then
in 709bbb17317c67d28cf7ec8f0baaef16c4137ad0 Mon Feb 17 18:55:45 2003
Supposedly, this was part of a rewrite to improve speed. Looking at
the mailing list history from that era:
http://lists.gnu.org/archive/html/libtool-patches/2003-02/msg00048.html
No explanation was given for that particular change (my fault).

Looking at the original version of win32_libid() -- after 6da15e03 but
before 709bbb17 -- it originally did this:

  if eval $OBJDUMP -f $1 2/dev/null | \
 grep -E 'file format pei+-i386(.*architecture: i386)?' /dev/null ;
then
win32_libid_type=x86 DLL
  else
if eval $OBJDUMP -f $1 2/dev/null | \
  grep -E 'file format pei*-i386(.*architecture: i386)?' /dev/null
 then
  win32_libid_type=x86
  if eval file $1 2/dev/null | \
 grep -E 'ar archive' /dev/null; then
win32_libid_type=$win32_libid_type archive
if eval 

Re: Archiver handling

2009-01-20 Thread Peter Rosin

Den 2009-01-20 23:35 skrev Peter Rosin:

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

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

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


No ChangeLog entry written yet.

Sorry 'bout that...


Here's an incremental update that makes the Link option thorough
search test proceed a bit further for MSYS/MSVC.

Basically it makes libtool itself use the new --mode=ar to create
archives if the archiver is odd (i.e. MS lib.exe). --mode=ar is
then extended to translate the path of the archive to host native
format which makes it possible to create archives with absolute
pathnames.

(Fails w/o this patch since MSYS doesn't convert pathnames in
arguments if they are prefixed the wrong way. In this case lib.exe
is called with lib -out:/absolute/archive/name.lib as MSYS does
not recognize that it has to convert /absolute/archive/name.lib to
a win32 path for lib.exe to understand it).


Blast, forgot the patch...

Cheers,
Peter

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 36dd3fb..fef7a0c 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -8256,9 +8258,10 @@ func_mode_ar ()
 for arg
 do
   if test -z $archive; then
-archive=$arg
+   func_to_host_path $arg
+   archive=$func_to_host_path_result
   else
-files=$files $arg
+   files=$files $arg
   fi
 done
 
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index e886d3d..c8a46eb 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1320,6 +1320,11 @@ lib)
   ;;
 esac
 
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+_LT_DECL([], [AR_TFLAGS], [1], [Flags to list archive content])
+_LT_DECL([], [AR_XFLAGS], [1], [Flags to extract an archive])
+_LT_DECL([], [AR_SEP], [1], [Separator between AR flags and AR files])
+
 if test -n $AR_SEP 
test X$AR_TFLAGS = Xt 
test X$AR_XFLAGS = Xx 
@@ -1327,20 +1332,23 @@ if test -n $AR_SEP 
 then
   LT_AR='$(AR)'
   LT_ARFLAGS='$(AR_FLAGS)'
+  lt_ar=\$AR
+  lt_arflags=\$AR_FLAGS
 else
-  LT_AR='$(SHELL) $(abs_top_builddir)/libtool --quiet --mode=ar'
+  LT_AR='$(SHELL) $(top_builddir)/libtool --quiet --mode=ar'
   LT_ARFLAGS=cru
+  lt_ar=\\$SHELL \[$]0 --quiet --mode=ar\
+  lt_arflags=cru
 fi
 
+_LT_DECL([LT_AR], [lt_ar], [0], [The portable archiver])
+_LT_DECL([LT_ARFLAGS], [lt_arflags], [0],
+  [Flags to portably create an archive])
 _LT_DECL([], [ar_extract_one_by_one], [1],
   [Extract archive members one by one])
 _LT_DECL([], [archiver_list_spec], [1],
   [How to feed a file listing to the archiver])
 
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-_LT_DECL([], [AR_TFLAGS], [1], [Flags to list archive content])
-_LT_DECL([], [AR_XFLAGS], [1], [Flags to extract an archive])
-_LT_DECL([], [AR_SEP], [1], [Separator between AR flags and AR files])
 AC_SUBST([LT_AR])
 AC_SUBST([LT_ARFLAGS])
 AC_SUBST([AR])
@@ -1363,7 +1371,7 @@ _LT_DECL([], [RANLIB], [1],
 [Commands used to install an old-style archive])
 
 # Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS$AR_SEP$oldlib$oldobjs'
+old_archive_cmds='$LT_AR $LT_ARFLAGS $oldlib$oldobjs'
 old_postinstall_cmds='chmod 644 $oldlib'
 old_postuninstall_cmds=
 


[PATCH] Minor cygwin cleanup

2009-01-20 Thread Charles Wilson
libltdl/config/ltmain.m4sh (func_generate_dlsyms): Correct
case pattern for cygwin.
---
Ok to push?

 libltdl/config/ltmain.m4sh |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 6be529a..760f647 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -1987,7 +1987,7 @@ extern \C\ {
  eval '$GREP -f $output_objdir/$outputname.exp  $nlist  
$nlistT'
  eval '$MV $nlistT $nlist'
  case $host in
-   *cygwin | *mingw* | *cegcc* )
+   *cygwin* | *mingw* | *cegcc* )
  eval echo EXPORTS ' $output_objdir/$outputname.def'
  eval 'cat $nlist  $output_objdir/$outputname.def'
  ;;
-- 
1.6.0.4





Link option thorough search test on MSYS/MSVC

2009-01-20 Thread Peter Rosin

Hi!

This patch together with [1] will make the Link option thorough
search test pass on MSYS/MSVC using the pr-msvc-support branch.
This patch makes manifest embedding and cl command files work
when facing POSIX /absolute/path/names that MSYS fails to convert
to win32 paths due to prefixes of the arguments (prefixes in
these cases are -outputresource: and @).

Cheers,
Peter

[1] http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg00090.html

2009-01-21  Peter Rosin  p...@lysator.liu.se

Convert POSIX paths with prefixes to host format for MSYS/MSVC
* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG)
[mingw] cl: Make sure the -outputresource: path for the
manifest tool is in Win32 format. Same for the MSVC command file
containing the exports.
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index e886d3d..c8a46eb 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -4770,7 +4778,8 @@ _LT_EOF
  else
sed -e 's/\\\(.*\\\)/-link\\\ -EXPORT:\\\1/'  
$export_symbols  $output_objdir/$soname.exp;
  fi~
- $CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs 
@$output_objdir/$soname.exp -link -DLL~
+ func_to_host_path $output_objdir/$soname.exp~
+ $CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs 
@$func_to_host_path_result -link -DLL~
  linknames='
# The linker will not automatically build a static lib if we build a 
DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
@@ -4787,6 +4796,8 @@ _LT_EOF
_LT_TAGVAR(compile_tag, $1)=-TC
_LT_TAGVAR(dashl_xform, $1)='s/\(.*\)/\1.lib/'
_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile=@OUTPUT@~
+ func_to_host_path $lt_outputfile~
+ lt_outputfile=$func_to_host_path_result~
  case $lt_outputfile in
*.[[eE][xX][eE]]) ;;
*) lt_outputfile=$lt_outputfile.exe ;;
@@ -5783,7 +5794,8 @@ if test $_lt_caught_CXX_error != yes; then
else
  $SED -e 's/\\\(.*\\\)/-link\\\ -EXPORT:\\\1/'  
$export_symbols  $output_objdir/$soname.exp;
fi~
-   $CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs 
@$output_objdir/$soname.exp -link -DLL~
+   func_to_host_path $output_objdir/$soname.exp~
+   $CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs 
@$func_to_host_path_result -link -DLL~
linknames='
  # The linker will not automatically build a static lib if we build a 
DLL.
  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
@@ -5799,6 +5811,8 @@ if test $_lt_caught_CXX_error != yes; then
  _LT_TAGVAR(compile_tag, $1)=-TP
  _LT_TAGVAR(dashl_xform, $1)='s/\(.*\)/\1.lib/'
  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile=@OUTPUT@~
+   func_to_host_path $lt_outputfile~
+   lt_outputfile=$func_to_host_path_result~
case $lt_outputfile in
  *.[[eE][xX][eE]]) ;;
  *) lt_outputfile=$lt_outputfile.exe ;;


Run tests with low max_cmd_len on MSYS/MSVC

2009-01-20 Thread Peter Rosin

Hi!

This patch together with [1] and [2] will make Run tests with
low max_cmd_len on MSYS/MSVC behave the same as the individual
tests.

The patch fixes a couple more of the /abs/path issues already
fixed in [1] and [2]. However, I fear that these hunks may be
more controversial, as they touch code that affects other
platforms as well.

Cheers,
Peter

[1] http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg00090.html
[2] http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg00092.html

2009-01-21  Peter Rosin  p...@lysator.liu.se

Convert paths to host format
* libltdl/config/ltmain.m4sh (func_mode_link): When exporting
symbols, linking and creating archives using command files (or
response files), make sure that both the name of the command
file and the content are made up of file names in a format
appropriate for the host. Fixes stresstest.at on MSYS/MSVC when
run with low command line length.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 36dd3fb..7047339 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -6833,11 +6833,13 @@ EOF
save_libobjs=$libobjs
save_output=$output
output=${output_objdir}/${output_la}.nm
-   libobjs=$nm_file_list_spec$output
+   func_to_host_path $output
+   libobjs=$nm_file_list_spec$func_to_host_path_result
delfiles=$delfiles $output
func_verbose creating $NM input file list: $output
for obj in $save_libobjs; do
- $ECHO $obj
+ func_to_host_path $obj
+ $ECHO $func_to_host_path_result
done  $output
eval cmd=\$cmd1\
func_show_eval $cmd 'exit $?'
@@ -6999,10 +7001,12 @@ EOF
fi
for obj
do
- $ECHO $obj  $output
+ func_to_host_path $obj
+ $ECHO $func_to_host_path_result  $output
done
delfiles=$delfiles $output
-   output=$firstobj\$file_list_spec$output\
+   func_to_host_path $output
+   output=$firstobj\$file_list_spec$func_to_host_path_result\
  else
if test -n $save_libobjs; then
  func_verbose creating reloadable object files...
@@ -7839,10 +7843,12 @@ EOF
elif test -n $archiver_list_spec; then
  func_verbose using command file archive linking...
  for obj in $oldobjs; do
-   $ECHO \$obj\
+   func_to_host_path $obj
+   $ECHO \$func_to_host_path_result\
  done  $output_objdir/$libname.libcmd
  save_oldobjs=$oldobjs
- oldobjs= $archiver_list_spec$output_objdir/$libname.libcmd
+ func_to_host_path $output_objdir/$libname.libcmd
+ oldobjs= $archiver_list_spec$func_to_host_path_result
  eval cmds=\\$old_archive_cmds\
  oldobjs=$save_oldobjs
else


Re: [PATCH] Minor cygwin cleanup

2009-01-20 Thread Ralf Wildenhues
Hi Charles,

* Charles Wilson wrote on Tue, Jan 20, 2009 at 11:31:43PM CET:
 libltdl/config/ltmain.m4sh (func_generate_dlsyms): Correct
 case pattern for cygwin.
 ---
 Ok to push?

Yes, thanks!

Cheers,
Ralf