>From 6142f2d434781373d572009af2b9cf40ccd7b93b Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Wed, 25 Aug 2010 11:25:40 +0200 Subject: [PATCH 2/7] Add path conversion from $build to toolchain. * libltdl/m4/libtool.m4 (_LT_PATH_CONVERSION_FUNCTIONS): Add cache variable lt_cv_to_tool_path_cmd that describes how to convert paths from $build to toolchain format. * libltdl/config/ltmain.m4sh (func_to_tool_path): New function that utilizes the above. * Makefile.am: Ensure to_tool_path_cmd is included in TEST_ENVIRONMENT so that it is passed to (old testsuite) tests. * testsuite.at: Ensure to_tool_path_cmd is passed as a variable setting on the configure line for (new testsuite) tests. Signed-off-by: Peter Rosin --- ChangeLog | 13 +++++++++++++ Makefile.am | 3 ++- libltdl/config/ltmain.m4sh | 14 ++++++++++++++ libltdl/m4/libtool.m4 | 20 ++++++++++++++++++++ tests/testsuite.at | 5 ++++- 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cda261e..c951f8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2010-08-25 Peter Rosin + Add path conversion from $build to toolchain. + * libltdl/m4/libtool.m4 (_LT_PATH_CONVERSION_FUNCTIONS): Add + cache variable lt_cv_to_tool_path_cmd that describes how to + convert paths from $build to toolchain format. + * libltdl/config/ltmain.m4sh (func_to_tool_path): New function + that utilizes the above. + * Makefile.am: Ensure to_tool_path_cmd is included in + TEST_ENVIRONMENT so that it is passed to (old testsuite) tests. + * testsuite.at: Ensure to_tool_path_cmd is passed as a variable + setting on the configure line for (new testsuite) tests. + +2010-08-25 Peter Rosin + Move path conversion functions earlier in the libtool script. * libltdl/config/ltmain.m4sh (func_wine_to_win32_path) (func_cygpath, func_msys_to_win32, func_path_convert_check) diff --git a/Makefile.am b/Makefile.am index 251dc19..b0fdece 100644 --- a/Makefile.am +++ b/Makefile.am @@ -529,7 +529,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_path_cmd="$(to_host_path_cmd)" + lt_cv_to_host_path_cmd="$(to_host_path_cmd)" \ + lt_cv_to_tool_path_cmd="$(to_tool_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 01fabf8..a8ba41d 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -797,6 +797,20 @@ func_to_host_path () # end func_to_host_path +# func_to_tool_path ARG +# converts the path ARG from $build format to toolchain +# format. +func_to_tool_path () +{ + $opt_debug +# lt_func_to_host_path_result=$func_to_host_path_result + eval '$to_tool_path_cmd "$1"' + func_to_tool_path_result=$func_to_host_path_result +# func_to_host_path_result=$lt_func_to_host_path_result +} +# end func_to_tool_path + + # func_noop_path_convert ARG # A no-op path conversion function for use when $build == $host. # or when there is no required (or known) conversion function diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index d7bd57d..03786bc 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -7627,5 +7627,25 @@ AC_MSG_RESULT([$lt_cv_to_host_path_cmd]) _LT_DECL([to_host_path_cmd], [lt_cv_to_host_path_cmd], [0], [convert $build paths to $host format])dnl AC_SUBST([to_host_path_cmd])dnl + +AC_MSG_CHECKING([how to convert $build paths to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_path_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_path_cmd=func_noop_path_convert +case $host in + *mingw* ) + case $build in + *mingw* ) # actually msys + lt_cv_to_tool_path_cmd=func_msys_to_mingw_path_convert + ;; + esac + ;; +esac +]) +to_tool_path_cmd=$lt_cv_to_tool_path_cmd +AC_MSG_RESULT([$lt_cv_to_tool_path_cmd]) +_LT_DECL([to_tool_path_cmd], [lt_cv_to_tool_path_cmd], + [0], [convert $build paths to toolchain format])dnl +AC_SUBST([to_tool_path_cmd])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/tests/testsuite.at b/tests/testsuite.at index 3475fa1..ee54dd3 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_path_cmd|to_tool_path_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_path_cmd"; then configure_options="$configure_options lt_cv_to_host_path_cmd=$to_host_path_cmd" fi +if test -n "$to_tool_path_cmd"; then + configure_options="$configure_options lt_cv_to_tool_path_cmd=$to_tool_path_cmd" +fi if (FOO=bar; unset FOO) >/dev/null 2>&1; then unset=unset else -- 1.7.1