${var:+quo ted} and similar, inside unquoted here-docs

2010-08-29 Thread Ralf Wildenhues
With Solaris 10 sh (and others):

cat EOF
${var-quo  ted}
EOF

quo  ted

Whereas with bash (and others):

quo  ted

This shows up in some of the log files in the Configuring libtool line:
http://autobuild.josefsson.org/libtool/log-201008291316239205000.txt

Eric, did you have this in your recent autoconf.texi additions already?
It can be a problem for all of the stuff that gets expanded into here
documents.

Thanks,
Ralf



Re: ${var:+quo ted} and similar, inside unquoted here-docs

2010-08-29 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Sun, Aug 29, 2010 at 04:48:34PM CEST:
 With Solaris 10 sh (and others):
 
 cat EOF
 ${var-quo  ted}
 EOF
 
 quo  ted

I'm working around the issue in Libtool like this.

Cheers,
Ralf

Work around yet another shell quoting portability issue.

* configure.ac: Avoid nonportable quoted alternate variable
value in unquoted here document, so Solaris 10 sh and Tru64
ksh do not print spurious extra quotes.

diff --git a/configure.ac b/configure.ac
index e13ad43..87f3ce1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,7 +113,11 @@ case $lt_alpha in
 TIMESTAMP=
 ;;
 esac
-AS_BOX([Configuring AC_PACKAGE_TARNAME${TIMESTAMP:+ (Build:$TIMESTAMP)} 
AC_PACKAGE_VERSION])
+timestamp_string=
+if test -n $TIMESTAMP; then
+  timestamp_string= (Build:$TIMESTAMP)
+fi
+AS_BOX([Configuring AC_PACKAGE_TARNAME$timestamp_string AC_PACKAGE_VERSION])
 echo
 AC_SUBST([TIMESTAMP])
 AC_SUBST([package_revision])



Re: [PATCH] [cygwin|mingw]: Add cross-compile support to cwrapper (take 6)

2010-08-29 Thread Peter Rosin
Den 2010-08-28 08:57 skrev Charles Wilson:
 Rename file/path conversion functions
 
 * TODO: Document QoI issue with file name conversion functions.
 * Makefile.am (TESTS_ENVIRONMENT): Renamed cache variable
 lt_cv_to_host_path_cmd to lt_cv_to_host_file_cmd; Renamed
 environment variable to_host_path_cmd to to_host_file_cmd.
 * tests/testsuite.at: Ditto.

You missed one instance here. Pushed the attached as obvious...

Cheers,
Peter
From 7f41a19bc95d266cf0761bdad21e1821335cd442 Mon Sep 17 00:00:00 2001
From: Peter Rosin peda@lysator.liu.se
Date: Sun, 29 Aug 2010 18:17:45 +0200
Subject: [PATCH] Fix typo when renaming path conversion functions.

* tests/testsuite.at: Ensure to_host_file_cmd is passed as a
variable setting on the configure line for (new testsuite) tests.

Signed-off-by: Peter Rosin peda@lysator.liu.se
---
 ChangeLog  |6 ++
 tests/testsuite.at |2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6650889..c6c2447 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-29  Peter Rosin  peda@lysator.liu.se
+
+	Fix typo when renaming path conversion functions.
+	* tests/testsuite.at: Ensure to_host_file_cmd is passed as a
+	variable setting on the configure line for (new testsuite) tests.
+
 2010-08-29  Ralf Wildenhues  Ralf.Wildenhues@gmx.de
 
 	Work around yet another shell quoting portability issue.
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 5818060..a20e074 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -37,7 +37,7 @@ for tool in ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF; do
 done
 export ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF
 eval `$LIBTOOL --config | grep '^EGREP='`
-eval `$LIBTOOL --config | $EGREP '^(host|host_os|host_alias|build|build_alias|to_host_path_cmd)='`
+eval `$LIBTOOL --config | $EGREP '^(host|host_os|host_alias|build|build_alias|to_host_file_cmd)='`
 configure_options=--prefix=/nonexistent
 if test -n $host_alias; then
   configure_options=$configure_options --host $host_alias
