This patch obsoletes the previous one named: wrc: -v, --[no-]use-temp-file ChangeLog Added windres compatibility switches: -v, --[no-]use-temp-file. New -h option to conform to standard practice (and MS' rc). Collapse -w16 into -O as res16. Updated documentation, minor option parsing cleanup. Index: ./dlls/gdi/Makefile.in =================================================================== RCS file: /var/cvs/wine/dlls/gdi/Makefile.in,v retrieving revision 1.42 diff -u -r1.42 Makefile.in --- ./dlls/gdi/Makefile.in 9 Jan 2003 00:03:53 -0000 1.42 +++ ./dlls/gdi/Makefile.in 9 Jan 2003 05:25:25 -0000 @@ -87,6 +87,6 @@ $(LDPATH) $(WINEBUILD) $(DEFS) -H 65520 -o $@ -M $(MODULE) -r version16.res --spec $(SRCDIR)/gdi.exe.spec version16.res: version16.rc - $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/version16.rc + $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/version16.rc ### Dependencies: Index: ./dlls/kernel/Makefile.in =================================================================== RCS file: /var/cvs/wine/dlls/kernel/Makefile.in,v retrieving revision 1.53 diff -u -r1.53 Makefile.in --- ./dlls/kernel/Makefile.in 9 Jan 2003 00:03:53 -0000 1.53 +++ ./dlls/kernel/Makefile.in 9 Jan 2003 05:25:50 -0000 @@ -56,6 +56,6 @@ $(LDPATH) $(WINEBUILD) $(DEFS) -N kernel -o $@ -M $(MODULE) -r version16.res --spec $(SRCDIR)/krnl386.exe.spec version16.res: version16.rc - $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/version16.rc + $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/version16.rc ### Dependencies: Index: ./dlls/shell32/Makefile.in =================================================================== RCS file: /var/cvs/wine/dlls/shell32/Makefile.in,v retrieving revision 1.59 diff -u -r1.59 Makefile.in --- ./dlls/shell32/Makefile.in 9 Jan 2003 00:03:53 -0000 1.59 +++ ./dlls/shell32/Makefile.in 9 Jan 2003 05:25:59 -0000 @@ -65,7 +65,7 @@ # Special rules for 16-bit resource files version16.res: version16.rc - $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/version16.rc + $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/version16.rc shell.spec.c: shell.spec version16.res $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -M $(MODULE) -r version16.res --spec $(SRCDIR)/shell.spec Index: ./dlls/user/Makefile.in =================================================================== RCS file: /var/cvs/wine/dlls/user/Makefile.in,v retrieving revision 1.61 diff -u -r1.61 Makefile.in --- ./dlls/user/Makefile.in 9 Jan 2003 00:03:53 -0000 1.61 +++ ./dlls/user/Makefile.in 9 Jan 2003 05:26:16 -0000 @@ -114,12 +114,12 @@ $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -M $(MODULE) -r resources/mouse.res --spec $(SRCDIR)/mouse.spec resources/display.res: resources/display.rc - $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/resources/display.rc + $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/resources/display.rc resources/mouse.res: resources/mouse.rc - $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/resources/mouse.rc + $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/resources/mouse.rc resources/version16.res: resources/version16.rc - $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -w16 $(SRCDIR)/resources/version16.rc + $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -O res16 $(SRCDIR)/resources/version16.rc ### Dependencies: Index: tools/wrc/wrc.c =================================================================== RCS file: /var/cvs/wine/tools/wrc/wrc.c,v retrieving revision 1.23 diff -u -r1.23 wrc.c --- tools/wrc/wrc.c 9 Jan 2003 00:03:53 -0000 1.23 +++ tools/wrc/wrc.c 9 Jan 2003 05:17:15 -0000 @@ -77,19 +77,19 @@ #define INCLUDEDIR "/usr/local/include/wine" #endif +#ifdef WORDS_BIGENDIAN +#define ENDIAN "big" +#else +#define ENDIAN "little" +#endif + static char usage[] = "Usage: wrc [options...] [infile[.rc|.res]] [outfile]\n" " -a n Alignment of resource (win16 only, default is 4)\n" " -A Auto register resources (only with gcc 2.7 and better)\n" " -b Create an assembly array from a binary .res file\n" " -B x Set output byte-order x={n[ative], l[ittle], b[ig]}\n" - " (win32 only; default is n[ative] which equals " -#ifdef WORDS_BIGENDIAN - "big" -#else - "little" -#endif - "-endian)\n" + " (win32 only; default is " ENDIAN "-endian)\n" " -c Add 'const' prefix to C constants\n" " -C cp Set the resource's codepage to cp (default is 0)\n" " -d n Set debug level to 'n'\n" @@ -98,6 +98,7 @@ " -E Preprocess only\n" " -F target Ignored for compatibility with windres\n" " -g Add symbols to the global c namespace\n" + " -h Prints this summary.\n" " -i file The name of the input file.\n" " -I path Set include search dir to path (multiple -I allowed)\n" " -J Do not search the standard include path\n" @@ -105,13 +106,13 @@ " -m Do not remap numerical resource IDs\n" " -N Do not preprocess input\n" " -o file Output to file (default is infile.[res|s|h]\n" - " -O format The output format: one of `res', 'asm', 'hdr'.\n" + " -O format The output format: one of `res', 'res16', 'asm', 'hdr'.\n" " -p prefix Give a prefix for the generated names\n" " -s Add structure with win32/16 (PE/NE) resource directory\n" " -t Generate indirect loadable resource tables\n" " -T Generate only indirect loadable resources tables\n" + " -v Enable verbose mode.\n" " -V Print version and exit\n" - " -w 16|32 Select win16 or win32 output (default is win32)\n" " -W Enable pedantic warnings\n" #ifdef HAVE_GETOPT_LONG "The following long options are supported:\n" @@ -123,8 +124,10 @@ " --nostdinc Synonym for -J.\n" " --define Synonym for -D.\n" " --language Synonym for -l.\n" + " --use-temp-file Ignored for compatibility with windres.\n" + " --no-use-temp-file Ignored for compatibility with windres.\n" " --preprocessor Specify the preprocessor to use, including arguments.\n" - " --help Prints a usage summary.\n" + " --help Synonym for -h.\n" " --version Synonym for -V.\n" #endif "Input is taken from stdin if no sourcefile specified.\n" @@ -135,11 +138,8 @@ " * 0x08 Preprocessor messages\n" " * 0x10 Preprocessor lex messages\n" " * 0x20 Preprocessor yacc trace\n" - "The -o option only applies to the final destination file, which is\n" - "in case of normal compile a .s file. You must use the '-H header.h'\n" - "option to override the header-filename.\n" "If no input filename is given and the output name is not overridden\n" - "with -o and/or -H, then the output is written to \"wrc.tab.[sh]\"\n" + "with -o, then the output is written to \"wrc.tab.[sh]\"\n" ; char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n" @@ -272,6 +272,8 @@ static void rm_tempfile(void); static void segvhandler(int sig); +static const char* short_options = + "a:AbB:cC:d:D:eEF:ghH:i:I:Jl:LmnNo:O:p:rstTvVW"; #ifdef HAVE_GETOPT_LONG static struct option long_options[] = { { "input", 1, 0, 'i' }, @@ -282,9 +284,11 @@ { "nostdinc", 0, 0, 'J' }, { "define", 1, 0, 'D' }, { "language", 1, 0, 'l' }, - { "preprocessor", 1, 0, 1 }, - { "help", 0, 0, 2 }, { "version", 0, 0, 'V' }, + { "help", 0, 0, 'h' }, + { "preprocessor", 1, 0, 1 }, + { "use-temp-file", 0, 0, 2 }, + { "no-use-temp-file", 0, 0, 3 }, { 0, 0, 0, 0 } }; #endif @@ -320,9 +324,9 @@ } #ifdef HAVE_GETOPT_LONG - while((optc = getopt_long(argc, argv, "a:AbB:cC:d:D:eEF:ghH:i:I:Jl:LmnNo:O:p:rstTVw:W", long_options, &opti)) != EOF) + while((optc = getopt_long(argc, argv, short_options, long_options, &opti)) != EOF) #else - while((optc = getopt(argc, argv, "a:AbB:cC:d:D:eEF:ghH:i:I:Jl:LmnNo:O:p:rstTVw:W")) != EOF) + while((optc = getopt(argc, argv, short_options)) != EOF) #endif { switch(optc) @@ -331,8 +335,10 @@ fprintf(stderr, "--preprocessor option not yet supported, ignored.\n"); break; case 2: - printf(usage); - exit(0); + fprintf(stderr, "--use-temp-file option not yet supported, ignored.\n"); + break; + case 3: + fprintf(stderr, "--no-use-temp-file option not yet supported, ignored.\n"); break; case 'a': alignment = atoi(optarg); @@ -387,6 +393,9 @@ case 'g': global = 1; break; + case 'h': + printf(usage); + exit(0); case 'i': if (!input_name) input_name = strdup(optarg); else error("Too many input files.\n"); @@ -418,6 +427,7 @@ break; case 'O': if (strcmp(optarg, "res") == 0) output_type = output_res; + else if (strcmp(optarg, "res16") == 0) { output_type = output_res; win32 = 0; } else if (strcmp(optarg, "asm") == 0) output_type = output_asm; else if (strcmp(optarg, "hdr") == 0) output_type = output_hdr; else error("Output format %s not supported.", optarg); @@ -434,17 +444,12 @@ case 't': indirect = 1; break; + case 'v': + debuglevel = DEBUGLEVEL_CHAT; + break; case 'V': printf(version_string); exit(0); - break; - case 'w': - if(!strcmp(optarg, "16")) - win32 = 0; - else if(!strcmp(optarg, "32")) - win32 = 1; - else - lose++; break; case 'W': pedantic = 1; Index: tools/wrc/wrc.man =================================================================== RCS file: /var/cvs/wine/tools/wrc/wrc.man,v retrieving revision 1.9 diff -u -r1.9 wrc.man --- tools/wrc/wrc.man 9 Jan 2003 00:03:53 -0000 1.9 +++ tools/wrc/wrc.man 9 Jan 2003 05:20:08 -0000 @@ -79,6 +79,9 @@ Add symbols to the global C namespace. This makes all symbols available for linking by other modules. .TP +.I \-h +Prints a summary message and exits. +.TP .I \-I path Add \fIpath\fR to include search directories. \fIPath\fR may contain multiple directories, separated with ':'. It is allowed to specify @@ -120,7 +123,7 @@ compilation mode. .TP .I \-O format -Sets the output format. \fformat\fR can one of 'res', 'asm', and 'hdr' +Sets the output format. \fformat\fR can one of 'res', 'res16', 'asm', and 'hdr' to generate a \fB.res\fR, \fB.s\fR, or \fB.h\fR file respectively. If not specified, \fBwrc\fR assumes 'res'. .TP @@ -141,9 +144,6 @@ .TP .I \-V Print version end exit. -.TP -.I \-w 16|32 -Select win16 or win32 output. Default is win32. .TP .I \-W Enable pedantic warnings. Notably redefinition of #define statements can -- Dimi.