[fpc-devel] Enabling use of {$R *.dfm} on Windows

Michael Van Canneyt michael at freepascal.org
Wed Jul 25 15:16:50 CEST 2007



On Mon, 23 Jul 2007, Michael Van Canneyt wrote:

> 
> 
> On Mon, 23 Jul 2007, Sergei Gorelkin wrote:
> 
> > Hello,
> > 
> > I have written - and submit for your judgement - a small utility that allows
> > to use {$R *.dfm} directives on Windows. It is somewhat like a fpcres utility
> > that exists for ELF platforms.
> > 
> > How to use:
> > 
> > 1) compile :)
> > 2) rename windres.exe from binutils package to windres1.exe
> > 3) replace windres.exe with compiled binary.
> > 
> > How does it work:
> > 
> > It serves as a proxy for windres.exe. If input file is not a component stream,
> > it simply passes that file to original windres. Otherwise, it optionally
> > converts text stream into binary format, then dumps it to a temporary file
> > (.rc format that contains a hex dump) and passes that temporary file to
> > original windres to compile. Ideally it could write COFF file directly, but
> > now it is just a proof of concept.
> > 
> > Is such thing useful and can it be eventually included into mainstream?
> 
> Yes. The crossfpc people have made a similar tool. I think we should add
> an option to the compiler which specifies the name of the resource compiler
> tool - this way we avoid the renaming issue.
> 
> I'll discuss it on core, and get back to you.

Hi,

The name of the resource linker can now be set with -FR<x>. 
This binary should transform a resource file file to a .o file.

You can also specify the name of the recource compiler with -FC. 
This binary should transform a resource source file to a .o file.
(normally used for .rc files)

Both options expect the name of a binary (will be searched in the PATH), 
and the binary should handle the same options as windres does. 

Can you test this using the latest SVN ? (at least revision 8164)

Michael.



More information about the fpc-devel mailing list