-- 
1.7.1



[PATCH 1/3] Save and restore CFLAGS properly inside libtool.m4 macros.

2010-08-29 Thread Ralf Wildenhues
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Use different
temporary variables for saved and restored values of $LIBS,
$CFLAGS, to avoid overlap with the *_CONFIG macros.
(_LT_LANG_CXX_CONFIG, _LT_LANG_F77_CONFIG, _LT_LANG_FC_CONFIG)
(_LT_LANG_GCJ_CONFIG, _LT_LANG_RC_CONFIG): Also save and restore
$CFLAGS, and override it with per-language flags, so that in
case output_verbose_link_cmd uses $CFLAGS, the right flags are
used.

Signed-off-by: Ralf Wildenhues ralf.wildenh...@gmx.de
---
 ChangeLog |   10 ++
 libltdl/m4/libtool.m4 |   31 +++
 2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6650889..6421def 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2010-08-29  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
+   Save and restore CFLAGS properly inside libtool.m4 macros.
+   * libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Use different
+   temporary variables for saved and restored values of $LIBS,
+   $CFLAGS, to avoid overlap with the *_CONFIG macros.
+   (_LT_LANG_CXX_CONFIG, _LT_LANG_F77_CONFIG, _LT_LANG_FC_CONFIG)
+   (_LT_LANG_GCJ_CONFIG, _LT_LANG_RC_CONFIG): Also save and restore
+   $CFLAGS, and override it with per-language flags, so that in
+   case output_verbose_link_cmd uses $CFLAGS, the right flags are
+   used.
+
Work around yet another shell quoting portability issue.
* configure.ac: Avoid nonportable quoted alternate variable
value in unquoted here document, so Solaris 10 sh and Tru64
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index e03543b..ffe20db 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3697,15 +3697,15 @@ static const void *lt_preloaded_setup() {
 _LT_EOF
  # Now try linking the two files.
  mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS=$LIBS
- lt_save_CFLAGS=$CFLAGS
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
  LIBS=conftstm.$ac_objext
  CFLAGS=$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
  if AC_TRY_EVAL(ac_link)  test -s conftest${ac_exeext}; then
pipe_works=yes
  fi
- LIBS=$lt_save_LIBS
- CFLAGS=$lt_save_CFLAGS
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
else
  echo cannot find nm_test_func in $nlist AS_MESSAGE_LOG_FD
fi
@@ -5748,6 +5748,7 @@ if test $_lt_caught_CXX_error != yes; then
 
   # Allow CC to be a program name with arguments.
   lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
   lt_save_LD=$LD
   lt_save_GCC=$GCC
   GCC=$GXX
@@ -5765,6 +5766,7 @@ if test $_lt_caught_CXX_error != yes; then
   fi
   test -z ${LDCXX+set} || LD=$LDCXX
   CC=${CXX-c++}
+  CFLAGS=$CXXFLAGS
   compiler=$CC
   _LT_TAGVAR(compiler, $1)=$CC
   _LT_CC_BASENAME([$compiler])
@@ -6733,6 +6735,7 @@ if test $_lt_caught_CXX_error != yes; then
   fi # test -n $compiler
 
   CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
   LDCXX=$LD
   LD=$lt_save_LD
   GCC=$lt_save_GCC
@@ -7071,7 +7074,9 @@ if test $_lt_disable_F77 != yes; then
   # Allow CC to be a program name with arguments.
   lt_save_CC=$CC
   lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
   CC=${F77-f77}
+  CFLAGS=$FFLAGS
   compiler=$CC
   _LT_TAGVAR(compiler, $1)=$CC
   _LT_CC_BASENAME([$compiler])
@@ -7125,6 +7130,7 @@ if test $_lt_disable_F77 != yes; then
 
   GCC=$lt_save_GCC
   CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
 fi # test $_lt_disable_F77 != yes
 
 AC_LANG_POP
@@ -7201,7 +7207,9 @@ if test $_lt_disable_FC != yes; then
   # Allow CC to be a program name with arguments.
   lt_save_CC=$CC
   lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
   CC=${FC-f95}
+  CFLAGS=$FCFLAGS
   compiler=$CC
   GCC=$ac_cv_fc_compiler_gnu
 
@@ -7257,7 +7265,8 @@ if test $_lt_disable_FC != yes; then
   fi # test -n $compiler
 
   GCC=$lt_save_GCC
-  CC=$lt_save_CC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
 fi # test $_lt_disable_FC != yes
 
 AC_LANG_POP
@@ -7294,10 +7303,12 @@ _LT_COMPILER_BOILERPLATE
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC=$CC
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=yes
 CC=${GCJ-gcj}
+CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
 _LT_TAGVAR(LD, $1)=$LD
@@ -7328,7 +7339,8 @@ fi
 AC_LANG_RESTORE
 
 GCC=$lt_save_GCC
-CC=$lt_save_CC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_GCJ_CONFIG
 
 
@@ -7363,9 +7375,11 @@ _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
 lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
 CC=${RC-windres}
+CFLAGS=
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
 _LT_CC_BASENAME([$compiler])
@@ -7378,7 +7392,8 @@ fi
 
 GCC=$lt_save_GCC
 AC_LANG_RESTORE
-CC=$lt_save_CC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_RC_CONFIG
 
 
-- 
1.7.2.1.222.g9988




Re: proposed autobuild_mode naming scheme

2010-08-29 Thread Ralf Wildenhues
Hello Simon,

* Ralf Wildenhues wrote on Sun, Aug 22, 2010 at 08:44:57PM CEST:
  configure: autobuild mode... default
 [...]
 
 Autobuild uses a few strings to categorize log results: package version,
 $build, $host, hostname, time and date, and a so-called mode which my
 patch sets with the $autobuild_mode variable.

I've not finished the autobuild_mode automatic setting stuff yet, but I
have done a test run on various systems with native compiler and GCC,
(and on AIX without and with runtimelinking).

The results can be found here (should be complete in a few minutes):
http://autobuild.josefsson.org/libtool/

I only now realize that the autobuild mode is not used at all for
categorizing results nor display.  So, for example, the logs with
mode 'rtl' and mode 'gcc' are treated as replacing the 'default'
mode logs in relevance.

Would you accept a patch that shows the mode as another column in the
summary, and uses the mode as another indicator for which runs are the
most recent relevant ones?  Also, a sub table keyed on mode would be
good as well.  Otherwise the page will not be easy to read when we add
more results that only differ in mode.  I'd hate to hack around that by,
e.g., adding the mode to the System name or so.

Further, in an off-list version of the table (created with autobuild
plus the patches I proposed earlier), I see that there are still wrong
Results entries.  Will fix them ...

Thanks,
Ralf



[PATCH 2/3] Disable GCC LTO for verbose library extraction.

2010-08-29 Thread Ralf Wildenhues
* libltdl/m4/libtool.m4 (_LT_SYS_HIDDEN_LIBDEPS): Temporarily
append -fno-lto or -fno-whopr to CFLAGS if CC or CFLAGS (which
are substituted with the per-language variables here) contain
-flto or match -fwhopr*, respectively.

Signed-off-by: Ralf Wildenhues ralf.wildenh...@gmx.de
---
 ChangeLog |6 ++
 libltdl/m4/libtool.m4 |8 
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6421def..f7e2943 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-08-29  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
+   Disable GCC LTO for verbose library extraction.
+   * libltdl/m4/libtool.m4 (_LT_SYS_HIDDEN_LIBDEPS): Temporarily
+   append -fno-lto or -fno-whopr to CFLAGS if CC or CFLAGS (which
+   are substituted with the per-language variables here) contain
+   -flto or match -fwhopr*, respectively.
+
Save and restore CFLAGS properly inside libtool.m4 macros.
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Use different
temporary variables for saved and restored values of $LIBS,
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index ffe20db..0a5f5b1 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -6832,6 +6832,13 @@ public class foo {
 };
 _LT_EOF
 ])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case $CC $CFLAGS  in #(
