[comp.sys.3b1] Compiler without defines

jms@informix.com (John Stephens) (03/27/91)

Configuration: 3.51m, 2M/67M, combo card with 512K, ethernet (disconnected)

Suddenly, my compiler can onnly locate the pre-defined symbol unix.
MC68000, SysV, etc have disappeared.

I looked at my libraries and noticed that they had been changed at about the
same time as the combo board and its driver were installed. I have since 
deinstalled and reinstalled the compiler, and the problem persists.  this
is keeping me from compiling !!

Has anyone else run across this oddity ?

Jack




-- 
 -------------------------------------------------------------------------
| Jack Stephens      ..!{uunet|pyramid}!infmx!jms --or-- ..!jack!wzlr!jms |
| Systems Programmer "Into the valley of Death rode the 600...            |
| Informix Software      which allowed them to use the carpool lane."     |

bamford@cbnewsd.att.com (harold.e.bamford) (03/28/91)

In article <jms.670036088@wits-end> jms@informix.com (John Stephens) writes:
>Configuration: 3.51m, 2M/67M, combo card with 512K, ethernet (disconnected)
>
>Suddenly, my compiler can only locate the pre-defined symbol unix.
>MC68000, SysV, etc have disappeared.

The compiler doesn't define MC68000 or SysV.  These are defined on
the compiler command line via the -D directives.  If you use make,
with the standard includes (Makepre.h, Makepost.h ???) then the CC
or CC_CMD macro will have these defines.

Try compiling with a makefile:

	include Makepre.h

	prog: prog.c prog.h
		$(CC) prog.c

	include Makepost.h

The exact names are from memory, but you get the idea, I'll bet.

Good luck.

-- Harold

john@chance.UUCP (John R. MacMillan) (03/28/91)

|Suddenly, my compiler can onnly locate the pre-defined symbol unix.
|MC68000, SysV, etc have disappeared.

I presume you mean the cpp (preprocessor) symbols?  /lib/cpp defines
unix, and mc68k (and __LINE__ and __FILE__); if you run strings on
/lib/cpp, you should see these.  /bin/cc by default defines mc68k32,
mc68k and mc68010 when it invokes cpp; you can see this by trying
"/bin/cc -# -E foo.c".  SysV is usually defined in the Makefile of
whatever you're trying to build, although SYSV is unconditionally
defined in /usr/include/curses.h (enough to my annoyance that it is no
longer true on chance).

If you mean symbols that should be resolved by ld, then I'm afraid I'm
not sure what you mean.

|I looked at my libraries and noticed that they had been changed at about the
|same time as the combo board and its driver were installed.

The Install.sh script moves libc.a, libm.a, libmath.a, ifile.0413,
crt0.o and ld out of the way when it does installs, so that's why the
date changes. (This makes it difficult to install library upgrades,
and is one reason I install things ``manually'' by running the
package's Install script after I've looked it over to see what it
wants to do.)

One preprocessor symbol you might notice missing if you run lint, is
the symbol ``lint''!  This is because of what is IMHO a bug in
/bin/cc.  If you do a strings on /bin/cc, you'll notice the getopt
string, and in it "C:", ie. the -C flag takes an argument.  Well, the
-C flag to cpp does NOT take an argument, and when lint invokes cc it
does not supply an argument.  So the argument after, which happens to
be ``-Dlint'', disappears.  Two fixes: change lint to put a bogus
argument after -C, or patch the binary of /bin/cc.