WRC(1)

πŸ“¦ version 6.0, in ubuntu jammy

πŸ’– WRC(1) β€” the Wine Resource Compiler, bestie edition πŸ’–

okay so this is wrc from the Wine Developers Manual, and it's genuinely one of my faves. sit down, hydrate, let's get into it 🫢


✨ NAME ✨

wrc β€” the Wine Resource Compiler. that's it, that's the girl. πŸ‘‘


🌸 SYNOPSIS 🌸

wrc [options] [inputfile...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she DO? wrc compiles resources from inputfile into win16 and win32 compatible binary format. iconic behavior honestly.

the source file gets preprocessed with a builtin ANSI-C compatible preprocessor before the resources are compiled. (go look at PREPROCESSOR below, i gotchu.)

wrc takes a series of inputfile as argument. if you give her no inputfile at all, she reads the resources from standard input. and if you don't pick an output file with -o, she writes the output to inputfile.res with .rc stripped, or to wrc.tab.res if no inputfile was given. no cap.


πŸ’… OPTIONS πŸ’…

  • -b, --target=cpu-manufacturer[-kernel]-os β€” specify the target CPU and platform the generated code is gonna be built on. the target spec is in the standard autoconf format, like what config.sub returns. ✨
  • -D, --define=id[=val] β€” define preprocessor identifier id to (optionally) the value val. see also PREPROCESSOR below.
  • --debug=nn β€” set debug level to nn. the value is a bitmask, and it's giving very much "pick your chaos":
    • 1 = verbose
    • 2 = dump internals
    • 4 = resource parser trace
    • 8 = preprocessor messages
    • 16 = preprocessor scanner
    • 32 = preprocessor parser trace
  • --endianness=e β€” Win32 only; sets the output byte-ordering, where e is one of n[ative], l[ittle] or b[ig]. only resources in source-form can be reordered. native ordering depends on the system wrc was built on. you can peep the native ordering by typing wrc -h. 🧚
  • -E β€” preprocess only. output goes to standard output if no outputfile was selected. the output is compatible with what gcc would generate.
  • -h, --help β€” prints a summary message and exits. the polite queen.
  • -i, --input=file β€” the name of the input file. if you don't use this option, wrc uses the first non-option argument as the input file name. and if there are no non-option arguments at all? she reads from standard input. πŸ’œ
  • -I, --include-dir=path β€” add path to the include search directories. path can contain multiple directories, separated with :. you're allowed to specify -I multiple times. include files are searched in the order the -I options were specified. the search is compatible with gcc, where <> quoted filenames are searched exclusively via the -I set path, whereas the "" quoted filenames are first tried to be opened in the current directory. also, resource statements with file references are located in the same way. πŸ”
  • -J, --input-format=format β€” sets the input format. valid options are rc or rc16. setting the input to rc16 disables the recognition of win32 keywords. ⚠️
  • -l, --language=lang β€” set default language to lang. default is the neutral language 0 (i.e. "LANGUAGE 0, 0").
  • -m16, -m32, -m64 β€” generate resources for 16-bit, 32-bit or 64-bit platforms respectively. the only difference between 32-bit and 64-bit is whether the _WIN64 preprocessor symbol is defined. 🌈
  • --nls-dir=dir β€” specify the directory to search for the NLS files containing the codepage mapping tables.
  • --nostdinc β€” do not search the standard include path, look for include files only in the directories explicitly specified with the -I option.
  • --no-use-temp-file β€” ignored for compatibility with windres. yeah she's just standing there, ignore her πŸ’€
  • -o, -fo, --output=file β€” write output to file. default is inputfile.res with .rc stripped, or wrc.tab.res if input is read from standard input.
  • -O, --output-format=format β€” sets the output format. the supported formats are po, pot, res, and res16. if this option isn't specified, the format defaults to res. in po mode, if an output file name is specified it must match a known language name, like en_US.po; only resources for the specified language are output. if no output file name is specified, a separate .po file is created for every language encountered in the input. πŸŽ€
  • --pedantic β€” enable pedantic warnings. notably, redefinition of #define statements can be discovered with this option. πŸ‘€
  • --po-dir=dir β€” enable the generation of resource translations based on mo files loaded from the specified directory. that directory must follow the gettext convention β€” in particular it must contain one .mo file for each language, and a LINGUAS file listing the available languages.
  • -r β€” ignored for compatibility with rc. another one just vibing πŸ™ˆ
  • --preprocessor=program β€” this option may be used to specify the preprocessor to use, including any leading arguments. if not specified, wrc uses its builtin processor. to disable preprocessing, use --preprocessor=cat.
  • --sysroot=dir β€” prefix the standard include paths with dir.
  • --utf8, -u β€” set the default codepage of the input file to UTF-8. ✨
  • -U, --undefine=id β€” undefine preprocessor identifier id. please note that only macros defined up to this point are undefined by this command. however, these include the special macros defined automatically by wrc. see also PREPROCESSOR below.
  • --use-temp-file β€” ignored for compatibility with windres. (the third one. she's also just standing there.)
  • -v, --verbose β€” turns on verbose mode (equivalent to -d 1).
  • --version β€” print version and exit. 🫑

🧚 PREPROCESSOR 🧚

the preprocessor is ANSI-C compatible with some of the extensions of the gcc preprocessor. she's well-read, okay?

the preprocessor recognizes these directives: #include, #define (both simple and macro), #undef, #if, #ifdef, #ifndef, #elif, #else, #endif, #error, #warning, #line, # (both null- and line-directive), #pragma (ignored), #ident (ignored).

the preprocessor sets by default several defines:

  • RC_INVOKED β€” set to 1
  • __WRC__ β€” Major version of wrc
  • __WRC_MINOR__ β€” Minor version of wrc
  • __WRC_PATCHLEVEL__ β€” Patch level

Win32 compilation mode also sets _WIN32 to 1.

special macros __FILE__, __LINE__, __TIME__ and __DATE__ are also recognized and expand to their respective equivalent. πŸ’«


🌈 LANGUAGE SUPPORT 🌈

language, version and characteristics can be bound to all resource types that have inline data, such as RCDATA. this is an extension to Microsoft's resource compiler, which lacks this support completely. only VERSIONINFO cannot have version and characteristics attached, but languages are propagated properly if you declare it correctly before the VERSIONINFO resource starts.

example:

1 RCDATA DISCARDABLE
LANGUAGE 1, 0
VERSION 312
CHARACTERISTICS 876
{
     1, 2, 3, 4, 5, "and whatever more data you want"
     '00 01 02 03 04 05 06 07 08'
}

πŸ‘‘ AUTHORS πŸ‘‘

wrc was written by Bertho A. Stultiens and is a nearly complete rewrite of the first wine resource compiler (1994) by Martin von Loewis. additional resource-types were contributed by Ulrich Czekalla and Albert den Haan. many cleanups by Dimitrie O. Paun in 2002-2003. bugfixes have been contributed by many Wine developers. we love a collaborative moment fr fr 🫢


πŸ’€ BUGS πŸ’€

  • the preprocessor recognizes variable argument macros, but does not expand them correctly.
  • error reporting should be more precise, as currently the column and line number reported are those of the next token.
  • default memory options should differ between win16 and win32.

there is no support for:

  • RT_DLGINCLUDE, RT_VXD, RT_PLUGPLAY and RT_HTML (unknown format)
  • PUSHBOX control is unsupported due to lack of original functionality.

fonts are parsed and generated, but there is no support for the generation of the FONTDIR yet. the user must supply the FONTDIR resource in the source to match the FONT resources.

bugs can be reported on the Wine bug tracker. πŸ›

⭐ AVAILABILITY ⭐

wrc is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters.


πŸ”₯ SEE ALSO πŸ”₯

  • wine(1),
  • Wine documentation and support.

and that's the whole page bestie, you ate it up πŸ’… this was Wine 6.0, October 2005 β€” go compile something cute, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from