+*\ -flto\ *) CFLAGS=$CFLAGS -fno-lto ;;
+*\ -fwhopr*\ *) CFLAGS=$CFLAGS -fno-whopr ;;
+esac
+
 dnl Parse the compiler output and extract the necessary
 dnl objects, libraries and library flags.
 if AC_TRY_EVAL(ac_compile); then
@@ -6925,6 +6932,7 @@ else
 fi
 
 $RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
 
 # PORTME: override above test on systems where it is broken
 m4_if([$1], [CXX],
-- 
1.7.2.1.222.g9988




[PATCH 3/3] Support GCC LTO on GNU/Linux.

2010-08-29 Thread Ralf Wildenhues
* libltdl/config/ltmain.m4sh (func_mode_link): Allow through
flags matching -O*, -flto*, -fwhopr, -fuse-linker-plugin.
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Drop symbols
starting with __gnu_lto.
(_LT_LINKER_SHLIBS) [linux] archive_cmds, archive_expsyms_cmds:
Add $pic_flag for GCC.
(_LT_LANG_CXX_CONFIG) [linux] archive_cmds, archive_expsyms_cmds:
Likewise.
(_LT_SYS_HIDDEN_LIBDEPS): Ignore files matching *.lto.o.
* NEWS: Update.

Signed-off-by: Ralf Wildenhues ralf.wildenh...@gmx.de
---
 ChangeLog  |   12 
 NEWS   |1 +
 libltdl/config/ltmain.m4sh |4 +++-
 libltdl/m4/libtool.m4  |8 +---
 4 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f7e2943..4878aee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2010-08-29  Ralf Wildenhues  ralf.wildenh...@gmx.de
 
+   Support GCC LTO on GNU/Linux.
+   * libltdl/config/ltmain.m4sh (func_mode_link): Allow through
+   flags matching -O*, -flto*, -fwhopr, -fuse-linker-plugin.
+   * libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Drop symbols
+   starting with __gnu_lto.
+   (_LT_LINKER_SHLIBS) [linux] archive_cmds, archive_expsyms_cmds:
+   Add $pic_flag for GCC.
+   (_LT_LANG_CXX_CONFIG) [linux] archive_cmds, archive_expsyms_cmds:
+   Likewise.
+   (_LT_SYS_HIDDEN_LIBDEPS): Ignore files matching *.lto.o.
+   * NEWS: Update.
+
Disable GCC LTO for verbose library extraction.
* libltdl/m4/libtool.m4 (_LT_SYS_HIDDEN_LIBDEPS): Temporarily
append -fno-lto or -fno-whopr to CFLAGS if CC or CFLAGS (which
diff --git a/NEWS b/NEWS
index 688bdca..f321bf0 100644
--- a/NEWS
+++ b/NEWS
@@ -97,6 +97,7 @@ New in 2.2.7b 2010-05-20: git version 2.2.7a, Libtool team:
   - With binutils 2.19.50+, shared libraries can be built on AIX.
   - Initial support for the Cuda Compiler Driver on GNU/Linux.
   - Support for Haiku (i586-pc-haiku).
+  - Initial support for GCC link-time optimization (LTO) flags.
 
 * Bug fixes:
 
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 32860c7..e86e944 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -5015,8 +5015,10 @@ 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
   -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=*)
+  
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+  -O*|-flto*|-fwhopr|-fuse-linker-plugin)
 func_quote_for_eval $arg
