> Whatever -- the point is that rewriting and reinvention of
> the wheel for the
> single purpose that it is more convenient to have it included
> in wine is a
> bit silly. We require a C compiler (for now we require gcc
> with is OK IMO),
> we require a make program (don't know if gmake is required
> though),
Solaris Make works fine.
> perl,
Perl is not required just to compile Wine.
It is only required for certain development issues.
> yacc, lex, etc. It would be simply silly to reimplement all
OK. I have bison and flex install on my Solaris box, but ...
> this programs
> simply because some systems don't have them. They are free on the net,
> download them.
... there is no need to add yet another depency that is totally unnessary.
> Also, whether requiring GNU cpp is reasonable or not is another rather
> artificial question. It is just a tool. It is similar but not
> identical to
> the standard cpp. So, if we require one of its particular
> features, than we
> require a different tool from the standard cpp. Call it a
> different name if
> that helps you. Just as we require perl. So, you are not
> going to suggest
> that we do the perl stuff in cpp (I hope). In other words, I
> don't see what
> your problem is, if we were to require GNU cpp. Fortunately,
> standard cpp
> seems to be enough, but if we were to require GNU cpp, what
> would be the
> (real) problem???
It is not a real problem but I prefer to minmize the depencies
whenever possible. You have heard the story about
"The straw that broke the {ass,donkey,mule}'s back", haven't you?
Anyway, I have do some experimentation and I found out that
this simple patch implements a pre wrc call to the C preprocessor.
Works with both Solaris C/CPP and GNU C/CPP.
Index: wine/Make.rules.in
===================================================================
RCS file: /home/wine/wine/Make.rules.in,v
retrieving revision 1.32
diff -u -u -r1.32 Make.rules.in
--- wine/Make.rules.in 2000/03/19 12:08:09 1.32
+++ wine/Make.rules.in 2000/03/20 12:29:13
@@ -153,19 +153,19 @@
$(CC) -c -o $*.o $<
.rc.s:
- $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<
+ $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -xc $< | $(WRC)
$(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -o $*.s
.rc.h:
- $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -nh $<
+ $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -xc $< | $(WRC)
$(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -nh -o $*.s
.rc.res:
- $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -r $<
+ $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -xc $< | $(WRC)
$(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -r -o $*.s
.res.s:
- $(WRC) $(WRCFLAGS) $(WRCEXTRA) -b $<
+ $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -xc $< | $(WRC)
$(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -b -o $*.s
.res.h:
- $(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
+ $(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -xc $< | $(WRC)
$(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -bnh -o $*.s
.spec.spec.c:
$(BUILD) @BUILDFLAGS@ -o $@ -spec $<
Index: wine/tools/wrc/parser.l
===================================================================
RCS file: /home/wine/wine/tools/wrc/parser.l,v
retrieving revision 1.8
diff -u -u -r1.8 parser.l
--- wine/tools/wrc/parser.l 2000/03/19 12:44:46 1.8
+++ wine/tools/wrc/parser.l 2000/03/20 12:29:19
@@ -59,6 +59,7 @@
%x pp_incl
%x pp_def
%x pp_undef
+%x pp_ident
%x pp_if
%x pp_ifdef
%x pp_ifndef
@@ -449,6 +450,14 @@
/* #undef handling */
^{ws}*#{ws}*undef{ws}* push_to(pp_undef);
<pp_undef>{cident} {
+ del_define(yytext);
+ pop_start();
+ /*push_to(pp_ignore);*/
+ }
+
+ /* #ident handling */
+^{ws}*#{ws}*ident{ws}* push_to(pp_ident);
+<pp_ident>.* {
del_define(yytext);
pop_start();
/*push_to(pp_ignore);*/