[M3devel] TARGET_OS, TARGET_PROCESSOR, TARGET_ENDIAN?
Jay K
jay.krell at cornell.edu
Wed Jul 15 14:01:43 CEST 2009
I propose there be quake variables, set by by cm3 in Target.m3 with the possible names/values:
TARGET_OS: ?TARGET_KERNEL, ?TARGET_LIBC (which /sort of/ makes sense but surely wouldn't be the conclusion)
FREEBSD, NETBSD, OPENBSD, DARWIN, LINUX, SOLARIS, NT, CYGWIN, INETRIX, TRU64 (OSF1?), VMS, HPUX, IRIX, AIX, HERD?, GNUHERD?, GNU??, PLAN9?, MACOS?, DJGPP?, MSDOS?
TARGET_PROCESSOR: ?TARGET_CPU, ?TARGET_ARCHITECTURE, ?TARGET_PROCESSOR_ARCHITECTURE
I386, AMD64, SPARC, SPARC64, PPC, PPC64, ARM, MIPS, MIPS64, ALPHA, IA64, M68K?, SH3?, SH4? (I doubt these last three will ever be supported.)
I grant that this is somewhat redundant with WORD_SIZE. You could just have X86, SPARC, PPC, MIPS, and dispense with AMD64, SPARC64, PPC64, MIPS64.
TARGET_ENDIAN:
BIG, LITTLE
This would allow for much smoother maintenance of a few m3makefiles, since a lot of stuff keyed by TARGET need only be keyed by one of these factors.
I also propose, maybe, there be similar HOST_ variables where above I have TARGET_. Though these
have far less utility.
If I didn't already introduce it, HOST_OSTYPE is about the right thing here -- POSIX or WIN32.
I also put in HOST which draws from the same values as TARGET, really just as a default for TARGET when probing for config files.
I also grant that I'm ignoring some harder to pin down problems such as "TARGET_ABI" -- 32bit MIPS has two, and IA64 has a surprising number -- there are actually 32bit ABIs on IA64_HPUX, we'd probably never support them.
Ideally but not always, TARGET = TARGET_PROCESSOR + TARGET_OS?
- Jay
More information about the M3devel
mailing list