arg=$func_quote_for_eval_result
 func_append compile_command  $arg
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 0a5f5b1..8ae64b7 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3615,6 +3615,7 @@ for ac_symprfx in  _; do
   else
 lt_cv_sys_global_symbol_pipe=sed -n -e 's/^.*[[
]]\($symcode$symcode*\)[[   ]][[
]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'
   fi
+  lt_cv_sys_global_symbol_pipe=$lt_cv_sys_global_symbol_pipe | sed '/ 
__gnu_lto/d'
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -4664,7 +4665,7 @@ _LT_EOF
   if $LD --help 21 | $EGREP ': supported targets:.* elf'  /dev/null \
  test $tmp_diet = no
   then
-   tmp_addflag=
+   tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
 pgcc*) # Portland Group C compiler
@@ -5788,8 +5789,8 @@ if test $_lt_caught_CXX_error != yes; then
   # Check if GNU C++ uses GNU ld as the underlying linker, since the
   # archiving commands below assume that GNU ld is being used.
   if test $with_gnu_ld = yes; then
-_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects 
$libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o 
$lib'
-_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname 
$wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+_LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname 
$wl$soname -o $lib'
+_LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname 
$wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
@@ -6897,6 +6898,7 @@ if AC_TRY_EVAL(ac_compile); then
  

