Xref: utzoo comp.lang.c:32782 comp.unix.questions:26132 Path: utzoo!attcan!uunet!bu.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!ucsd!ucbvax!unisoft!rembo From: rembo@unisoft.UUCP (Tony Rems) Newsgroups: comp.lang.c,comp.unix.questions Subject: Re: C Compiler under Unix System VR4 Message-ID: <3158@unisoft.UUCP> Date: 11 Oct 90 04:29:36 GMT References: <125@alfrat.uucp> Reply-To: rembo@unisoft.UUCP (Tony Rems) Lines: 54 In article <125@alfrat.uucp> roy@alfrat.UUCP (Roy Phillips) writes: >The standard header files supplied with AT&T's UNIX System V Release 4.2 >contains pre-processor commands such as the following: > > #if #machine(pdp11) > >The C preprocessor supplied has no problems with this, but my preferred C >compiler, gcc, objects, even in it's '-ansi' mode. So I guess it's >not ANSI C. > >My questions are:: > >1. Does anyone know about this pre-processor syntax? and is it > supposed to be standard on SysVR4? > >2. Assuming yes to the above, is there a patch for 'gcc' to cater for it? > >As well as the above, the organisation of the library directory has changed >somewhat - 'gcc' can't find 'crt0.o', which is now in /usr/ccs/lib, instead >of /usr/lib (the same goes for most of the libraries). > 1. Yes, this is standard in the C Issue 5.0 which is provided with SVR4. This works through a pre-processor function that works like this: #define pdp11 1 #assert machine(pdp11) so, doing '#if #machine(pdp11)' (assuming the above declaration), indicates that the assertion is true. 2. I believe there is currently negotiation underway for GNU to work on a version of gcc and gdb for SVR4. As for you compatibility problem, I suggest symbolic links as a temporary hack. AT&T has decided that all the language development tools belong under /usr/ccs. Depending on what needs you have, you can #ifdef them out if you really need to use gcc. This way you can do something like: #ifdef ATT_CC #if #machine(pdp11) #else #ifdef GCC #do whatever checks you might need #endif It's a hack, but it should solve your problems. -Tony