SUMMARY: How to install GCC/Solaris2.5

From: Charles Harvey (
Date: Thu Feb 06 1997 - 10:30:54 CST

Sean Harvey's question:

Hello friends, I have what may seem to some of you a stupid question.=20
But I'm stuck and need a little help.

As you know Solaris 2.5 ships without a compiler

I'm trying to install gcc-2.7.2 under Solaris 2.5

I ran 'configure' according to the instructions and it ended with this
promising message:

"Links are now set up to build a native compiler for


Thanks to all who replied. The easy fix was to get a package version that
installed using the pkgadd utility. It was very easy. I had to erase /usr/ucb/cc
and create a link to the gcc install directory to get 'make' working.

Thanks for the help, I needed it. I love you man.


Here are a few replies that have Internet addresses to download the package from:


Try using the precompiled version of gcc-2.7.2. It comes in package
form, and it's has a very straightforward installation. It works fine
with me.

grab it from:

after doing the gzip -d to decompress, just add it as any usual package:
pkgadd -d .


If you want simplicity, get the gcc package from:

You can then do a simple pkgadd. Cool.

The Force is strong with this one,


you'll have to get a running compiler binary dist before you can
build the compiler (catch 22)

a binary dist is avaialble at somewhere; look
at /pub/gnu/*README* and probalby there will be an appropriate


Sure... First you need to have a compiler. Get a prebuilt one from

The files are GNUzip.1.2.4.SPARC.Solaris.2.5.pkg.tar

Note: These are also available for 2.5.1. Hope this helps.



We installed GCC, but we didn't do it from the source.... there is a whole
slew of binary pkgadd format gnu programs available from sunsite...
just download them and do a pkgadd <pkg> and it will add them, then you
can remove them or update them later w/ the pkg functions...

I can't remeber the exact location of the pkg's, but they shouldn't be too
hard to find with one of the net search engines...



        What happens now is that you must compile the compiler. Unfortunately without
a compiler to compile with, compilation is not possible.
        get a binary distribution of gcc, or compile it somewhere else & move across.
Binaries can be found on most sunsites (I use


>From a FAQ somewhere (ain't AltaVista Grand?)
"Sun took the C compiler out of Solaris 2.x. Am I stuck?"
No; and its mirror sites provide GCC binaries for Solaris.
As a rule, these binaries are not updated as often as the sources are,
so if you want the very latest version of gcc/g++, you may need to grab and
install binaries for an older version and use it to bootstrap the latest
version from source.

The latest gcc binaries on and its mirror sites are for
version 2.5.6 for Solaris on the Sparc, and version 2.4.5 for Solaris
on Intel 386/486 machines. There are also binaries for "gzip", the GNU
compression utility, which you'll need for uncompressing the binary
distribution. On any GNU archive site, look in subdirectories
`i486-sun-solaris2' or `sparc-sun-solaris2'.

The ftp directory /pub/GNU on site contains various GNU and
freeware programs for Solaris2.X running on the sparc.
These are packaged to enable installation using the Solaris "pkgadd"
utility. These include GNU emacs 19.27, gcc (and g++) 2.6.0,
Perl 4.036, and others.



Try installing the precompiled version for Solaris 2.5. One of
the URL's is


A precompiled version of gcc can be found at:

                                GOOD LUCK


I thought that you might want to use a 'packaged' gnu C and C++ compiler
that is available on the web. I have installed it with only a couple of
minor thing which require you to define some symbols to be used at

I found the compiler and the documentation through the altavista search
engine using the search words `gnu free software solaris' and looked
at the article title "GNU programs packaged for Solaris".
[ ]

The pacakged binaries could be obtained using ftp at the site in the directory /pub/GNU/2.5/sparc. (Remember to use
a binary transfer mode.)

The installation goes pretty well according to the documentation noted in
the first reference. Just gunzip the (package).gz and then
do the pgkadd -d {package} {package}. This makes it known to Solaris.

The only things that I found were that I wanted to install the software
on another disk drive so I had to use the "-a none" option in the pkgadd
command and the resultant symbols required for gnu had an extra directory
level /2.7.2/ in it that I needed to change.

Take a close look at
I think C_PLUS_PLUS_INCLUDE (I don't have the info in front of me but
gnu C++ descriptions show most of the symbols needed.

I hope that this will help you.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:44 CDT