Re: Patch for cygwin: silence cwrapper compilation warnings

2008-04-29 Thread Charles Wilson

Charles Wilson wrote:

2008-04-25  Charles Wilson  <...>

Ensure cwrapper compiles without warnings under -std=c99:

* libltdl/config/ltmain.m4sh (func_emit_wrapper_part1):
new function.
(func_emit_wrapper_part2): new function.
(func_emit_wrapper): delegate to new functions.
(func_emit_cwrapperexe_src) [__CYGWIN__ && __STRICT_ANSI__]:
ensure realpath is declared.
(func_emit_cwrapperexe_src): declare two different strings
to each hold part of the wrapper script content. Initialize
using new func_emit_wrapper_partX functions.
(func_emit_cwrapperexe_src) [main]: when emitting wrapper
script content, use both strings.



However, this bit in the posted patch, in func_emit_wrapper():
+   func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+   func_emit_wrapper_part2 "${func_emit_wrapper_arg2}"
should really be
+   func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+   func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
because func_emit_wrapper() only has *arg1 and should pass that argument 
on to both of the func_emit_wrapper_part*() sub-functions.


Okay for push, with the above change and rebasing?

BTW, what's the normal procedure after rebasing your topic branch, and 
pulling into (local) master [and, according to Jim's suggestions on 
gnulib mailing list, finally adding your commit info to the ChangeLog, and

  git-add ChangeLog
  git commit --amend -e
]?

On CVS, instead of 'cvs commit' you'd do 'clcommit'
On GIT, instead of 'git-push' you do...?

--
Chuck




Re: Patch for cygwin: silence cwrapper compilation warnings

2008-04-25 Thread Charles Wilson

Charles Wilson wrote:


2008-04-25  Charles Wilson  <...>

Ensure cwrapper compiles without warnings under -std=c99:

* libltdl/config/ltmain.m4sh (func_emit_wrapper_part1):
new function.
(func_emit_wrapper_part2): new function.
(func_emit_wrapper): delegate to new functions.
(func_emit_cwrapperexe_src) [__CYGWIN__ && __STRICT_ANSI__]:
ensure realpath is declared.
(func_emit_cwrapperexe_src): declare two different strings
to each hold part of the wrapper script content. Initialize
using new func_emit_wrapper_partX functions.
(func_emit_cwrapperexe_src) [main]: when emitting wrapper
script content, use both strings.


Test resuits:
==
All 115 tests passed
(9 tests were not run)
==

ERROR: 68 tests were run,
6 failed (3 expected failures).
3 tests were skipped.

Failed:
 10: verbatim aclocal.m4 w/o AC_CONFIG_MACRO_DIR FAILED
 23: Link order of deplibs.  FAILED
 70: Run tests with low max_cmd_len  FAILED

I believe #10 is already-reported fallout from one of Gary's patches, 
and #23 and #70 are expected on cygwin.


But see:
http://cygwin.com/ml/cygwin/2008-04/msg00681.html


However, this bit in the posted patch, in func_emit_wrapper():
+   func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+   func_emit_wrapper_part2 "${func_emit_wrapper_arg2}"
should really be
+   func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+   func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
because func_emit_wrapper() only has *arg1 and should pass that argument 
on to both of the func_emit_wrapper_part*() sub-functions.


--
Chuck

P.S. I think I might have to switch to dash for my libtool work. Running 
the testsuite on cygwin-1.5.25-12, Vista Home Premium 32bit, 3G Ram, 
dual core centrino mobile T5250...took 4.5 hours.








Patch for cygwin: silence cwrapper compilation warnings

2008-04-25 Thread Charles Wilson
Now that configure doesn't generate libtool until late in the game (when 
LT_OUTPUT is not used), the package CFLAGS determined during the rest of 
configure are added to LTCFLAGS, and used to compile the cwrapper.


In one case, the project used -Wall -Werror -std=c99 (which turns on 
__STRICT_ANSI__).  This led to a number of problems:


(1) .warning: string length `4368' is greater than the
length `4095' ISO C99 compilers are required to support

e.g. we can't put the entire wrapper script into a single string

(2) warning: implicit declaration of function `realpath'

Posix says realpath is declared when #include 
Strict ansi says no.

These warnings, coupled with -Werror, means that libtool fails compile 
the wrapper executable.  However, that error is not detected, and 
libtool continues:


(3) strip: './foo.exe': No such file

The attached patch addresses #1 and #2, but not #3.  Reported by Yaakov 
Selkowitz.  I'm not sure if all the documentation needs to be duplicated 
for all three functions, but...


Test suite on cygwin in progress.

--
Chuck

2008-04-25  Charles Wilson  <...>

Ensure cwrapper compiles without warnings under -std=c99:

* libltdl/config/ltmain.m4sh (func_emit_wrapper_part1):
new function.
(func_emit_wrapper_part2): new function.
(func_emit_wrapper): delegate to new functions.
(func_emit_cwrapperexe_src) [__CYGWIN__ && __STRICT_ANSI__]:
ensure realpath is declared.
(func_emit_cwrapperexe_src): declare two different strings
to each hold part of the wrapper script content. Initialize
using new func_emit_wrapper_partX functions.
(func_emit_cwrapperexe_src) [main]: when emitting wrapper
script content, use both strings.

diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index ac334dc..60cad1f 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2249,9 +2249,9 @@ func_extract_archives ()
 
 
 
-# func_emit_wrapper arg
+# func_emit_wrapper_part1 arg
 #
-# emit a libtool wrapper script on stdout
+# emit the first part of a libtool wrapper script on stdout
 # don't directly open a file because we may want to
 # incorporate the script contents within a cygwin/mingw
 # wrapper executable.  Must ONLY be called from within
@@ -2263,11 +2263,11 @@ func_extract_archives ()
 # will assume that the directory in which it is stored is
 # the '.lib' directory.  This is a cygwin/mingw-specific
 # behavior.
-func_emit_wrapper ()
+func_emit_wrapper_part1 ()
 {
-   func_emit_wrapper_arg1=no
+   func_emit_wrapper_part1_arg1=no
if test -n "$1" ; then
- func_emit_wrapper_arg1=$1
+ func_emit_wrapper_part1_arg1=$1
fi
 
$ECHO "\
@@ -2352,10 +2352,36 @@ else
 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
   done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 arg
+#
+# emit the second part of a libtool wrapper script on stdout
+# don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variable
+# set therein.
+#
+# arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the '.lib' directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper_part2 ()
+{
+   func_emit_wrapper_part2_arg1=no
+   if test -n "$1" ; then
+ func_emit_wrapper_part2_arg1=$1
+   fi
+
+   $ECHO "\
 
   # Usually 'no', except on cygwin/mingw when embedded into
   # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
   if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
 # special case for '.'
 if test \"\$thisdir\" = \".\"; then
@@ -2472,7 +2498,36 @@ else
 fi\
 "
 }
-# end: func_emit_wrapper
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper arg
+#
+# emit a libtool wrapper script on stdout
+# don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variable
+# set therein.
+#
+# arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the '.lib' directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+   func_emit_wrapper_arg1=no
+   if test -n "$1" ; then
+ func_emit_wrapper_arg1=$1
+   fi
+
+   # split this up so that func_emit_cwrapperexe_src
+   # can call each part independently.
+   func_emit_wrap