From: Casper Hornstrup
From: Ge van Geldorp
I'm running into a problem importing the latest Wine winmm
sources. The resource file winmm_res.rc now contains Unicode
strings (in the CORE and VIDEODISC resources). Windres from
binutils 2.15.94 doesn't like those.
I'm not sure how to solve this. Any ideas?
Use wrc?
Ok, we can do that, but it won't be pretty....
First of all, we need to run wrc on the host, meaning that when
cross-compiling under Linux wrc needs to be a Linux executable. wrc depends
on some Unicode stuff. We could replace it with MultiByteToWideChar et al
when running on Windows, but that won't work for Linux. The easiest way
around that is to import the Wine Unicode library, which Thomas just managed
to remove....
Next problem is that we use #include_next a lot in our headers, especially
for Wine stuff. The built-in preprocessor in wrc doesn't understand that.
Luckily, Filip had a patch floating around in his tree implementing
#include_next.
But the built-in preprocessor can't find "standard" include files like
stdlib.h on Windows. On Linux it's no problem, just go to /usr/include.
There's no such standard place on Windows. So, the solution I opted for was
to use "gcc -E" to do the preprocessing. gcc "knows" where to find
its
include files.
Final problem is that wrc doesn't output .coff files, it creates "MSVC
.res"
files. Luckily, windres can convert those to .coff files...
So, the final solution looks like this:
- Preprocess .rc file using "gcc -E" to create .rci file
- Run wrc on .rci file to create .res file
- Run windres on .res file to create .coff file
As I said, it works but it ain't pretty...
I've created a patch file ftp://ftp.geldorp.nl/pub/ReactOS/wrc.patch and a
zip file ftp://ftp.geldorp.nl/pub/ReactOS/wrc.zip. Unpack the zip file in
reactos/tools/wrc and apply the patch. "winedll" targets will then use wrc.
If nobody objects, I'll commit this weekend.
Gé van Geldorp.