[PATCH 0/3]: Another go at LTO support

2010-08-29 Thread Ralf Wildenhues
OK, so the issues I had with
http://thread.gmane.org/gmane.comp.gnu.libtool.patches/9767
was both changing output_verbose_link_cmd to something that might work
worse in a number of setups, and on the other hand having a reliable way
to get at postdeps in presence of -flto or -fwhopr or so.

Here's another try.

0) I know that the Right Thing to do would be to re-evaluate this
extraction from verbose output completely, with the goal that we do not
do it for any GCC any more.  Yes.  This is something I'd love (somebody)
to do, but verifying that all kinds of setups still work afterwards is
something *I* don't want to do before 2.2.12.

1) So, instead of trying to do things right in presence of -flto or
-fwhopr*, let's just disable these flags, that ought to be fairly safe?

2) In the process I noticed that we use $CC $CFLAGS consistently in
output_verbose_link_cmd for different languages, but only set CC to the
per-language compiler and forget CFLAGS.

3) In the process of fixing (2) I noticed that we might be using the
same variables for saving and restoring some variables in potentially-
overlapping macros, and renamed some.

I would appreciate a look over for typos and of course agreement that
this is an acceptable compromise for now.

Thanks,
Ralf



[PATCH] Path conversion documentation

2010-08-29 Thread Charles Wilson
* doc/libtool.texi (Platform quirks): Add new subsections
'Cross compiling' and 'File name/path conversion'.
* libltdl/config/ltmain.m4sh (func_convert_file_check): Update
comments and warning message.
func_convert_path_check): Update warning message.
---
Documentation updates for path conversion. Plus a missed
path-file-name terminology correction.

OK to push?

--
Chuck


 doc/libtool.texi   |  381 
 libltdl/config/ltmain.m4sh |8 +-
 2 files changed, 385 insertions(+), 4 deletions(-)

diff --git a/doc/libtool.texi b/doc/libtool.texi
index a3f1c59..7c67cca 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -223,6 +223,8 @@ Platform quirks
 * Reloadable objects::  Binding object files together.
 * Multiple dependencies::   Removing duplicate dependent libraries.
 * Archivers::   Programs that create static archives.
+* Cross compiling:: Issues that arise when cross compiling.
+* File name/path conversion::   Converting filenames between platforms.
 
 @end detailmenu
 @end menu
@@ -5750,6 +5752,8 @@ write your own.
 * Reloadable objects::  Binding object files together.
 * Multiple dependencies::   Removing duplicate dependent libraries.
 * Archivers::   Programs that create static archives.
+* Cross compiling:: Issues that arise when cross compiling.
+* File name/path conversion::   Converting filenames between platforms.
 @end menu
 
 @node References
@@ -5875,6 +5879,383 @@ must be used to ``bless'' the created library before 
linking against it,
 with the @kbd{ranlib l...@var{name}.a} command.  Some systems, like Irix,
 use the @code{ar ts} command, instead.
 
