Description
The C compiler issued with AT&T Unix.
This compiler doesn't have any identifying macros. The assumption was "Well, you're on AT&T System V, so you must be using AT&T's C compiler."
Porting Bases
AT&T Unix was ported to a few architectures. Below is a list of known porting bases that AT&T referenced in sources and/or documentation. This might help in identifying the compiler.
| SVR1 | PDP-11 and VAX |
| SVR2 | VAX, 3B2, and NS32000 |
| SVR3 | 3B2 |
| SVR4 | Intel x86 and SPARC |
Macros
| Identification | unix | SVR1 | Defined on all Unix systems |
| Identification | pdp11 | SVR1 | Defined on PDP-11 hardware |
| Identification | vax | SVR1 | Defined on VAX hardware |
| Identification | m68k | SVR1 | Defined in System V/68 R1 |
| Identification | u370 | SVR1 | Defined on VM/370 UTS I presume |
| Identification | u3b | SVR2 | Defined on 3B hardware |
| Identification | u3b5 | SVR2 | Defined on 3B5 hardware |
| Identification | ns32000 | SVR2 | Defined on NS32K hardware |
| Identification | iAPX286 | SVR2 | Defined on Microport's System V/AT |
| Identification | u3b2 | SVR3 | Defined on AT&T 3B2 hardware |
| Identification | u3b20d | SVR3 | Defined on AT&T 3B20 hardware |
| Identification | u3b15 | SVR3 | Defined on AT&T 3B15 hardware |
| Identification | sysV68 | SVR3 | Defined on System V/68 Release 3 |
| Identification | clipper | SVR3 | Defined on Intergraph CLIX |
| Identification | m88k | SVR3 | Opus System V.3 for M88000 and DG/UX |
| Identification | i386 | SVR4 | Defined on Intel hardware |
| Identification | sparc | SVR4 | Defined on SPARC hardware |
References to other things -- gcos, interdata, tss etc -- in /lib/cpp seem to me to be efforts to port the C compiler to those systems, possibly for the aim of cross-compiling Unix. I am going to ignore those definitions for now.
Conclusion
It is not easily possible to detect the compiler or the version of AT&T System V from preprocessor macros alone.
The ideal solution is to use a script that can invoke uname and create custom definitions.
Notes
These sorts of shenanigans continue with all derivatives of System V Release 3.
SCO System V Release 5 also slightly conflates this. I think the mentality was "This is Unix, we do not need to define anything that identifies what sort of Unix, because this is Unix."
AT&T System V was a mess.