Charles Wilson wrote:
Charles Wilson wrote:
How does that sound, as an intermediate plan?
Implemented as attached, which should be applied on top of the -take3 patch.
Ping?
The attached represents the combination of -take3
http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg00233.html
ChangeLog for that piece is here:
http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg00163.html
And the followup *addendum* patch, with an associated pseudo-changelog:
http://lists.gnu.org/archive/html/libtool-patches/2009-01/msg00238.html
These two *could* be reviewed separately, if that is preferable. Or,
just look at the attached combo patch.
ChangeLog (for combo patch)
libltdl/m4/libtool.m4 (_LT_PATH_CONVERSION_FUNCTIONS): New
function sets libtool variable $to_host_path_cmd, and employs
cache. AC_SUBSTs $to_host_path_cmd, as well.
(_LT_SETUP): Require it.
tests/testsuite.at: Ensure to_host_path_cmd is passed as a
variable setting on the configure line for (new testsuite) tests.
Makefile.am: Ensure to_host_path_cmd is included in
TEST_ENVIRONMENT so that it is passed to (old testsuite) tests.
libltdl/config/ltmain.m4sh (func_cygpath): New function.
(func_init_to_host_pathlist_cmd): New function.
(func_to_host_path): Refactored to... (now uses eval
$to_host_path_cmd).
(func_wine_to_win32_path): Here. New function.
(func_msys_to_win32): Here. New function.
(func_path_convert_check): Here. New function.
(func_noop_path_convert): Here. New function.
(func_msys_to_mingw_path_convert): Here. New function.
(func_cygwin_to_mingw_path_convert): Here. New function.
(func_nix_to_mingw_path_convert): Here. New function.
(func_msys_to_cygwin_path_convert): New function.
(func_nix_to_cygwin_path_convert): New function.
(func_to_host_pathlist): Refactored to... (now uses eval
$to_host_pathlist_cmd and func_init_to_host_pathlist_cmd).
(func_pathlist_convert_check): Here. New function.
(func_pathlist_front_back_pathsep): Here. New function.
(func_wine_to_win32_pathlist): Here. New function.
(func_noop_pathlist_convert): Here. New function.
(func_msys_to_mingw_pathlist_convert): Here. New function.
(func_cygwin_to_mingw_pathlist_convert): Here. New function.
(func_nix_to_mingw_pathlist_convert): Here. New function.
(func_msys_to_cygwin_pathlist_convert): New function.
(func_nix_to_cygwin_pathlist_convert): New function.
diff --git a/Makefile.am b/Makefile.am
index 574147d..9cd1628 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -507,7 +507,8 @@ TESTS_ENVIRONMENT = MAKE=$(MAKE) CC=$(CC)
CFLAGS=$(CFLAGS) \
CXX=$(CXX) CXXFLAGS=$(CXXFLAGS) CXXCPP=$(CXXCPP) \
F77=$(F77) FFLAGS=$(FFLAGS) \
FC=$(FC) FCFLAGS=$(FCFLAGS) \
- GCJ=$(GCJ) GCJFLAGS=$(GCJFLAGS)
+ GCJ=$(GCJ) GCJFLAGS=$(GCJFLAGS) \
+ lt_cv_to_host_path_cmd=$(to_host_path_cmd)
BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir=$(abs_top_srcdir) \
LIBTOOLIZE=$(abs_top_builddir)/libtoolize \
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 49e07c3..d362d73 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2533,166 +2533,595 @@ fi\
}
+
+# PATH CONVERSION HELPER FUNCTIONS #
+
+
+# func_wine_to_win32_path ARG
+# Helper function used by path conversion functions
+# when $build is *nix, and $host is mingw, cygwin,
+# or some other win32 environment. Relies on a
+# correctly configured wine environment available,
+# with the winepath program in $build's $PATH.
+#
+# ARG is the $build path to be converted to win32 format.
+# result is available in $func_wine_to_win32_path_result
+# result is empty on error (or when arg is empty)
+func_wine_to_win32_path ()
+{
+ $opt_debug
+ lt_sed_naive_backslashify='s|*|\\|g;s|/|\\|g;s|\\||g'
+ func_wine_to_win32_path_result=$1
+ if test -n $1; then
+# Unfortunately, winepath does not exit with a non-zero
+# error code, so we are forced to check the contents of
+# stdout. On the other hand, if the command is not
+# found, the shell will set an exit code of 127 and print
+# *an error message* to stdout. So we must check for both
+# error code of zero AND non-empty stdout, which explains
+# the odd construction:
+func_to_host_path_tmp1=`winepath -w $1 2/dev/null`
+if test $? -eq 0 test -n ${func_wine_to_win32_path_tmp}; then
+ func_to_host_path_result=`$ECHO $func_wine_to_win32_path_tmp |
+$SED -e $lt_sed_naive_backslashify`
+else
+ func_wine_to_win32_path_result=
+fi
+ fi
+}
+# end: func_wine_to_win32_path
+
+
+# func_wine_to_win32_pathlist ARG
+# Helper function used by path conversion functions
+# when $build is *nix, and $host is mingw, cygwin,
+# or some other win32 environment. Relies on a
+# correctly configured wine environment available,
+# with the winepath program in $build's $PATH.
+# Assumes ARG has no leading or trailing path separator
+# characters.
+#
+# ARG is pathlist to be