From: rcf@ms.washington.edu (Richard Fairfield)
Subject: problems installing libg++.a on DS 5000 running DEC OSF/1
Organization: Gnus Not Usenet
Distribution: gnu
Date: Thu, 12 Nov 1992 10:57:19 GMT

I have been able to hack together an installation of libg++.a version 2.2 on a
DECstation 5000/200 running DEC OSF/1 Version 1.0. The installation is not at
all clean so I am hoping that someone can help me clean it up a bit.

Anyway, here is what I did:

1) I installed gcc version 2.3.1. This installation went smoothly. I did NOT
   do "make install-fixincludes" (see below).


2) I modified Makefile.in in the libg++.a source directory to use a locally
   installed bsd-style install program. The OSF/1 version of install does not
   work with "make install".  Here is a diff of the modified Makefile:

	46c46
	< INSTALL = install -c
	---
	> INSTALL = /usr/local/bin/install-bsd -c


3) I ran "configure mips-dec-osf1". The release doesn't really seem to know
   about OSF/1 on a DECstation, but it swallowed this, so OK.


4) I modified /usr/include/machine/endian.h. Basically, I removed the special
   GNUC section because it causes errors like this on g++ source files:

	/usr/include/machine/endian.h:109: `w' undeclared, outside of functions
	/usr/include/machine/endian.h:110: parse error before `w'
	/usr/include/machine/endian.h:111: register name not specified for `w'
	/usr/include/machine/endian.h:111: parse error before `{'
	/usr/include/machine/endian.h:118: `l' undeclared, outside of functions
	/usr/include/machine/endian.h:119: parse error before `l'
	/usr/include/machine/endian.h:120: register name not specified for `l'
	/usr/include/machine/endian.h:120: parse error before `{'

   This is the sort of thing that I would expect the "make install-fixincludes"
   in the gcc release to fix. But when if I do that I get lots include file
   errors when I try to compile libgcc.a.


   Here is a diff of my changes to the include file:

96,97d95
< #if defined(lint) || !defined(__GNUC__)
<
100,125d97
<
< #else /* !lint && LITTLE_ENDIAN && __GNUC__ */
<
< /*
<  * Use GNUC support to inline the byteswappers.
<  */
<
< static __inline__
< unsigned long /* XXX "long" (and &xff's) needed for optimality */
< ntohs(w)
<       register unsigned long w;
< {
<       return ((w << 8) | ((w >> 8) & 0xff)) & 0xffff;
< }
< #define       htons   ntohs
<
< static __inline__
< unsigned long
< ntohl(l)
<       register unsigned long l;
< {
<       return (l << 24) | (l >> 24) | ((l & 0xff00) << 8) | ((l >> 8) & 0xff00)
;
< }
< #define htonl ntohl
<
< #endif        /* __GNUC__ inlines */



5) Here are the commands I used to build and install libgcc.a (remember that
   I am using my local install program):
	
	make CC=gcc
	make install



At this point, I am able to compile and run "regular" C programs with any of
cc, gcc, or g++. But I am just learning C++ and there are no other users on
this system yet, so I haven't really been able to test g++ and libg++.a.

I am thinking that I should replace include file <machine/endian.h> with its
original version before I start having other problems. But I then expect any
g++ program which uses this include file to fail (for example, anything that
includes <sys/file.h> gets <machine/endian.h>).


Any help will be appreciated.

thanks,
Richard Fairfield
Math Sciences Computing Center
University of Washington
206-685-2303
rcf@ms.washington.edu

Newsgroups: gnu.g++.lib.bug