]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Convert POSIX file names to toolchain format for MSVC
authorPeter Rosin <peda@lysator.liu.se>
Tue, 7 Sep 2010 05:04:49 +0000 (07:04 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Tue, 7 Sep 2010 05:04:49 +0000 (07:04 +0200)
* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG)
[cygwin, mingw, pw32, cegcc] <cl*, postlink_cmds>: Make
sure the -outputresource: file name for the manifest tool is
in w32 format.
<cl*, archive_expsym_cmds>: 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 <peda@lysator.liu.se>
ChangeLog
doc/libtool.texi
libltdl/config/ltmain.m4sh
libltdl/m4/libtool.m4

index f177fdc69aa1ab2b6f3cb6faca116c8bb0fabc9c..5af41fb83d83e69900efc0d6447cf56f4abf7aed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-07  Peter Rosin  <peda@lysator.liu.se>
+
+       Convert POSIX file names to toolchain format for MSVC
+       * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG)
+       [cygwin, mingw, pw32, cegcc] <cl*, postlink_cmds>: Make
+       sure the -outputresource: file name for the manifest tool is
+       in w32 format.
+       <cl*, archive_expsym_cmds>: 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  <peda@lysator.liu.se>
 
        Use func_to_tool_file instead of fix_srcfile_path.
index 5a76e26d6f388ae6542e9dd6fe9e97c3870fbf89..7d7eb76b016076c98bbbf44163d11055ddeee528 100644 (file)
@@ -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
index e5867b63ce9360b9a18b8d0a0796ab90de123152..1a7bd968e3bb013856176c21b95784f41ba0e50a 100644 (file)
@@ -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
 
index 132dd2c37af7df10b35ffcb1efe16e9ae41bc1db..ba48ce3a224ff226bbe53425124c7a638a167359 100644 (file)
@@ -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'
          ;;