+...@node Cross compiling
+...@subsection Cross compiling
+...@cindex cross compile
+
+Most build systems support the ability to compile libraries and applications
+on one platform (the @code{$build} system) for use on a different platform (the
+...@code{$host} system) -- provided a compiler capable of generating the
+appropriate output is available.  The GNU Build System
+...@url{http://www.gnu.org/software/hello/manual/automake/GNU-Build-System.html},
+of which libtool is a part, supports cross compiling via arguments passed to
+the configure script: @option{--build=...} and @option{--host=...}. However,
+when the @code{$build} and @code{$host} systems are very different, libtool is
+required to make certain accommodations to support these scenarios.
+
+In most cases, because the @code{$build} platform and @code{$host} platform
+differ, the cross-compiled libraries and executables can't be executed or
+tested on the @code{$build} platform where they were compiled.  The testsuites
+of most build systems will often skip any tests that involve executing such
+foriegn executables when cross-compiling.  However, if the @code{$build} and
+...@code{$host} platforms are sufficiently similar, it is often possible to
+run cross-compiled applications.  Libtool's own testsuite often attempts to
+execute cross-compiled tests, but will mark any failures as @emph{skipped}
+since the failure might simply be due to the differences between the two
+platforms.
+
+In addition to cases where the @code{$host} and @code{$build} system are
+extremely similar (e.g. @samp{i586-pc-linux-gnu} and @samp{i686-pc-linux-gnu}),
+there is another case in which cross-compiled @code{$host} applications may
+be executed on the @code{$build} system.  This occurs when the @code{$build}
+platform supports an emulation or API-enhanced environment for @code{$host}.
+One example of this situation would be if @code{$build} were MinGW, and
+...@code{$host} were Cygwin (or vice versa).  Both of these platforms can 
actually
+operate within a single Win32 instance, so Cygwin applications can be launched
+from a MinGW context, and vice versa -- provided certain care is taken. Another
+example would be if @code{$build} were linux on an @samp{x86} 32bit processor,
+and @code{$host} were MinGW.  In this situation, the WINE
+...@url{http://www.winehq.org/} environment can be used to launch Win32
+applications from the linux operating system; again, provided certain care is
+taken.
+
+One particular issue occurs when a Win32 platform such as MinGW, Cygwin, MSYS,
+or MSVC is the @code{$host} or @code{$build}, while the other platform is a 
unix
+system.  In these cases, there are often conflicts between the format of the
+file names and paths expected within @code{$host} libraries and executables,
+and those employed on the @code{$build} platform.
+
+This situation is best described using a concrete example: suppose the
+...@code{$build} is linux -- (specifically, @code{i686-pc-linux-gnu}), and the
+...@code{$host} is MinGW (specifically, @code{i586-pc-mingw32}).  On the linux
+system, there exists a cross compiler, following the usual naming conventions
+of such compilers, where the compiler name is prefixed by the @code{$host}
+triple.  In this case, the C 

Re: [PATCH] [cygwin|mingw]: Add cross-compile support to cwrapper (take 6)

2010-08-29 Thread Charles Wilson
On 8/29/2010 12:21 PM, Peter Rosin wrote:
 Den 2010-08-28 08:57 skrev Charles Wilson:
 Rename file/path conversion functions
 
 You missed one instance here. Pushed the attached as obvious...

Thanks.

--
Chuck



Re: [PATCH] Path conversion documentation

2010-08-29 Thread Gary V. Vaughan
Hi Chuck,

On 30 Aug 2010, at 06:50, Charles Wilson wrote:
 * doc/libtool.texi (Platform quirks): Add new subsections
 'Cross compiling' and 'File name/path conversion'.
 * libltdl/config/ltmain.m4sh (func_convert_file_check): Update
 comments and warning message.
 func_convert_path_check): Update warning message.
 ---
 Documentation updates for path conversion. Plus a missed
 path-file-name terminology correction.

Awesome!  Thanks for that.  An interesting read.

 OK to push?

Please do.  Two patches though - otherwise we have two independent
changes in a single commit.

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



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