Alexandre Julliard wrote:
I think the right way is to get rid of the #ifdefs, but not by pushing
them into the .spec.c file but my making the target a run-time
option. I've been meaning to do this for a while now, I was just
waiting for someone to actually need that feature ;-)

Fantastic! Those ifdefs have been driving me crazy. After adding support in winebuild for hppa, I found the source code extremely difficult to follow. Cutting out most of the ifdefs should make it much more manageable.

So we could do something like this: Add a --target= option to both winegcc and winebuild. If present, winegcc would pass that option through to winebuild. The target parameter could be a standard cpu-mfr-opsys system triplet like config.guess generates. Without this --target option, the behavior is unchanged. If the --target=foo is present, we generate assembler code for the 'foo' architecture.

Additionally, we could set the default compiler to foo-gcc, linker to foo-ld, (and same for g++, nm, cpp, whatever else we use). These are the default filenames for cross-compilers, so I think it would make sense to use these when the target is specified. These could be overridden by command line args (there's already an --ld-cmd, so we could add --cc-cmd, --cxx-cmd, etc).

Eric

Reply via email to