[comp.lang.c++] Making AT&T C++ for Sun 3

ken@ektools.UUCP (Kenneth J. Lester) (05/18/88)

This probably has been discussed before, but could someone tell 
me how to make AT&T C++ version 1.2.1 for the Sun 3 family of
computers (O/S 3.x).  It makes just fine, but when executed
via CC, cfront runs and never returns.  I've run the bsd.fix
script, and have tried compiling it with compilers gcc, and Sun 
cc compilers from Sun O/S 3.2 and 3.5.

I know I'm doing something wrong but I followed the same make
procedure on a Vax running Ultrix 2.2 and it works just fine.
(Note Ultrix 2.2 is a BSD derivative).

If you can help with ideas or answers, it would be appreciated.

-- 
USPS:   EASTMAN KODAK COMPANY, 901 Elmgrove Rd., Rochester, NY 14650
VOICE:  716 726-4286
UUCP:   rochester!kodak!lester 

jim@cs.strath.ac.uk (Jim Reid) (05/20/88)

In article <1231@ektools.UUCP> ken@ektools.UUCP (Kenneth J. Lester) writes:
>This probably has been discussed before, but could someone tell 
>me how to make AT&T C++ version 1.2.1 for the Sun 3 family of
>computers (O/S 3.x).  It makes just fine, but when executed
>via CC, cfront runs and never returns.

The C++ stdio.h include file by default puts elements of the _iobuf
structures the wrong way round for Suns. The positioning of the _cnt and
_ptr fields of the structure is determined by an ifdef that looks like:
	extern  struct  _iobuf {
	#if vax || u3b || u3b2 || u3b5 || mc68k 
	        int     _cnt;
	        char    *_ptr;
	#else
	        char    *_ptr;
	        int     _cnt;
	#endif

The Sun cpp doesn't have mc68k as an in-built define, so all that's
required is to make the ifdef look like:
	#if vax || ..... mc68k || mc68000
That way, you'll get the right structure layout for use on Suns.

Sun's C preprocessor on the Sun2's and 3's does have mc68000 defined,
and so anything including /usr/include/CC/stdio.h gets the proper
structure layout.

Once we made this mod., recompiled and installed C++, the compiler has
worked for us OK.

		Jim
-- 
ARPA:	jim%cs.strath.ac.uk@ucl-cs.arpa, jim@cs.strath.ac.uk
UUCP:	jim@strath-cs.uucp, ...!uunet!mcvax!ukc!strath-cs!jim
JANET:	jim@uk.ac.strath.cs

"JANET domain ordering is swapped around so's there'd be some use for rev(1)!"