summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog17
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac1
-rw-r--r--doc/libtool.texi26
-rw-r--r--libltdl/config/ltmain.m4sh12
-rw-r--r--libltdl/m4/libtool.m420
-rw-r--r--tests/testsuite.at5
7 files changed, 79 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 448393fe..f352d145 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-06 Peter Rosin <peda@lysator.liu.se>
+
+ Add file name conversion from $build to toolchain.
+ * configure.ac: Ensure to_tool_file_cmd is available to Makefile.
+ * libltdl/m4/libtool.m4 (_LT_PATH_CONVERSION_FUNCTIONS): Add
+ cache variable lt_cv_to_tool_file_cmd that describes how to
+ convert file names from $build to toolchain format.
+ * libltdl/config/ltmain.m4sh (func_to_tool_file): New function
+ that utilizes the above.
+ * Makefile.am: Ensure to_tool_file_cmd is included in
+ TEST_ENVIRONMENT so that it is passed to (old testsuite) tests.
+ * testsuite.at: Ensure to_tool_file_cmd is passed as a variable
+ setting on the configure line for (new testsuite) tests.
+ * doc/libtool.texi (libtool script content): Update with
+ to_tool_file_cmd description.
+ (Cygwin to MinGW Cross): Update to mention lt_cv_to_tool_file_cmd.
+
2010-09-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
tests: avoid spurious test failure due to library mode on HP-UX.
diff --git a/Makefile.am b/Makefile.am
index 48fbf73c..dcd08766 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -518,7 +518,8 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
F77="$(F77)" FFLAGS="$(FFLAGS)" \
FC="$(FC)" FCFLAGS="$(FCFLAGS)" \
GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)" \
- lt_cv_to_host_file_cmd="$(to_host_file_cmd)"
+ lt_cv_to_host_file_cmd="$(to_host_file_cmd)" \
+ lt_cv_to_tool_file_cmd="$(to_tool_file_cmd)"
BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" \
LIBTOOLIZE="$(abs_top_builddir)/libtoolize" \
diff --git a/configure.ac b/configure.ac
index aaa946f7..d36addeb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,6 +203,7 @@ LT_LANG(Windows Resource)
# Ensure the correct file name (and path) conversion function
# is available to the test suite.
AC_SUBST([to_host_file_cmd])dnl
+AC_SUBST([to_tool_file_cmd])dnl
## --------------------------- ##
## Work out which tests to run ##
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 573536e0..f5d2f972 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -6230,6 +6230,16 @@ relative file names are used in the build system, and non-Windows-supported
Unix idioms such as symlinks and mount points are avoided, this scenario should
work.
+If you must use absolute file names, you will have to force Libtool to convert
+file names for the toolchain in this case, by doing the following before you
+run configure:
+
+@example
+@kbd{export lt_cv_to_tool_file_cmd=func_convert_file_cygwin_to_w32}
+@end example
+@cindex lt_cv_to_tool_file_cmd
+@cindex func_convert_file_cygwin_to_w32
+
In the @emph{lying} Cygwin to MinGW cross compile case, you lie to the
build system:
@@ -6247,14 +6257,18 @@ running under @emph{Cygwin} and not MinGW. In this case, libtool does
that you are performing a native MinGW build. However, as described in
(@pxref{Native MinGW File Name Conversion}), that scenario triggers an ``MSYS
to Windows'' file name conversion. This, of course, is the wrong conversion
-since we are actually running under Cygwin. To force the correct file name
-conversion in this situation, you should do the following @emph{before}
+since we are actually running under Cygwin. Also, the toolchain is expecting
+Windows file names (not Cygwin) but unless told so Libtool will feed Cygwin
+file names to the toolchain in this case. To force the correct file name
+conversions in this situation, you should do the following @emph{before}
running configure:
@example
@kbd{export lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32}
+@kbd{export lt_cv_to_tool_file_cmd=func_convert_file_cygwin_to_w32}
@end example
@cindex lt_cv_to_host_file_cmd
+@cindex lt_cv_to_tool_file_cmd
@cindex func_convert_file_cygwin_to_w32
Note that this relies on internal implementation details of libtool, and
@@ -6801,6 +6815,14 @@ Linker flag (passed through the C compiler) used to generate thread-safe
libraries.
@end defvar
+@defvar to_tool_file_cmd
+If the toolchain is not native to the build system (e.g.@: if you are using
+some Unix to drive the scripting together with a Windows toolchain running
+in Wine) this variable describes how to convert file names from the format
+used by the build system to the format used by the toolchain. Normally set
+to @samp{func_convert_file_noop}.
+@end defvar
+
@defvar version_type
The library version numbering type. One of @samp{libtool},
@samp{freebsd-aout}, @samp{freebsd-elf}, @samp{irix}, @samp{linux},
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index c31f7883..2cccd47f 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -873,6 +873,18 @@ func_to_host_file ()
# end func_to_host_file
+# func_to_tool_file ARG
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.
+func_to_tool_file ()
+{
+ $opt_debug
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+}
+# end func_to_tool_file
+
+
# func_convert_file_noop ARG
# Copy ARG to func_to_host_file_result.
func_convert_file_noop ()
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 666130d7..fa46813e 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -7718,5 +7718,23 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd
AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
[0], [convert $build file names to $host format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/tests/testsuite.at b/tests/testsuite.at
index c646c5df..ea13ec95 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_file_cmd)='`
+eval `$LIBTOOL --config | $EGREP '^(host|host_os|host_alias|build|build_alias|to_host_file_cmd|to_tool_file_cmd)='`
configure_options=--prefix=/nonexistent
if test -n "$host_alias"; then
configure_options="$configure_options --host $host_alias"
@@ -48,6 +48,9 @@ fi
if test -n "$to_host_file_cmd"; then
configure_options="$configure_options lt_cv_to_host_file_cmd=$to_host_file_cmd"
fi
+if test -n "$to_tool_file_cmd"; then
+ configure_options="$configure_options lt_cv_to_tool_file_cmd=$to_tool_file_cmd"
+fi
if (FOO=bar; unset FOO) >/dev/null 2>&1; then
unset=unset
else