libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MSVC: For MSVC, embed the manifest as a resource in the executable.


From: Peter Rosin
Subject: Re: MSVC: For MSVC, embed the manifest as a resource in the executable.
Date: Thu, 01 Jul 2010 22:30:56 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5

Hi!

Den 2010-06-26 22:42 skrev Ralf Wildenhues:
* Peter Rosin wrote on Fri, Jun 25, 2010 at 12:20:53AM CEST:
I know that I haven't addressed the exeext comment
in your other reply, but I don't know what you want me to do. Please
advise further...

Step 0 would be using
   case ... in
   *.exe | *.EXE ) ...

because nobody mixes case.  Step 1 (optional) would be having a variable
in ltmain which contains exeext-normalized value (i.e., either always
with, or always without the extension), so you don't have to put the
case in the tag code.  Step 2: IIUC then this particular .EXE can only
come from some makefile(.am) author using upper-case .EXE *in* the file.
Slap that author.  ;-)

It turns out that "*.exe | *.EXE)" doesn't work.

If I have this in my libtool file (as is the case on master):

# Commands necessary for finishing linking programs.
postlink_cmds="lt_outputfile=\\\"@address@hidden"~
          case \$lt_outputfile in
            *.exe | *.EXE) ;;
            *) lt_outputfile=\\\"\$lt_outputfile.exe\\\" ;;
          esac~
          if test \\\"\$MANIFEST_TOOL\\\" != \\\":\\\" && test -f 
\\\"\$lt_outputfile.manifest\\\"; then
            \$MANIFEST_TOOL -manifest \\\"\$lt_outputfile.manifest\\\" 
-outputresource:\\\"\$lt_outputfile\\\" || exit 1;
            \$RM \\\"\$lt_outputfile.manifest\\\";
          fi"

And run the link-order2.at test, it goes belly up with:

libtool: link: lt_outputfile="main.exe"
libtool: link:  case main.exe in main.exe wrong.exe | *.EXE) ;; *) 
lt_outputfile="main.exe.exe" ;; esac
/home/peda/libtool/git/libtool-msvc/msvc/libtool: eval: line 1167: syntax error 
near unexpected token `wrong.exe'
/home/peda/libtool/git/libtool-msvc/msvc/libtool: eval: line 1167: ` case main.exe in 
main.exe wrong.exe | *.EXE) ;; *) lt_outputfile="main.exe.exe" ;; esac'

I.e. *.exe get expanded. That doesn't happen with "*.[eE][xX][eE])":

libtool: link: lt_outputfile="main.exe"
libtool: link:  case main.exe in *.[eE][xX][eE]) ;; *) 
lt_outputfile="main.exe.exe" ;; esac
libtool: link:  if test "mt" != ":" && test -f "main.exe.manifest"; then mt -manifest 
"main.exe.manifest" -outputresource:"main.exe" || exit 1; rm -f "main.exe.manifest"; fi
Microsoft (R) Manifest Tool version 5.2.3790.2075
Copyright (c) Microsoft Corporation 2005.
All rights reserved.

But if I use "*.[eE][xX][eE] )" it breaks too (notice the space
before the bracket):

libtool: link: lt_outputfile="main.exe"
libtool: link:  case main.exe in main.exe wrong.exe ) ;; *) 
lt_outputfile="main.exe.exe" ;; esac
/c/cygwin/home/peda/libtool/git/libtool-msvc/msvc/libtool: eval: line 1167: 
syntax error near unexpected token `wrong.exe'
/c/cygwin/home/peda/libtool/git/libtool-msvc/msvc/libtool: eval: line 1167: ` case 
main.exe in main.exe wrong.exe ) ;; *) lt_outputfile="main.exe.exe" ;; esac'

This all seems awfully fragile. I don't know how to quote
this expression in libtool.m4 and need help. Someone please?
Or should I just go back to the working "*.[eE][xX][eE])"?

Hmmm, "*.exe|*.EXE)" also works. But as I said, it seems
awfully fragile to rely on spaces not being present...

Cheers,
Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]