[comp.unix.amiga] NEED config files for G++

crash@ckctpa.UUCP (Frank J. Edwards) (06/18/91)

In article <1991Jun17.101219@cs.utwente.nl> devisser@cs.utwente.nl (Jan de Visser) writes:
>When trying to install g++ on my Amiga 3000UX, it complained that a FILE does
>not have a _bufsize field. I examined stdio.h, where FILE is defined, and what 
>do you think? No _bufsize! (strange eh :-).

Oh, so you're trying to do this also, huh?  ;-) ;-)

>To check, I took a look at /usr/5include/stdio.h on our Sun system. On there, FILE *has* 
>a _bufsize field.
>
>What is the reason for this incompatibility? What to do to solve it? Are there more of
>this kind of incompatibilties?

First of all, to install G++ you should already have GCC.  If you do it'll
work fine 'cuz these same setups had to be done for GCC.  If you don't, you
need to create the configuration files for Amix.  (We'll talk about this
later in the article.)

Your particular problem is because of the System V slant of Amix, as opposed
to the BSD slant of SunOS.  Look in /usr/ucbinclude/stdio.h and you'll find
the _bufsiz macro.

For completeness' sake I've included the proper code here (I presume you're
talking about toplev.c -- put this at line 65):

	#ifndef _bufsiz
*	# if defined(USG) || defined(USG_STDIO)
	#  define _bufend(p)	_bufendtab[(p)->_file]
	#  define _bufsiz(p)	(_bufend(p) - (p)->_base)
	# else
	#  define _bufsiz(p)	((p)->_bufsiz)
	# endif
	#endif

You'll also find that the line marked with an "*" above will probably
be needed as a replacement for "#ifdef USG" just about everywhere.

>Jan.
>
>===========================================================================
>Jan de Visser,            | Internet: devisser@cs.utwente.nl
>University of Twente,     |
>Dept. Computer Science,   | < Still looking for something to fill
>PO Box 217,               |   this space. Hmm, I think I did it! >
>NL - 7500 AE  Enschede.   |
>===========================================================================

Okay, configuration files for Amix.  DOES ANYBODY HAVE THEM???  I sent
a request to talk@amix within the last 48 hours so I'm hoping to hear
from those folks.  [Question:  are they required by the GPL to provide
any config files they derive from supplied code? what if they create them
from scratch?]

Alright, here's what I did as a starting point.  I have a g++ and
cc1plus that generate assembler code.  However ... they generate the
wrong assembler!  Since I don't have docs for the "as" assembler,
I'm using the output of gcc provided by C-A (version 1.37.1) as a
template in generating config files.  Here's the first step:

	/* My tst.c program is shown later... */

	$ gcc -v -V -S tst.c -o tst.gcc
----------------------------------------------------------------------------
GNU GCC version 1.37 (68k, SGS/AT&T unixpc syntax) compiled by GNU C version 1.37.
					  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 /usr/public/lib/gcc-cpp -v -undef -D__GNUC__ -Dmc68k -Dm68k -Dunix -DAMIX -D__mc68k__ -D__m68k__ -D__unix__ -D__AMIX__ -D__STDC__=0 tst.c /var/tmp/cca000_c.cpp
GNU CPP version 1.37 (68k, SGS/AT&T unixpc syntax) compiled by GNU C version 1.37.
 /usr/public/lib/gcc-cc1 /var/tmp/cca000_c.cpp -quiet -dumpbase tst.c -version -o tst.gcc
GNU C version 1.37 (68k, SGS/AT&T unixpc syntax) compiled by GNU C version 1.37.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
----------------------------------------------------------------------------
The output gave me a clue to which config file(s) to start with.  But I have
no assembler docs, so it got tough...

	add item to "case" block '3b1' in config.g++ for "a3000"

	$ cp config/tm-3b1.h config/tm-a3000.h	# ignore config/tm-3b1g.h for now
	$ cp config/xm-3b1.h config/xm-a3000.h

Now I've got to compare the output of the above gcc command (tst.gcc) to the
output generated by g++ until I get the assembler syntax correct.  The simple
assembler stuff looks easy, but adding the SDB information could be ridiculous.
GCC is generating SDB debugging information in the .s file that I can't even
parse -- how am I going to duplicate it?

Good luck!!
-- 
Frank J. Edwards		|  "I did make up my own mind -- there
2677 Arjay Court		|   simply WASN'T ANY OTHER choice!"
Palm Harbor, FL  34684-4504	|		-- Me
Phone (813) 786-3675 (voice)	|    Only Amiga Makes It Possible...