"Dimitrie O. Paun" dpaun@rogers.com writes:
Collapse -w16 into -O as res16.
-w16 can apply to all modes, not only .res, so you would need to support 'asm16' and 'hdr16' too. It seems cleaner to keep it as a separate option.
On January 9, 2003 02:23 pm, Alexandre Julliard wrote:
-w16 can apply to all modes, not only .res, so you would need to support 'asm16' and 'hdr16' too. It seems cleaner to keep it as a separate option.
Yes, I know, but we officially don't support Win16. We only need 16-bit support in a handful of places within wine, and there we use only .res.
We make a big point about not supporting Win16 (headers, libs, etc. -- and I like that! :)), it seems a bit confusing to clutter the options (which are already too many) with it.
I mean, come on -- who would use it? :) Win16 has been dead for so many years, I doubt there are that many Win16 programs in existance, and of those, who would use wrc?!?
"Dimitrie O. Paun" dpaun@rogers.com writes:
Yes, I know, but we officially don't support Win16. We only need 16-bit support in a handful of places within wine, and there we use only .res.
Again, wrc can be useful for more than simply building Wine. Sure, that feature is not going to be used often, and we probably wouldn't implement it today if it didn't exist. But it's here, it works, and it can potentially be useful to someone someday; there's nothing to gain by removing it.
On January 9, 2003 04:14 pm, Alexandre Julliard wrote:
But it's here, it works, and it can potentially be useful to someone someday; there's nothing to gain by removing it.
I really wonder how it can be of use to anyone. There is stuff to gain: simplicity, less code to maintain and support. But fine, if you don't want it, here's the patch with -w16 in:
ChangeLog Added windres compatibility switches: -v, --[no-]use-temp-file. New -h option to conform to standard practice (and MS' rc). Updated documentation, minor option parsing cleanup.
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" @@ -110,13 +111,13 @@ " -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:W"; #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"); @@ -434,17 +444,12 @@ case 't': indirect = 1; break; + case 'v': + debuglevel = DEBUGLEVEL_CHAT; + break; case 'V': printf(version_string); exit(0); 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