From: Peter Rosin Date: Tue, 7 Sep 2010 05:04:49 +0000 (+0200) Subject: Convert POSIX file names to toolchain format for MSVC X-Git-Tag: v2.4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25d44a7ae02548f1cc834e5a251fa3611643cf7d;p=thirdparty%2Flibtool.git Convert POSIX file names to toolchain format for MSVC * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [cygwin, mingw, pw32, cegcc] : Make sure the -outputresource: file name for the manifest tool is in w32 format. : Likewise for the MSVC command file containing the exports and the output file name. * libltdl/config/ltmain.m4sh (func_mode_link): Precalculate the toolchain format of the output_objdir file name and store it in the tool_output_objdir variable. Also replace any occurrence of @TOOL_OUTPUT@ in postlink_cmds with the toolchain version of the @OUTPUT@ content. * doc/libtool.texi (libtool script content): Update description of postlink_cmds to mention @TOOL_OUTPUT@. Signed-off-by: Peter Rosin --- diff --git a/ChangeLog b/ChangeLog index f177fdc69..5af41fb83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2010-09-07 Peter Rosin + + Convert POSIX file names to toolchain format for MSVC + * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) + [cygwin, mingw, pw32, cegcc] : Make + sure the -outputresource: file name for the manifest tool is + in w32 format. + : Likewise for the MSVC command file + containing the exports and the output file name. + * libltdl/config/ltmain.m4sh (func_mode_link): Precalculate the + toolchain format of the output_objdir file name and store it in + the tool_output_objdir variable. Also replace any occurrence of + @TOOL_OUTPUT@ in postlink_cmds with the toolchain version of the + @OUTPUT@ content. + * doc/libtool.texi (libtool script content): Update description + of postlink_cmds to mention @TOOL_OUTPUT@. + 2010-09-06 Peter Rosin Use func_to_tool_file instead of fix_srcfile_path. diff --git a/doc/libtool.texi b/doc/libtool.texi index 5a76e26d6..7d7eb76b0 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -6747,11 +6747,12 @@ Commands run after uninstalling a shared or static library, respectively. @defvar postlink_cmds Commands necessary for finishing linking programs. @code{postlink_cmds} -are executed immediately after the program is linked. Any occurance of +are executed immediately after the program is linked. Any occurrence of the string @code{@@OUTPUT@@} in @code{postlink_cmds} is replaced by the -name of the created executable (i.e. not the wrapper, if a wrapper is -generated) prior to execution. Normally disabled (i.e. -@code{postlink_cmds} empty). +name of the created executable (i.e.@: not the wrapper, if a wrapper is +generated) prior to execution. Similarly, @code{@@TOOL_OUTPUT@@} is +replaced by the toolchain format of @{@@OUTPUT@@}. Normally disabled +(i.e.@: @code{postlink_cmds} empty). @end defvar @defvar reload_cmds diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index e5867b63c..1a7bd968e 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -5196,6 +5196,8 @@ func_mode_link () func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" @@ -8051,7 +8053,8 @@ EOF func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g'` + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi @@ -8102,7 +8105,8 @@ EOF func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g'` + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi @@ -8140,7 +8144,8 @@ EOF func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 132dd2c37..ba48ce3a2 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -5004,7 +5004,7 @@ _LT_EOF else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs @$output_objdir/$soname.exp -Wl,-DLL~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' @@ -5013,12 +5013,16 @@ _LT_EOF # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; - *) lt_outputfile="$lt_outputfile.exe" ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_outputfile.manifest" -outputresource:"$lt_outputfile" || exit 1; + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; @@ -5999,7 +6003,7 @@ if test "$_lt_caught_CXX_error" != yes; then else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs @$output_objdir/$soname.exp -Wl,-DLL~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' @@ -6007,12 +6011,17 @@ if test "$_lt_caught_CXX_error" != yes; then # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; - *) lt_outputfile="$lt_outputfile.exe" ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; esac~ + func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_outputfile.manifest" -outputresource:"$lt_outputfile" || exit 1; + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;;