]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
For MSVC, embed the manifest as a resource in the executable.
authorPeter Rosin <peda@lysator.liu.se>
Tue, 12 Aug 2008 07:02:32 +0000 (09:02 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Tue, 13 Jan 2009 09:04:09 +0000 (10:04 +0100)
* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) <postlink_cmds>:
New tag variable.
[ cygwin, mingw, cegcc ] <cl*>: Embed the manifest file as a
resource.
(_LT_LANG_CXX_CONFIG): Likewise.
* libltdl/config/ltmain.m4sh (func_mode_link): After linking
a program, replace @OUTPUT@ in $postlink_cmds and then execute
the commands.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
libltdl/config/ltmain.m4sh
libltdl/m4/libtool.m4

index 2af489f041b22912a5ba004cc9731cd2e2d7b6a9..825c7e5d33f47200f8c9963a27b0362c5454c56d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-08-12  Peter Rosin  <peda@lysator.liu.se>
+
+       * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS) <postlink_cmds>:
+       New tag variable.
+       [ cygwin, mingw, cegcc ] <cl*>: Embed the manifest file as a
+       resource.
+       (_LT_LANG_CXX_CONFIG): Likewise.
+       * libltdl/config/ltmain.m4sh (func_mode_link): After linking
+       a program, replace @OUTPUT@ in $postlink_cmds and then execute
+       the commands.
+
 2008-08-12  Peter Rosin  <peda@lysator.liu.se>
 
        * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Disable nocase
index fdc9bf9d92e38767021f590f90c1a31e0ff17d8f..ca9a74925dba12111c9e415ea001bbbf2c3e4238 100644 (file)
@@ -7529,6 +7529,11 @@ EOF
        exit_status=0
        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_execute_cmds "$postlink_cmds" 'exit $?'
+       fi
+
        # Delete the generated files.
        if test -f "$output_objdir/${outputname}S.${objext}"; then
          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
@@ -7574,6 +7579,12 @@ EOF
        $opt_dry_run || $RM $output
        # Link the executable and exit
        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_execute_cmds "$postlink_cmds" 'exit $?'
+       fi
+
        exit $EXIT_SUCCESS
       fi
 
@@ -7607,6 +7618,11 @@ 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_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
       # Now create the wrapper script.
       func_verbose "creating $output"
 
index 4df3cafecd0b6a5e34225b75d6d6f4aaaa45ee14..bda0eaabaf7af6f7f2c38ca5a1fc0147ba3e2d53 100644 (file)
@@ -4760,6 +4760,10 @@ _LT_EOF
        _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
        _LT_TAGVAR(compile_tag, $1)=-TC
        _LT_TAGVAR(dashl_xform, $1)='s/\(.*\)/\1.lib/'
+       _LT_TAGVAR(postlink_cmds, $1)='if test -e "@OUTPUT@.exe.manifest"; then
+           mt -manifest "@OUTPUT@.exe.manifest" -outputresource:"@OUTPUT@.exe";
+           $RM "@OUTPUT@.exe.manifest";
+         fi'
        ;;
       *)
        # Assume MSVC wrapper
@@ -5313,6 +5317,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
     [Symbols that must always be exported])
 _LT_TAGDECL([], [prelink_cmds], [2],
     [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
 _LT_TAGDECL([], [file_list_spec], [1],
     [Specify filename containing input files])
 _LT_TAGDECL([], [dashL_envvar], [1],
@@ -5761,6 +5767,10 @@ if test "$_lt_caught_CXX_error" != yes; then
          _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
          _LT_TAGVAR(compile_tag, $1)=-TP
          _LT_TAGVAR(dashl_xform, $1)='s/\(.*\)/\1.lib/'
+         _LT_TAGVAR(postlink_cmds, $1)='if test -e "@OUTPUT@.exe.manifest"; then
+             mt -manifest "@OUTPUT@.exe.manifest" -outputresource:"@OUTPUT@.exe";
+             $RM "@OUTPUT@.exe.manifest";
+           fi'
          ;;
        *)
          # g++